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:
Thu Oct 20 17:07:32 2016 -0700
Revision:
52:1cc3c6d07cad
Parent:
44:33dd78697616
Child:
53:1e5a1ca1f274
1.0.10

Who changed what in which revision?

UserRevisionLine numberNew 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.h
AzureIoTClient 16:deba40344375 5 * @brief Extends the IoTHubCLient_LL module with additional features.
AzureIoTClient 16:deba40344375 6 *
AzureIoTClient 16:deba40344375 7 * @details IoTHubClient is a module that extends the IoTHubCLient_LL
AzureIoTClient 16:deba40344375 8 * module with 2 features:
AzureIoTClient 40:1a94db9139ea 9 * - scheduling the work for the IoTHubCLient from a
AzureIoTClient 16:deba40344375 10 * thread, so that the user does not need to create their
AzureIoTClient 16:deba40344375 11 * own thread
AzureIoTClient 16:deba40344375 12 * - thread-safe APIs
AzureIoTClient 16:deba40344375 13 */
AzureIoTClient 16:deba40344375 14
AzureIoTClient 16:deba40344375 15 #ifndef IOTHUB_CLIENT_H
AzureIoTClient 22:b8732db970af 16 #define IOTHUB_CLIENT_H
AzureIoTClient 16:deba40344375 17
Azure.IoT Build 37:18310e4d888d 18 typedef struct IOTHUB_CLIENT_INSTANCE_TAG* IOTHUB_CLIENT_HANDLE;
Azure.IoT Build 37:18310e4d888d 19
AzureIoTClient 16:deba40344375 20 #include "iothub_client_ll.h"
Azure.IoT Build 37:18310e4d888d 21 #include "iothubtransport.h"
AzureIoTClient 16:deba40344375 22
AzureIoTClient 16:deba40344375 23 #ifdef __cplusplus
AzureIoTClient 16:deba40344375 24 extern "C"
AzureIoTClient 16:deba40344375 25 {
AzureIoTClient 16:deba40344375 26 #endif
AzureIoTClient 16:deba40344375 27
AzureIoTClient 42:448eecc3676e 28 #define IOTHUB_CLIENT_FILE_UPLOAD_RESULT_VALUES \
AzureIoTClient 42:448eecc3676e 29 FILE_UPLOAD_OK ,\
AzureIoTClient 42:448eecc3676e 30 FILE_UPLOAD_ERROR
AzureIoTClient 42:448eecc3676e 31
AzureIoTClient 42:448eecc3676e 32 DEFINE_ENUM(IOTHUB_CLIENT_FILE_UPLOAD_RESULT, IOTHUB_CLIENT_FILE_UPLOAD_RESULT_VALUES)
AzureIoTClient 42:448eecc3676e 33 typedef void(*IOTHUB_CLIENT_FILE_UPLOAD_CALLBACK)(IOTHUB_CLIENT_FILE_UPLOAD_RESULT result, void* userContextCallback);
AzureIoTClient 16:deba40344375 34
AzureIoTClient 40:1a94db9139ea 35 /**
AzureIoTClient 40:1a94db9139ea 36 * @brief Creates a IoT Hub client for communication with an existing
AzureIoTClient 40:1a94db9139ea 37 * IoT Hub using the specified connection string parameter.
AzureIoTClient 40:1a94db9139ea 38 *
AzureIoTClient 40:1a94db9139ea 39 * @param connectionString Pointer to a character string
AzureIoTClient 40:1a94db9139ea 40 * @param protocol Function pointer for protocol implementation
AzureIoTClient 40:1a94db9139ea 41 *
AzureIoTClient 40:1a94db9139ea 42 * Sample connection string:
AzureIoTClient 40:1a94db9139ea 43 * <blockquote>
AzureIoTClient 40:1a94db9139ea 44 * <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 40:1a94db9139ea 45 * <pre>HostName=[IoT Hub name goes here].[IoT Hub suffix goes here, e.g., private.azure-devices-int.net];DeviceId=[Device ID goes here];SharedAccessSignature=SharedAccessSignature sr=[IoT Hub name goes here].[IoT Hub suffix goes here, e.g., private.azure-devices-int.net]/devices/[Device ID goes here]&sig=[SAS Token goes here]&se=[Expiry Time goes here];</pre>
AzureIoTClient 40:1a94db9139ea 46 * </blockquote>
AzureIoTClient 40:1a94db9139ea 47 *
AzureIoTClient 40:1a94db9139ea 48 * @return A non-NULL @c IOTHUB_CLIENT_HANDLE value that is used when
AzureIoTClient 40:1a94db9139ea 49 * invoking other functions for IoT Hub client and @c NULL on failure.
AzureIoTClient 40:1a94db9139ea 50 */
AzureIoTClient 40:1a94db9139ea 51 extern IOTHUB_CLIENT_HANDLE IoTHubClient_CreateFromConnectionString(const char* connectionString, IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol);
AzureIoTClient 16:deba40344375 52
AzureIoTClient 40:1a94db9139ea 53 /**
AzureIoTClient 40:1a94db9139ea 54 * @brief Creates a IoT Hub client for communication with an existing IoT
AzureIoTClient 40:1a94db9139ea 55 * Hub using the specified parameters.
AzureIoTClient 40:1a94db9139ea 56 *
AzureIoTClient 40:1a94db9139ea 57 * @param config Pointer to an @c IOTHUB_CLIENT_CONFIG structure
AzureIoTClient 40:1a94db9139ea 58 *
AzureIoTClient 40:1a94db9139ea 59 * The API does not allow sharing of a connection across multiple
AzureIoTClient 40:1a94db9139ea 60 * devices. This is a blocking call.
AzureIoTClient 40:1a94db9139ea 61 *
AzureIoTClient 40:1a94db9139ea 62 * @return A non-NULL @c IOTHUB_CLIENT_HANDLE value that is used when
AzureIoTClient 40:1a94db9139ea 63 * invoking other functions for IoT Hub client and @c NULL on failure.
AzureIoTClient 40:1a94db9139ea 64 */
AzureIoTClient 40:1a94db9139ea 65 extern IOTHUB_CLIENT_HANDLE IoTHubClient_Create(const IOTHUB_CLIENT_CONFIG* config);
AzureIoTClient 16:deba40344375 66
AzureIoTClient 40:1a94db9139ea 67 /**
Azure.IoT Build 37:18310e4d888d 68 * @brief Creates a IoT Hub client for communication with an existing IoT
Azure.IoT Build 37:18310e4d888d 69 * Hub using the specified parameters.
Azure.IoT Build 37:18310e4d888d 70 *
Azure.IoT Build 37:18310e4d888d 71 * @param transportHandle TRANSPORT_HANDLE which represents a connection.
Azure.IoT Build 37:18310e4d888d 72 * @param config Pointer to an @c IOTHUB_CLIENT_CONFIG structure
Azure.IoT Build 37:18310e4d888d 73 *
Azure.IoT Build 37:18310e4d888d 74 * The API allows sharing of a connection across multiple
Azure.IoT Build 37:18310e4d888d 75 * devices. This is a blocking call.
Azure.IoT Build 37:18310e4d888d 76 *
Azure.IoT Build 37:18310e4d888d 77 * @return A non-NULL @c IOTHUB_CLIENT_HANDLE value that is used when
Azure.IoT Build 37:18310e4d888d 78 * invoking other functions for IoT Hub client and @c NULL on failure.
Azure.IoT Build 37:18310e4d888d 79 */
Azure.IoT Build 37:18310e4d888d 80 extern IOTHUB_CLIENT_HANDLE IoTHubClient_CreateWithTransport(TRANSPORT_HANDLE transportHandle, const IOTHUB_CLIENT_CONFIG* config);
Azure.IoT Build 37:18310e4d888d 81
AzureIoTClient 40:1a94db9139ea 82 /**
AzureIoTClient 40:1a94db9139ea 83 * @brief Disposes of resources allocated by the IoT Hub client. This is a
AzureIoTClient 40:1a94db9139ea 84 * blocking call.
AzureIoTClient 40:1a94db9139ea 85 *
AzureIoTClient 40:1a94db9139ea 86 * @param iotHubClientHandle The handle created by a call to the create function.
AzureIoTClient 40:1a94db9139ea 87 */
AzureIoTClient 40:1a94db9139ea 88 extern void IoTHubClient_Destroy(IOTHUB_CLIENT_HANDLE iotHubClientHandle);
AzureIoTClient 16:deba40344375 89
AzureIoTClient 40:1a94db9139ea 90 /**
AzureIoTClient 40:1a94db9139ea 91 * @brief Asynchronous call to send the message specified by @p eventMessageHandle.
AzureIoTClient 40:1a94db9139ea 92 *
AzureIoTClient 40:1a94db9139ea 93 * @param iotHubClientHandle The handle created by a call to the create function.
AzureIoTClient 40:1a94db9139ea 94 * @param eventMessageHandle The handle to an IoT Hub message.
AzureIoTClient 40:1a94db9139ea 95 * @param eventConfirmationCallback The callback specified by the device for receiving
AzureIoTClient 40:1a94db9139ea 96 * confirmation of the delivery of the IoT Hub message.
AzureIoTClient 40:1a94db9139ea 97 * This callback can be expected to invoke the
AzureIoTClient 40:1a94db9139ea 98 * ::IoTHubClient_SendEventAsync function for the
AzureIoTClient 40:1a94db9139ea 99 * same message in an attempt to retry sending a failing
AzureIoTClient 40:1a94db9139ea 100 * message. The user can specify a @c NULL value here to
AzureIoTClient 40:1a94db9139ea 101 * indicate that no callback is required.
AzureIoTClient 40:1a94db9139ea 102 * @param userContextCallback User specified context that will be provided to the
AzureIoTClient 40:1a94db9139ea 103 * callback. This can be @c NULL.
AzureIoTClient 40:1a94db9139ea 104 *
AzureIoTClient 40:1a94db9139ea 105 * @b NOTE: The application behavior is undefined if the user calls
AzureIoTClient 40:1a94db9139ea 106 * the ::IoTHubClient_Destroy function from within any callback.
AzureIoTClient 40:1a94db9139ea 107 *
AzureIoTClient 40:1a94db9139ea 108 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure.
AzureIoTClient 40:1a94db9139ea 109 */
AzureIoTClient 40:1a94db9139ea 110 extern IOTHUB_CLIENT_RESULT IoTHubClient_SendEventAsync(IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_MESSAGE_HANDLE eventMessageHandle, IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK eventConfirmationCallback, void* userContextCallback);
AzureIoTClient 16:deba40344375 111
AzureIoTClient 40:1a94db9139ea 112 /**
AzureIoTClient 40:1a94db9139ea 113 * @brief This function returns the current sending status for IoTHubClient.
AzureIoTClient 40:1a94db9139ea 114 *
AzureIoTClient 40:1a94db9139ea 115 * @param iotHubClientHandle The handle created by a call to the create function.
AzureIoTClient 40:1a94db9139ea 116 * @param iotHubClientStatus The sending state is populated at the address pointed
AzureIoTClient 40:1a94db9139ea 117 * at by this parameter. The value will be set to
AzureIoTClient 40:1a94db9139ea 118 * @c IOTHUBCLIENT_SENDSTATUS_IDLE if there is currently
AzureIoTClient 40:1a94db9139ea 119 * no item to be sent and @c IOTHUBCLIENT_SENDSTATUS_BUSY
AzureIoTClient 40:1a94db9139ea 120 * if there are.
AzureIoTClient 40:1a94db9139ea 121 *
AzureIoTClient 40:1a94db9139ea 122 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure.
AzureIoTClient 40:1a94db9139ea 123 */
AzureIoTClient 40:1a94db9139ea 124 extern IOTHUB_CLIENT_RESULT IoTHubClient_GetSendStatus(IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_STATUS *iotHubClientStatus);
AzureIoTClient 16:deba40344375 125
AzureIoTClient 40:1a94db9139ea 126 /**
AzureIoTClient 40:1a94db9139ea 127 * @brief Sets up the message callback to be invoked when IoT Hub issues a
AzureIoTClient 40:1a94db9139ea 128 * message to the device. This is a blocking call.
AzureIoTClient 40:1a94db9139ea 129 *
AzureIoTClient 40:1a94db9139ea 130 * @param iotHubClientHandle The handle created by a call to the create function.
AzureIoTClient 40:1a94db9139ea 131 * @param messageCallback The callback specified by the device for receiving
AzureIoTClient 40:1a94db9139ea 132 * messages from IoT Hub.
AzureIoTClient 40:1a94db9139ea 133 * @param userContextCallback User specified context that will be provided to the
AzureIoTClient 40:1a94db9139ea 134 * callback. This can be @c NULL.
AzureIoTClient 40:1a94db9139ea 135 *
AzureIoTClient 40:1a94db9139ea 136 * @b NOTE: The application behavior is undefined if the user calls
AzureIoTClient 40:1a94db9139ea 137 * the ::IoTHubClient_Destroy function from within any callback.
AzureIoTClient 40:1a94db9139ea 138 *
AzureIoTClient 40:1a94db9139ea 139 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure.
AzureIoTClient 40:1a94db9139ea 140 */
AzureIoTClient 40:1a94db9139ea 141 extern IOTHUB_CLIENT_RESULT IoTHubClient_SetMessageCallback(IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC messageCallback, void* userContextCallback);
AzureIoTClient 16:deba40344375 142
AzureIoTClient 52:1cc3c6d07cad 143 /**
AzureIoTClient 52:1cc3c6d07cad 144 * @brief Sets up the connection status callback to be invoked representing the status of
AzureIoTClient 52:1cc3c6d07cad 145 * the connection to IOT Hub. This is a blocking call.
AzureIoTClient 52:1cc3c6d07cad 146 *
AzureIoTClient 52:1cc3c6d07cad 147 * @param iotHubClientHandle The handle created by a call to the create function.
AzureIoTClient 52:1cc3c6d07cad 148 * @param connectionStatusCallback The callback specified by the device for receiving
AzureIoTClient 52:1cc3c6d07cad 149 * updates about the status of the connection to IoT Hub.
AzureIoTClient 52:1cc3c6d07cad 150 * @param userContextCallback User specified context that will be provided to the
AzureIoTClient 52:1cc3c6d07cad 151 * callback. This can be @c NULL.
AzureIoTClient 52:1cc3c6d07cad 152 *
AzureIoTClient 52:1cc3c6d07cad 153 * @b NOTE: The application behavior is undefined if the user calls
AzureIoTClient 52:1cc3c6d07cad 154 * the ::IoTHubClient_LL_Destroy function from within any callback.
AzureIoTClient 52:1cc3c6d07cad 155 *
AzureIoTClient 52:1cc3c6d07cad 156 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure.
AzureIoTClient 52:1cc3c6d07cad 157 */
AzureIoTClient 52:1cc3c6d07cad 158 extern IOTHUB_CLIENT_RESULT IoTHubClient_SetConnectionStatusCallback(IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle, IOTHUB_CLIENT_CONNECTION_STATUS_CALLBACK connectionStatusCallback, void* userContextCallback);
AzureIoTClient 52:1cc3c6d07cad 159
AzureIoTClient 52:1cc3c6d07cad 160 /**
AzureIoTClient 52:1cc3c6d07cad 161 * @brief Sets up the connection status callback to be invoked representing the status of
AzureIoTClient 52:1cc3c6d07cad 162 * the connection to IOT Hub. This is a blocking call.
AzureIoTClient 52:1cc3c6d07cad 163 *
AzureIoTClient 52:1cc3c6d07cad 164 * @param iotHubClientHandle The handle created by a call to the create function.
AzureIoTClient 52:1cc3c6d07cad 165 * @param retryPolicy The policy to use to reconnect to IoT Hub when a
AzureIoTClient 52:1cc3c6d07cad 166 * connection drops.
AzureIoTClient 52:1cc3c6d07cad 167 * @param retryTimeoutLimitinSeconds Maximum amount of time(seconds) to attempt reconnection when a
AzureIoTClient 52:1cc3c6d07cad 168 * connection drops to IOT Hub.
AzureIoTClient 52:1cc3c6d07cad 169 *
AzureIoTClient 52:1cc3c6d07cad 170 * @b NOTE: The application behavior is undefined if the user calls
AzureIoTClient 52:1cc3c6d07cad 171 * the ::IoTHubClient_LL_Destroy function from within any callback.
AzureIoTClient 52:1cc3c6d07cad 172 *
AzureIoTClient 52:1cc3c6d07cad 173 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure.
AzureIoTClient 52:1cc3c6d07cad 174 */
AzureIoTClient 52:1cc3c6d07cad 175 extern IOTHUB_CLIENT_RESULT IoTHubClient_SetRetryPolicy(IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY retryPolicy, size_t retryTimeoutLimitinSeconds);
AzureIoTClient 52:1cc3c6d07cad 176
AzureIoTClient 52:1cc3c6d07cad 177 /**
AzureIoTClient 52:1cc3c6d07cad 178 * @brief Sets up the connection status callback to be invoked representing the status of
AzureIoTClient 52:1cc3c6d07cad 179 * the connection to IOT Hub. This is a blocking call.
AzureIoTClient 52:1cc3c6d07cad 180 *
AzureIoTClient 52:1cc3c6d07cad 181 * @param iotHubClientHandle The handle created by a call to the create function.
AzureIoTClient 52:1cc3c6d07cad 182 * @param retryPolicy Out parameter containing the policy to use to reconnect to IoT Hub.
AzureIoTClient 52:1cc3c6d07cad 183 * @param retryTimeoutLimitinSeconds Out parameter containing maximum amount of time in seconds to attempt reconnection
AzureIoTClient 52:1cc3c6d07cad 184 to IOT Hub.
AzureIoTClient 52:1cc3c6d07cad 185 *
AzureIoTClient 52:1cc3c6d07cad 186 * @b NOTE: The application behavior is undefined if the user calls
AzureIoTClient 52:1cc3c6d07cad 187 * the ::IoTHubClient_LL_Destroy function from within any callback.
AzureIoTClient 52:1cc3c6d07cad 188 *
AzureIoTClient 52:1cc3c6d07cad 189 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure.
AzureIoTClient 52:1cc3c6d07cad 190 */
AzureIoTClient 52:1cc3c6d07cad 191 extern IOTHUB_CLIENT_RESULT IoTHubClient_GetRetryPolicy(IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY* retryPolicy, size_t* retryTimeoutLimitinSeconds);
AzureIoTClient 52:1cc3c6d07cad 192
AzureIoTClient 40:1a94db9139ea 193 /**
AzureIoTClient 40:1a94db9139ea 194 * @brief This function returns in the out parameter @p lastMessageReceiveTime
AzureIoTClient 40:1a94db9139ea 195 * what was the value of the @c time function when the last message was
AzureIoTClient 40:1a94db9139ea 196 * received at the client.
AzureIoTClient 40:1a94db9139ea 197 *
AzureIoTClient 40:1a94db9139ea 198 * @param iotHubClientHandle The handle created by a call to the create function.
AzureIoTClient 40:1a94db9139ea 199 * @param lastMessageReceiveTime Out parameter containing the value of @c time function
AzureIoTClient 40:1a94db9139ea 200 * when the last message was received.
AzureIoTClient 40:1a94db9139ea 201 *
AzureIoTClient 40:1a94db9139ea 202 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure.
AzureIoTClient 40:1a94db9139ea 203 */
AzureIoTClient 40:1a94db9139ea 204 extern IOTHUB_CLIENT_RESULT IoTHubClient_GetLastMessageReceiveTime(IOTHUB_CLIENT_HANDLE iotHubClientHandle, time_t* lastMessageReceiveTime);
AzureIoTClient 16:deba40344375 205
AzureIoTClient 40:1a94db9139ea 206 /**
AzureIoTClient 40:1a94db9139ea 207 * @brief This API sets a runtime option identified by parameter @p optionName
AzureIoTClient 40:1a94db9139ea 208 * to a value pointed to by @p value. @p optionName and the data type
AzureIoTClient 40:1a94db9139ea 209 * @p value is pointing to are specific for every option.
AzureIoTClient 40:1a94db9139ea 210 *
AzureIoTClient 40:1a94db9139ea 211 * @param iotHubClientHandle The handle created by a call to the create function.
AzureIoTClient 40:1a94db9139ea 212 * @param optionName Name of the option.
AzureIoTClient 40:1a94db9139ea 213 * @param value The value.
AzureIoTClient 40:1a94db9139ea 214 *
AzureIoTClient 40:1a94db9139ea 215 * The options that can be set via this API are:
AzureIoTClient 40:1a94db9139ea 216 * - @b timeout - the maximum time in milliseconds a communication is
AzureIoTClient 40:1a94db9139ea 217 * allowed to use. @p value is a pointer to an @c unsigned @c int with
AzureIoTClient 40:1a94db9139ea 218 * the timeout value in milliseconds. This is only supported for the HTTP
AzureIoTClient 40:1a94db9139ea 219 * protocol as of now. When the HTTP protocol uses CURL, the meaning of
AzureIoTClient 40:1a94db9139ea 220 * the parameter is <em>total request time</em>. When the HTTP protocol uses
AzureIoTClient 40:1a94db9139ea 221 * winhttp, the meaning is the same as the @c dwSendTimeout and
AzureIoTClient 40:1a94db9139ea 222 * @c dwReceiveTimeout parameters of the
AzureIoTClient 40:1a94db9139ea 223 * <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa384116(v=vs.85).aspx">
AzureIoTClient 40:1a94db9139ea 224 * WinHttpSetTimeouts</a> API.
AzureIoTClient 40:1a94db9139ea 225 * - @b CURLOPT_LOW_SPEED_LIMIT - only available for HTTP protocol and only
AzureIoTClient 40:1a94db9139ea 226 * when CURL is used. It has the same meaning as CURL's option with the same
AzureIoTClient 40:1a94db9139ea 227 * name. @p value is pointer to a long.
AzureIoTClient 40:1a94db9139ea 228 * - @b CURLOPT_LOW_SPEED_TIME - only available for HTTP protocol and only
AzureIoTClient 40:1a94db9139ea 229 * when CURL is used. It has the same meaning as CURL's option with the same
AzureIoTClient 40:1a94db9139ea 230 * name. @p value is pointer to a long.
AzureIoTClient 40:1a94db9139ea 231 * - @b CURLOPT_FORBID_REUSE - only available for HTTP protocol and only
AzureIoTClient 40:1a94db9139ea 232 * when CURL is used. It has the same meaning as CURL's option with the same
AzureIoTClient 40:1a94db9139ea 233 * name. @p value is pointer to a long.
AzureIoTClient 40:1a94db9139ea 234 * - @b CURLOPT_FRESH_CONNECT - only available for HTTP protocol and only
AzureIoTClient 40:1a94db9139ea 235 * when CURL is used. It has the same meaning as CURL's option with the same
AzureIoTClient 40:1a94db9139ea 236 * name. @p value is pointer to a long.
AzureIoTClient 40:1a94db9139ea 237 * - @b CURLOPT_VERBOSE - only available for HTTP protocol and only
AzureIoTClient 40:1a94db9139ea 238 * when CURL is used. It has the same meaning as CURL's option with the same
AzureIoTClient 40:1a94db9139ea 239 * name. @p value is pointer to a long.
AzureIoTClient 40:1a94db9139ea 240 * - @b messageTimeout - the maximum time in milliseconds until a message
AzureIoTClient 40:1a94db9139ea 241 * is timeouted. The time starts at IoTHubClient_SendEventAsync. By default,
AzureIoTClient 42:448eecc3676e 242 * messages do not expire. @p is a pointer to a uint64_t
AzureIoTClient 40:1a94db9139ea 243 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure.
AzureIoTClient 40:1a94db9139ea 244 */
AzureIoTClient 40:1a94db9139ea 245 extern IOTHUB_CLIENT_RESULT IoTHubClient_SetOption(IOTHUB_CLIENT_HANDLE iotHubClientHandle, const char* optionName, const void* value);
AzureIoTClient 43:038d8511e817 246
AzureIoTClient 44:33dd78697616 247 #ifndef DONT_USE_UPLOADTOBLOB
AzureIoTClient 42:448eecc3676e 248 /**
AzureIoTClient 42:448eecc3676e 249 * @brief IoTHubClient_UploadToBlobAsync uploads data from memory to a file in Azure Blob Storage.
AzureIoTClient 42:448eecc3676e 250 *
AzureIoTClient 42:448eecc3676e 251 * @param iotHubClientHandle The handle created by a call to the IoTHubClient_Create function.
AzureIoTClient 42:448eecc3676e 252 * @param destinationFileName The name of the file to be created in Azure Blob Storage.
AzureIoTClient 42:448eecc3676e 253 * @param source The source of data.
AzureIoTClient 42:448eecc3676e 254 * @param size The size of data.
AzureIoTClient 42:448eecc3676e 255 * @param iotHubClientFileUploadCallback A callback to be invoked when the file upload operation has finished.
AzureIoTClient 42:448eecc3676e 256 * @param context A user-provided context to be passed to the file upload callback.
AzureIoTClient 42:448eecc3676e 257 *
AzureIoTClient 42:448eecc3676e 258 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure.
AzureIoTClient 42:448eecc3676e 259 */
AzureIoTClient 42:448eecc3676e 260 extern IOTHUB_CLIENT_RESULT IoTHubClient_UploadToBlobAsync(IOTHUB_CLIENT_HANDLE iotHubClientHandle, const char* destinationFileName, const unsigned char* source, size_t size, IOTHUB_CLIENT_FILE_UPLOAD_CALLBACK iotHubClientFileUploadCallback, void* context);
AzureIoTClient 43:038d8511e817 261 #endif
AzureIoTClient 16:deba40344375 262 #ifdef __cplusplus
AzureIoTClient 16:deba40344375 263 }
AzureIoTClient 16:deba40344375 264 #endif
AzureIoTClient 16:deba40344375 265
AzureIoTClient 16:deba40344375 266 #endif /* IOTHUB_CLIENT_H */