Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: iothub_client_sample_http simplesample_http temp_sensor_anomaly
Revision 1:2ba812f3d9b7, committed 2015-09-15
- Comitter:
- AzureIoTClient
- Date:
- Tue Sep 15 22:25:44 2015 -0700
- Parent:
- 0:fa2b00dcd9d4
- Child:
- 2:ff9104b866b8
- Commit message:
- New release
Changed in this revision
| iothubtransporthttp.c | Show annotated file Show diff for this revision Revisions of this file |
--- a/iothubtransporthttp.c Tue Sep 15 21:57:19 2015 -0700
+++ b/iothubtransporthttp.c Tue Sep 15 22:25:44 2015 -0700
@@ -45,7 +45,7 @@
IoTHubTransportHttp_Subscribe, /*pfIoTHubTransport_Subscribe IoTHubTransport_Subscribe; */
IoTHubTransportHttp_Unsubscribe, /*pfIoTHubTransport_Unsubscribe IoTHubTransport_Unsubscribe; */
IoTHubTransportHttp_DoWork, /*pfIoTHubTransport_DoWork IoTHubTransport_DoWork; */
- IoTHubTransportHttp_GetSendStatus /* pfIoTHubTransport_GetSendStatus IoTHubTransport_GetSendStatus */
+ IoTHubTransportHttp_GetSendStatus /* pfIoTHubTransport_GetSendStatus IoTHubTransport_GetSendStatus */
};
const void* IoTHubTransportHttp_ProvideTransportInterface(void)
@@ -425,36 +425,36 @@
LogError("invalid arg (configuration is missing)\r\n");
result = NULL;
}
- else if (config->upperConfig == NULL)
- {
- LogError("invalid arg (upperConfig is NULL)\r\n");
- result = NULL;
- }
- else if (config->waitingToSend == NULL)
- {
- LogError("invalid arg (waitingToSend is NULL)\r\n");
- result = NULL;
- }
- else if (config->upperConfig->protocol == NULL)
- {
- LogError("invalid arg (protocol is NULL)\r\n");
- result = NULL;
- }
- else if (config->upperConfig->deviceId == NULL)
- {
- LogError("invalid arg (deviceId is NULL)\r\n");
- result = NULL;
- }
- else if (config->upperConfig->iotHubName == NULL)
- {
- LogError("invalid arg (iotHubName is NULL)\r\n");
- result = NULL;
- }
- else if (config->upperConfig->iotHubSuffix == NULL)
- {
- LogError("invalid arg (iotHubSuffix is NULL)\r\n");
- result = NULL;
- }
+ else if (config->upperConfig == NULL)
+ {
+ LogError("invalid arg (upperConfig is NULL)\r\n");
+ result = NULL;
+ }
+ else if (config->waitingToSend == NULL)
+ {
+ LogError("invalid arg (waitingToSend is NULL)\r\n");
+ result = NULL;
+ }
+ else if (config->upperConfig->protocol == NULL)
+ {
+ LogError("invalid arg (protocol is NULL)\r\n");
+ result = NULL;
+ }
+ else if (config->upperConfig->deviceId == NULL)
+ {
+ LogError("invalid arg (deviceId is NULL)\r\n");
+ result = NULL;
+ }
+ else if (config->upperConfig->iotHubName == NULL)
+ {
+ LogError("invalid arg (iotHubName is NULL)\r\n");
+ result = NULL;
+ }
+ else if (config->upperConfig->iotHubSuffix == NULL)
+ {
+ LogError("invalid arg (iotHubSuffix is NULL)\r\n");
+ result = NULL;
+ }
else if (config->upperConfig->deviceKey == NULL)
{
LogError("invalid arg (deviceKey is NULL)\r\n");
@@ -1184,8 +1184,8 @@
-requestType: POST
-relativePath: abandon relative path begin (as created by _Create) + value of ETag + "/abandon?api-version=2015-08-15-preview"
- requestHttpHeadersHandle: an HTTP headers instance containing the following
- Authorization: " "
- If-Match: value of ETag
+ Authorization: " "
+ If-Match: value of ETag
- requestContent: NULL
- statusCode: a pointer to unsigned int which might be examined for logging
- responseHeadearsHandle: NULL
@@ -1194,8 +1194,8 @@
-requestType: DELETE
-relativePath: abandon relative path begin + value of ETag + "?api-version=2015-08-15-preview"
- requestHttpHeadersHandle: an HTTP headers instance containing the following
- Authorization: " "
- If-Match: value of ETag
+ Authorization: " "
+ If-Match: value of ETag
- requestContent: NULL
- statusCode: a pointer to unsigned int which might be used by logging
- responseHeadearsHandle: NULL
@@ -1204,8 +1204,8 @@
-requestType: DELETE
-relativePath: abandon relative path begin + value of ETag +"?api-version=2015-08-15-preview" + "&reject"
- requestHttpHeadersHandle: an HTTP headers instance containing the following
- Authorization: " "
- If-Match: value of ETag
+ Authorization: " "
+ If-Match: value of ETag
- requestContent: NULL
- statusCode: a pointer to unsigned int which might be used by logging
- responseHeadearsHandle: NULL
@@ -1514,38 +1514,38 @@
IOTHUB_CLIENT_RESULT IoTHubTransportHttp_GetSendStatus(TRANSPORT_HANDLE handle, IOTHUB_CLIENT_STATUS *iotHubClientStatus)
{
- IOTHUB_CLIENT_RESULT result;
+ IOTHUB_CLIENT_RESULT result;
- /* Codes_SRS_IOTHUBTRANSPORTTHTTP_09_001: [IoTHubTransportHttp_GetSendStatus shall return IOTHUB_CLIENT_INVALID_ARG if called with NULL parameter] */
- if (handle == NULL)
- {
- result = IOTHUB_CLIENT_INVALID_ARG;
- LogError("Invalid handle to IoTHubClient HTTP transport instance.\r\n");
- }
- else if (iotHubClientStatus == NULL)
- {
- result = IOTHUB_CLIENT_INVALID_ARG;
- LogError("Invalid pointer to output parameter IOTHUB_CLIENT_STATUS.\r\n");
- }
- else
- {
- HTTPTRANSPORT_HANDLE_DATA* handleData = (HTTPTRANSPORT_HANDLE_DATA*)handle;
+ /* Codes_SRS_IOTHUBTRANSPORTTHTTP_09_001: [IoTHubTransportHttp_GetSendStatus shall return IOTHUB_CLIENT_INVALID_ARG if called with NULL parameter] */
+ if (handle == NULL)
+ {
+ result = IOTHUB_CLIENT_INVALID_ARG;
+ LogError("Invalid handle to IoTHubClient HTTP transport instance.\r\n");
+ }
+ else if (iotHubClientStatus == NULL)
+ {
+ result = IOTHUB_CLIENT_INVALID_ARG;
+ LogError("Invalid pointer to output parameter IOTHUB_CLIENT_STATUS.\r\n");
+ }
+ else
+ {
+ HTTPTRANSPORT_HANDLE_DATA* handleData = (HTTPTRANSPORT_HANDLE_DATA*)handle;
- /* Codes_SRS_IOTHUBTRANSPORTTHTTP_09_002: [IoTHubTransportHttp_GetSendStatus shall return IOTHUB_CLIENT_OK and status IOTHUB_CLIENT_SEND_STATUS_IDLE if there are currently no event items to be sent or being sent] */
- if (!DList_IsListEmpty(handleData->waitingToSend))
- {
- *iotHubClientStatus = IOTHUB_CLIENT_SEND_STATUS_BUSY;
- }
- /* Codes_SRS_IOTHUBTRANSPORTTHTTP_09_003: [IoTHubTransportHttp_GetSendStatus shall return IOTHUB_CLIENT_OK and status IOTHUB_CLIENT_SEND_STATUS_BUSY if there are currently event items to be sent or being sent] */
- else
- {
- *iotHubClientStatus = IOTHUB_CLIENT_SEND_STATUS_IDLE;
- }
+ /* Codes_SRS_IOTHUBTRANSPORTTHTTP_09_002: [IoTHubTransportHttp_GetSendStatus shall return IOTHUB_CLIENT_OK and status IOTHUB_CLIENT_SEND_STATUS_IDLE if there are currently no event items to be sent or being sent] */
+ if (!DList_IsListEmpty(handleData->waitingToSend))
+ {
+ *iotHubClientStatus = IOTHUB_CLIENT_SEND_STATUS_BUSY;
+ }
+ /* Codes_SRS_IOTHUBTRANSPORTTHTTP_09_003: [IoTHubTransportHttp_GetSendStatus shall return IOTHUB_CLIENT_OK and status IOTHUB_CLIENT_SEND_STATUS_BUSY if there are currently event items to be sent or being sent] */
+ else
+ {
+ *iotHubClientStatus = IOTHUB_CLIENT_SEND_STATUS_IDLE;
+ }
- result = IOTHUB_CLIENT_OK;
- }
+ result = IOTHUB_CLIENT_OK;
+ }
- return result;
+ return result;
}
IOTHUB_CLIENT_RESULT IoTHubTransportHttp_SetOption(TRANSPORT_HANDLE handle, const char* option, const void* value)
@@ -1566,15 +1566,15 @@
else
{
HTTPTRANSPORT_HANDLE_DATA* handleData = (HTTPTRANSPORT_HANDLE_DATA*)handle;
- /*Codes_SRS_IOTHUBTRANSPORTTHTTP_02_097: ["SetBatching"] */
- if (strcmp("SetBatching", option) == 0)
+ /*Codes_SRS_IOTHUBTRANSPORTTHTTP_02_097: ["Batching"] */
+ if (strcmp("Batching", option) == 0)
{
/*Codes_SRS_IOTHUBTRANSPORTTHTTP_02_083: [If optionName is an option handled by IoTHubTransportHttp then it shall be set.] */
handleData->doBatchedTransfers = *(bool*)value;
result = IOTHUB_CLIENT_OK;
}
- /*Codes_SRS_IOTHUBTRANSPORTTHTTP_02_114: ["GetMinimumPollingTime"] */
- else if (strcmp("GetMinimumPollingTime", option) == 0)
+ /*Codes_SRS_IOTHUBTRANSPORTTHTTP_02_114: ["MinimumPollingTime"] */
+ else if (strcmp("MinimumPollingTime", option) == 0)
{
handleData->getMinimumPollingTime = *(unsigned int*)value;
result = IOTHUB_CLIENT_OK;