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
iothub_transport_ll.h@61:8b85a4e797cf, 2017-03-10 (annotated)
- Committer:
- AzureIoTClient
- Date:
- Fri Mar 10 11:47:36 2017 -0800
- Revision:
- 61:8b85a4e797cf
- Parent:
- 55:59b527ab3452
- Child:
- 66:a419827cb051
1.1.9
Who changed what in which revision?
User | Revision | Line number | New 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 | |
AzureIoTClient | 55:59b527ab3452 | 17 | typedef void* METHOD_HANDLE; |
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" |
AzureIoTClient | 61:8b85a4e797cf | 22 | |
AzureIoTClient | 61:8b85a4e797cf | 23 | struct MESSAGE_DISPOSITION_CONTEXT_TAG; |
AzureIoTClient | 61:8b85a4e797cf | 24 | typedef struct MESSAGE_DISPOSITION_CONTEXT_TAG* MESSAGE_DISPOSITION_CONTEXT_HANDLE; |
AzureIoTClient | 61:8b85a4e797cf | 25 | typedef struct MESSAGE_CALLBACK_INFO_TAG |
AzureIoTClient | 61:8b85a4e797cf | 26 | { |
AzureIoTClient | 61:8b85a4e797cf | 27 | IOTHUB_MESSAGE_HANDLE messageHandle; |
AzureIoTClient | 61:8b85a4e797cf | 28 | MESSAGE_DISPOSITION_CONTEXT_HANDLE transportContext; |
AzureIoTClient | 61:8b85a4e797cf | 29 | }MESSAGE_CALLBACK_INFO; |
AzureIoTClient | 61:8b85a4e797cf | 30 | |
Azure.IoT Build | 38:a05929a75111 | 31 | #include "iothub_client_ll.h" |
Azure.IoT Build | 38:a05929a75111 | 32 | |
Azure.IoT Build | 38:a05929a75111 | 33 | #ifdef __cplusplus |
Azure.IoT Build | 38:a05929a75111 | 34 | extern "C" |
Azure.IoT Build | 38:a05929a75111 | 35 | { |
Azure.IoT Build | 38:a05929a75111 | 36 | #endif |
Azure.IoT Build | 38:a05929a75111 | 37 | |
AzureIoTClient | 53:1e5a1ca1f274 | 38 | /** @brief This struct captures device configuration. */ |
AzureIoTClient | 53:1e5a1ca1f274 | 39 | typedef struct IOTHUB_DEVICE_CONFIG_TAG |
AzureIoTClient | 53:1e5a1ca1f274 | 40 | { |
AzureIoTClient | 53:1e5a1ca1f274 | 41 | /** @brief A string that identifies the device. */ |
AzureIoTClient | 53:1e5a1ca1f274 | 42 | const char* deviceId; |
AzureIoTClient | 40:1a94db9139ea | 43 | |
AzureIoTClient | 53:1e5a1ca1f274 | 44 | /** @brief The device key used to authenticate the device. */ |
AzureIoTClient | 53:1e5a1ca1f274 | 45 | const char* deviceKey; |
AzureIoTClient | 40:1a94db9139ea | 46 | |
AzureIoTClient | 53:1e5a1ca1f274 | 47 | /** @brief The device SAS used to authenticate the device in place of using the device key. */ |
AzureIoTClient | 53:1e5a1ca1f274 | 48 | const char* deviceSasToken; |
Azure.IoT Build | 38:a05929a75111 | 49 | |
AzureIoTClient | 53:1e5a1ca1f274 | 50 | } IOTHUB_DEVICE_CONFIG; |
AzureIoTClient | 40:1a94db9139ea | 51 | |
AzureIoTClient | 43:038d8511e817 | 52 | typedef STRING_HANDLE (*pfIoTHubTransport_GetHostname)(TRANSPORT_LL_HANDLE handle); |
AzureIoTClient | 53:1e5a1ca1f274 | 53 | typedef IOTHUB_CLIENT_RESULT(*pfIoTHubTransport_SetOption)(TRANSPORT_LL_HANDLE handle, const char *optionName, const void* value); |
AzureIoTClient | 53:1e5a1ca1f274 | 54 | typedef TRANSPORT_LL_HANDLE(*pfIoTHubTransport_Create)(const IOTHUBTRANSPORT_CONFIG* config); |
AzureIoTClient | 53:1e5a1ca1f274 | 55 | typedef void (*pfIoTHubTransport_Destroy)(TRANSPORT_LL_HANDLE handle); |
AzureIoTClient | 53:1e5a1ca1f274 | 56 | 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 | 57 | typedef void(*pfIotHubTransport_Unregister)(IOTHUB_DEVICE_HANDLE deviceHandle); |
AzureIoTClient | 53:1e5a1ca1f274 | 58 | typedef int (*pfIoTHubTransport_Subscribe)(IOTHUB_DEVICE_HANDLE handle); |
AzureIoTClient | 53:1e5a1ca1f274 | 59 | typedef void (*pfIoTHubTransport_Unsubscribe)(IOTHUB_DEVICE_HANDLE handle); |
AzureIoTClient | 53:1e5a1ca1f274 | 60 | typedef void (*pfIoTHubTransport_DoWork)(TRANSPORT_LL_HANDLE handle, IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle); |
AzureIoTClient | 53:1e5a1ca1f274 | 61 | typedef int(*pfIoTHubTransport_SetRetryPolicy)(TRANSPORT_LL_HANDLE handle, IOTHUB_CLIENT_RETRY_POLICY retryPolicy, size_t retryTimeoutLimitInSeconds); |
AzureIoTClient | 53:1e5a1ca1f274 | 62 | typedef IOTHUB_CLIENT_RESULT(*pfIoTHubTransport_GetSendStatus)(IOTHUB_DEVICE_HANDLE handle, IOTHUB_CLIENT_STATUS *iotHubClientStatus); |
AzureIoTClient | 53:1e5a1ca1f274 | 63 | typedef int (*pfIoTHubTransport_Subscribe_DeviceTwin)(IOTHUB_DEVICE_HANDLE handle); |
AzureIoTClient | 53:1e5a1ca1f274 | 64 | typedef void (*pfIoTHubTransport_Unsubscribe_DeviceTwin)(IOTHUB_DEVICE_HANDLE handle); |
AzureIoTClient | 61:8b85a4e797cf | 65 | typedef IOTHUB_CLIENT_RESULT(*pfIotHubTransport_SendMessageDisposition)(MESSAGE_CALLBACK_INFO* messageData, IOTHUBMESSAGE_DISPOSITION_RESULT disposition); |
AzureIoTClient | 53:1e5a1ca1f274 | 66 | typedef IOTHUB_PROCESS_ITEM_RESULT(*pfIoTHubTransport_ProcessItem)(TRANSPORT_LL_HANDLE handle, IOTHUB_IDENTITY_TYPE item_type, IOTHUB_IDENTITY_INFO* iothub_item); |
AzureIoTClient | 53:1e5a1ca1f274 | 67 | typedef int(*pfIoTHubTransport_Subscribe_DeviceMethod)(IOTHUB_DEVICE_HANDLE handle); |
AzureIoTClient | 53:1e5a1ca1f274 | 68 | typedef void(*pfIoTHubTransport_Unsubscribe_DeviceMethod)(IOTHUB_DEVICE_HANDLE handle); |
AzureIoTClient | 55:59b527ab3452 | 69 | typedef int(*pfIoTHubTransport_DeviceMethod_Response)(IOTHUB_DEVICE_HANDLE handle, METHOD_HANDLE methodId, const unsigned char* response, size_t response_size, int status_response); |
Azure.IoT Build | 38:a05929a75111 | 70 | |
AzureIoTClient | 53:1e5a1ca1f274 | 71 | #define TRANSPORT_PROVIDER_FIELDS \ |
AzureIoTClient | 61:8b85a4e797cf | 72 | pfIotHubTransport_SendMessageDisposition IoTHubTransport_SendMessageDisposition; \ |
AzureIoTClient | 53:1e5a1ca1f274 | 73 | pfIoTHubTransport_Subscribe_DeviceMethod IoTHubTransport_Subscribe_DeviceMethod; \ |
AzureIoTClient | 53:1e5a1ca1f274 | 74 | pfIoTHubTransport_Unsubscribe_DeviceMethod IoTHubTransport_Unsubscribe_DeviceMethod;\ |
AzureIoTClient | 55:59b527ab3452 | 75 | pfIoTHubTransport_DeviceMethod_Response IoTHubTransport_DeviceMethod_Response; \ |
AzureIoTClient | 53:1e5a1ca1f274 | 76 | pfIoTHubTransport_Subscribe_DeviceTwin IoTHubTransport_Subscribe_DeviceTwin; \ |
AzureIoTClient | 53:1e5a1ca1f274 | 77 | pfIoTHubTransport_Unsubscribe_DeviceTwin IoTHubTransport_Unsubscribe_DeviceTwin; \ |
AzureIoTClient | 53:1e5a1ca1f274 | 78 | pfIoTHubTransport_ProcessItem IoTHubTransport_ProcessItem; \ |
AzureIoTClient | 53:1e5a1ca1f274 | 79 | pfIoTHubTransport_GetHostname IoTHubTransport_GetHostname; \ |
AzureIoTClient | 53:1e5a1ca1f274 | 80 | pfIoTHubTransport_SetOption IoTHubTransport_SetOption; \ |
AzureIoTClient | 53:1e5a1ca1f274 | 81 | pfIoTHubTransport_Create IoTHubTransport_Create; \ |
AzureIoTClient | 53:1e5a1ca1f274 | 82 | pfIoTHubTransport_Destroy IoTHubTransport_Destroy; \ |
AzureIoTClient | 53:1e5a1ca1f274 | 83 | pfIotHubTransport_Register IoTHubTransport_Register; \ |
AzureIoTClient | 53:1e5a1ca1f274 | 84 | pfIotHubTransport_Unregister IoTHubTransport_Unregister; \ |
AzureIoTClient | 53:1e5a1ca1f274 | 85 | pfIoTHubTransport_Subscribe IoTHubTransport_Subscribe; \ |
AzureIoTClient | 53:1e5a1ca1f274 | 86 | pfIoTHubTransport_Unsubscribe IoTHubTransport_Unsubscribe; \ |
AzureIoTClient | 53:1e5a1ca1f274 | 87 | pfIoTHubTransport_DoWork IoTHubTransport_DoWork; \ |
AzureIoTClient | 53:1e5a1ca1f274 | 88 | pfIoTHubTransport_SetRetryPolicy IoTHubTransport_SetRetryPolicy; \ |
AzureIoTClient | 53:1e5a1ca1f274 | 89 | pfIoTHubTransport_GetSendStatus IoTHubTransport_GetSendStatus /*there's an intentional missing ; on this line*/ |
Azure.IoT Build | 38:a05929a75111 | 90 | |
AzureIoTClient | 53:1e5a1ca1f274 | 91 | struct TRANSPORT_PROVIDER_TAG |
AzureIoTClient | 53:1e5a1ca1f274 | 92 | { |
AzureIoTClient | 53:1e5a1ca1f274 | 93 | TRANSPORT_PROVIDER_FIELDS; |
AzureIoTClient | 53:1e5a1ca1f274 | 94 | }; |
Azure.IoT Build | 38:a05929a75111 | 95 | |
Azure.IoT Build | 38:a05929a75111 | 96 | #ifdef __cplusplus |
Azure.IoT Build | 38:a05929a75111 | 97 | } |
Azure.IoT Build | 38:a05929a75111 | 98 | #endif |
Azure.IoT Build | 38:a05929a75111 | 99 | |
Azure.IoT Build | 38:a05929a75111 | 100 | #endif /* IOTHUB_TRANSPORT_LL_H */ |