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_client_core_common.h@93:7c0bbb86b167, 2018-10-04 (annotated)
- Committer:
- AzureIoTClient
- Date:
- Thu Oct 04 09:15:49 2018 -0700
- Revision:
- 93:7c0bbb86b167
- Parent:
- 92:97148cf9aa2a
1.2.10
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AzureIoTClient | 88:248736be106e | 1 | // Copyright (c) Microsoft. All rights reserved. |
AzureIoTClient | 88:248736be106e | 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
AzureIoTClient | 88:248736be106e | 3 | |
AzureIoTClient | 88:248736be106e | 4 | /* Shared structures and enums for iothub convenience layer and LL layer */ |
AzureIoTClient | 88:248736be106e | 5 | |
AzureIoTClient | 88:248736be106e | 6 | #ifndef IOTHUB_CLIENT_CORE_COMMON_H |
AzureIoTClient | 88:248736be106e | 7 | #define IOTHUB_CLIENT_CORE_COMMON_H |
AzureIoTClient | 88:248736be106e | 8 | |
AzureIoTClient | 88:248736be106e | 9 | #include "azure_c_shared_utility/macro_utils.h" |
AzureIoTClient | 88:248736be106e | 10 | #include "azure_c_shared_utility/umock_c_prod.h" |
AzureIoTClient | 88:248736be106e | 11 | |
AzureIoTClient | 88:248736be106e | 12 | #include "iothub_transport_ll.h" |
AzureIoTClient | 88:248736be106e | 13 | #include "iothub_message.h" |
AzureIoTClient | 88:248736be106e | 14 | |
AzureIoTClient | 88:248736be106e | 15 | #ifdef __cplusplus |
AzureIoTClient | 88:248736be106e | 16 | extern "C" |
AzureIoTClient | 88:248736be106e | 17 | { |
AzureIoTClient | 88:248736be106e | 18 | #endif |
AzureIoTClient | 88:248736be106e | 19 | |
AzureIoTClient | 88:248736be106e | 20 | #define IOTHUB_CLIENT_FILE_UPLOAD_RESULT_VALUES \ |
AzureIoTClient | 88:248736be106e | 21 | FILE_UPLOAD_OK, \ |
AzureIoTClient | 88:248736be106e | 22 | FILE_UPLOAD_ERROR |
AzureIoTClient | 88:248736be106e | 23 | |
AzureIoTClient | 88:248736be106e | 24 | DEFINE_ENUM(IOTHUB_CLIENT_FILE_UPLOAD_RESULT, IOTHUB_CLIENT_FILE_UPLOAD_RESULT_VALUES) |
AzureIoTClient | 88:248736be106e | 25 | typedef void(*IOTHUB_CLIENT_FILE_UPLOAD_CALLBACK)(IOTHUB_CLIENT_FILE_UPLOAD_RESULT result, void* userContextCallback); |
AzureIoTClient | 88:248736be106e | 26 | |
AzureIoTClient | 88:248736be106e | 27 | #define IOTHUB_CLIENT_RESULT_VALUES \ |
AzureIoTClient | 88:248736be106e | 28 | IOTHUB_CLIENT_OK, \ |
AzureIoTClient | 88:248736be106e | 29 | IOTHUB_CLIENT_INVALID_ARG, \ |
AzureIoTClient | 88:248736be106e | 30 | IOTHUB_CLIENT_ERROR, \ |
AzureIoTClient | 88:248736be106e | 31 | IOTHUB_CLIENT_INVALID_SIZE, \ |
AzureIoTClient | 88:248736be106e | 32 | IOTHUB_CLIENT_INDEFINITE_TIME |
AzureIoTClient | 88:248736be106e | 33 | |
AzureIoTClient | 88:248736be106e | 34 | /** @brief Enumeration specifying the status of calls to various APIs in this module. |
AzureIoTClient | 88:248736be106e | 35 | */ |
AzureIoTClient | 88:248736be106e | 36 | |
AzureIoTClient | 88:248736be106e | 37 | DEFINE_ENUM(IOTHUB_CLIENT_RESULT, IOTHUB_CLIENT_RESULT_VALUES); |
AzureIoTClient | 88:248736be106e | 38 | |
AzureIoTClient | 92:97148cf9aa2a | 39 | typedef void(*IOTHUB_METHOD_INVOKE_CALLBACK)(IOTHUB_CLIENT_RESULT result, int responseStatus, unsigned char* responsePayload, size_t responsePayloadSize, void* context); |
AzureIoTClient | 92:97148cf9aa2a | 40 | |
AzureIoTClient | 88:248736be106e | 41 | #define IOTHUB_CLIENT_RETRY_POLICY_VALUES \ |
AzureIoTClient | 88:248736be106e | 42 | IOTHUB_CLIENT_RETRY_NONE, \ |
AzureIoTClient | 88:248736be106e | 43 | IOTHUB_CLIENT_RETRY_IMMEDIATE, \ |
AzureIoTClient | 88:248736be106e | 44 | IOTHUB_CLIENT_RETRY_INTERVAL, \ |
AzureIoTClient | 88:248736be106e | 45 | IOTHUB_CLIENT_RETRY_LINEAR_BACKOFF, \ |
AzureIoTClient | 88:248736be106e | 46 | IOTHUB_CLIENT_RETRY_EXPONENTIAL_BACKOFF, \ |
AzureIoTClient | 88:248736be106e | 47 | IOTHUB_CLIENT_RETRY_EXPONENTIAL_BACKOFF_WITH_JITTER, \ |
AzureIoTClient | 88:248736be106e | 48 | IOTHUB_CLIENT_RETRY_RANDOM |
AzureIoTClient | 88:248736be106e | 49 | |
AzureIoTClient | 88:248736be106e | 50 | /** @brief Enumeration passed in by the IoT Hub when the event confirmation |
AzureIoTClient | 92:97148cf9aa2a | 51 | * callback is invoked to indicate status of the event processing in |
AzureIoTClient | 92:97148cf9aa2a | 52 | * the hub. |
AzureIoTClient | 88:248736be106e | 53 | */ |
AzureIoTClient | 88:248736be106e | 54 | DEFINE_ENUM(IOTHUB_CLIENT_RETRY_POLICY, IOTHUB_CLIENT_RETRY_POLICY_VALUES); |
AzureIoTClient | 88:248736be106e | 55 | |
AzureIoTClient | 88:248736be106e | 56 | struct IOTHUBTRANSPORT_CONFIG_TAG; |
AzureIoTClient | 88:248736be106e | 57 | typedef struct IOTHUBTRANSPORT_CONFIG_TAG IOTHUBTRANSPORT_CONFIG; |
AzureIoTClient | 88:248736be106e | 58 | |
AzureIoTClient | 88:248736be106e | 59 | #define IOTHUB_CLIENT_STATUS_VALUES \ |
AzureIoTClient | 88:248736be106e | 60 | IOTHUB_CLIENT_SEND_STATUS_IDLE, \ |
AzureIoTClient | 88:248736be106e | 61 | IOTHUB_CLIENT_SEND_STATUS_BUSY |
AzureIoTClient | 88:248736be106e | 62 | |
AzureIoTClient | 88:248736be106e | 63 | /** @brief Enumeration returned by the ::IoTHubClient_LL_GetSendStatus |
AzureIoTClient | 92:97148cf9aa2a | 64 | * API to indicate the current sending status of the IoT Hub client. |
AzureIoTClient | 88:248736be106e | 65 | */ |
AzureIoTClient | 88:248736be106e | 66 | DEFINE_ENUM(IOTHUB_CLIENT_STATUS, IOTHUB_CLIENT_STATUS_VALUES); |
AzureIoTClient | 88:248736be106e | 67 | |
AzureIoTClient | 88:248736be106e | 68 | #define IOTHUB_IDENTITY_TYPE_VALUE \ |
AzureIoTClient | 88:248736be106e | 69 | IOTHUB_TYPE_TELEMETRY, \ |
AzureIoTClient | 88:248736be106e | 70 | IOTHUB_TYPE_DEVICE_TWIN, \ |
AzureIoTClient | 89:a2ed767a532e | 71 | IOTHUB_TYPE_DEVICE_METHODS, \ |
AzureIoTClient | 89:a2ed767a532e | 72 | IOTHUB_TYPE_EVENT_QUEUE |
AzureIoTClient | 88:248736be106e | 73 | DEFINE_ENUM(IOTHUB_IDENTITY_TYPE, IOTHUB_IDENTITY_TYPE_VALUE); |
AzureIoTClient | 88:248736be106e | 74 | |
AzureIoTClient | 88:248736be106e | 75 | #define IOTHUB_PROCESS_ITEM_RESULT_VALUE \ |
AzureIoTClient | 88:248736be106e | 76 | IOTHUB_PROCESS_OK, \ |
AzureIoTClient | 88:248736be106e | 77 | IOTHUB_PROCESS_ERROR, \ |
AzureIoTClient | 88:248736be106e | 78 | IOTHUB_PROCESS_NOT_CONNECTED, \ |
AzureIoTClient | 88:248736be106e | 79 | IOTHUB_PROCESS_CONTINUE |
AzureIoTClient | 88:248736be106e | 80 | DEFINE_ENUM(IOTHUB_PROCESS_ITEM_RESULT, IOTHUB_PROCESS_ITEM_RESULT_VALUE); |
AzureIoTClient | 88:248736be106e | 81 | |
AzureIoTClient | 88:248736be106e | 82 | #define IOTHUBMESSAGE_DISPOSITION_RESULT_VALUES \ |
AzureIoTClient | 88:248736be106e | 83 | IOTHUBMESSAGE_ACCEPTED, \ |
AzureIoTClient | 88:248736be106e | 84 | IOTHUBMESSAGE_REJECTED, \ |
AzureIoTClient | 88:248736be106e | 85 | IOTHUBMESSAGE_ABANDONED |
AzureIoTClient | 88:248736be106e | 86 | |
AzureIoTClient | 88:248736be106e | 87 | /** @brief Enumeration returned by the callback which is invoked whenever the |
AzureIoTClient | 92:97148cf9aa2a | 88 | * IoT Hub sends a message to the device. |
AzureIoTClient | 88:248736be106e | 89 | */ |
AzureIoTClient | 88:248736be106e | 90 | DEFINE_ENUM(IOTHUBMESSAGE_DISPOSITION_RESULT, IOTHUBMESSAGE_DISPOSITION_RESULT_VALUES); |
AzureIoTClient | 88:248736be106e | 91 | |
AzureIoTClient | 88:248736be106e | 92 | #define IOTHUB_CLIENT_IOTHUB_METHOD_STATUS_VALUES \ |
AzureIoTClient | 88:248736be106e | 93 | IOTHUB_CLIENT_IOTHUB_METHOD_STATUS_SUCCESS, \ |
AzureIoTClient | 88:248736be106e | 94 | IOTHUB_CLIENT_IOTHUB_METHOD_STATUS_ERROR \ |
AzureIoTClient | 88:248736be106e | 95 | |
AzureIoTClient | 88:248736be106e | 96 | /** @brief Enumeration returned by remotely executed functions |
AzureIoTClient | 88:248736be106e | 97 | */ |
AzureIoTClient | 88:248736be106e | 98 | DEFINE_ENUM(IOTHUB_CLIENT_IOTHUB_METHOD_STATUS, IOTHUB_CLIENT_IOTHUB_METHOD_STATUS_VALUES); |
AzureIoTClient | 88:248736be106e | 99 | |
AzureIoTClient | 88:248736be106e | 100 | |
AzureIoTClient | 88:248736be106e | 101 | #define IOTHUB_CLIENT_CONFIRMATION_RESULT_VALUES \ |
AzureIoTClient | 88:248736be106e | 102 | IOTHUB_CLIENT_CONFIRMATION_OK, \ |
AzureIoTClient | 88:248736be106e | 103 | IOTHUB_CLIENT_CONFIRMATION_BECAUSE_DESTROY, \ |
AzureIoTClient | 88:248736be106e | 104 | IOTHUB_CLIENT_CONFIRMATION_MESSAGE_TIMEOUT, \ |
AzureIoTClient | 88:248736be106e | 105 | IOTHUB_CLIENT_CONFIRMATION_ERROR \ |
AzureIoTClient | 88:248736be106e | 106 | |
AzureIoTClient | 88:248736be106e | 107 | /** @brief Enumeration passed in by the IoT Hub when the event confirmation |
AzureIoTClient | 92:97148cf9aa2a | 108 | * callback is invoked to indicate status of the event processing in |
AzureIoTClient | 92:97148cf9aa2a | 109 | * the hub. |
AzureIoTClient | 88:248736be106e | 110 | */ |
AzureIoTClient | 88:248736be106e | 111 | DEFINE_ENUM(IOTHUB_CLIENT_CONFIRMATION_RESULT, IOTHUB_CLIENT_CONFIRMATION_RESULT_VALUES); |
AzureIoTClient | 88:248736be106e | 112 | |
AzureIoTClient | 88:248736be106e | 113 | #define IOTHUB_CLIENT_CONNECTION_STATUS_VALUES \ |
AzureIoTClient | 88:248736be106e | 114 | IOTHUB_CLIENT_CONNECTION_AUTHENTICATED, \ |
AzureIoTClient | 88:248736be106e | 115 | IOTHUB_CLIENT_CONNECTION_UNAUTHENTICATED \ |
AzureIoTClient | 88:248736be106e | 116 | |
AzureIoTClient | 88:248736be106e | 117 | |
AzureIoTClient | 88:248736be106e | 118 | /** @brief Enumeration passed in by the IoT Hub when the connection status |
AzureIoTClient | 92:97148cf9aa2a | 119 | * callback is invoked to indicate status of the connection in |
AzureIoTClient | 92:97148cf9aa2a | 120 | * the hub. |
AzureIoTClient | 88:248736be106e | 121 | */ |
AzureIoTClient | 88:248736be106e | 122 | DEFINE_ENUM(IOTHUB_CLIENT_CONNECTION_STATUS, IOTHUB_CLIENT_CONNECTION_STATUS_VALUES); |
AzureIoTClient | 88:248736be106e | 123 | |
AzureIoTClient | 88:248736be106e | 124 | #define IOTHUB_CLIENT_CONNECTION_STATUS_REASON_VALUES \ |
AzureIoTClient | 88:248736be106e | 125 | IOTHUB_CLIENT_CONNECTION_EXPIRED_SAS_TOKEN, \ |
AzureIoTClient | 88:248736be106e | 126 | IOTHUB_CLIENT_CONNECTION_DEVICE_DISABLED, \ |
AzureIoTClient | 88:248736be106e | 127 | IOTHUB_CLIENT_CONNECTION_BAD_CREDENTIAL, \ |
AzureIoTClient | 88:248736be106e | 128 | IOTHUB_CLIENT_CONNECTION_RETRY_EXPIRED, \ |
AzureIoTClient | 88:248736be106e | 129 | IOTHUB_CLIENT_CONNECTION_NO_NETWORK, \ |
AzureIoTClient | 88:248736be106e | 130 | IOTHUB_CLIENT_CONNECTION_COMMUNICATION_ERROR, \ |
AzureIoTClient | 88:248736be106e | 131 | IOTHUB_CLIENT_CONNECTION_OK \ |
AzureIoTClient | 88:248736be106e | 132 | |
AzureIoTClient | 88:248736be106e | 133 | /** @brief Enumeration passed in by the IoT Hub when the connection status |
AzureIoTClient | 92:97148cf9aa2a | 134 | * callback is invoked to indicate status of the connection in |
AzureIoTClient | 92:97148cf9aa2a | 135 | * the hub. |
AzureIoTClient | 88:248736be106e | 136 | */ |
AzureIoTClient | 88:248736be106e | 137 | DEFINE_ENUM(IOTHUB_CLIENT_CONNECTION_STATUS_REASON, IOTHUB_CLIENT_CONNECTION_STATUS_REASON_VALUES); |
AzureIoTClient | 88:248736be106e | 138 | |
AzureIoTClient | 88:248736be106e | 139 | #define TRANSPORT_TYPE_VALUES \ |
AzureIoTClient | 88:248736be106e | 140 | TRANSPORT_LL, /*LL comes from "LowLevel" */ \ |
AzureIoTClient | 88:248736be106e | 141 | TRANSPORT_THREADED |
AzureIoTClient | 88:248736be106e | 142 | |
AzureIoTClient | 88:248736be106e | 143 | DEFINE_ENUM(TRANSPORT_TYPE, TRANSPORT_TYPE_VALUES); |
AzureIoTClient | 88:248736be106e | 144 | |
AzureIoTClient | 88:248736be106e | 145 | #define DEVICE_TWIN_UPDATE_STATE_VALUES \ |
AzureIoTClient | 88:248736be106e | 146 | DEVICE_TWIN_UPDATE_COMPLETE, \ |
AzureIoTClient | 88:248736be106e | 147 | DEVICE_TWIN_UPDATE_PARTIAL |
AzureIoTClient | 88:248736be106e | 148 | |
AzureIoTClient | 88:248736be106e | 149 | DEFINE_ENUM(DEVICE_TWIN_UPDATE_STATE, DEVICE_TWIN_UPDATE_STATE_VALUES); |
AzureIoTClient | 88:248736be106e | 150 | |
AzureIoTClient | 88:248736be106e | 151 | typedef void(*IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK)(IOTHUB_CLIENT_CONFIRMATION_RESULT result, void* userContextCallback); |
AzureIoTClient | 88:248736be106e | 152 | typedef void(*IOTHUB_CLIENT_CONNECTION_STATUS_CALLBACK)(IOTHUB_CLIENT_CONNECTION_STATUS result, IOTHUB_CLIENT_CONNECTION_STATUS_REASON reason, void* userContextCallback); |
AzureIoTClient | 88:248736be106e | 153 | typedef IOTHUBMESSAGE_DISPOSITION_RESULT (*IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC)(IOTHUB_MESSAGE_HANDLE message, void* userContextCallback); |
AzureIoTClient | 88:248736be106e | 154 | |
AzureIoTClient | 88:248736be106e | 155 | typedef void(*IOTHUB_CLIENT_DEVICE_TWIN_CALLBACK)(DEVICE_TWIN_UPDATE_STATE update_state, const unsigned char* payLoad, size_t size, void* userContextCallback); |
AzureIoTClient | 88:248736be106e | 156 | typedef void(*IOTHUB_CLIENT_REPORTED_STATE_CALLBACK)(int status_code, void* userContextCallback); |
AzureIoTClient | 88:248736be106e | 157 | typedef int(*IOTHUB_CLIENT_DEVICE_METHOD_CALLBACK_ASYNC)(const char* method_name, const unsigned char* payload, size_t size, unsigned char** response, size_t* response_size, void* userContextCallback); |
AzureIoTClient | 88:248736be106e | 158 | typedef int(*IOTHUB_CLIENT_INBOUND_DEVICE_METHOD_CALLBACK)(const char* method_name, const unsigned char* payload, size_t size, METHOD_HANDLE method_id, void* userContextCallback); |
AzureIoTClient | 88:248736be106e | 159 | |
AzureIoTClient | 88:248736be106e | 160 | |
AzureIoTClient | 88:248736be106e | 161 | #define IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_RESULT_VALUES \ |
AzureIoTClient | 88:248736be106e | 162 | IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_OK, \ |
AzureIoTClient | 88:248736be106e | 163 | IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_ABORT |
AzureIoTClient | 88:248736be106e | 164 | |
AzureIoTClient | 88:248736be106e | 165 | DEFINE_ENUM(IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_RESULT, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_RESULT_VALUES); |
AzureIoTClient | 88:248736be106e | 166 | |
AzureIoTClient | 88:248736be106e | 167 | /** |
AzureIoTClient | 88:248736be106e | 168 | * @brief Callback invoked by IoTHubClient_UploadMultipleBlocksToBlobAsync requesting the chunks of data to be uploaded. |
AzureIoTClient | 88:248736be106e | 169 | * @param result The result of the upload of the previous block of data provided by the user (IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX only) |
AzureIoTClient | 88:248736be106e | 170 | * @param data Next block of data to be uploaded, to be provided by the user when this callback is invoked. |
AzureIoTClient | 88:248736be106e | 171 | * @param size Size of the data parameter. |
AzureIoTClient | 88:248736be106e | 172 | * @param context User context provided on the call to IoTHubClient_UploadMultipleBlocksToBlobAsync. |
AzureIoTClient | 88:248736be106e | 173 | * @remarks If the user wants to abort the upload, the callback should return IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_ABORT |
AzureIoTClient | 88:248736be106e | 174 | * It should return IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_OK otherwise. |
AzureIoTClient | 88:248736be106e | 175 | * If a NULL is provided for parameter "data" and/or zero is provided for "size", the user indicates to the client that the complete file has been uploaded. |
AzureIoTClient | 88:248736be106e | 176 | * In such case this callback will be invoked only once more to indicate the status of the final block upload. |
AzureIoTClient | 92:97148cf9aa2a | 177 | * If result is not FILE_UPLOAD_OK, the upload is cancelled and this callback stops being invoked. |
AzureIoTClient | 92:97148cf9aa2a | 178 | * When this callback is called for the last time, no data or size is expected, so data and size are NULL |
AzureIoTClient | 88:248736be106e | 179 | */ |
AzureIoTClient | 88:248736be106e | 180 | typedef void(*IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK)(IOTHUB_CLIENT_FILE_UPLOAD_RESULT result, unsigned char const ** data, size_t* size, void* context); |
AzureIoTClient | 88:248736be106e | 181 | typedef IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_RESULT(*IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX)(IOTHUB_CLIENT_FILE_UPLOAD_RESULT result, unsigned char const ** data, size_t* size, void* context); |
AzureIoTClient | 88:248736be106e | 182 | |
AzureIoTClient | 92:97148cf9aa2a | 183 | /** @brief This struct captures IoTHub client configuration. */ |
AzureIoTClient | 88:248736be106e | 184 | typedef struct IOTHUB_CLIENT_CONFIG_TAG |
AzureIoTClient | 88:248736be106e | 185 | { |
AzureIoTClient | 88:248736be106e | 186 | /** @brief A function pointer that is passed into the @c IoTHubClientCreate. |
AzureIoTClient | 92:97148cf9aa2a | 187 | * A function definition for AMQP is defined in the include @c iothubtransportamqp.h. |
AzureIoTClient | 88:248736be106e | 188 | * A function definition for HTTP is defined in the include @c iothubtransporthttp.h |
AzureIoTClient | 88:248736be106e | 189 | * A function definition for MQTT is defined in the include @c iothubtransportmqtt.h */ |
AzureIoTClient | 88:248736be106e | 190 | IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol; |
AzureIoTClient | 88:248736be106e | 191 | |
AzureIoTClient | 92:97148cf9aa2a | 192 | /** @brief A string that identifies the device. */ |
AzureIoTClient | 88:248736be106e | 193 | const char* deviceId; |
AzureIoTClient | 88:248736be106e | 194 | |
AzureIoTClient | 92:97148cf9aa2a | 195 | /** @brief The device key used to authenticate the device. |
AzureIoTClient | 88:248736be106e | 196 | If neither deviceSasToken nor deviceKey is present then the authentication is assumed x509.*/ |
AzureIoTClient | 88:248736be106e | 197 | const char* deviceKey; |
AzureIoTClient | 88:248736be106e | 198 | |
AzureIoTClient | 92:97148cf9aa2a | 199 | /** @brief The device SAS Token used to authenticate the device in place of device key. |
AzureIoTClient | 88:248736be106e | 200 | If neither deviceSasToken nor deviceKey is present then the authentication is assumed x509.*/ |
AzureIoTClient | 88:248736be106e | 201 | const char* deviceSasToken; |
AzureIoTClient | 88:248736be106e | 202 | |
AzureIoTClient | 92:97148cf9aa2a | 203 | /** @brief The IoT Hub name to which the device is connecting. */ |
AzureIoTClient | 88:248736be106e | 204 | const char* iotHubName; |
AzureIoTClient | 88:248736be106e | 205 | |
AzureIoTClient | 92:97148cf9aa2a | 206 | /** @brief IoT Hub suffix goes here, e.g., private.azure-devices-int.net. */ |
AzureIoTClient | 88:248736be106e | 207 | const char* iotHubSuffix; |
AzureIoTClient | 88:248736be106e | 208 | |
AzureIoTClient | 88:248736be106e | 209 | const char* protocolGatewayHostName; |
AzureIoTClient | 88:248736be106e | 210 | } IOTHUB_CLIENT_CONFIG; |
AzureIoTClient | 88:248736be106e | 211 | |
AzureIoTClient | 92:97148cf9aa2a | 212 | /** @brief This struct captures IoTHub client device configuration. */ |
AzureIoTClient | 88:248736be106e | 213 | typedef struct IOTHUB_CLIENT_DEVICE_CONFIG_TAG |
AzureIoTClient | 88:248736be106e | 214 | { |
AzureIoTClient | 88:248736be106e | 215 | /** @brief A function pointer that is passed into the @c IoTHubClientCreate. |
AzureIoTClient | 92:97148cf9aa2a | 216 | * A function definition for AMQP is defined in the include @c iothubtransportamqp.h. |
AzureIoTClient | 88:248736be106e | 217 | * A function definition for HTTP is defined in the include @c iothubtransporthttp.h |
AzureIoTClient | 88:248736be106e | 218 | * A function definition for MQTT is defined in the include @c iothubtransportmqtt.h */ |
AzureIoTClient | 88:248736be106e | 219 | IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol; |
AzureIoTClient | 88:248736be106e | 220 | |
AzureIoTClient | 88:248736be106e | 221 | /** @brief a transport handle implementing the protocol */ |
AzureIoTClient | 88:248736be106e | 222 | void * transportHandle; |
AzureIoTClient | 88:248736be106e | 223 | |
AzureIoTClient | 92:97148cf9aa2a | 224 | /** @brief A string that identifies the device. */ |
AzureIoTClient | 88:248736be106e | 225 | const char* deviceId; |
AzureIoTClient | 88:248736be106e | 226 | |
AzureIoTClient | 92:97148cf9aa2a | 227 | /** @brief The device key used to authenticate the device. |
AzureIoTClient | 88:248736be106e | 228 | x509 authentication is is not supported for multiplexed connections*/ |
AzureIoTClient | 88:248736be106e | 229 | const char* deviceKey; |
AzureIoTClient | 88:248736be106e | 230 | |
AzureIoTClient | 92:97148cf9aa2a | 231 | /** @brief The device SAS Token used to authenticate the device in place of device key. |
AzureIoTClient | 88:248736be106e | 232 | x509 authentication is is not supported for multiplexed connections.*/ |
AzureIoTClient | 88:248736be106e | 233 | const char* deviceSasToken; |
AzureIoTClient | 88:248736be106e | 234 | } IOTHUB_CLIENT_DEVICE_CONFIG; |
AzureIoTClient | 88:248736be106e | 235 | |
AzureIoTClient | 88:248736be106e | 236 | #ifdef __cplusplus |
AzureIoTClient | 88:248736be106e | 237 | } |
AzureIoTClient | 88:248736be106e | 238 | #endif |
AzureIoTClient | 88:248736be106e | 239 | |
AzureIoTClient | 88:248736be106e | 240 | #endif /* IOTHUB_CLIENT_CORE_COMMON_H */ |