HTTP cellular improvement: reset profile at outset.
At the start of the setup of an HTTP instance uCellHttp now issue AT+HTTP=x, where x is the profile ID, to reset the profile before starting to use it.
@@ -506,6 +506,13 @@ int32_t uCellHttpOpen(uDeviceHandle_t cellHandle, const char *pServerName,
pHttpInstance->pCallback = pCallback;
pHttpInstance->pCallbackParam = pCallbackParam;
atHandle = pCellInstance->atHandle;
+ // Reset the HTTP profile
+ uAtClientLock(atHandle);
+ uAtClientCommandStart(atHandle, "AT+UHTTP=");
+ uAtClientWriteInt(atHandle, profileId);
+ uAtClientCommandStopReadResponse(atHandle);
+ errorCodeOrHandle = uAtClientUnlock(atHandle);
+ if (errorCodeOrHandle == 0) {
// Determine if the server name given
// is an IP address or a domain name
// by processing it as an IP address
@@ -583,6 +590,7 @@ int32_t uCellHttpOpen(uDeviceHandle_t cellHandle, const char *pServerName,
uPortFree(pHttpInstance);
}
}
+ }
// Free temporary memory
uPortFree(pServerNameTmp);
}
