- Timestamp:
- Jun 22, 2021, 9:00:19 PM (3 years ago)
- Location:
- azure_iot_hub_f767zi/trunk/azure_iot_sdk/iothub_client/inc
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
azure_iot_hub_f767zi/trunk/azure_iot_sdk/iothub_client/inc/internal/iothub_client_authorization.h
r457 r464 42 42 MOCKABLE_FUNCTION(, IOTHUB_CREDENTIAL_TYPE, IoTHubClient_Auth_Set_x509_Type, IOTHUB_AUTHORIZATION_HANDLE, handle, bool, enable_x509); 43 43 MOCKABLE_FUNCTION(, IOTHUB_CREDENTIAL_TYPE, IoTHubClient_Auth_Get_Credential_Type, IOTHUB_AUTHORIZATION_HANDLE, handle); 44 MOCKABLE_FUNCTION(, char*, IoTHubClient_Auth_Get_SasToken, IOTHUB_AUTHORIZATION_HANDLE, handle, const char*, scope, size_t, expiry_time_relative_seconds, const char*, key_name);44 MOCKABLE_FUNCTION(, char*, IoTHubClient_Auth_Get_SasToken, IOTHUB_AUTHORIZATION_HANDLE, handle, const char*, scope, uint64_t, expiry_time_relative_seconds, const char*, key_name); 45 45 MOCKABLE_FUNCTION(, int, IoTHubClient_Auth_Set_xio_Certificate, IOTHUB_AUTHORIZATION_HANDLE, handle, XIO_HANDLE, xio); 46 46 MOCKABLE_FUNCTION(, const char*, IoTHubClient_Auth_Get_DeviceId, IOTHUB_AUTHORIZATION_HANDLE, handle); … … 49 49 MOCKABLE_FUNCTION(, SAS_TOKEN_STATUS, IoTHubClient_Auth_Is_SasToken_Valid, IOTHUB_AUTHORIZATION_HANDLE, handle); 50 50 MOCKABLE_FUNCTION(, int, IoTHubClient_Auth_Get_x509_info, IOTHUB_AUTHORIZATION_HANDLE, handle, char**, x509_cert, char**, x509_key); 51 MOCKABLE_FUNCTION(, int, IoTHubClient_Auth_Set_SasToken_Expiry, IOTHUB_AUTHORIZATION_HANDLE, handle, size_t, expiry_time_seconds);52 MOCKABLE_FUNCTION(, size_t, IoTHubClient_Auth_Get_SasToken_Expiry, IOTHUB_AUTHORIZATION_HANDLE, handle);51 MOCKABLE_FUNCTION(, int, IoTHubClient_Auth_Set_SasToken_Expiry, IOTHUB_AUTHORIZATION_HANDLE, handle, uint64_t, expiry_time_seconds); 52 MOCKABLE_FUNCTION(, uint64_t, IoTHubClient_Auth_Get_SasToken_Expiry, IOTHUB_AUTHORIZATION_HANDLE, handle); 53 53 54 54 -
azure_iot_hub_f767zi/trunk/azure_iot_sdk/iothub_client/inc/internal/iothub_internal_consts.h
r457 r464 10 10 #endif 11 11 12 static const char* IOTHUB_API_VERSION = "2019-10-01"; 13 // TODO: https://github.com/Azure/azure-iot-sdk-c/issues/1547 tracks removing this preview 14 // variable once the underlying logic is enabled on all IoTHubs. 15 static const char* IOTHUB_API_PREVIEW_VERSION = "2020-05-31-preview"; 16 12 static const char* IOTHUB_API_VERSION = "2020-09-30"; 17 13 static const char* SECURITY_INTERFACE_INTERNAL_ID = "iothub-interface-internal-id"; 18 14 static const char* SECURITY_INTERFACE_INTERNAL_ID_VALUE = "security*azureiot*com^SecurityAgent^1*0*0"; -
azure_iot_hub_f767zi/trunk/azure_iot_sdk/iothub_client/inc/iothub_client.h
r457 r464 2 2 // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 3 4 //********************************************************************** 5 // NOTE: THIS HEADER IS DEPRECATED 6 // 7 // Functions in this header will be maintained for backward compatability. 8 // New applications should use iothub_device_client.h. 9 // 10 //********************************************************************** 11 4 12 /** @file iothub_client.h 5 * @brief Extends the IoTHubC Lient_LL modulewith additional features.13 * @brief Extends the IoTHubClient_LL with additional features. 6 14 * 7 15 * @note DEPRECATED. New users use iothub_device_client.h for IoTHubClient APIs. … … 38 46 39 47 /** 40 * @brief Creates a IoT Hub client for communication with an existing 41 * IoT Hub using the specified connection string parameter. 42 * 43 * @param connectionString Pointer to a character string 44 * @param protocol Function pointer for protocol implementation 45 * 46 * Sample connection string: 47 * <blockquote> 48 * <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> 49 * <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> 50 * </blockquote> 51 * 52 * @return A non-NULL @c IOTHUB_CLIENT_HANDLE value that is used when 53 * invoking other functions for IoT Hub client and @c NULL on failure. 48 * @deprecated IoTHubClient_CreateFromConnectionString is deprecated. Use IoTHubDeviceClient_CreateFromConnectionString instead. 54 49 */ 55 50 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_HANDLE, IoTHubClient_CreateFromConnectionString, const char*, connectionString, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol); 56 51 57 52 /** 58 * @brief Creates a IoT Hub client for communication with an existing IoT 59 * Hub using the specified parameters. 60 * 61 * @param config Pointer to an @c IOTHUB_CLIENT_CONFIG structure 62 * 63 * The API does not allow sharing of a connection across multiple 64 * devices. This is a blocking call. 65 * 66 * @return A non-NULL @c IOTHUB_CLIENT_HANDLE value that is used when 67 * invoking other functions for IoT Hub client and @c NULL on failure. 53 * @deprecated IoTHubClient_Create is deprecated. Use IoTHubDeviceClient_Create instead. 68 54 */ 69 55 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_HANDLE, IoTHubClient_Create, const IOTHUB_CLIENT_CONFIG*, config); 70 56 71 57 /** 72 * @brief Creates a IoT Hub client for communication with an existing IoT 73 * Hub using the specified parameters. 74 * 75 * @param transportHandle TRANSPORT_HANDLE which represents a connection. 76 * @param config Pointer to an @c IOTHUB_CLIENT_CONFIG structure 77 * 78 * The API allows sharing of a connection across multiple 79 * devices. This is a blocking call. 80 * 81 * @return A non-NULL @c IOTHUB_CLIENT_HANDLE value that is used when 82 * invoking other functions for IoT Hub client and @c NULL on failure. 58 * @deprecated IoTHubClient_CreateWithTransport is deprecated. Use IoTHubDeviceClient_CreateWithTransport instead. 83 59 */ 84 60 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_HANDLE, IoTHubClient_CreateWithTransport, TRANSPORT_HANDLE, transportHandle, const IOTHUB_CLIENT_CONFIG*, config); 85 61 86 62 /** 87 * @brief Creates a IoT Hub client for communication with an existing IoT 88 * Hub using the device auth module. 89 * 90 * @param iothub_uri Pointer to an ioThub hostname received in the registration process 91 * @param device_id Pointer to the device Id of the device 92 * @param protocol Function pointer for protocol implementation 93 * 94 * @return A non-NULL @c IOTHUB_CLIENT_LL_HANDLE value that is used when 95 * invoking other functions for IoT Hub client and @c NULL on failure. 63 * @deprecated IoTHubClient_CreateFromDeviceAuth is deprecated. Use IoTHubDeviceClient_CreateFromDeviceAuth instead. 96 64 */ 97 65 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_HANDLE, IoTHubClient_CreateFromDeviceAuth, const char*, iothub_uri, const char*, device_id, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol); 98 66 99 67 /** 100 * @brief Disposes of resources allocated by the IoT Hub client. This is a 101 * blocking call. 102 * 103 * @param iotHubClientHandle The handle created by a call to the create function. 68 * @deprecated IoTHubClient_Destroy is deprecated. Use IoTHubDeviceClient_Destroy instead. 104 69 */ 105 70 MOCKABLE_FUNCTION(, void, IoTHubClient_Destroy, IOTHUB_CLIENT_HANDLE, iotHubClientHandle); 106 71 107 72 /** 108 * @brief Asynchronous call to send the message specified by @p eventMessageHandle. 109 * 110 * @param iotHubClientHandle The handle created by a call to the create function. 111 * @param eventMessageHandle The handle to an IoT Hub message. 112 * @param eventConfirmationCallback The callback specified by the device for receiving 113 * confirmation of the delivery of the IoT Hub message. 114 * This callback can be expected to invoke the 115 * ::IoTHubClient_SendEventAsync function for the 116 * same message in an attempt to retry sending a failing 117 * message. The user can specify a @c NULL value here to 118 * indicate that no callback is required. 119 * @param userContextCallback User specified context that will be provided to the 120 * callback. This can be @c NULL. 121 * 122 * @b NOTE: The application behavior is undefined if the user calls 123 * the ::IoTHubClient_Destroy function from within any callback. 124 * @remarks 125 * The IOTHUB_MESSAGE_HANDLE instance provided as argument is copied by the function, 126 * so this argument can be destroyed by the calling application right after IoTHubClient_SendEventAsync returns. 127 * The copy of @c eventMessageHandle is later destroyed by the iothub client when the message is effectively sent, if a failure sending it occurs, or if the client is destroyed. 128 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 73 * @deprecated IoTHubClient_SendEventAsync is deprecated. Use IoTHubDeviceClient_SendEventAsync instead. 129 74 */ 130 75 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_SendEventAsync, IOTHUB_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_MESSAGE_HANDLE, eventMessageHandle, IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK, eventConfirmationCallback, void*, userContextCallback); 131 76 132 77 /** 133 * @brief This function returns the current sending status for IoTHubClient. 134 * 135 * @param iotHubClientHandle The handle created by a call to the create function. 136 * @param iotHubClientStatus The sending state is populated at the address pointed 137 * at by this parameter. The value will be set to 138 * @c IOTHUBCLIENT_SENDSTATUS_IDLE if there is currently 139 * no item to be sent and @c IOTHUBCLIENT_SENDSTATUS_BUSY 140 * if there are. 141 * 142 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 78 * @deprecated IoTHubClient_GetSendStatus is deprecated. Use IoTHubDeviceClient_GetSendStatus instead. 143 79 */ 144 80 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_GetSendStatus, IOTHUB_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_STATUS*, iotHubClientStatus); 145 81 146 82 /** 147 * @brief Sets up the message callback to be invoked when IoT Hub issues a 148 * message to the device. This is a blocking call. 149 * 150 * @param iotHubClientHandle The handle created by a call to the create function. 151 * @param messageCallback The callback specified by the device for receiving 152 * messages from IoT Hub. 153 * @param userContextCallback User specified context that will be provided to the 154 * callback. This can be @c NULL. 155 * 156 * @b NOTE: The application behavior is undefined if the user calls 157 * the ::IoTHubClient_Destroy function from within any callback. 158 * 159 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 83 * @deprecated IoTHubClient_SetMessageCallback is deprecated. Use IoTHubDeviceClient_SetMessageCallback instead. 160 84 */ 161 85 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_SetMessageCallback, IOTHUB_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC, messageCallback, void*, userContextCallback); 162 86 163 87 /** 164 * @brief Sets up the connection status callback to be invoked representing the status of 165 * the connection to IOT Hub. This is a blocking call. 166 * 167 * @param iotHubClientHandle The handle created by a call to the create function. 168 * @param connectionStatusCallback The callback specified by the device for receiving 169 * updates about the status of the connection to IoT Hub. 170 * @param userContextCallback User specified context that will be provided to the 171 * callback. This can be @c NULL. 172 * 173 * @b NOTE: The application behavior is undefined if the user calls 174 * the ::IoTHubClient_LL_Destroy function from within any callback. 175 * 176 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 88 * @deprecated IoTHubClient_SetConnectionStatusCallback is deprecated. Use IoTHubDeviceClient_SetConnectionStatusCallback instead. 177 89 */ 178 90 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_SetConnectionStatusCallback, IOTHUB_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_CONNECTION_STATUS_CALLBACK, connectionStatusCallback, void*, userContextCallback); 179 91 180 92 /** 181 * @brief Sets up the connection status callback to be invoked representing the status of 182 * the connection to IOT Hub. This is a blocking call. 183 * 184 * @param iotHubClientHandle The handle created by a call to the create function. 185 * @param retryPolicy The policy to use to reconnect to IoT Hub when a 186 * connection drops. 187 * @param retryTimeoutLimitInSeconds Maximum amount of time(seconds) to attempt reconnection when a 188 * connection drops to IOT Hub. 189 * 190 * @b NOTE: The application behavior is undefined if the user calls 191 * the ::IoTHubClient_LL_Destroy function from within any callback. 192 * 193 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 93 * @deprecated IoTHubClient_SetRetryPolicy is deprecated. Use IoTHubDeviceClient_SetRetryPolicy instead. 194 94 */ 195 95 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_SetRetryPolicy, IOTHUB_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY, retryPolicy, size_t, retryTimeoutLimitInSeconds); 196 96 197 97 /** 198 * @brief Sets up the connection status callback to be invoked representing the status of 199 * the connection to IOT Hub. This is a blocking call. 200 * 201 * @param iotHubClientHandle The handle created by a call to the create function. 202 * @param retryPolicy Out parameter containing the policy to use to reconnect to IoT Hub. 203 * @param retryTimeoutLimitInSeconds Out parameter containing maximum amount of time in seconds to attempt reconnection 204 to IOT Hub. 205 * 206 * @b NOTE: The application behavior is undefined if the user calls 207 * the ::IoTHubClient_LL_Destroy function from within any callback. 208 * 209 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 98 * @deprecated IoTHubClient_GetRetryPolicy is deprecated. Use IoTHubDeviceClient_GetRetryPolicy instead. 210 99 */ 211 100 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_GetRetryPolicy, IOTHUB_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY*, retryPolicy, size_t*, retryTimeoutLimitInSeconds); 212 101 213 102 /** 214 * @brief This function returns in the out parameter @p lastMessageReceiveTime 215 * what was the value of the @c time function when the last message was 216 * received at the client. 217 * 218 * @param iotHubClientHandle The handle created by a call to the create function. 219 * @param lastMessageReceiveTime Out parameter containing the value of @c time function 220 * when the last message was received. 221 * 222 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 103 * @deprecated IoTHubClient_GetLastMessageReceiveTime is deprecated. Use IoTHubDeviceClient_GetLastMessageReceiveTime instead. 223 104 */ 224 105 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_GetLastMessageReceiveTime, IOTHUB_CLIENT_HANDLE, iotHubClientHandle, time_t*, lastMessageReceiveTime); 225 106 226 107 /** 227 * @brief This API sets a runtime option identified by parameter @p optionName 228 * to a value pointed to by @p value. @p optionName and the data type 229 * @p value is pointing to are specific for every option. 230 * 231 * @param iotHubClientHandle The handle created by a call to the create function. 232 * @param optionName Name of the option. 233 * @param value The value. 234 * 235 * The options that can be set via this API are: 236 * - @b timeout - the maximum time in milliseconds a communication is 237 * allowed to use. @p value is a pointer to an @c unsigned @c int with 238 * the timeout value in milliseconds. This is only supported for the HTTP 239 * protocol as of now. When the HTTP protocol uses CURL, the meaning of 240 * the parameter is <em>total request time</em>. When the HTTP protocol uses 241 * winhttp, the meaning is the same as the @c dwSendTimeout and 242 * @c dwReceiveTimeout parameters of the 243 * <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa384116(v=vs.85).aspx"> 244 * WinHttpSetTimeouts</a> API. 245 * - @b CURLOPT_LOW_SPEED_LIMIT - only available for HTTP protocol and only 246 * when CURL is used. It has the same meaning as CURL's option with the same 247 * name. @p value is pointer to a long. 248 * - @b CURLOPT_LOW_SPEED_TIME - only available for HTTP protocol and only 249 * when CURL is used. It has the same meaning as CURL's option with the same 250 * name. @p value is pointer to a long. 251 * - @b CURLOPT_FORBID_REUSE - only available for HTTP protocol and only 252 * when CURL is used. It has the same meaning as CURL's option with the same 253 * name. @p value is pointer to a long. 254 * - @b CURLOPT_FRESH_CONNECT - only available for HTTP protocol and only 255 * when CURL is used. It has the same meaning as CURL's option with the same 256 * name. @p value is pointer to a long. 257 * - @b CURLOPT_VERBOSE - only available for HTTP protocol and only 258 * when CURL is used. It has the same meaning as CURL's option with the same 259 * name. @p value is pointer to a long. 260 * - @b messageTimeout - the maximum time in milliseconds until a message 261 * is timeouted. The time starts at IoTHubClient_SendEventAsync. By default, 262 * messages do not expire. @p is a pointer to a uint64_t 263 * - @b svc2cl_keep_alive_timeout_secs - the AMQP service side keep alive interval in seconds. 264 * After the connection established the client requests the server to set the 265 * keep alive interval for given time. 266 * If it is not set then the default 240 sec applies. 267 * If it is set to zero the server will not send keep alive messages to the client. 268 * - @b cl2svc_keep_alive_send_ratio - the AMQP client side keep alive interval in seconds. 269 * After the connection established the server requests the client to set the 270 * keep alive interval for given time. 271 * If it is not set then the default ratio of 1/2 is applied. 272 * The ratio has to be greater than 0.0 and equal to or less than 0.9 273 274 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 275 */ 108 * @deprecated IoTHubClient_SetOption is deprecated. Use IoTHubDeviceClient_SetOption instead. 109 */ 276 110 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_SetOption, IOTHUB_CLIENT_HANDLE, iotHubClientHandle, const char*, optionName, const void*, value); 277 111 278 112 /** 279 * @brief This API specifies a call back to be used when the device receives a state update. 280 * 281 * @param iotHubClientHandle The handle created by a call to the create function. 282 * @param deviceTwinCallback The callback specified by the device client to be used for updating 283 * the desired state. The callback will be called in response to a 284 * request send by the IoTHub services. The payload will be passed to the 285 * callback, along with two version numbers: 286 * - Desired: 287 * - LastSeenReported: 288 * @param userContextCallback User specified context that will be provided to the 289 * callback. This can be @c NULL. 290 * 291 * @b NOTE: The application behavior is undefined if the user calls 292 * the ::IoTHubClient_Destroy function from within any callback. 293 * 294 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 113 * @deprecated IoTHubClient_SetDeviceTwinCallback is deprecated. Use IoTHubDeviceClient_SetDeviceTwinCallback instead. 295 114 */ 296 115 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_SetDeviceTwinCallback, IOTHUB_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_DEVICE_TWIN_CALLBACK, deviceTwinCallback, void*, userContextCallback); 297 116 298 117 /** 299 * @brief This API sends a report of the device's properties and their current values. 300 * 301 * @param iotHubClientHandle The handle created by a call to the create function. 302 * @param reportedState The current device property values to be 'reported' to the IoTHub. 303 * @param reportedStateCallback The callback specified by the device client to be called with the 304 * result of the transaction. 305 * @param userContextCallback User specified context that will be provided to the 306 * callback. This can be @c NULL. 307 * 308 * @b NOTE: The application behavior is undefined if the user calls 309 * the ::IoTHubClient_Destroy function from within any callback. 310 * 311 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 118 * @deprecated IoTHubClient_SendReportedState is deprecated. Use IoTHubDeviceClient_SendReportedState instead. 312 119 */ 313 120 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_SendReportedState, IOTHUB_CLIENT_HANDLE, iotHubClientHandle, const unsigned char*, reportedState, size_t, size, IOTHUB_CLIENT_REPORTED_STATE_CALLBACK, reportedStateCallback, void*, userContextCallback); 314 121 315 122 /** 316 * @brief This API sets callback for cloud to device method call. 317 * 318 * @param iotHubClientHandle The handle created by a call to the create function. 319 * @param deviceMethodCallback The callback which will be called by IoTHub. 320 * @param userContextCallback User specified context that will be provided to the 321 * callback. This can be @c NULL. 322 * 323 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 123 * @deprecated IoTHubClient_SetDeviceMethodCallback is deprecated. Use IoTHubDeviceClient_SetDeviceMethodCallback instead. 324 124 */ 325 125 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_SetDeviceMethodCallback, IOTHUB_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_DEVICE_METHOD_CALLBACK_ASYNC, deviceMethodCallback, void*, userContextCallback); 326 126 327 127 /** 328 * @brief This API sets callback for async cloud to device method call. 329 * 330 * @param iotHubClientHandle The handle created by a call to the create function. 331 * @param inboundDeviceMethodCallback The callback which will be called by IoTHub. 332 * @param userContextCallback User specified context that will be provided to the 333 * callback. This can be @c NULL. 334 * 335 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 128 * @deprecated IoTHubClient_SetDeviceMethodCallback_Ex is deprecated. Use IoTHubDeviceClient_SetDeviceMethodCallback instead. 336 129 */ 337 130 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_SetDeviceMethodCallback_Ex, IOTHUB_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_INBOUND_DEVICE_METHOD_CALLBACK, inboundDeviceMethodCallback, void*, userContextCallback); 338 131 339 132 /** 340 * @brief This API responses to a asnyc method callback identified the methodId. 341 * 342 * @param iotHubClientHandle The handle created by a call to the create function. 343 * @param methodId The methodId of the Device Method callback. 344 * @param response The response data for the method callback. 345 * @param response_size The size of the response data buffer. 346 * @param status_response The status response of the method callback. 347 * 348 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 133 * @deprecated IoTHubClient_DeviceMethodResponse is deprecated. Use IoTHubDeviceClient_SetDeviceMethodCallback instead. 349 134 */ 350 135 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_DeviceMethodResponse, IOTHUB_CLIENT_HANDLE, iotHubClientHandle, METHOD_HANDLE, methodId, const unsigned char*, response, size_t, response_size, int, statusCode); … … 352 137 #ifndef DONT_USE_UPLOADTOBLOB 353 138 /** 354 * @brief IoTHubClient_UploadToBlobAsync uploads data from memory to a file in Azure Blob Storage. 355 * 356 * @param iotHubClientHandle The handle created by a call to the IoTHubClient_Create function. 357 * @param destinationFileName The name of the file to be created in Azure Blob Storage. 358 * @param source The source of data. 359 * @param size The size of data. 360 * @param iotHubClientFileUploadCallback A callback to be invoked when the file upload operation has finished. 361 * @param context A user-provided context to be passed to the file upload callback. 362 * 363 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 139 * @deprecated IoTHubClient_UploadToBlobAsync is deprecated. Use IoTHubDeviceClient_UploadToBlobAsync instead. 364 140 */ 365 141 MOCKABLE_FUNCTION(, 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); 366 142 367 143 /** 368 ** DEPRECATED: Use IoTHubClient_UploadMultipleBlocksToBlobAsyncEx instead ** 369 * @brief Uploads a file to a Blob storage in chunks, fed through the callback function provided by the user. 370 * @remarks This function allows users to upload large files in chunks, not requiring the whole file content to be passed in memory. 371 * @param iotHubClientHandle The handle created by a call to the IoTHubClient_Create function. 372 * @param destinationFileName The name of the file to be created in Azure Blob Storage. 373 * @param getDataCallback A callback to be invoked to acquire the file chunks to be uploaded, as well as to indicate the status of the upload of the previous block. 374 * @param context Any data provided by the user to serve as context on getDataCallback. 375 * @returns An IOTHUB_CLIENT_RESULT value indicating the success or failure of the API call. 376 ** DEPRECATED: Use IoTHubClient_UploadMultipleBlocksToBlobAsyncEx instead ** 144 * @deprecated IoTHubClient_UploadMultipleBlocksToBlobAsync is deprecated. Use IoTHubDeviceClient_UploadMultipleBlocksToBlobAsync instead. 377 145 */ 378 146 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_UploadMultipleBlocksToBlobAsync, IOTHUB_CLIENT_HANDLE, iotHubClientHandle, const char*, destinationFileName, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK, getDataCallback, void*, context); 379 147 380 148 /** 381 * @brief Uploads a file to a Blob storage in chunks, fed through the callback function provided by the user. 382 * @remarks This function allows users to upload large files in chunks, not requiring the whole file content to be passed in memory. 383 * @param iotHubClientHandle The handle created by a call to the IoTHubClient_Create function. 384 * @param destinationFileName The name of the file to be created in Azure Blob Storage. 385 * @param getDataCallbackEx A callback to be invoked to acquire the file chunks to be uploaded, as well as to indicate the status of the upload of the previous block. 386 * @param context Any data provided by the user to serve as context on getDataCallback. 387 * @returns An IOTHUB_CLIENT_RESULT value indicating the success or failure of the API call.*/ 149 * @deprecated IoTHubClient_UploadMultipleBlocksToBlobAsyncEx is deprecated. Use IoTHubDeviceClient_UploadMultipleBlocksToBlobAsync instead. 150 */ 388 151 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_UploadMultipleBlocksToBlobAsyncEx, IOTHUB_CLIENT_HANDLE, iotHubClientHandle, const char*, destinationFileName, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX, getDataCallbackEx, void*, context); 389 152 -
azure_iot_hub_f767zi/trunk/azure_iot_sdk/iothub_client/inc/iothub_client_core.h
r457 r464 2 2 // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 3 4 /** @file iothub_client_core.h 5 * @brief Extends the IoTHubClientCore_LL module with additional features. 6 * 7 * @details IoTHubClientCore is a module that extends the IoTHubClientCore_LL 8 * module with 2 features: 9 * - scheduling the work for the IoTHubCLient from a 10 * thread, so that the user does not need to create their 11 * own thread 12 * - thread-safe APIs 13 */ 4 //********************************************************************** 5 // NOTE: THIS HEADER IS FOR INTERNAL USE ONLY 6 // 7 // Applications should use iothub_device_client.h or iothub_module_client.h 8 // instead for the official API. 9 // 10 //********************************************************************** 14 11 15 12 #ifndef IOTHUB_CLIENT_CORE_H -
azure_iot_hub_f767zi/trunk/azure_iot_sdk/iothub_client/inc/iothub_client_core_ll.h
r457 r464 2 2 // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 3 4 /** @file iothub_client_core_ll.h 5 * @brief APIs that allow a user (usually a device) to communicate 6 * with an Azure IoTHub. 7 * 8 * @details IoTHubClientCore_LL is a module that allows a user (usually a 9 * device) to communicate with an Azure IoTHub. It can send events 10 * and receive messages. At any given moment in time there can only 11 * be at most 1 message callback function. 12 * 13 * This API surface contains a set of APIs that allows the user to 14 * interact with the lower layer portion of the IoTHubClient. These APIs 15 * contain @c _LL_ in their name, but retain the same functionality like the 16 * @c IoTHubClient_... APIs, with one difference. If the @c _LL_ APIs are 17 * used then the user is responsible for scheduling when the actual work done 18 * by the IoTHubClient happens (when the data is sent/received on/from the wire). 19 * This is useful for constrained devices where spinning a separate thread is 20 * often not desired. 21 */ 4 //********************************************************************** 5 // NOTE: THIS HEADER IS FOR INTERNAL USE ONLY 6 // 7 // Applications should use iothub_device_client_ll.h or iothub_module_client_ll.h 8 // instead for the official API. 9 // 10 //********************************************************************** 22 11 23 12 #ifndef IOTHUB_CLIENT_CORE_LL_H -
azure_iot_hub_f767zi/trunk/azure_iot_sdk/iothub_client/inc/iothub_client_ll.h
r457 r464 1 1 // Copyright (c) Microsoft. All rights reserved. 2 2 // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 4 //********************************************************************** 5 // NOTE: THIS HEADER IS DEPRECATED 6 // 7 // Functions in this header will be maintained for backward compatability. 8 // New applications should use iothub_device_client_ll.h. 9 // 10 //********************************************************************** 11 3 12 4 13 /** @file iothub_client_ll.h … … 6 15 * with an Azure IoTHub. 7 16 * 8 * @details IoTHubClient_LL is a module thatallows a user (usually a17 * @details IoTHubClient_LL allows a user (usually a 9 18 * device) to communicate with an Azure IoTHub. It can send events 10 19 * and receive messages. At any given moment in time there can only … … 38 47 typedef struct IOTHUB_CLIENT_CORE_LL_HANDLE_DATA_TAG* IOTHUB_CLIENT_LL_HANDLE; 39 48 49 /** 50 * @deprecated IoTHubClient_LL_CreateFromConnectionString is deprecated. Use IoTHubDeviceClient_LL_CreateFromConnectionString instead. 51 */ 52 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_LL_HANDLE, IoTHubClient_LL_CreateFromConnectionString, const char*, connectionString, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol); 40 53 41 54 /** 42 * @brief Creates a IoT Hub client for communication with an existing 43 * IoT Hub using the specified connection string parameter. 44 * 45 * @param connectionString Pointer to a character string 46 * @param protocol Function pointer for protocol implementation 47 * 48 * Sample connection string: 49 * <blockquote> 50 * <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> 51 * </blockquote> 52 * 53 * @return A non-NULL @c IOTHUB_CLIENT_LL_HANDLE value that is used when 54 * invoking other functions for IoT Hub client and @c NULL on failure. 55 * @deprecated IoTHubClient_LL_Create is deprecated. Use IoTHubDeviceClient_LL_Create instead. 55 56 */ 56 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_LL_HANDLE, IoTHubClient_LL_CreateFromConnectionString, const char*, connectionString, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol);57 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_LL_HANDLE, IoTHubClient_LL_Create, const IOTHUB_CLIENT_CONFIG*, config); 57 58 58 59 /** 59 * @brief Creates a IoT Hub client for communication with an existing IoT 60 * Hub using the specified parameters. 61 * 62 * @param config Pointer to an @c IOTHUB_CLIENT_CONFIG structure 63 * 64 * The API does not allow sharing of a connection across multiple 65 * devices. This is a blocking call. 66 * 67 * @return A non-NULL @c IOTHUB_CLIENT_LL_HANDLE value that is used when 68 * invoking other functions for IoT Hub client and @c NULL on failure. 60 * @deprecated IoTHubClient_LL_CreateWithTransport is deprecated. Use IoTHubDeviceClient_LL_CreateWithTransport instead. 69 61 */ 70 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_LL_HANDLE, IoTHubClient_LL_Create, const IOTHUB_CLIENT_CONFIG*, config);62 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_LL_HANDLE, IoTHubClient_LL_CreateWithTransport, const IOTHUB_CLIENT_DEVICE_CONFIG*, config); 71 63 72 64 /** 73 * @brief Creates a IoT Hub client for communication with an existing IoT 74 * Hub using an existing transport. 75 * 76 * @param config Pointer to an @c IOTHUB_CLIENT_DEVICE_CONFIG structure 77 * 78 * The API *allows* sharing of a connection across multiple 79 * devices. This is a blocking call. 80 * 81 * @return A non-NULL @c IOTHUB_CLIENT_LL_HANDLE value that is used when 82 * invoking other functions for IoT Hub client and @c NULL on failure. 65 * @deprecated IoTHubClient_LL_CreateFromDeviceAuth is deprecated. Use IoTHubDeviceClient_LL_CreateFromDeviceAuth instead. 83 66 */ 84 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_LL_HANDLE, IoTHubClient_LL_CreateWithTransport, const IOTHUB_CLIENT_DEVICE_CONFIG*, config); 85 86 /** 87 * @brief Creates a IoT Hub client for communication with an existing IoT 88 * Hub using the device auth module. 89 * 90 * @param iothub_uri Pointer to an ioThub hostname received in the registration process 91 * @param device_id Pointer to the device Id of the device 92 * @param device_auth_handle a device auth handle used to generate the connection string 93 * @param protocol Function pointer for protocol implementation 94 * 95 * @return A non-NULL @c IOTHUB_CLIENT_LL_HANDLE value that is used when 96 * invoking other functions for IoT Hub client and @c NULL on failure. 97 */ 98 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_LL_HANDLE, IoTHubClient_LL_CreateFromDeviceAuth, const char*, iothub_uri, const char*, device_id, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol); 67 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_LL_HANDLE, IoTHubClient_LL_CreateFromDeviceAuth, const char*, iothub_uri, const char*, device_id, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol); 99 68 100 69 /** 101 * @brief Disposes of resources allocated by the IoT Hub client. This is a 102 * blocking call. 103 * 104 * @param iotHubClientHandle The handle created by a call to the create function. 70 * @deprecated IoTHubClient_LL_Destroy is deprecatedDevice. Use IoTHubClient_LL_Destroy instead. 105 71 */ 106 72 MOCKABLE_FUNCTION(, void, IoTHubClient_LL_Destroy, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle); 107 73 108 74 /** 109 * @brief Asynchronous call to send the message specified by @p eventMessageHandle. 110 * 111 * @param iotHubClientHandle The handle created by a call to the create function. 112 * @param eventMessageHandle The handle to an IoT Hub message. 113 * @param eventConfirmationCallback The callback specified by the device for receiving 114 * confirmation of the delivery of the IoT Hub message. 115 * This callback can be expected to invoke the 116 * ::IoTHubClient_LL_SendEventAsync function for the 117 * same message in an attempt to retry sending a failing 118 * message. The user can specify a @c NULL value here to 119 * indicate that no callback is required. 120 * @param userContextCallback User specified context that will be provided to the 121 * callback. This can be @c NULL. 122 * 123 * @b NOTE: The application behavior is undefined if the user calls 124 * the ::IoTHubClient_LL_Destroy function from within any callback. 125 * @remarks 126 * The IOTHUB_MESSAGE_HANDLE instance provided as argument is copied by the function, 127 * so this argument can be destroyed by the calling application right after IoTHubClient_LL_SendEventAsync returns. 128 * The copy of @c eventMessageHandle is later destroyed by the iothub client when the message is effectively sent, if a failure sending it occurs, or if the client is destroyed. 129 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 75 * @deprecated IoTHubClient_LL_SendEventAsync is deprecated. Use IoTHubDeviceClient_LL_SendEventAsync instead. 130 76 */ 131 77 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SendEventAsync, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_MESSAGE_HANDLE, eventMessageHandle, IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK, eventConfirmationCallback, void*, userContextCallback); 132 78 133 79 /** 134 * @brief This function returns the current sending status for IoTHubClient. 135 * 136 * @param iotHubClientHandle The handle created by a call to the create function. 137 * @param iotHubClientStatus The sending state is populated at the address pointed 138 * at by this parameter. The value will be set to 139 * @c IOTHUBCLIENT_SENDSTATUS_IDLE if there is currently 140 * no item to be sent and @c IOTHUBCLIENT_SENDSTATUS_BUSY 141 * if there are. 142 * 143 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 80 * @deprecated IoTHubClient_LL_GetSendStatus is deprecated. UseDevice IoTHubClient_LL_GetSendStatus instead. 144 81 */ 145 82 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_GetSendStatus, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_STATUS*, iotHubClientStatus); 146 83 147 84 /** 148 * @brief Sets up the message callback to be invoked when IoT Hub issues a 149 * message to the device. This is a blocking call. 150 * 151 * @param iotHubClientHandle The handle created by a call to the create function. 152 * @param messageCallback The callback specified by the device for receiving 153 * messages from IoT Hub. 154 * @param userContextCallback User specified context that will be provided to the 155 * callback. This can be @c NULL. 156 * 157 * @b NOTE: The application behavior is undefined if the user calls 158 * the ::IoTHubClient_LL_Destroy function from within any callback. 159 * 160 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 85 * @deprecated IoTHubClient_LL_SetMessageCallback is deprecated. Use IoTHubDeviceClient_LL_SetMessageCallback instead. 161 86 */ 162 87 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SetMessageCallback, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC, messageCallback, void*, userContextCallback); 163 88 164 89 /** 165 * @brief Sets up the connection status callback to be invoked representing the status of 166 * the connection to IOT Hub. This is a blocking call. 167 * 168 * @param iotHubClientHandle The handle created by a call to the create function. 169 * @param connectionStatusCallback The callback specified by the device for receiving 170 * updates about the status of the connection to IoT Hub. 171 * @param userContextCallback User specified context that will be provided to the 172 * callback. This can be @c NULL. 173 * 174 * @b NOTE: The application behavior is undefined if the user calls 175 * the ::IoTHubClient_LL_Destroy function from within any callback. 176 * 177 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 90 * @deprecated IoTHubClient_LL_SetConnectionStatusCallback is deprecated. Use IoTHubDeviceClient_LL_SetConnectionStatusCallback instead. 178 91 */ 179 92 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SetConnectionStatusCallback, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_CONNECTION_STATUS_CALLBACK, connectionStatusCallback, void*, userContextCallback); 180 93 181 94 /** 182 * @brief Sets up the connection status callback to be invoked representing the status of 183 * the connection to IOT Hub. This is a blocking call. 184 * 185 * @param iotHubClientHandle The handle created by a call to the create function. 186 * @param retryPolicy The policy to use to reconnect to IoT Hub when a 187 * connection drops. 188 * @param retryTimeoutLimitInSeconds Maximum amount of time(seconds) to attempt reconnection when a 189 * connection drops to IOT Hub. 190 * 191 * @b NOTE: The application behavior is undefined if the user calls 192 * the ::IoTHubClient_LL_Destroy function from within any callback. 193 * 194 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 95 * @deprecated IoTHubClient_LL_SetRetryPolicy is deprecated. Use IoTHubDeviceClient_LL_SetRetryPolicy instead. 195 96 */ 196 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SetRetryPolicy, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY, retryPolicy, size_t, retryTimeoutLimitInSeconds); 197 97 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SetRetryPolicy, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY, retryPolicy, size_t, retryTimeoutLimitInSeconds); 198 98 199 99 /** 200 * @brief Sets up the connection status callback to be invoked representing the status of 201 * the connection to IOT Hub. This is a blocking call. 202 * 203 * @param iotHubClientHandle The handle created by a call to the create function. 204 * @param retryPolicy Out parameter containing the policy to use to reconnect to IoT Hub. 205 * @param retryTimeoutLimitInSeconds Out parameter containing maximum amount of time in seconds to attempt reconnection 206 to IOT Hub. 207 * 208 * @b NOTE: The application behavior is undefined if the user calls 209 * the ::IoTHubClient_LL_Destroy function from within any callback. 210 * 211 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 100 * @deprecated IoTHubClient_LL_GetRetryPolicy is deprecated. Use IoTHubDeviceClient_LL_GetRetryPolicy instead. 212 101 */ 213 102 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_GetRetryPolicy, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY*, retryPolicy, size_t*, retryTimeoutLimitInSeconds); 214 103 215 104 /** 216 * @brief This function returns in the out parameter @p lastMessageReceiveTime 217 * what was the value of the @c time function when the last message was 218 * received at the client. 219 * 220 * @param iotHubClientHandle The handle created by a call to the create function. 221 * @param lastMessageReceiveTime Out parameter containing the value of @c time function 222 * when the last message was received. 223 * 224 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 105 * @deprecated IoTHubClient_LL_GetLastMessageReceiveTime is deprecated. Use IoTHubDeviceClient_LL_GetLastMessageReceiveTime instead. 225 106 */ 226 107 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_GetLastMessageReceiveTime, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, time_t*, lastMessageReceiveTime); 227 108 228 109 /** 229 * @brief This function is meant to be called by the user when work 230 * (sending/receiving) can be done by the IoTHubClient. 231 * 232 * @param iotHubClientHandle The handle created by a call to the create function. 233 * 234 * All IoTHubClient interactions (in regards to network traffic 235 * and/or user level callbacks) are the effect of calling this 236 * function and they take place synchronously inside _DoWork. 110 * @deprecated IoTHubClient_LL_DoWork is deprecateDeviced. Use IoTHubDeviceClient_LL_DoWork instead. 237 111 */ 238 112 MOCKABLE_FUNCTION(, void, IoTHubClient_LL_DoWork, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle); 239 113 240 114 /** 241 * @brief This API sets a runtime option identified by parameter @p optionName 242 * to a value pointed to by @p value. @p optionName and the data type 243 * @p value is pointing to are specific for every option. 244 * 245 * @param iotHubClientHandle The handle created by a call to the create function. 246 * @param optionName Name of the option. 247 * @param value The value. 248 * 249 * The options that can be set via this API are: 250 * - @b timeout - the maximum time in milliseconds a communication is 251 * allowed to use. @p value is a pointer to an @c unsigned @c int with 252 * the timeout value in milliseconds. This is only supported for the HTTP 253 * protocol as of now. When the HTTP protocol uses CURL, the meaning of 254 * the parameter is <em>total request time</em>. When the HTTP protocol uses 255 * winhttp, the meaning is the same as the @c dwSendTimeout and 256 * @c dwReceiveTimeout parameters of the 257 * <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa384116(v=vs.85).aspx"> 258 * WinHttpSetTimeouts</a> API. 259 * - @b CURLOPT_LOW_SPEED_LIMIT - only available for HTTP protocol and only 260 * when CURL is used. It has the same meaning as CURL's option with the same 261 * name. @p value is pointer to a long. 262 * - @b CURLOPT_LOW_SPEED_TIME - only available for HTTP protocol and only 263 * when CURL is used. It has the same meaning as CURL's option with the same 264 * name. @p value is pointer to a long. 265 * - @b CURLOPT_FORBID_REUSE - only available for HTTP protocol and only 266 * when CURL is used. It has the same meaning as CURL's option with the same 267 * name. @p value is pointer to a long. 268 * - @b CURLOPT_FRESH_CONNECT - only available for HTTP protocol and only 269 * when CURL is used. It has the same meaning as CURL's option with the same 270 * name. @p value is pointer to a long. 271 * - @b CURLOPT_VERBOSE - only available for HTTP protocol and only 272 * when CURL is used. It has the same meaning as CURL's option with the same 273 * name. @p value is pointer to a long. 274 * - @b keepalive - available for MQTT protocol. Integer value that sets the 275 * interval in seconds when pings are sent to the server. 276 * - @b logtrace - available for MQTT protocol. Boolean value that turns on and 277 * off the diagnostic logging. 278 * - @b sas_token_lifetime - available for MQTT & AMQP protocol. size_t value that that determines the 279 * sas token timeout length. 280 * 281 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 115 * @deprecated IoTHubClient_LL_SetOption is deprecated. Device Use IoTHubDeviceClient_LL_SetOption instead. 282 116 */ 283 117 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SetOption, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, const char*, optionName, const void*, value); 284 118 285 119 /** 286 * @brief This API specifies a call back to be used when the device receives a desired state update. 287 * 288 * @param iotHubClientHandle The handle created by a call to the create function. 289 * @param deviceTwinCallback The callback specified by the device client to be used for updating 290 * the desired state. The callback will be called in response to patch 291 * request send by the IoTHub services. The payload will be passed to the 292 * callback, along with two version numbers: 293 * - Desired: 294 * - LastSeenReported: 295 * @param userContextCallback User specified context that will be provided to the 296 * callback. This can be @c NULL. 297 * 298 * @b NOTE: The application behavior is undefined if the user calls 299 * the ::IoTHubClient_LL_Destroy function from within any callback. 300 * 301 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 120 * @deprecated IoTHubClient_LL_SetDeviceTwinCallback is deprecated. Use IoTHubDeviceClient_LL_SetDeviceTwinCallback instead. 302 121 */ 303 122 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SetDeviceTwinCallback, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_DEVICE_TWIN_CALLBACK, deviceTwinCallback, void*, userContextCallback); 304 123 305 124 /** 306 * @brief This API sneds a report of the device's properties and their current values. 307 * 308 * @param iotHubClientHandle The handle created by a call to the create function. 309 * @param reportedState The current device property values to be 'reported' to the IoTHub. 310 * @param reportedStateCallback The callback specified by the device client to be called with the 311 * result of the transaction. 312 * @param userContextCallback User specified context that will be provided to the 313 * callback. This can be @c NULL. 314 * 315 * @b NOTE: The application behavior is undefined if the user calls 316 * the ::IoTHubClient_LL_Destroy function from within any callback. 317 * 318 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 125 * @deprecated IoTHubClient_LL_SendReportedState is deprecated. Use IoTHubDeviceClient_LL_SendReportedState instead. 319 126 */ 320 127 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SendReportedState, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, const unsigned char*, reportedState, size_t, size, IOTHUB_CLIENT_REPORTED_STATE_CALLBACK, reportedStateCallback, void*, userContextCallback); 321 128 322 /** 323 * @brief This API sets callback for cloud to device method call. 324 * 325 * @param iotHubClientHandle The handle created by a call to the create function. 326 * @param deviceMethodCallback The callback which will be called by IoTHub. 327 * @param userContextCallback User specified context that will be provided to the 328 * callback. This can be @c NULL. 329 * 330 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 331 */ 332 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SetDeviceMethodCallback, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_DEVICE_METHOD_CALLBACK_ASYNC, deviceMethodCallback, void*, userContextCallback); 129 /** 130 * @deprecated IoTHubClient_LL_SetDeviceMethodCallback is deprecated. Use IoTHubDeviceClient_LL_SetDeviceMethodCallback instead. 131 */ 132 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SetDeviceMethodCallback, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_DEVICE_METHOD_CALLBACK_ASYNC, deviceMethodCallback, void*, userContextCallback); 333 133 334 /** 335 * @brief This API sets callback for async cloud to device method call. 336 * 337 * @param iotHubClientHandle The handle created by a call to the create function. 338 * @param inboundDeviceMethodCallback The callback which will be called by IoTHub. 339 * @param userContextCallback User specified context that will be provided to the 340 * callback. This can be @c NULL. 341 * 342 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 343 */ 344 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SetDeviceMethodCallback_Ex, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_INBOUND_DEVICE_METHOD_CALLBACK, inboundDeviceMethodCallback, void*, userContextCallback); 134 /** 135 * @deprecated IoTHubClient_LL_SetDeviceMethodCallback_Ex is deprecated. Use IoTHubDeviceClient_LL_SetDeviceMethodCallback instead. 136 */ 137 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SetDeviceMethodCallback_Ex, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_INBOUND_DEVICE_METHOD_CALLBACK, inboundDeviceMethodCallback, void*, userContextCallback); 345 138 346 /** 347 * @brief This API responses to a asnyc method callback identified the methodId. 348 * 349 * @param iotHubClientHandle The handle created by a call to the create function. 350 * @param methodId The methodId of the Device Method callback. 351 * @param response The response data for the method callback. 352 * @param response_size The size of the response data buffer. 353 * @param status_response The status response of the method callback. 354 * 355 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 356 */ 357 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_DeviceMethodResponse, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, METHOD_HANDLE, methodId, const unsigned char*, response, size_t, respSize, int, statusCode); 139 /** 140 * @deprecated IoTHubClient_LL_DeviceMethodResponse is deprecated. Use IoTHubDeviceClient_LL_SetDeviceMethodCallback instead. 141 */ 142 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_DeviceMethodResponse, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, METHOD_HANDLE, methodId, const unsigned char*, response, size_t, respSize, int, statusCode); 358 143 359 144 #ifndef DONT_USE_UPLOADTOBLOB 360 145 /** 361 * @brief This API uploads to Azure Storage the content pointed to by @p source having the size @p size 362 * under the blob name devicename/@pdestinationFileName 363 * 364 * @param iotHubClientHandle The handle created by a call to the create function. 365 * @param destinationFileName name of the file. 366 * @param source pointer to the source for file content (can be NULL) 367 * @param size the size of the source in memory (if @p source is NULL then size needs to be 0). 368 * 369 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 146 * @deprecated IoTHubClient_LL_UploadToBlob is deprecated. UsDevicee IoTHubDeviceClient_LL_UploadToBlob instead. 370 147 */ 371 148 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_UploadToBlob, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, const char*, destinationFileName, const unsigned char*, source, size_t, size); 372 149 373 /** 374 ** DEPRECATED: Use IoTHubClient_LL_UploadMultipleBlocksToBlobAsyncEx instead ** 375 * @brief This API uploads to Azure Storage the content provided block by block by @p getDataCallback 376 * under the blob name devicename/@pdestinationFileName 377 * 378 * @param iotHubClientHandle The handle created by a call to the create function. 379 * @param destinationFileName name of the file. 380 * @param getDataCallback A callback to be invoked to acquire the file chunks to be uploaded, as well as to indicate the status of the upload of the previous block. 381 * @param context Any data provided by the user to serve as context on getDataCallback. 382 * 383 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 384 ** DEPRECATED: Use IoTHubClient_LL_UploadMultipleBlocksToBlobAsyncEx instead ** 385 */ 386 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_UploadMultipleBlocksToBlob, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, const char*, destinationFileName, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK, getDataCallback, void*, context); 150 /** 151 * @deprecated IoTHubClient_LL_UploadMultipleBlocksToBlob is deprecated. Use IoTHubDeviceClient_LL_UploadMultipleBlocksToBlob instead. 152 */ 153 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_UploadMultipleBlocksToBlob, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, const char*, destinationFileName, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK, getDataCallback, void*, context); 387 154 388 /** 389 * @brief This API uploads to Azure Storage the content provided block by block by @p getDataCallback 390 * under the blob name devicename/@pdestinationFileName 391 * 392 * @param iotHubClientHandle The handle created by a call to the create function. 393 * @param destinationFileName name of the file. 394 * @param getDataCallbackEx A callback to be invoked to acquire the file chunks to be uploaded, as well as to indicate the status of the upload of the previous block. 395 * @param context Any data provided by the user to serve as context on getDataCallback. 396 * 397 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 398 */ 399 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_UploadMultipleBlocksToBlobEx, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, const char*, destinationFileName, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX, getDataCallbackEx, void*, context); 155 /** 156 * @deprecated IoTHubClient_LL_UploadMultipleBlocksToBlobEx is deprecated. Use IoTHubDeviceClient_LL_UploadMultipleBlocksToBlob instead. 157 */ 158 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_UploadMultipleBlocksToBlobEx, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, const char*, destinationFileName, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX, getDataCallbackEx, void*, context); 400 159 401 160 #endif /*DONT_USE_UPLOADTOBLOB*/ -
azure_iot_hub_f767zi/trunk/azure_iot_sdk/iothub_client/inc/iothub_client_options.h
r457 r464 28 28 static STATIC_VAR_UNUSED const char* OPTION_CONNECTION_TIMEOUT = "connect_timeout"; 29 29 30 /* None of the OPTION_PROXY_* options below are implemented. Use OPTION_HTTP_PROXY 31 from shared_util_options.h in https://github.com/Azure/azure-c-shared-utility/ repo instead */ 30 32 static STATIC_VAR_UNUSED const char* OPTION_PROXY_HOST = "proxy_address"; 31 33 static STATIC_VAR_UNUSED const char* OPTION_PROXY_USERNAME = "proxy_username"; … … 87 89 static STATIC_VAR_UNUSED const char* OPTION_DO_WORK_FREQUENCY_IN_MS = "do_work_freq_ms"; 88 90 91 // Minimum percentage (in the 0 to 1 range) of multiplexed registered devices that must be failing for a transport-wide reconnection to be triggered. 92 // A value of zero results in a single registered device to be able to cause a general transport reconnection 93 // (thus causing all other multiplexed registered devices to be also reconnected, meaning an agressive reconnection strategy). 94 // Setting this parameter to one indicates that 100% of the multiplexed registered devices must be failing in parallel for a 95 // transport-wide reconnection to be triggered (resulting in a very lenient reconnection strategy). 96 #define DEVICE_MULTIPLEXING_FAULTY_DEVICE_RATIO_RECONNECTION_THRESHOLD 0 97 98 // Minimum number of consecutive failures an individual registered device must have to be considered a faulty device. 99 // This is used along with DEVICE_MULTIPLEXING_FAULTY_DEVICE_RATIO_RECONNECTION_THRESHOLD to trigger transport-wide reconnections. 100 // The device may fail to authenticate, timeout establishing the connection, get disconnected by the service for some reason or fail sending messages. 101 // In all these cases the failures are cummulatively counted; if the count is equal to or greater than DEVICE_FAILURE_COUNT_RECONNECTION_THRESHOLD 102 // the device is considered to be in a faulty state. 103 #define DEVICE_FAILURE_COUNT_RECONNECTION_THRESHOLD 5 104 89 105 #ifdef __cplusplus 90 106 } -
azure_iot_hub_f767zi/trunk/azure_iot_sdk/iothub_client/inc/iothub_client_version.h
r457 r464 9 9 #define IOTHUB_CLIENT_VERSION_H 10 10 11 #define IOTHUB_SDK_VERSION "1. 3.8"11 #define IOTHUB_SDK_VERSION "1.6.0" 12 12 13 13 #include "umock_c/umock_c_prod.h" -
azure_iot_hub_f767zi/trunk/azure_iot_sdk/iothub_client/inc/iothub_device_client_ll.h
r457 r464 6 6 * with an Azure IoTHub. 7 7 * 8 * @details IoTHubDeviceClient_LL is a module thatallows a user (usually a8 * @details IoTHubDeviceClient_LL allows a user (usually a 9 9 * device) to communicate with an Azure IoTHub. It can send events 10 10 * and receive messages. At any given moment in time there can only … … 16 16 * @c IoTHubDeviceClient_... APIs, with one difference. If the @c _LL_ APIs are 17 17 * used then the user is responsible for scheduling when the actual work done 18 * by the IoTHubClient happens (when the data is sent/received on/from the wire).18 * by the IoTHubClient happens (when the data is sent/received on/from the network). 19 19 * This is useful for constrained devices where spinning a separate thread is 20 20 * often not desired. … … 88 88 /** 89 89 * @brief Creates a IoT Hub client for communication with an existing IoT 90 * Hub using the device auth module.90 * Hub using the device auth. 91 91 * 92 92 * @param iothub_uri Pointer to an ioThub hostname received in the registration process … … 116 116 * confirmation of the delivery of the IoT Hub message. 117 117 * This callback can be expected to invoke the 118 * ::IoTHubDeviceClient_LL_SendEventAsync function for the118 * IoTHubDeviceClient_LL_SendEventAsync function for the 119 119 * same message in an attempt to retry sending a failing 120 120 * message. The user can specify a @c NULL value here to … … 124 124 * 125 125 * @b NOTE: The application behavior is undefined if the user calls 126 * the ::IoTHubDeviceClient_LL_Destroy function from within any callback.126 * the IoTHubDeviceClient_LL_Destroy function from within any callback. 127 127 * @remarks 128 128 * The IOTHUB_MESSAGE_HANDLE instance provided as argument is copied by the function, … … 139 139 * @param iotHubClientStatus The sending state is populated at the address pointed 140 140 * at by this parameter. The value will be set to 141 * @c IOTHUB CLIENT_SENDSTATUS_IDLE if there is currently142 * no item to be sent and @c IOTHUB CLIENT_SENDSTATUS_BUSY141 * @c IOTHUB_CLIENT_SEND_STATUS_IDLE if there is currently 142 * no item to be sent and @c IOTHUB_CLIENT_SEND_STATUS_BUSY 143 143 * if there are. 144 * 145 * @remark Does not return information related to uploads initiated by IoTHubDeviceClient_LL_UploadToBlob or IoTHubDeviceClient_LL_UploadMultipleBlocksToBlob. 144 146 * 145 147 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. … … 158 160 * 159 161 * @b NOTE: The application behavior is undefined if the user calls 160 * the ::IoTHubDeviceClient_LL_Destroy function from within any callback.162 * the IoTHubDeviceClient_LL_Destroy function from within any callback. 161 163 * 162 164 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. … … 175 177 * 176 178 * @b NOTE: The application behavior is undefined if the user calls 177 * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. 179 * the IoTHubDeviceClient_LL_Destroy function from within any callback. 180 * 181 * @remark Callback specified will not receive connection status change notifications for upload connections created with IoTHubDeviceClient_LL_UploadToBlob or IoTHubDeviceClient_LL_UploadMultipleBlocksToBlob. 178 182 * 179 183 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. … … 192 196 * 193 197 * @b NOTE: The application behavior is undefined if the user calls 194 * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. 198 * the IoTHubDeviceClient_LL_Destroy function from within any callback. 199 * 200 * @remark Uploads initiated by IoTHubDeviceClient_LL_UploadToBlob or IoTHubDeviceClient_LL_UploadMultipleBlocksToBlob do not have automatic retries and do not honor the retryPolicy settings. 195 201 * 196 202 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. … … 209 215 * 210 216 * @b NOTE: The application behavior is undefined if the user calls 211 * the ::IoTHubDeviceClient_LL_Destroy function from within any callback.217 * the IoTHubDeviceClient_LL_Destroy function from within any callback. 212 218 * 213 219 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. … … 229 235 230 236 /** 231 * @brief This function MUST be called by the user so work (sending/receiving data on the wire,237 * @brief This function MUST be called by the user so work (sending/receiving data on the network, 232 238 * computing and enforcing timeout controls, managing the connection to the IoT Hub) can 233 239 * be done by the IoTHubClient. … … 251 257 * @param value The value. 252 258 * 253 * The options that can be set via this API are: 254 * - @b timeout - the maximum time in milliseconds a communication is 255 * allowed to use. @p value is a pointer to an @c unsigned @c int with 256 * the timeout value in milliseconds. This is only supported for the HTTP 257 * protocol as of now. When the HTTP protocol uses CURL, the meaning of 258 * the parameter is <em>total request time</em>. When the HTTP protocol uses 259 * winhttp, the meaning is the same as the @c dwSendTimeout and 260 * @c dwReceiveTimeout parameters of the 261 * <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa384116(v=vs.85).aspx"> 262 * WinHttpSetTimeouts</a> API. 263 * - @b CURLOPT_LOW_SPEED_LIMIT - only available for HTTP protocol and only 264 * when CURL is used. It has the same meaning as CURL's option with the same 265 * name. @p value is pointer to a long. 266 * - @b CURLOPT_LOW_SPEED_TIME - only available for HTTP protocol and only 267 * when CURL is used. It has the same meaning as CURL's option with the same 268 * name. @p value is pointer to a long. 269 * - @b CURLOPT_FORBID_REUSE - only available for HTTP protocol and only 270 * when CURL is used. It has the same meaning as CURL's option with the same 271 * name. @p value is pointer to a long. 272 * - @b CURLOPT_FRESH_CONNECT - only available for HTTP protocol and only 273 * when CURL is used. It has the same meaning as CURL's option with the same 274 * name. @p value is pointer to a long. 275 * - @b CURLOPT_VERBOSE - only available for HTTP protocol and only 276 * when CURL is used. It has the same meaning as CURL's option with the same 277 * name. @p value is pointer to a long. 278 * - @b keepalive - available for MQTT protocol. Integer value that sets the 279 * interval in seconds when pings are sent to the server. 280 * - @b logtrace - available for MQTT protocol. Boolean value that turns on and 281 * off the diagnostic logging. 282 * - @b sas_token_lifetime - available for MQTT & AMQP protocol. size_t value that that determines the 283 * sas token timeout length. 284 * - @b OPTION_TRUSTED_CERT - Azure Server certificate used to validate TLS connection to iothub. 259 * @remarks Documentation for configuration options is available at https://github.com/Azure/azure-iot-sdk-c/blob/master/doc/Iothub_sdk_options.md. 285 260 * 286 261 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. … … 302 277 * 303 278 * @b NOTE: The application behavior is undefined if the user calls 304 * the ::IoTHubDeviceClient_LL_Destroy function from within any callback.279 * the IoTHubDeviceClient_LL_Destroy function from within any callback. 305 280 * 306 281 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. … … 319 294 * 320 295 * @b NOTE: The application behavior is undefined if the user calls 321 * the ::IoTHubDeviceClient_LL_Destroy function from within any callback.296 * the IoTHubDeviceClient_LL_Destroy function from within any callback. 322 297 * 323 298 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. … … 334 309 * 335 310 * @b NOTE: The application behavior is undefined if the user calls 336 * the ::IoTHubClient_LL_Destroy function from within any callback.311 * the IoTHubClient_LL_Destroy function from within any callback. 337 312 * 338 313 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. … … 374 349 * @param source pointer to the source for file content (can be NULL) 375 350 * @param size the size of the source in memory (if @p source is NULL then size needs to be 0). 351 * 352 * @warning Other _LL_ functions such as IoTHubDeviceClient_LL_SendEventAsync queue work to be performed later and do not block. IoTHubDeviceClient_LL_UploadToBlob 353 * will block however until the upload is completed or fails, which may take a while. 376 354 * 377 355 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. … … 388 366 * @param context Any data provided by the user to serve as context on getDataCallback. 389 367 * 368 * @warning Other _LL_ functions such as IoTHubDeviceClient_LL_SendEventAsync queue work to be performed later and do not block. IoTHubDeviceClient_LL_UploadMultipleBlocksToBlob 369 * will block however until the upload is completed or fails, which may take a while. 370 * 390 371 * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. 391 372 */ -
azure_iot_hub_f767zi/trunk/azure_iot_sdk/iothub_client/inc/iothub_message.h
r457 r464 192 192 * @param iotHubMessageHandle Handle to the message. 193 193 * 194 * @param key name of the property to set. Note that when sending messages via the HTTP transport, this value must not contain spaces. 195 * 196 * @param value of the property to set. 194 * @param key name of the property to set. Note that when sending messages via the HTTP transport, this value must not contain spaces. 195 * 196 * @param value of the property to set. 197 * 198 * @b NOTE: The accepted character sets for the key name and value parameters are dependent on different factors, such as the protocol 199 * being used. For more information on the character sets accepted by Azure IoT Hub, see 200 * <a href="https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messages-construct">Create and read IoT Hub messages</a>. 197 201 * 198 202 * @return An @c IOTHUB_MESSAGE_RESULT value indicating the result of setting the property. … … 252 256 * @param correlationId Pointer to the memory location of the messageId 253 257 * 254 * @return Returns IOTHUB_MESSAGE_OK if the messageId was set successfully258 * @return Returns IOTHUB_MESSAGE_OK if the CorrelationId was set successfully 255 259 * or an error code otherwise. 256 260 */ … … 295 299 * @param outputName Pointer to the queue to output message to 296 300 * 297 * @return Returns IOTHUB_MESSAGE_OK if the DiagnosticDatawas set successfully301 * @return Returns IOTHUB_MESSAGE_OK if the outputName was set successfully 298 302 * or an error code otherwise. 299 303 */ … … 318 322 * @param inputName Pointer to the queue to input message to 319 323 * 320 * @return Returns IOTHUB_MESSAGE_OK if the DiagnosticDatawas set successfully324 * @return Returns IOTHUB_MESSAGE_OK if the inputName was set successfully 321 325 * or an error code otherwise. 322 326 */ … … 340 344 * @param connectionModuleId Pointer to the module ID of connector 341 345 * 342 * @return Returns IOTHUB_MESSAGE_OK if the DiagnosticDatawas set successfully346 * @return Returns IOTHUB_MESSAGE_OK if the connectionModuleId was set successfully 343 347 * or an error code otherwise. 344 348 */ 345 349 MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetConnectionModuleId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, connectionModuleId); 346 350 347 348 351 /** 349 352 * @brief Gets the connection device ID from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, … … 356 359 */ 357 360 MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetConnectionDeviceId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); 361 362 /** 363 * @brief Sets the message creation time in UTC. 364 * 365 * @param iotHubMessageHandle Handle to the message. 366 * @param messageCreationTimeUtc Pointer to the message creation time as null-terminated string 367 * 368 * @return Returns IOTHUB_MESSAGE_OK if the messageCreationTimeUtc was set successfully 369 * or an error code otherwise. 370 */ 371 MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetMessageCreationTimeUtcSystemProperty, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, messageCreationTimeUtc); 372 373 /** 374 * @brief Gets the message creation time in UTC from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, 375 * the caller is not responsible for freeing the memory. The memory 376 * is valid until IoTHubMessage_Destroy is called on the message. 377 * 378 * @param iotHubMessageHandle Handle to the message. 379 * 380 * @return A const char* pointing to the message creation time in UTC. 381 */ 382 MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetMessageCreationTimeUtcSystemProperty, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); 383 384 /** 385 * @brief Sets the message user id. CAUTION: SDK user should not call it directly, it is for internal use only. 386 * 387 * @param iotHubMessageHandle Handle to the message. 388 * @param userId Pointer to the message user id as null-terminated string 389 * 390 * @return Returns IOTHUB_MESSAGE_OK if the userId was set successfully or an error code otherwise. 391 */ 392 MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetMessageUserIdSystemProperty, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, userId); 393 394 /** 395 * @brief Gets the message user id from the IOTHUB_MESSAGE_HANDLE. No new memory is allocated, 396 * the caller is not responsible for freeing the memory. The memory 397 * is valid until IoTHubMessage_Destroy is called on the message. 398 * 399 * @param iotHubMessageHandle Handle to the message. 400 * 401 * @return A const char* pointing to the message user id. 402 */ 403 MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetMessageUserIdSystemProperty, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); 358 404 359 405 /**
Note:
See TracChangeset
for help on using the changeset viewer.