corrected version (with typedef struct IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE_DATA* IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE;) included in the sources
Dependents: STM32F746_iothub_client_sample_mqtt
Fork of iothub_client by
Diff: iothub_client.c
- Revision:
- 9:3ec7e2695f98
- Parent:
- 0:e393db310d89
- Child:
- 10:38383e246675
diff -r d2c6f6b532e1 -r 3ec7e2695f98 iothub_client.c --- a/iothub_client.c Wed Sep 16 06:38:05 2015 +0000 +++ b/iothub_client.c Tue Sep 22 20:36:48 2015 -0700 @@ -35,7 +35,7 @@ /* Codes_SRS_IOTHUBCLIENT_01_040: [If acquiring the lock fails, IoTHubClient_LL_DoWork shall not be called.] */ if (Lock(iotHubClientInstance->LockHandle) == LOCK_OK) { - /* Codes_SRS_IOTHUBCLIENT_01_037: [The thread created by IoTHubClient_SendEvent or IoTHubClient_SetNotificationCallback shall call IoTHubClient_LL_DoWork every 1 ms.] */ + /* Codes_SRS_IOTHUBCLIENT_01_037: [The thread created by IoTHubClient_SendEvent or IoTHubClient_SetMessageCallback shall call IoTHubClient_LL_DoWork every 1 ms.] */ IoTHubClient_LL_DoWork(iotHubClientInstance->IoTHubClientLLHandle); /* Codes_SRS_IOTHUBCLIENT_01_039: [All calls to IoTHubClient_LL_DoWork shall be protected by the lock created in IotHubClient_Create.] */ Unlock(iotHubClientInstance->LockHandle); @@ -161,7 +161,7 @@ { IOTHUB_CLIENT_INSTANCE* iotHubClientInstance = (IOTHUB_CLIENT_INSTANCE*)iotHubClientHandle; - /* Codes_SRS_IOTHUBCLIENT_01_007: [The thread created as part of executing IoTHubClient_SendEventAsync or IoTHubClient_SetNotificationCallback shall be joined.] */ + /* Codes_SRS_IOTHUBCLIENT_01_007: [The thread created as part of executing IoTHubClient_SendEventAsync or IoTHubClient_SetMessageCallback shall be joined.] */ if (iotHubClientInstance->ThreadHandle != NULL) { int res; @@ -263,13 +263,13 @@ return result; } -IOTHUB_CLIENT_RESULT IoTHubClient_SetNotificationCallback(IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_NOTIFICATION_CALLBACK_ASYNC notificationCallback, void* userContextCallback) +IOTHUB_CLIENT_RESULT IoTHubClient_SetMessageCallback(IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC messageCallback, void* userContextCallback) { IOTHUB_CLIENT_RESULT result; if (iotHubClientHandle == NULL) { - /* Codes_SRS_IOTHUBCLIENT_01_016: [If iotHubClientHandle is NULL, IoTHubClient_SetNotificationCallback shall return IOTHUB_CLIENT_INVALID_ARG.] */ + /* Codes_SRS_IOTHUBCLIENT_01_016: [If iotHubClientHandle is NULL, IoTHubClient_SetMessageCallback shall return IOTHUB_CLIENT_INVALID_ARG.] */ result = IOTHUB_CLIENT_INVALID_ARG; LogError("NULL iothubClientHandle\r\n"); } @@ -277,31 +277,31 @@ { IOTHUB_CLIENT_INSTANCE* iotHubClientInstance = (IOTHUB_CLIENT_INSTANCE*)iotHubClientHandle; - /* Codes_SRS_IOTHUBCLIENT_01_027: [IoTHubClient_SetNotificationCallback shall be made thread-safe by using the lock created in IoTHubClient_Create.] */ + /* Codes_SRS_IOTHUBCLIENT_01_027: [IoTHubClient_SetMessageCallback shall be made thread-safe by using the lock created in IoTHubClient_Create.] */ if (Lock(iotHubClientInstance->LockHandle) != LOCK_OK) { - /* Codes_SRS_IOTHUBCLIENT_01_028: [If acquiring the lock fails, IoTHubClient_SetNotificationCallback shall return IOTHUB_CLIENT_ERROR.] */ + /* Codes_SRS_IOTHUBCLIENT_01_028: [If acquiring the lock fails, IoTHubClient_SetMessageCallback shall return IOTHUB_CLIENT_ERROR.] */ result = IOTHUB_CLIENT_ERROR; LogError("Could not acquire lock\r\n"); } else { - /* Codes_SRS_IOTHUBCLIENT_01_014: [IoTHubClient_SetNotificationCallback shall start the worker thread if it was not previously started.] */ + /* Codes_SRS_IOTHUBCLIENT_01_014: [IoTHubClient_SetMessageCallback shall start the worker thread if it was not previously started.] */ StartWorkerThreadIfNeeded(iotHubClientInstance); if (iotHubClientInstance->ThreadHandle == NULL) { - /* Codes_SRS_IOTHUBCLIENT_01_015: [If starting the thread fails, IoTHubClient_SetNotificationCallback shall return IOTHUB_CLIENT_ERROR.] */ + /* Codes_SRS_IOTHUBCLIENT_01_015: [If starting the thread fails, IoTHubClient_SetMessageCallback shall return IOTHUB_CLIENT_ERROR.] */ result = IOTHUB_CLIENT_ERROR; LogError("Could not start worker thread\r\n"); } else { - /* Codes_SRS_IOTHUBCLIENT_01_017: [IoTHubClient_SetNotificationCallback shall call IoTHubClient_LL_SetNotificationCallback, while passing the IoTHubClient_LL handle created by IoTHubClient_Create and the parameters notificationCallback and userContextCallback.] */ - result = IoTHubClient_LL_SetNotificationCallback(iotHubClientInstance->IoTHubClientLLHandle, notificationCallback, userContextCallback); + /* Codes_SRS_IOTHUBCLIENT_01_017: [IoTHubClient_SetMessageCallback shall call IoTHubClient_LL_SetMessageCallback, while passing the IoTHubClient_LL handle created by IoTHubClient_Create and the parameters messageCallback and userContextCallback.] */ + result = IoTHubClient_LL_SetMessageCallback(iotHubClientInstance->IoTHubClientLLHandle, messageCallback, userContextCallback); } - /* Codes_SRS_IOTHUBCLIENT_01_027: [IoTHubClient_SetNotificationCallback shall be made thread-safe by using the lock created in IoTHubClient_Create.] */ + /* Codes_SRS_IOTHUBCLIENT_01_027: [IoTHubClient_SetMessageCallback shall be made thread-safe by using the lock created in IoTHubClient_Create.] */ Unlock(iotHubClientInstance->LockHandle); } } @@ -309,13 +309,13 @@ return result; } -IOTHUB_CLIENT_RESULT IoTHubClient_GetLastNotificationReceiveTime(IOTHUB_CLIENT_HANDLE iotHubClientHandle, time_t* lastNotificationReceiveTime) +IOTHUB_CLIENT_RESULT IoTHubClient_GetLastMessageReceiveTime(IOTHUB_CLIENT_HANDLE iotHubClientHandle, time_t* lastMessageReceiveTime) { IOTHUB_CLIENT_RESULT result; if (iotHubClientHandle == NULL) { - /* Codes_SRS_IOTHUBCLIENT_01_020: [If iotHubClientHandle is NULL, IoTHubClient_GetLastNotificationReceiveTime shall return IOTHUB_CLIENT_INVALID_ARG.] */ + /* Codes_SRS_IOTHUBCLIENT_01_020: [If iotHubClientHandle is NULL, IoTHubClient_GetLastMessageReceiveTime shall return IOTHUB_CLIENT_INVALID_ARG.] */ result = IOTHUB_CLIENT_INVALID_ARG; LogError("NULL iothubClientHandle\r\n"); } @@ -323,20 +323,20 @@ { IOTHUB_CLIENT_INSTANCE* iotHubClientInstance = (IOTHUB_CLIENT_INSTANCE*)iotHubClientHandle; - /* Codes_SRS_IOTHUBCLIENT_01_035: [IoTHubClient_GetLastNotificationReceiveTime shall be made thread-safe by using the lock created in IoTHubClient_Create.] */ + /* Codes_SRS_IOTHUBCLIENT_01_035: [IoTHubClient_GetLastMessageReceiveTime shall be made thread-safe by using the lock created in IoTHubClient_Create.] */ if (Lock(iotHubClientInstance->LockHandle) != LOCK_OK) { - /* Codes_SRS_IOTHUBCLIENT_01_036: [If acquiring the lock fails, IoTHubClient_GetLastNotificationReceiveTime shall return IOTHUB_CLIENT_ERROR.] */ + /* Codes_SRS_IOTHUBCLIENT_01_036: [If acquiring the lock fails, IoTHubClient_GetLastMessageReceiveTime shall return IOTHUB_CLIENT_ERROR.] */ result = IOTHUB_CLIENT_ERROR; LogError("Could not acquire lock\r\n"); } else { - /* Codes_SRS_IOTHUBCLIENT_01_019: [IoTHubClient_GetLastNotificationReceiveTime shall call IoTHubClient_LL_GetLastNotificationReceiveTime, while passing the IoTHubClient_LL handle created by IoTHubClient_Create and the parameter lastNotificationReceiveTime.] */ - /* Codes_SRS_IOTHUBCLIENT_01_021: [Otherwise, IoTHubClient_GetLastNotificationReceiveTime shall return the result of IoTHubClient_LL_GetLastNotificationReceiveTime.] */ - result = IoTHubClient_LL_GetLastNotificationReceiveTime(iotHubClientInstance->IoTHubClientLLHandle, lastNotificationReceiveTime); + /* Codes_SRS_IOTHUBCLIENT_01_019: [IoTHubClient_GetLastMessageReceiveTime shall call IoTHubClient_LL_GetLastMessageReceiveTime, while passing the IoTHubClient_LL handle created by IoTHubClient_Create and the parameter lastMessageReceiveTime.] */ + /* Codes_SRS_IOTHUBCLIENT_01_021: [Otherwise, IoTHubClient_GetLastMessageReceiveTime shall return the result of IoTHubClient_LL_GetLastMessageReceiveTime.] */ + result = IoTHubClient_LL_GetLastMessageReceiveTime(iotHubClientInstance->IoTHubClientLLHandle, lastMessageReceiveTime); - /* Codes_SRS_IOTHUBCLIENT_01_035: [IoTHubClient_GetLastNotificationReceiveTime shall be made thread-safe by using the lock created in IoTHubClient_Create.] */ + /* Codes_SRS_IOTHUBCLIENT_01_035: [IoTHubClient_GetLastMessageReceiveTime shall be made thread-safe by using the lock created in IoTHubClient_Create.] */ Unlock(iotHubClientInstance->LockHandle); } }