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:
AzureIoTClient
Date:
Wed Nov 16 21:37:53 2016 -0800
Revision:
53:1e5a1ca1f274
Parent:
48:cc5d91f2b06d
Child:
54:6dcad9019a64
1.0.10

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 38:a05929a75111 17 #include "azure_c_shared_utility/doublylinkedlist.h"
AzureIoTClient 43:038d8511e817 18 #include "azure_c_shared_utility/strings.h"
Azure.IoT Build 38:a05929a75111 19 #include "iothub_message.h"
Azure.IoT Build 38:a05929a75111 20 #include "iothub_client_ll.h"
Azure.IoT Build 38:a05929a75111 21
Azure.IoT Build 38:a05929a75111 22 #ifdef __cplusplus
Azure.IoT Build 38:a05929a75111 23 extern "C"
Azure.IoT Build 38:a05929a75111 24 {
Azure.IoT Build 38:a05929a75111 25 #endif
Azure.IoT Build 38:a05929a75111 26
AzureIoTClient 53:1e5a1ca1f274 27 /** @brief This struct captures device configuration. */
AzureIoTClient 53:1e5a1ca1f274 28 typedef struct IOTHUB_DEVICE_CONFIG_TAG
AzureIoTClient 53:1e5a1ca1f274 29 {
AzureIoTClient 53:1e5a1ca1f274 30 /** @brief A string that identifies the device. */
AzureIoTClient 53:1e5a1ca1f274 31 const char* deviceId;
AzureIoTClient 40:1a94db9139ea 32
AzureIoTClient 53:1e5a1ca1f274 33 /** @brief The device key used to authenticate the device. */
AzureIoTClient 53:1e5a1ca1f274 34 const char* deviceKey;
AzureIoTClient 40:1a94db9139ea 35
AzureIoTClient 53:1e5a1ca1f274 36 /** @brief The device SAS used to authenticate the device in place of using the device key. */
AzureIoTClient 53:1e5a1ca1f274 37 const char* deviceSasToken;
Azure.IoT Build 38:a05929a75111 38
AzureIoTClient 53:1e5a1ca1f274 39 } IOTHUB_DEVICE_CONFIG;
AzureIoTClient 40:1a94db9139ea 40
AzureIoTClient 43:038d8511e817 41 typedef STRING_HANDLE (*pfIoTHubTransport_GetHostname)(TRANSPORT_LL_HANDLE handle);
AzureIoTClient 53:1e5a1ca1f274 42 typedef IOTHUB_CLIENT_RESULT(*pfIoTHubTransport_SetOption)(TRANSPORT_LL_HANDLE handle, const char *optionName, const void* value);
AzureIoTClient 53:1e5a1ca1f274 43 typedef TRANSPORT_LL_HANDLE(*pfIoTHubTransport_Create)(const IOTHUBTRANSPORT_CONFIG* config);
AzureIoTClient 53:1e5a1ca1f274 44 typedef void (*pfIoTHubTransport_Destroy)(TRANSPORT_LL_HANDLE handle);
AzureIoTClient 53:1e5a1ca1f274 45 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 46 typedef void(*pfIotHubTransport_Unregister)(IOTHUB_DEVICE_HANDLE deviceHandle);
AzureIoTClient 53:1e5a1ca1f274 47 typedef int (*pfIoTHubTransport_Subscribe)(IOTHUB_DEVICE_HANDLE handle);
AzureIoTClient 53:1e5a1ca1f274 48 typedef void (*pfIoTHubTransport_Unsubscribe)(IOTHUB_DEVICE_HANDLE handle);
AzureIoTClient 53:1e5a1ca1f274 49 typedef void (*pfIoTHubTransport_DoWork)(TRANSPORT_LL_HANDLE handle, IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle);
AzureIoTClient 53:1e5a1ca1f274 50 typedef int(*pfIoTHubTransport_SetRetryPolicy)(TRANSPORT_LL_HANDLE handle, IOTHUB_CLIENT_RETRY_POLICY retryPolicy, size_t retryTimeoutLimitInSeconds);
AzureIoTClient 53:1e5a1ca1f274 51 typedef IOTHUB_CLIENT_RESULT(*pfIoTHubTransport_GetSendStatus)(IOTHUB_DEVICE_HANDLE handle, IOTHUB_CLIENT_STATUS *iotHubClientStatus);
AzureIoTClient 53:1e5a1ca1f274 52 typedef int (*pfIoTHubTransport_Subscribe_DeviceTwin)(IOTHUB_DEVICE_HANDLE handle);
AzureIoTClient 53:1e5a1ca1f274 53 typedef void (*pfIoTHubTransport_Unsubscribe_DeviceTwin)(IOTHUB_DEVICE_HANDLE handle);
AzureIoTClient 53:1e5a1ca1f274 54 typedef IOTHUB_PROCESS_ITEM_RESULT(*pfIoTHubTransport_ProcessItem)(TRANSPORT_LL_HANDLE handle, IOTHUB_IDENTITY_TYPE item_type, IOTHUB_IDENTITY_INFO* iothub_item);
AzureIoTClient 53:1e5a1ca1f274 55 typedef int(*pfIoTHubTransport_Subscribe_DeviceMethod)(IOTHUB_DEVICE_HANDLE handle);
AzureIoTClient 53:1e5a1ca1f274 56 typedef void(*pfIoTHubTransport_Unsubscribe_DeviceMethod)(IOTHUB_DEVICE_HANDLE handle);
Azure.IoT Build 38:a05929a75111 57
AzureIoTClient 53:1e5a1ca1f274 58 #define TRANSPORT_PROVIDER_FIELDS \
AzureIoTClient 53:1e5a1ca1f274 59 pfIoTHubTransport_Subscribe_DeviceMethod IoTHubTransport_Subscribe_DeviceMethod; \
AzureIoTClient 53:1e5a1ca1f274 60 pfIoTHubTransport_Unsubscribe_DeviceMethod IoTHubTransport_Unsubscribe_DeviceMethod;\
AzureIoTClient 53:1e5a1ca1f274 61 pfIoTHubTransport_Subscribe_DeviceTwin IoTHubTransport_Subscribe_DeviceTwin; \
AzureIoTClient 53:1e5a1ca1f274 62 pfIoTHubTransport_Unsubscribe_DeviceTwin IoTHubTransport_Unsubscribe_DeviceTwin; \
AzureIoTClient 53:1e5a1ca1f274 63 pfIoTHubTransport_ProcessItem IoTHubTransport_ProcessItem; \
AzureIoTClient 53:1e5a1ca1f274 64 pfIoTHubTransport_GetHostname IoTHubTransport_GetHostname; \
AzureIoTClient 53:1e5a1ca1f274 65 pfIoTHubTransport_SetOption IoTHubTransport_SetOption; \
AzureIoTClient 53:1e5a1ca1f274 66 pfIoTHubTransport_Create IoTHubTransport_Create; \
AzureIoTClient 53:1e5a1ca1f274 67 pfIoTHubTransport_Destroy IoTHubTransport_Destroy; \
AzureIoTClient 53:1e5a1ca1f274 68 pfIotHubTransport_Register IoTHubTransport_Register; \
AzureIoTClient 53:1e5a1ca1f274 69 pfIotHubTransport_Unregister IoTHubTransport_Unregister; \
AzureIoTClient 53:1e5a1ca1f274 70 pfIoTHubTransport_Subscribe IoTHubTransport_Subscribe; \
AzureIoTClient 53:1e5a1ca1f274 71 pfIoTHubTransport_Unsubscribe IoTHubTransport_Unsubscribe; \
AzureIoTClient 53:1e5a1ca1f274 72 pfIoTHubTransport_DoWork IoTHubTransport_DoWork; \
AzureIoTClient 53:1e5a1ca1f274 73 pfIoTHubTransport_SetRetryPolicy IoTHubTransport_SetRetryPolicy; \
AzureIoTClient 53:1e5a1ca1f274 74 pfIoTHubTransport_GetSendStatus IoTHubTransport_GetSendStatus /*there's an intentional missing ; on this line*/
Azure.IoT Build 38:a05929a75111 75
AzureIoTClient 53:1e5a1ca1f274 76 struct TRANSPORT_PROVIDER_TAG
AzureIoTClient 53:1e5a1ca1f274 77 {
AzureIoTClient 53:1e5a1ca1f274 78 TRANSPORT_PROVIDER_FIELDS;
AzureIoTClient 53:1e5a1ca1f274 79 };
Azure.IoT Build 38:a05929a75111 80
Azure.IoT Build 38:a05929a75111 81 #ifdef __cplusplus
Azure.IoT Build 38:a05929a75111 82 }
Azure.IoT Build 38:a05929a75111 83 #endif
Azure.IoT Build 38:a05929a75111 84
Azure.IoT Build 38:a05929a75111 85 #endif /* IOTHUB_TRANSPORT_LL_H */