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
iothub_client_ll.h@31:741eacddf296, 2016-01-25 (annotated)
- Committer:
- AzureIoTClient
- Date:
- Mon Jan 25 19:21:04 2016 -0800
- Revision:
- 31:741eacddf296
- Parent:
- 16:deba40344375
- Child:
- 32:6e9d81a62085
v1.0.0-preview.9
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AzureIoTClient | 16:deba40344375 | 1 | // Copyright (c) Microsoft. All rights reserved. |
AzureIoTClient | 16:deba40344375 | 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
AzureIoTClient | 16:deba40344375 | 3 | |
AzureIoTClient | 16:deba40344375 | 4 | /** @file iothub_client_ll.h |
AzureIoTClient | 16:deba40344375 | 5 | * @brief APIs that allow a user (usually a device) to communicate |
AzureIoTClient | 16:deba40344375 | 6 | * with an Azure IoTHub. |
AzureIoTClient | 16:deba40344375 | 7 | * |
AzureIoTClient | 16:deba40344375 | 8 | * @details IoTHubClient_LL is a module that allows a user (usually a |
AzureIoTClient | 16:deba40344375 | 9 | * device) to communicate with an Azure IoTHub. It can send events |
AzureIoTClient | 16:deba40344375 | 10 | * and receive messages. At any given moment in time there can only |
AzureIoTClient | 16:deba40344375 | 11 | * be at most 1 message callback function. |
AzureIoTClient | 16:deba40344375 | 12 | * |
AzureIoTClient | 16:deba40344375 | 13 | * This API surface contains a set of APIs that allows the user to |
AzureIoTClient | 16:deba40344375 | 14 | * interact with the lower layer portion of the IoTHubClient. These APIs |
AzureIoTClient | 16:deba40344375 | 15 | * contain @c _LL_ in their name, but retain the same functionality like the |
AzureIoTClient | 16:deba40344375 | 16 | * @c IoTHubClient_... APIs, with one difference. If the @c _LL_ APIs are |
AzureIoTClient | 16:deba40344375 | 17 | * used then the user is responsible for scheduling when the actual work done |
AzureIoTClient | 16:deba40344375 | 18 | * by the IoTHubClient happens (when the data is sent/received on/from the wire). |
AzureIoTClient | 16:deba40344375 | 19 | * This is useful for constrained devices where spinning a separate thread is |
AzureIoTClient | 16:deba40344375 | 20 | * often not desired. |
AzureIoTClient | 16:deba40344375 | 21 | */ |
AzureIoTClient | 16:deba40344375 | 22 | |
AzureIoTClient | 16:deba40344375 | 23 | #ifndef IOTHUB_CLIENT_LL_H |
AzureIoTClient | 16:deba40344375 | 24 | #define IOTHUB_CLIENT_LL_H |
AzureIoTClient | 16:deba40344375 | 25 | |
AzureIoTClient | 16:deba40344375 | 26 | #include "agenttime.h" |
AzureIoTClient | 16:deba40344375 | 27 | |
AzureIoTClient | 16:deba40344375 | 28 | #include "macro_utils.h" |
AzureIoTClient | 16:deba40344375 | 29 | |
AzureIoTClient | 16:deba40344375 | 30 | #include "iothub_message.h" |
AzureIoTClient | 16:deba40344375 | 31 | |
AzureIoTClient | 31:741eacddf296 | 32 | #include "xio.h" |
AzureIoTClient | 31:741eacddf296 | 33 | |
AzureIoTClient | 16:deba40344375 | 34 | #ifdef __cplusplus |
AzureIoTClient | 16:deba40344375 | 35 | extern "C" |
AzureIoTClient | 16:deba40344375 | 36 | { |
AzureIoTClient | 16:deba40344375 | 37 | #endif |
AzureIoTClient | 16:deba40344375 | 38 | |
AzureIoTClient | 16:deba40344375 | 39 | #define IOTHUB_CLIENT_RESULT_VALUES \ |
AzureIoTClient | 16:deba40344375 | 40 | IOTHUB_CLIENT_OK, \ |
AzureIoTClient | 16:deba40344375 | 41 | IOTHUB_CLIENT_INVALID_ARG, \ |
AzureIoTClient | 16:deba40344375 | 42 | IOTHUB_CLIENT_ERROR, \ |
AzureIoTClient | 16:deba40344375 | 43 | IOTHUB_CLIENT_INVALID_SIZE, \ |
AzureIoTClient | 16:deba40344375 | 44 | IOTHUB_CLIENT_INDEFINITE_TIME \ |
AzureIoTClient | 16:deba40344375 | 45 | |
AzureIoTClient | 16:deba40344375 | 46 | /** @brief Enumeration specifying the status of calls to various APIs in this module. |
AzureIoTClient | 16:deba40344375 | 47 | */ |
AzureIoTClient | 16:deba40344375 | 48 | DEFINE_ENUM(IOTHUB_CLIENT_RESULT, IOTHUB_CLIENT_RESULT_VALUES); |
AzureIoTClient | 16:deba40344375 | 49 | |
AzureIoTClient | 16:deba40344375 | 50 | #define IOTHUB_CLIENT_CONFIRMATION_RESULT_VALUES \ |
AzureIoTClient | 16:deba40344375 | 51 | IOTHUB_CLIENT_CONFIRMATION_OK, \ |
AzureIoTClient | 16:deba40344375 | 52 | IOTHUB_CLIENT_CONFIRMATION_BECAUSE_DESTROY, \ |
AzureIoTClient | 16:deba40344375 | 53 | IOTHUB_CLIENT_CONFIRMATION_ERROR \ |
AzureIoTClient | 16:deba40344375 | 54 | |
AzureIoTClient | 16:deba40344375 | 55 | /** @brief Enumeration passed in by the IoT Hub when the event confirmation |
AzureIoTClient | 16:deba40344375 | 56 | * callback is invoked to indicate status of the event processing in |
AzureIoTClient | 16:deba40344375 | 57 | * the hub. |
AzureIoTClient | 16:deba40344375 | 58 | */ |
AzureIoTClient | 16:deba40344375 | 59 | DEFINE_ENUM(IOTHUB_CLIENT_CONFIRMATION_RESULT, IOTHUB_CLIENT_CONFIRMATION_RESULT_VALUES); |
AzureIoTClient | 16:deba40344375 | 60 | |
AzureIoTClient | 16:deba40344375 | 61 | #define IOTHUB_CLIENT_STATUS_VALUES \ |
AzureIoTClient | 16:deba40344375 | 62 | IOTHUB_CLIENT_SEND_STATUS_IDLE, \ |
AzureIoTClient | 16:deba40344375 | 63 | IOTHUB_CLIENT_SEND_STATUS_BUSY \ |
AzureIoTClient | 16:deba40344375 | 64 | |
AzureIoTClient | 16:deba40344375 | 65 | /** @brief Enumeration returned by the ::IoTHubClient_LL_GetSendStatus |
AzureIoTClient | 16:deba40344375 | 66 | * API to indicate the current sending status of the IoT Hub client. |
AzureIoTClient | 16:deba40344375 | 67 | */ |
AzureIoTClient | 16:deba40344375 | 68 | DEFINE_ENUM(IOTHUB_CLIENT_STATUS, IOTHUB_CLIENT_STATUS_VALUES); |
AzureIoTClient | 16:deba40344375 | 69 | |
AzureIoTClient | 16:deba40344375 | 70 | #define TRANSPORT_TYPE_VALUES \ |
AzureIoTClient | 16:deba40344375 | 71 | TRANSPORT_LL, /*LL comes from "LowLevel" */ \ |
AzureIoTClient | 16:deba40344375 | 72 | TRANSPORT_THREADED |
AzureIoTClient | 16:deba40344375 | 73 | |
AzureIoTClient | 16:deba40344375 | 74 | DEFINE_ENUM(TRANSPORT_TYPE, TRANSPORT_TYPE_VALUES); |
AzureIoTClient | 16:deba40344375 | 75 | |
AzureIoTClient | 16:deba40344375 | 76 | #define IOTHUBMESSAGE_DISPOSITION_RESULT_VALUES \ |
AzureIoTClient | 16:deba40344375 | 77 | IOTHUBMESSAGE_ACCEPTED, \ |
AzureIoTClient | 16:deba40344375 | 78 | IOTHUBMESSAGE_REJECTED, \ |
AzureIoTClient | 16:deba40344375 | 79 | IOTHUBMESSAGE_ABANDONED |
AzureIoTClient | 16:deba40344375 | 80 | |
AzureIoTClient | 16:deba40344375 | 81 | /** @brief Enumeration returned by the callback which is invoked whenever the |
AzureIoTClient | 16:deba40344375 | 82 | * IoT Hub sends a message to the device. |
AzureIoTClient | 16:deba40344375 | 83 | */ |
AzureIoTClient | 16:deba40344375 | 84 | DEFINE_ENUM(IOTHUBMESSAGE_DISPOSITION_RESULT, IOTHUBMESSAGE_DISPOSITION_RESULT_VALUES); |
AzureIoTClient | 16:deba40344375 | 85 | |
AzureIoTClient | 16:deba40344375 | 86 | typedef void* IOTHUB_CLIENT_LL_HANDLE; |
AzureIoTClient | 16:deba40344375 | 87 | typedef void(*IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK)(IOTHUB_CLIENT_CONFIRMATION_RESULT result, void* userContextCallback); |
AzureIoTClient | 16:deba40344375 | 88 | typedef IOTHUBMESSAGE_DISPOSITION_RESULT (*IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC)(IOTHUB_MESSAGE_HANDLE message, void* userContextCallback); |
AzureIoTClient | 16:deba40344375 | 89 | typedef const void*(*IOTHUB_CLIENT_TRANSPORT_PROVIDER)(void); |
AzureIoTClient | 31:741eacddf296 | 90 | typedef const XIO_HANDLE (*IO_TRANSPORT_PROVIDER_CALLBACK)(const char* fqdn, int port); |
AzureIoTClient | 16:deba40344375 | 91 | |
AzureIoTClient | 16:deba40344375 | 92 | /** @brief This struct captures IoTHub client configuration. */ |
AzureIoTClient | 16:deba40344375 | 93 | typedef struct IOTHUB_CLIENT_CONFIG_TAG |
AzureIoTClient | 16:deba40344375 | 94 | { |
AzureIoTClient | 31:741eacddf296 | 95 | /** @brief A function pointer that is passed into the @c IoTHubClientCreate. |
AzureIoTClient | 31:741eacddf296 | 96 | * A function definition for AMQP, @c DeviceClientProvideAmqpResources, |
AzureIoTClient | 31:741eacddf296 | 97 | * is defined in the include @c iothubtransportamqp.h. A function |
AzureIoTClient | 31:741eacddf296 | 98 | * definition for HTTP, @c DeviceClientProvideHttpResources, is defined |
AzureIoTClient | 31:741eacddf296 | 99 | * in the include @c iothubtransporthttp.h */ |
AzureIoTClient | 16:deba40344375 | 100 | IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol; |
AzureIoTClient | 16:deba40344375 | 101 | |
AzureIoTClient | 16:deba40344375 | 102 | /** @brief A string that identifies the device. */ |
AzureIoTClient | 16:deba40344375 | 103 | const char* deviceId; |
AzureIoTClient | 16:deba40344375 | 104 | |
AzureIoTClient | 31:741eacddf296 | 105 | /** @brief The device key used to authenticate the device. */ |
AzureIoTClient | 16:deba40344375 | 106 | const char* deviceKey; |
AzureIoTClient | 16:deba40344375 | 107 | |
AzureIoTClient | 16:deba40344375 | 108 | /** @brief The IoT Hub name to which the device is connecting. */ |
AzureIoTClient | 16:deba40344375 | 109 | const char* iotHubName; |
AzureIoTClient | 16:deba40344375 | 110 | |
AzureIoTClient | 31:741eacddf296 | 111 | /** @brief IoT Hub suffix goes here, e.g., private.azure-devices-int.net. */ |
AzureIoTClient | 16:deba40344375 | 112 | const char* iotHubSuffix; |
AzureIoTClient | 16:deba40344375 | 113 | |
AzureIoTClient | 16:deba40344375 | 114 | const char* protocolGatewayHostName; |
AzureIoTClient | 31:741eacddf296 | 115 | |
AzureIoTClient | 31:741eacddf296 | 116 | /** @brief A callback function to provide the IO transport instance, e.g. SChannel, OpenSSL or WebSockets. */ |
AzureIoTClient | 31:741eacddf296 | 117 | IO_TRANSPORT_PROVIDER_CALLBACK io_transport_provider_callback; |
AzureIoTClient | 16:deba40344375 | 118 | } IOTHUB_CLIENT_CONFIG; |
AzureIoTClient | 16:deba40344375 | 119 | |
AzureIoTClient | 16:deba40344375 | 120 | /** |
AzureIoTClient | 16:deba40344375 | 121 | * @brief Creates a IoT Hub client for communication with an existing |
AzureIoTClient | 16:deba40344375 | 122 | * IoT Hub using the specified connection string parameter. |
AzureIoTClient | 16:deba40344375 | 123 | * |
AzureIoTClient | 16:deba40344375 | 124 | * @param connectionString Pointer to a character string |
AzureIoTClient | 16:deba40344375 | 125 | * @param protocol Function pointer for protocol implementation |
AzureIoTClient | 16:deba40344375 | 126 | * |
AzureIoTClient | 16:deba40344375 | 127 | * Sample connection string: |
AzureIoTClient | 16:deba40344375 | 128 | * <blockquote> |
AzureIoTClient | 16:deba40344375 | 129 | * <pre>HostName=[IoT Hub name goes here].[IoT Hub suffix goes here, e.g., private.azure-devices-int.net];DeviceId=[Device ID goes here];SharedAccessKey=[Device key goes here];</pre> |
AzureIoTClient | 16:deba40344375 | 130 | * </blockquote> |
AzureIoTClient | 16:deba40344375 | 131 | * |
AzureIoTClient | 16:deba40344375 | 132 | * @return A non-NULL @c IOTHUB_CLIENT_LL_HANDLE value that is used when |
AzureIoTClient | 16:deba40344375 | 133 | * invoking other functions for IoT Hub client and @c NULL on failure. |
AzureIoTClient | 16:deba40344375 | 134 | */ |
AzureIoTClient | 16:deba40344375 | 135 | extern IOTHUB_CLIENT_LL_HANDLE IoTHubClient_LL_CreateFromConnectionString(const char* connectionString, IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol); |
AzureIoTClient | 16:deba40344375 | 136 | |
AzureIoTClient | 16:deba40344375 | 137 | /** |
AzureIoTClient | 16:deba40344375 | 138 | * @brief Creates a IoT Hub client for communication with an existing IoT |
AzureIoTClient | 16:deba40344375 | 139 | * Hub using the specified parameters. |
AzureIoTClient | 16:deba40344375 | 140 | * |
AzureIoTClient | 16:deba40344375 | 141 | * @param config Pointer to an @c IOTHUB_CLIENT_CONFIG structure |
AzureIoTClient | 16:deba40344375 | 142 | * |
AzureIoTClient | 16:deba40344375 | 143 | * The API does not allow sharing of a connection across multiple |
AzureIoTClient | 16:deba40344375 | 144 | * devices. This is a blocking call. |
AzureIoTClient | 16:deba40344375 | 145 | * |
AzureIoTClient | 16:deba40344375 | 146 | * @return A non-NULL @c IOTHUB_CLIENT_LL_HANDLE value that is used when |
AzureIoTClient | 16:deba40344375 | 147 | * invoking other functions for IoT Hub client and @c NULL on failure. |
AzureIoTClient | 16:deba40344375 | 148 | */ |
AzureIoTClient | 16:deba40344375 | 149 | extern IOTHUB_CLIENT_LL_HANDLE IoTHubClient_LL_Create(const IOTHUB_CLIENT_CONFIG* config); |
AzureIoTClient | 16:deba40344375 | 150 | |
AzureIoTClient | 16:deba40344375 | 151 | /** |
AzureIoTClient | 16:deba40344375 | 152 | * @brief Disposes of resources allocated by the IoT Hub client. This is a |
AzureIoTClient | 16:deba40344375 | 153 | * blocking call. |
AzureIoTClient | 16:deba40344375 | 154 | * |
AzureIoTClient | 16:deba40344375 | 155 | * @param iotHubClientHandle The handle created by a call to the create function. |
AzureIoTClient | 16:deba40344375 | 156 | */ |
AzureIoTClient | 16:deba40344375 | 157 | extern void IoTHubClient_LL_Destroy(IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle); |
AzureIoTClient | 16:deba40344375 | 158 | |
AzureIoTClient | 16:deba40344375 | 159 | /** |
AzureIoTClient | 16:deba40344375 | 160 | * @brief Asynchronous call to send the message specified by @p eventMessageHandle. |
AzureIoTClient | 16:deba40344375 | 161 | * |
AzureIoTClient | 16:deba40344375 | 162 | * @param iotHubClientHandle The handle created by a call to the create function. |
AzureIoTClient | 16:deba40344375 | 163 | * @param eventMessageHandle The handle to an IoT Hub message. |
AzureIoTClient | 16:deba40344375 | 164 | * @param eventConfirmationCallback The callback specified by the device for receiving |
AzureIoTClient | 16:deba40344375 | 165 | * confirmation of the delivery of the IoT Hub message. |
AzureIoTClient | 16:deba40344375 | 166 | * This callback can be expected to invoke the |
AzureIoTClient | 16:deba40344375 | 167 | * ::IoTHubClient_LL_SendEventAsync function for the |
AzureIoTClient | 16:deba40344375 | 168 | * same message in an attempt to retry sending a failing |
AzureIoTClient | 16:deba40344375 | 169 | * message. The user can specify a @c NULL value here to |
AzureIoTClient | 16:deba40344375 | 170 | * indicate that no callback is required. |
AzureIoTClient | 16:deba40344375 | 171 | * @param userContextCallback User specified context that will be provided to the |
AzureIoTClient | 16:deba40344375 | 172 | * callback. This can be @c NULL. |
AzureIoTClient | 16:deba40344375 | 173 | * |
AzureIoTClient | 16:deba40344375 | 174 | * @b NOTE: The application behavior is undefined if the user calls |
AzureIoTClient | 16:deba40344375 | 175 | * the ::IoTHubClient_LL_Destroy function from within any callback. |
AzureIoTClient | 16:deba40344375 | 176 | * |
AzureIoTClient | 16:deba40344375 | 177 | * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. |
AzureIoTClient | 16:deba40344375 | 178 | */ |
AzureIoTClient | 16:deba40344375 | 179 | extern IOTHUB_CLIENT_RESULT IoTHubClient_LL_SendEventAsync(IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle, IOTHUB_MESSAGE_HANDLE eventMessageHandle, IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK eventConfirmationCallback, void* userContextCallback); |
AzureIoTClient | 16:deba40344375 | 180 | |
AzureIoTClient | 16:deba40344375 | 181 | /** |
AzureIoTClient | 16:deba40344375 | 182 | * @brief This function returns the current sending status for IoTHubClient. |
AzureIoTClient | 16:deba40344375 | 183 | * |
AzureIoTClient | 16:deba40344375 | 184 | * @param iotHubClientHandle The handle created by a call to the create function. |
AzureIoTClient | 16:deba40344375 | 185 | * @param iotHubClientStatus The sending state is populated at the address pointed |
AzureIoTClient | 16:deba40344375 | 186 | * at by this parameter. The value will be set to |
AzureIoTClient | 16:deba40344375 | 187 | * @c IOTHUBCLIENT_SENDSTATUS_IDLE if there is currently |
AzureIoTClient | 16:deba40344375 | 188 | * no item to be sent and @c IOTHUBCLIENT_SENDSTATUS_BUSY |
AzureIoTClient | 16:deba40344375 | 189 | * if there are. |
AzureIoTClient | 16:deba40344375 | 190 | * |
AzureIoTClient | 16:deba40344375 | 191 | * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. |
AzureIoTClient | 16:deba40344375 | 192 | */ |
AzureIoTClient | 16:deba40344375 | 193 | extern IOTHUB_CLIENT_RESULT IoTHubClient_LL_GetSendStatus(IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle, IOTHUB_CLIENT_STATUS *iotHubClientStatus); |
AzureIoTClient | 16:deba40344375 | 194 | |
AzureIoTClient | 16:deba40344375 | 195 | /** |
AzureIoTClient | 16:deba40344375 | 196 | * @brief Sets up the message callback to be invoked when IoT Hub issues a |
AzureIoTClient | 16:deba40344375 | 197 | * message to the device. This is a blocking call. |
AzureIoTClient | 16:deba40344375 | 198 | * |
AzureIoTClient | 16:deba40344375 | 199 | * @param iotHubClientHandle The handle created by a call to the create function. |
AzureIoTClient | 16:deba40344375 | 200 | * @param messageCallback The callback specified by the device for receiving |
AzureIoTClient | 16:deba40344375 | 201 | * messages from IoT Hub. |
AzureIoTClient | 16:deba40344375 | 202 | * @param userContextCallback User specified context that will be provided to the |
AzureIoTClient | 16:deba40344375 | 203 | * callback. This can be @c NULL. |
AzureIoTClient | 16:deba40344375 | 204 | * |
AzureIoTClient | 16:deba40344375 | 205 | * @b NOTE: The application behavior is undefined if the user calls |
AzureIoTClient | 16:deba40344375 | 206 | * the ::IoTHubClient_LL_Destroy function from within any callback. |
AzureIoTClient | 16:deba40344375 | 207 | * |
AzureIoTClient | 16:deba40344375 | 208 | * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. |
AzureIoTClient | 16:deba40344375 | 209 | */ |
AzureIoTClient | 16:deba40344375 | 210 | extern IOTHUB_CLIENT_RESULT IoTHubClient_LL_SetMessageCallback(IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle, IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC messageCallback, void* userContextCallback); |
AzureIoTClient | 16:deba40344375 | 211 | |
AzureIoTClient | 16:deba40344375 | 212 | /** |
AzureIoTClient | 16:deba40344375 | 213 | * @brief This function returns in the out parameter @p lastMessageReceiveTime |
AzureIoTClient | 16:deba40344375 | 214 | * what was the value of the @c time function when the last message was |
AzureIoTClient | 16:deba40344375 | 215 | * received at the client. |
AzureIoTClient | 16:deba40344375 | 216 | * |
AzureIoTClient | 16:deba40344375 | 217 | * @param iotHubClientHandle The handle created by a call to the create function. |
AzureIoTClient | 16:deba40344375 | 218 | * @param lastMessageReceiveTime Out parameter containing the value of @c time function |
AzureIoTClient | 16:deba40344375 | 219 | * when the last message was received. |
AzureIoTClient | 16:deba40344375 | 220 | * |
AzureIoTClient | 16:deba40344375 | 221 | * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. |
AzureIoTClient | 16:deba40344375 | 222 | */ |
AzureIoTClient | 16:deba40344375 | 223 | extern IOTHUB_CLIENT_RESULT IoTHubClient_LL_GetLastMessageReceiveTime(IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle, time_t* lastMessageReceiveTime); |
AzureIoTClient | 16:deba40344375 | 224 | |
AzureIoTClient | 16:deba40344375 | 225 | /** |
AzureIoTClient | 16:deba40344375 | 226 | * @brief This function is meant to be called by the user when work |
AzureIoTClient | 16:deba40344375 | 227 | * (sending/receiving) can be done by the IoTHubClient. |
AzureIoTClient | 16:deba40344375 | 228 | * |
AzureIoTClient | 16:deba40344375 | 229 | * @param iotHubClientHandle The handle created by a call to the create function. |
AzureIoTClient | 16:deba40344375 | 230 | * |
AzureIoTClient | 16:deba40344375 | 231 | * All IoTHubClient interactions (in regards to network traffic |
AzureIoTClient | 16:deba40344375 | 232 | * and/or user level callbacks) are the effect of calling this |
AzureIoTClient | 16:deba40344375 | 233 | * function and they take place synchronously inside _DoWork. |
AzureIoTClient | 16:deba40344375 | 234 | */ |
AzureIoTClient | 16:deba40344375 | 235 | extern void IoTHubClient_LL_DoWork(IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle); |
AzureIoTClient | 16:deba40344375 | 236 | |
AzureIoTClient | 16:deba40344375 | 237 | /** |
AzureIoTClient | 16:deba40344375 | 238 | * @brief This API sets a runtime option identified by parameter @p optionName |
AzureIoTClient | 16:deba40344375 | 239 | * to a value pointed to by @p value. @p optionName and the data type |
AzureIoTClient | 16:deba40344375 | 240 | * @p value is pointing to are specific for every option. |
AzureIoTClient | 16:deba40344375 | 241 | * |
AzureIoTClient | 16:deba40344375 | 242 | * @param iotHubClientHandle The handle created by a call to the create function. |
AzureIoTClient | 16:deba40344375 | 243 | * @param optionName Name of the option. |
AzureIoTClient | 16:deba40344375 | 244 | * @param value The value. |
AzureIoTClient | 16:deba40344375 | 245 | * |
AzureIoTClient | 16:deba40344375 | 246 | * The options that can be set via this API are: |
AzureIoTClient | 16:deba40344375 | 247 | * - @b timeout - the maximum time in milliseconds a communication is |
AzureIoTClient | 16:deba40344375 | 248 | * allowed to use. @p value is a pointer to an @c unsigned @c int with |
AzureIoTClient | 16:deba40344375 | 249 | * the timeout value in milliseconds. This is only supported for the HTTP |
AzureIoTClient | 16:deba40344375 | 250 | * protocol as of now. When the HTTP protocol uses CURL, the meaning of |
AzureIoTClient | 16:deba40344375 | 251 | * the parameter is <em>total request time</em>. When the HTTP protocol uses |
AzureIoTClient | 16:deba40344375 | 252 | * winhttp, the meaning is the same as the @c dwSendTimeout and |
AzureIoTClient | 16:deba40344375 | 253 | * @c dwReceiveTimeout parameters of the |
AzureIoTClient | 16:deba40344375 | 254 | * <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa384116(v=vs.85).aspx"> |
AzureIoTClient | 16:deba40344375 | 255 | * WinHttpSetTimeouts</a> API. |
AzureIoTClient | 16:deba40344375 | 256 | * - @b CURLOPT_LOW_SPEED_LIMIT - only available for HTTP protocol and only |
AzureIoTClient | 16:deba40344375 | 257 | * when CURL is used. It has the same meaning as CURL's option with the same |
AzureIoTClient | 16:deba40344375 | 258 | * name. @p value is pointer to a long. |
AzureIoTClient | 16:deba40344375 | 259 | * - @b CURLOPT_LOW_SPEED_TIME - only available for HTTP protocol and only |
AzureIoTClient | 16:deba40344375 | 260 | * when CURL is used. It has the same meaning as CURL's option with the same |
AzureIoTClient | 16:deba40344375 | 261 | * name. @p value is pointer to a long. |
AzureIoTClient | 16:deba40344375 | 262 | * - @b CURLOPT_FORBID_REUSE - only available for HTTP protocol and only |
AzureIoTClient | 16:deba40344375 | 263 | * when CURL is used. It has the same meaning as CURL's option with the same |
AzureIoTClient | 16:deba40344375 | 264 | * name. @p value is pointer to a long. |
AzureIoTClient | 16:deba40344375 | 265 | * - @b CURLOPT_FRESH_CONNECT - only available for HTTP protocol and only |
AzureIoTClient | 16:deba40344375 | 266 | * when CURL is used. It has the same meaning as CURL's option with the same |
AzureIoTClient | 16:deba40344375 | 267 | * name. @p value is pointer to a long. |
AzureIoTClient | 16:deba40344375 | 268 | * - @b CURLOPT_VERBOSE - only available for HTTP protocol and only |
AzureIoTClient | 16:deba40344375 | 269 | * when CURL is used. It has the same meaning as CURL's option with the same |
AzureIoTClient | 16:deba40344375 | 270 | * name. @p value is pointer to a long. |
AzureIoTClient | 16:deba40344375 | 271 | * |
AzureIoTClient | 16:deba40344375 | 272 | * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. |
AzureIoTClient | 16:deba40344375 | 273 | */ |
AzureIoTClient | 16:deba40344375 | 274 | extern IOTHUB_CLIENT_RESULT IoTHubClient_LL_SetOption(IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle, const char* optionName, const void* value); |
AzureIoTClient | 16:deba40344375 | 275 | |
AzureIoTClient | 16:deba40344375 | 276 | #ifdef __cplusplus |
AzureIoTClient | 16:deba40344375 | 277 | } |
AzureIoTClient | 16:deba40344375 | 278 | #endif |
AzureIoTClient | 16:deba40344375 | 279 | |
AzureIoTClient | 16:deba40344375 | 280 | #endif /* IOTHUB_CLIENT_LL_H */ |