Microsoft Azure IoTHub client libraries

Dependents:   sht15_remote_monitoring RobotArmDemo iothub_client_sample_amqp f767zi_mqtt ... more

This library implements the Microsoft Azure IoTHub client library. The code is replicated from https://github.com/Azure/azure-iot-sdks

Committer:
Azure.IoT.Build
Date:
Wed Dec 14 15:59:51 2016 -0800
Revision:
54:6dcad9019a64
Parent:
53:1e5a1ca1f274
Child:
55:59b527ab3452
1.1.2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Azure.IoT Build 38:a05929a75111 1 // Copyright (c) Microsoft. All rights reserved.
Azure.IoT Build 38:a05929a75111 2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
Azure.IoT Build 38:a05929a75111 3
Azure.IoT Build 38:a05929a75111 4 #ifndef IOTHUB_TRANSPORT_LL_H
Azure.IoT Build 38:a05929a75111 5 #define IOTHUB_TRANSPORT_LL_H
Azure.IoT Build 38:a05929a75111 6
AzureIoTClient 53:1e5a1ca1f274 7
AzureIoTClient 43:038d8511e817 8 typedef void* TRANSPORT_LL_HANDLE;
AzureIoTClient 43:038d8511e817 9 typedef void* IOTHUB_DEVICE_HANDLE;
AzureIoTClient 48:cc5d91f2b06d 10
AzureIoTClient 48:cc5d91f2b06d 11 struct TRANSPORT_PROVIDER_TAG;
AzureIoTClient 43:038d8511e817 12 typedef struct TRANSPORT_PROVIDER_TAG TRANSPORT_PROVIDER;
AzureIoTClient 43:038d8511e817 13
AzureIoTClient 53:1e5a1ca1f274 14 union IOTHUB_IDENTITY_INFO_TAG;
AzureIoTClient 53:1e5a1ca1f274 15 typedef union IOTHUB_IDENTITY_INFO_TAG IOTHUB_IDENTITY_INFO;
AzureIoTClient 53:1e5a1ca1f274 16
Azure.IoT.Build 54:6dcad9019a64 17 typedef void* METHOD_ID;
Azure.IoT.Build 54:6dcad9019a64 18
Azure.IoT Build 38:a05929a75111 19 #include "azure_c_shared_utility/doublylinkedlist.h"
AzureIoTClient 43:038d8511e817 20 #include "azure_c_shared_utility/strings.h"
Azure.IoT Build 38:a05929a75111 21 #include "iothub_message.h"
Azure.IoT Build 38:a05929a75111 22 #include "iothub_client_ll.h"
Azure.IoT Build 38:a05929a75111 23
Azure.IoT Build 38:a05929a75111 24 #ifdef __cplusplus
Azure.IoT Build 38:a05929a75111 25 extern "C"
Azure.IoT Build 38:a05929a75111 26 {
Azure.IoT Build 38:a05929a75111 27 #endif
Azure.IoT Build 38:a05929a75111 28
AzureIoTClient 53:1e5a1ca1f274 29 /** @brief This struct captures device configuration. */
AzureIoTClient 53:1e5a1ca1f274 30 typedef struct IOTHUB_DEVICE_CONFIG_TAG
AzureIoTClient 53:1e5a1ca1f274 31 {
AzureIoTClient 53:1e5a1ca1f274 32 /** @brief A string that identifies the device. */
AzureIoTClient 53:1e5a1ca1f274 33 const char* deviceId;
AzureIoTClient 40:1a94db9139ea 34
AzureIoTClient 53:1e5a1ca1f274 35 /** @brief The device key used to authenticate the device. */
AzureIoTClient 53:1e5a1ca1f274 36 const char* deviceKey;
AzureIoTClient 40:1a94db9139ea 37
AzureIoTClient 53:1e5a1ca1f274 38 /** @brief The device SAS used to authenticate the device in place of using the device key. */
AzureIoTClient 53:1e5a1ca1f274 39 const char* deviceSasToken;
Azure.IoT Build 38:a05929a75111 40
AzureIoTClient 53:1e5a1ca1f274 41 } IOTHUB_DEVICE_CONFIG;
AzureIoTClient 40:1a94db9139ea 42
AzureIoTClient 43:038d8511e817 43 typedef STRING_HANDLE (*pfIoTHubTransport_GetHostname)(TRANSPORT_LL_HANDLE handle);
AzureIoTClient 53:1e5a1ca1f274 44 typedef IOTHUB_CLIENT_RESULT(*pfIoTHubTransport_SetOption)(TRANSPORT_LL_HANDLE handle, const char *optionName, const void* value);
AzureIoTClient 53:1e5a1ca1f274 45 typedef TRANSPORT_LL_HANDLE(*pfIoTHubTransport_Create)(const IOTHUBTRANSPORT_CONFIG* config);
AzureIoTClient 53:1e5a1ca1f274 46 typedef void (*pfIoTHubTransport_Destroy)(TRANSPORT_LL_HANDLE handle);
AzureIoTClient 53:1e5a1ca1f274 47 typedef IOTHUB_DEVICE_HANDLE(*pfIotHubTransport_Register)(TRANSPORT_LL_HANDLE handle, const IOTHUB_DEVICE_CONFIG* device, IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle, PDLIST_ENTRY waitingToSend);
AzureIoTClient 53:1e5a1ca1f274 48 typedef void(*pfIotHubTransport_Unregister)(IOTHUB_DEVICE_HANDLE deviceHandle);
AzureIoTClient 53:1e5a1ca1f274 49 typedef int (*pfIoTHubTransport_Subscribe)(IOTHUB_DEVICE_HANDLE handle);
AzureIoTClient 53:1e5a1ca1f274 50 typedef void (*pfIoTHubTransport_Unsubscribe)(IOTHUB_DEVICE_HANDLE handle);
AzureIoTClient 53:1e5a1ca1f274 51 typedef void (*pfIoTHubTransport_DoWork)(TRANSPORT_LL_HANDLE handle, IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle);
AzureIoTClient 53:1e5a1ca1f274 52 typedef int(*pfIoTHubTransport_SetRetryPolicy)(TRANSPORT_LL_HANDLE handle, IOTHUB_CLIENT_RETRY_POLICY retryPolicy, size_t retryTimeoutLimitInSeconds);
AzureIoTClient 53:1e5a1ca1f274 53 typedef IOTHUB_CLIENT_RESULT(*pfIoTHubTransport_GetSendStatus)(IOTHUB_DEVICE_HANDLE handle, IOTHUB_CLIENT_STATUS *iotHubClientStatus);
AzureIoTClient 53:1e5a1ca1f274 54 typedef int (*pfIoTHubTransport_Subscribe_DeviceTwin)(IOTHUB_DEVICE_HANDLE handle);
AzureIoTClient 53:1e5a1ca1f274 55 typedef void (*pfIoTHubTransport_Unsubscribe_DeviceTwin)(IOTHUB_DEVICE_HANDLE handle);
AzureIoTClient 53:1e5a1ca1f274 56 typedef IOTHUB_PROCESS_ITEM_RESULT(*pfIoTHubTransport_ProcessItem)(TRANSPORT_LL_HANDLE handle, IOTHUB_IDENTITY_TYPE item_type, IOTHUB_IDENTITY_INFO* iothub_item);
AzureIoTClient 53:1e5a1ca1f274 57 typedef int(*pfIoTHubTransport_Subscribe_DeviceMethod)(IOTHUB_DEVICE_HANDLE handle);
AzureIoTClient 53:1e5a1ca1f274 58 typedef void(*pfIoTHubTransport_Unsubscribe_DeviceMethod)(IOTHUB_DEVICE_HANDLE handle);
Azure.IoT Build 38:a05929a75111 59
AzureIoTClient 53:1e5a1ca1f274 60 #define TRANSPORT_PROVIDER_FIELDS \
AzureIoTClient 53:1e5a1ca1f274 61 pfIoTHubTransport_Subscribe_DeviceMethod IoTHubTransport_Subscribe_DeviceMethod; \
AzureIoTClient 53:1e5a1ca1f274 62 pfIoTHubTransport_Unsubscribe_DeviceMethod IoTHubTransport_Unsubscribe_DeviceMethod;\
AzureIoTClient 53:1e5a1ca1f274 63 pfIoTHubTransport_Subscribe_DeviceTwin IoTHubTransport_Subscribe_DeviceTwin; \
AzureIoTClient 53:1e5a1ca1f274 64 pfIoTHubTransport_Unsubscribe_DeviceTwin IoTHubTransport_Unsubscribe_DeviceTwin; \
AzureIoTClient 53:1e5a1ca1f274 65 pfIoTHubTransport_ProcessItem IoTHubTransport_ProcessItem; \
AzureIoTClient 53:1e5a1ca1f274 66 pfIoTHubTransport_GetHostname IoTHubTransport_GetHostname; \
AzureIoTClient 53:1e5a1ca1f274 67 pfIoTHubTransport_SetOption IoTHubTransport_SetOption; \
AzureIoTClient 53:1e5a1ca1f274 68 pfIoTHubTransport_Create IoTHubTransport_Create; \
AzureIoTClient 53:1e5a1ca1f274 69 pfIoTHubTransport_Destroy IoTHubTransport_Destroy; \
AzureIoTClient 53:1e5a1ca1f274 70 pfIotHubTransport_Register IoTHubTransport_Register; \
AzureIoTClient 53:1e5a1ca1f274 71 pfIotHubTransport_Unregister IoTHubTransport_Unregister; \
AzureIoTClient 53:1e5a1ca1f274 72 pfIoTHubTransport_Subscribe IoTHubTransport_Subscribe; \
AzureIoTClient 53:1e5a1ca1f274 73 pfIoTHubTransport_Unsubscribe IoTHubTransport_Unsubscribe; \
AzureIoTClient 53:1e5a1ca1f274 74 pfIoTHubTransport_DoWork IoTHubTransport_DoWork; \
AzureIoTClient 53:1e5a1ca1f274 75 pfIoTHubTransport_SetRetryPolicy IoTHubTransport_SetRetryPolicy; \
AzureIoTClient 53:1e5a1ca1f274 76 pfIoTHubTransport_GetSendStatus IoTHubTransport_GetSendStatus /*there's an intentional missing ; on this line*/
Azure.IoT Build 38:a05929a75111 77
AzureIoTClient 53:1e5a1ca1f274 78 struct TRANSPORT_PROVIDER_TAG
AzureIoTClient 53:1e5a1ca1f274 79 {
AzureIoTClient 53:1e5a1ca1f274 80 TRANSPORT_PROVIDER_FIELDS;
AzureIoTClient 53:1e5a1ca1f274 81 };
Azure.IoT Build 38:a05929a75111 82
Azure.IoT Build 38:a05929a75111 83 #ifdef __cplusplus
Azure.IoT Build 38:a05929a75111 84 }
Azure.IoT Build 38:a05929a75111 85 #endif
Azure.IoT Build 38:a05929a75111 86
Azure.IoT Build 38:a05929a75111 87 #endif /* IOTHUB_TRANSPORT_LL_H */