- *- * - * @return A non-NULL @c IOTHUB_DEVICE_CLIENT_HANDLE value that is used when - * invoking other functions for IoT Hub client and @c NULL on failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_DEVICE_CLIENT_HANDLE, IoTHubDeviceClient_CreateFromConnectionString, const char*, connectionString, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol); - - /** - * @brief Creates a IoT Hub client for communication with an existing IoT - * Hub using the specified parameters. - * - * @param config Pointer to an @c IOTHUB_CLIENT_CONFIG structure - * - * The API does not allow sharing of a connection across multiple - * devices. This is a blocking call. - * - * @return A non-NULL @c IOTHUB_DEVICE_CLIENT_HANDLE value that is used when - * invoking other functions for IoT Hub client and @c NULL on failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_DEVICE_CLIENT_HANDLE, IoTHubDeviceClient_Create, const IOTHUB_CLIENT_CONFIG*, config); - - /** - * @brief Creates a IoT Hub client for communication with an existing IoT - * Hub using the specified parameters. - * - * @param transportHandle TRANSPORT_HANDLE which represents a connection. - * @param config Pointer to an @c IOTHUB_CLIENT_CONFIG structure - * - * The API allows sharing of a connection across multiple - * devices. This is a blocking call. - * - * @return A non-NULL @c IOTHUB_DEVICE_CLIENT_HANDLE value that is used when - * invoking other functions for IoT Hub client and @c NULL on failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_DEVICE_CLIENT_HANDLE, IoTHubDeviceClient_CreateWithTransport, TRANSPORT_HANDLE, transportHandle, const IOTHUB_CLIENT_CONFIG*, config); - - /** - * @brief Creates a IoT Hub client for communication with an existing IoT - * Hub using the device auth module. - * - * @param iothub_uri Pointer to an ioThub hostname received in the registration process - * @param device_id Pointer to the device Id of the device - * @param protocol Function pointer for protocol implementation - * - * @return A non-NULL @c IOTHUB_DEVICE_CLIENT_HANDLE value that is used when - * invoking other functions for IoT Hub client and @c NULL on failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_DEVICE_CLIENT_HANDLE, IoTHubDeviceClient_CreateFromDeviceAuth, const char*, iothub_uri, const char*, device_id, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol); - - /** - * @brief Disposes of resources allocated by the IoT Hub client. This is a - * blocking call. - * - * @param iotHubClientHandle The handle created by a call to the create function. - */ - MOCKABLE_FUNCTION(, void, IoTHubDeviceClient_Destroy, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle); - - /** - * @brief Asynchronous call to send the message specified by @p eventMessageHandle. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param eventMessageHandle The handle to an IoT Hub message. - * @param eventConfirmationCallback The callback specified by the device for receiving - * confirmation of the delivery of the IoT Hub message. - * This callback can be expected to invoke the - * ::IoTHubDeviceClient_SendEventAsync function for the - * same message in an attempt to retry sending a failing - * message. The user can specify a @c NULL value here to - * indicate that no callback is required. - * @param userContextCallback User specified context that will be provided to the - * callback. This can be @c NULL. - * - * @b NOTE: The application behavior is undefined if the user calls - * the ::IoTHubDeviceClient_Destroy function from within any callback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_SendEventAsync, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_MESSAGE_HANDLE, eventMessageHandle, IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK, eventConfirmationCallback, void*, userContextCallback); - - /** - * @brief This function returns the current sending status for IoTHubClient. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param iotHubClientStatus The sending state is populated at the address pointed - * at by this parameter. The value will be set to - * @c IOTHUBCLIENT_SENDSTATUS_IDLE if there is currently - * no item to be sent and @c IOTHUBCLIENT_SENDSTATUS_BUSY - * if there are. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_GetSendStatus, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_STATUS*, iotHubClientStatus); - - /** - * @brief Sets up the message callback to be invoked when IoT Hub issues a - * message to the device. This is a blocking call. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param messageCallback The callback specified by the device for receiving - * messages from IoT Hub. - * @param userContextCallback User specified context that will be provided to the - * callback. This can be @c NULL. - * - * @b NOTE: The application behavior is undefined if the user calls - * the ::IoTHubDeviceClient_Destroy function from within any callback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_SetMessageCallback, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC, messageCallback, void*, userContextCallback); - - /** - * @brief Sets up the connection status callback to be invoked representing the status of - * the connection to IOT Hub. This is a blocking call. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param connectionStatusCallback The callback specified by the device for receiving - * updates about the status of the connection to IoT Hub. - * @param userContextCallback User specified context that will be provided to the - * callback. This can be @c NULL. - * - * @b NOTE: The application behavior is undefined if the user calls - * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_SetConnectionStatusCallback, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_CONNECTION_STATUS_CALLBACK, connectionStatusCallback, void*, userContextCallback); - - /** - * @brief Sets up the connection status callback to be invoked representing the status of - * the connection to IOT Hub. This is a blocking call. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param retryPolicy The policy to use to reconnect to IoT Hub when a - * connection drops. - * @param retryTimeoutLimitInSeconds Maximum amount of time(seconds) to attempt reconnection when a - * connection drops to IOT Hub. - * - * @b NOTE: The application behavior is undefined if the user calls - * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_SetRetryPolicy, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY, retryPolicy, size_t, retryTimeoutLimitInSeconds); - - /** - * @brief Sets up the connection status callback to be invoked representing the status of - * the connection to IOT Hub. This is a blocking call. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param retryPolicy Out parameter containing the policy to use to reconnect to IoT Hub. - * @param retryTimeoutLimitInSeconds Out parameter containing maximum amount of time in seconds to attempt reconnection - to IOT Hub. - * - * @b NOTE: The application behavior is undefined if the user calls - * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_GetRetryPolicy, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY*, retryPolicy, size_t*, retryTimeoutLimitInSeconds); - - /** - * @brief This function returns in the out parameter @p lastMessageReceiveTime - * what was the value of the @c time function when the last message was - * received at the client. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param lastMessageReceiveTime Out parameter containing the value of @c time function - * when the last message was received. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_GetLastMessageReceiveTime, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, time_t*, lastMessageReceiveTime); - - /** - * @brief This API sets a runtime option identified by parameter @p optionName - * to a value pointed to by @p value. @p optionName and the data type - * @p value is pointing to are specific for every option. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param optionName Name of the option. - * @param value The value. - * - * The options that can be set via this API are: - * - @b timeout - the maximum time in milliseconds a communication is - * allowed to use. @p value is a pointer to an @c unsigned @c int with - * the timeout value in milliseconds. This is only supported for the HTTP - * protocol as of now. When the HTTP protocol uses CURL, the meaning of - * the parameter is total request time. When the HTTP protocol uses - * winhttp, the meaning is the same as the @c dwSendTimeout and - * @c dwReceiveTimeout parameters of the - * - * WinHttpSetTimeouts API. - * - @b CURLOPT_LOW_SPEED_LIMIT - only available for HTTP protocol and only - * when CURL is used. It has the same meaning as CURL's option with the same - * name. @p value is pointer to a long. - * - @b CURLOPT_LOW_SPEED_TIME - only available for HTTP protocol and only - * when CURL is used. It has the same meaning as CURL's option with the same - * name. @p value is pointer to a long. - * - @b CURLOPT_FORBID_REUSE - only available for HTTP protocol and only - * when CURL is used. It has the same meaning as CURL's option with the same - * name. @p value is pointer to a long. - * - @b CURLOPT_FRESH_CONNECT - only available for HTTP protocol and only - * when CURL is used. It has the same meaning as CURL's option with the same - * name. @p value is pointer to a long. - * - @b CURLOPT_VERBOSE - only available for HTTP protocol and only - * when CURL is used. It has the same meaning as CURL's option with the same - * name. @p value is pointer to a long. - * - @b messageTimeout - the maximum time in milliseconds until a message - * is timeouted. The time starts at IoTHubDeviceClient_SendEventAsync. By default, - * messages do not expire. @p is a pointer to a uint64_t - * - @b svc2cl_keep_alive_timeout_secs - the AMQP service side keep alive interval in seconds. - * After the connection established the client requests the server to set the - * keep alive interval for given time. - * If it is not set then the default 240 sec applies. - * If it is set to zero the server will not send keep alive messages to the client. - * - @b cl2svc_keep_alive_send_ratio - the AMQP client side keep alive interval in seconds. - * After the connection established the server requests the client to set the - * keep alive interval for given time. - * If it is not set then the default ratio of 1/2 is applied. - * The ratio has to be greater than 0.0 and equal to or less than 0.9 - - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_SetOption, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, const char*, optionName, const void*, value); - - /** - * @brief This API specifies a call back to be used when the device receives a state update. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param deviceTwinCallback The callback specified by the device client to be used for updating - * the desired state. The callback will be called in response to a - * request send by the IoTHub services. The payload will be passed to the - * callback, along with two version numbers: - * - Desired: - * - LastSeenReported: - * @param userContextCallback User specified context that will be provided to the - * callback. This can be @c NULL. - * - * @b NOTE: The application behavior is undefined if the user calls - * the ::IoTHubDeviceClient_Destroy function from within any callback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_SetDeviceTwinCallback, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_DEVICE_TWIN_CALLBACK, deviceTwinCallback, void*, userContextCallback); - - /** - * @brief This API sends a report of the device's properties and their current values. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param reportedState The current device property values to be 'reported' to the IoTHub. - * @param reportedStateCallback The callback specified by the device client to be called with the - * result of the transaction. - * @param userContextCallback User specified context that will be provided to the - * callback. This can be @c NULL. - * - * @b NOTE: The application behavior is undefined if the user calls - * the ::IoTHubDeviceClient_Destroy function from within any callback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_SendReportedState, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, const unsigned char*, reportedState, size_t, size, IOTHUB_CLIENT_REPORTED_STATE_CALLBACK, reportedStateCallback, void*, userContextCallback); - - /** - * @brief This API sets callback for async cloud to device method call. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param inboundDeviceMethodCallback The callback which will be called by IoTHub. - * @param userContextCallback User specified context that will be provided to the - * callback. This can be @c NULL. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_SetDeviceMethodCallback, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_DEVICE_METHOD_CALLBACK_ASYNC, deviceMethodCallback, void*, userContextCallback); - - /** - * @brief This API responses to a asnyc method callback identified the methodId. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param methodId The methodId of the Device Method callback. - * @param response The response data for the method callback. - * @param response_size The size of the response data buffer. - * @param status_response The status response of the method callback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_DeviceMethodResponse, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, METHOD_HANDLE, methodId, const unsigned char*, response, size_t, response_size, int, statusCode); - -#ifndef DONT_USE_UPLOADTOBLOB - /** - * @brief IoTHubDeviceClient_UploadToBlobAsync uploads data from memory to a file in Azure Blob Storage. - * - * @param iotHubClientHandle The handle created by a call to the IoTHubDeviceClient_Create function. - * @param destinationFileName The name of the file to be created in Azure Blob Storage. - * @param source The source of data. - * @param size The size of data. - * @param iotHubClientFileUploadCallback A callback to be invoked when the file upload operation has finished. - * @param context A user-provided context to be passed to the file upload callback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_UploadToBlobAsync, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, const char*, destinationFileName, const unsigned char*, source, size_t, size, IOTHUB_CLIENT_FILE_UPLOAD_CALLBACK, iotHubClientFileUploadCallback, void*, context); - - /** - * @brief Uploads a file to a Blob storage in chunks, fed through the callback function provided by the user. - * @remarks This function allows users to upload large files in chunks, not requiring the whole file content to be passed in memory. - * @param iotHubClientHandle The handle created by a call to the IoTHubDeviceClient_Create function. - * @param destinationFileName The name of the file to be created in Azure Blob Storage. - * @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. - * @param context Any data provided by the user to serve as context on getDataCallback. - * @returns An IOTHUB_CLIENT_RESULT value indicating the success or failure of the API call. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_UploadMultipleBlocksToBlobAsync, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, const char*, destinationFileName, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX, getDataCallbackEx, void*, context); - -#endif /* DONT_USE_UPLOADTOBLOB */ - -#ifdef __cplusplus -} -#endif - -#endif /* IOTHUB_CLIENT_H */ diff --git a/third_party/azure_iot-1.2.5/iothub_client/inc/iothub_device_client_ll.h b/third_party/azure_iot-1.2.5/iothub_client/inc/iothub_device_client_ll.h deleted file mode 100644 index ea086364..00000000 --- a/third_party/azure_iot-1.2.5/iothub_client/inc/iothub_device_client_ll.h +++ /dev/null @@ -1,378 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -/** @file iothub_client_ll.h -* @brief APIs that allow a user (usually a device) to communicate -* with an Azure IoTHub. -* -* @details IoTHubDeviceClient_LL is a module that allows a user (usually a -* device) to communicate with an Azure IoTHub. It can send events -* and receive messages. At any given moment in time there can only -* be at most 1 message callback function. -* -* This API surface contains a set of APIs that allows the user to -* interact with the lower layer portion of the IoTHubClient. These APIs -* contain @c _LL_ in their name, but retain the same functionality like the -* @c IoTHubDeviceClient_... APIs, with one difference. If the @c _LL_ APIs are -* used then the user is responsible for scheduling when the actual work done -* by the IoTHubClient happens (when the data is sent/received on/from the wire). -* This is useful for constrained devices where spinning a separate thread is -* often not desired. -*/ - -#ifndef IOTHUB_DEVICE_CLIENT_LL_H -#define IOTHUB_DEVICE_CLIENT_LL_H - -#includeHostName=[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];- *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];- *
- *- * - * @return A non-NULL @c IOTHUB_DEVICE_CLIENT_LL_HANDLE value that is used when - * invoking other functions for IoT Hub client and @c NULL on failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_DEVICE_CLIENT_LL_HANDLE, IoTHubDeviceClient_LL_CreateFromConnectionString, const char*, connectionString, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol); - - /** - * @brief Creates a IoT Hub client for communication with an existing IoT - * Hub using the specified parameters. - * - * @param config Pointer to an @c IOTHUB_CLIENT_CONFIG structure - * - * The API does not allow sharing of a connection across multiple - * devices. This is a blocking call. - * - * @return A non-NULL @c IOTHUB_DEVICE_CLIENT_LL_HANDLE value that is used when - * invoking other functions for IoT Hub client and @c NULL on failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_DEVICE_CLIENT_LL_HANDLE, IoTHubDeviceClient_LL_Create, const IOTHUB_CLIENT_CONFIG*, config); - - /** - * @brief Creates a IoT Hub client for communication with an existing IoT - * Hub using an existing transport. - * - * @param config Pointer to an @c IOTHUB_CLIENT_DEVICE_CONFIG structure - * - * The API *allows* sharing of a connection across multiple - * devices. This is a blocking call. - * - * @return A non-NULL @c IOTHUB_DEVICE_CLIENT_LL_HANDLE value that is used when - * invoking other functions for IoT Hub client and @c NULL on failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_DEVICE_CLIENT_LL_HANDLE, IoTHubDeviceClient_LL_CreateWithTransport, const IOTHUB_CLIENT_DEVICE_CONFIG*, config); - - /** - * @brief Creates a IoT Hub client for communication with an existing IoT - * Hub using the device auth module. - * - * @param iothub_uri Pointer to an ioThub hostname received in the registration process - * @param device_id Pointer to the device Id of the device - * @param device_auth_handle a device auth handle used to generate the connection string - * @param protocol Function pointer for protocol implementation - * - * @return A non-NULL @c IOTHUB_DEVICE_CLIENT_LL_HANDLE value that is used when - * invoking other functions for IoT Hub client and @c NULL on failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_DEVICE_CLIENT_LL_HANDLE, IoTHubDeviceClient_LL_CreateFromDeviceAuth, const char*, iothub_uri, const char*, device_id, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol); - - /** - * @brief Disposes of resources allocated by the IoT Hub client. This is a - * blocking call. - * - * @param iotHubClientHandle The handle created by a call to the create function. - */ - MOCKABLE_FUNCTION(, void, IoTHubDeviceClient_LL_Destroy, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle); - - /** - * @brief Asynchronous call to send the message specified by @p eventMessageHandle. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param eventMessageHandle The handle to an IoT Hub message. - * @param eventConfirmationCallback The callback specified by the device for receiving - * confirmation of the delivery of the IoT Hub message. - * This callback can be expected to invoke the - * ::IoTHubDeviceClient_LL_SendEventAsync function for the - * same message in an attempt to retry sending a failing - * message. The user can specify a @c NULL value here to - * indicate that no callback is required. - * @param userContextCallback User specified context that will be provided to the - * callback. This can be @c NULL. - * - * @b NOTE: The application behavior is undefined if the user calls - * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_SendEventAsync, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_MESSAGE_HANDLE, eventMessageHandle, IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK, eventConfirmationCallback, void*, userContextCallback); - - /** - * @brief This function returns the current sending status for IoTHubClient. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param iotHubClientStatus The sending state is populated at the address pointed - * at by this parameter. The value will be set to - * @c IOTHUBCLIENT_SENDSTATUS_IDLE if there is currently - * no item to be sent and @c IOTHUBCLIENT_SENDSTATUS_BUSY - * if there are. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_GetSendStatus, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_STATUS*, iotHubClientStatus); - - /** - * @brief Sets up the message callback to be invoked when IoT Hub issues a - * message to the device. This is a blocking call. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param messageCallback The callback specified by the device for receiving - * messages from IoT Hub. - * @param userContextCallback User specified context that will be provided to the - * callback. This can be @c NULL. - * - * @b NOTE: The application behavior is undefined if the user calls - * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_SetMessageCallback, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC, messageCallback, void*, userContextCallback); - - /** - * @brief Sets up the connection status callback to be invoked representing the status of - * the connection to IOT Hub. This is a blocking call. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param connectionStatusCallback The callback specified by the device for receiving - * updates about the status of the connection to IoT Hub. - * @param userContextCallback User specified context that will be provided to the - * callback. This can be @c NULL. - * - * @b NOTE: The application behavior is undefined if the user calls - * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_SetConnectionStatusCallback, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_CONNECTION_STATUS_CALLBACK, connectionStatusCallback, void*, userContextCallback); - - /** - * @brief Sets up the connection status callback to be invoked representing the status of - * the connection to IOT Hub. This is a blocking call. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param retryPolicy The policy to use to reconnect to IoT Hub when a - * connection drops. - * @param retryTimeoutLimitInSeconds Maximum amount of time(seconds) to attempt reconnection when a - * connection drops to IOT Hub. - * - * @b NOTE: The application behavior is undefined if the user calls - * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_SetRetryPolicy, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY, retryPolicy, size_t, retryTimeoutLimitInSeconds); - - - /** - * @brief Sets up the connection status callback to be invoked representing the status of - * the connection to IOT Hub. This is a blocking call. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param retryPolicy Out parameter containing the policy to use to reconnect to IoT Hub. - * @param retryTimeoutLimitInSeconds Out parameter containing maximum amount of time in seconds to attempt reconnection - to IOT Hub. - * - * @b NOTE: The application behavior is undefined if the user calls - * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_GetRetryPolicy, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY*, retryPolicy, size_t*, retryTimeoutLimitInSeconds); - - /** - * @brief This function returns in the out parameter @p lastMessageReceiveTime - * what was the value of the @c time function when the last message was - * received at the client. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param lastMessageReceiveTime Out parameter containing the value of @c time function - * when the last message was received. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_GetLastMessageReceiveTime, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, time_t*, lastMessageReceiveTime); - - /** - * @brief This function is meant to be called by the user when work - * (sending/receiving) can be done by the IoTHubClient. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * - * All IoTHubClient interactions (in regards to network traffic - * and/or user level callbacks) are the effect of calling this - * function and they take place synchronously inside _DoWork. - */ - MOCKABLE_FUNCTION(, void, IoTHubDeviceClient_LL_DoWork, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle); - - /** - * @brief This API sets a runtime option identified by parameter @p optionName - * to a value pointed to by @p value. @p optionName and the data type - * @p value is pointing to are specific for every option. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param optionName Name of the option. - * @param value The value. - * - * The options that can be set via this API are: - * - @b timeout - the maximum time in milliseconds a communication is - * allowed to use. @p value is a pointer to an @c unsigned @c int with - * the timeout value in milliseconds. This is only supported for the HTTP - * protocol as of now. When the HTTP protocol uses CURL, the meaning of - * the parameter is total request time. When the HTTP protocol uses - * winhttp, the meaning is the same as the @c dwSendTimeout and - * @c dwReceiveTimeout parameters of the - * - * WinHttpSetTimeouts API. - * - @b CURLOPT_LOW_SPEED_LIMIT - only available for HTTP protocol and only - * when CURL is used. It has the same meaning as CURL's option with the same - * name. @p value is pointer to a long. - * - @b CURLOPT_LOW_SPEED_TIME - only available for HTTP protocol and only - * when CURL is used. It has the same meaning as CURL's option with the same - * name. @p value is pointer to a long. - * - @b CURLOPT_FORBID_REUSE - only available for HTTP protocol and only - * when CURL is used. It has the same meaning as CURL's option with the same - * name. @p value is pointer to a long. - * - @b CURLOPT_FRESH_CONNECT - only available for HTTP protocol and only - * when CURL is used. It has the same meaning as CURL's option with the same - * name. @p value is pointer to a long. - * - @b CURLOPT_VERBOSE - only available for HTTP protocol and only - * when CURL is used. It has the same meaning as CURL's option with the same - * name. @p value is pointer to a long. - * - @b keepalive - available for MQTT protocol. Integer value that sets the - * interval in seconds when pings are sent to the server. - * - @b logtrace - available for MQTT protocol. Boolean value that turns on and - * off the diagnostic logging. - * - @b sas_token_lifetime - available for MQTT & AMQP protocol. size_t value that that determines the - * sas token timeout length. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_SetOption, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, const char*, optionName, const void*, value); - - /** - * @brief This API specifies a call back to be used when the device receives a desired state update. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param deviceTwinCallback The callback specified by the device client to be used for updating - * the desired state. The callback will be called in response to patch - * request send by the IoTHub services. The payload will be passed to the - * callback, along with two version numbers: - * - Desired: - * - LastSeenReported: - * @param userContextCallback User specified context that will be provided to the - * callback. This can be @c NULL. - * - * @b NOTE: The application behavior is undefined if the user calls - * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_SetDeviceTwinCallback, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_DEVICE_TWIN_CALLBACK, deviceTwinCallback, void*, userContextCallback); - - /** - * @brief This API sneds a report of the device's properties and their current values. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param reportedState The current device property values to be 'reported' to the IoTHub. - * @param reportedStateCallback The callback specified by the device client to be called with the - * result of the transaction. - * @param userContextCallback User specified context that will be provided to the - * callback. This can be @c NULL. - * - * @b NOTE: The application behavior is undefined if the user calls - * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_SendReportedState, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, const unsigned char*, reportedState, size_t, size, IOTHUB_CLIENT_REPORTED_STATE_CALLBACK, reportedStateCallback, void*, userContextCallback); - /** - * @brief This API sets callback for async cloud to device method call. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param inboundDeviceMethodCallback The callback which will be called by IoTHub. - * @param userContextCallback User specified context that will be provided to the - * callback. This can be @c NULL. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_SetDeviceMethodCallback, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_DEVICE_METHOD_CALLBACK_ASYNC, deviceMethodCallback, void*, userContextCallback); - - /** - * @brief This API responses to a asnyc method callback identified the methodId. - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param methodId The methodId of the Device Method callback. - * @param response The response data for the method callback. - * @param response_size The size of the response data buffer. - * @param status_response The status response of the method callback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_DeviceMethodResponse, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, METHOD_HANDLE, methodId, const unsigned char*, response, size_t, respSize, int, statusCode); - -#ifndef DONT_USE_UPLOADTOBLOB - /** - * @brief This API uploads to Azure Storage the content pointed to by @p source having the size @p size - * under the blob name devicename/@pdestinationFileName - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param destinationFileName name of the file. - * @param source pointer to the source for file content (can be NULL) - * @param size the size of the source in memory (if @p source is NULL then size needs to be 0). - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_UploadToBlob, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, const char*, destinationFileName, const unsigned char*, source, size_t, size); - - /** - * @brief This API uploads to Azure Storage the content provided block by block by @p getDataCallback - * under the blob name devicename/@pdestinationFileName - * - * @param iotHubClientHandle The handle created by a call to the create function. - * @param destinationFileName name of the file. - * @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. - * @param context Any data provided by the user to serve as context on getDataCallback. - * - * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. - */ - MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_UploadMultipleBlocksToBlob, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, const char*, destinationFileName, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX, getDataCallbackEx, void*, context); - -#endif /*DONT_USE_UPLOADTOBLOB*/ - -#ifdef __cplusplus -} -#endif - -#endif /* IOTHUB_DEVICE_CLIENT_LL_H */ diff --git a/third_party/azure_iot-1.2.5/version.txt b/third_party/azure_iot-1.2.5/version.txt deleted file mode 100644 index 3a1f10ea..00000000 --- a/third_party/azure_iot-1.2.5/version.txt +++ /dev/null @@ -1 +0,0 @@ -1.2.5 \ No newline at end of file diff --git a/third_party/azure_iot-1.2.5/LICENSE b/third_party/azure_iot-1.2.8/LICENSE similarity index 100% rename from third_party/azure_iot-1.2.5/LICENSE rename to third_party/azure_iot-1.2.8/LICENSE diff --git a/third_party/azure_iot-1.2.5/c-utility/LICENSE b/third_party/azure_iot-1.2.8/c-utility/LICENSE similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/LICENSE rename to third_party/azure_iot-1.2.8/c-utility/LICENSE diff --git a/third_party/azure_iot-1.2.5/c-utility/README.md b/third_party/azure_iot-1.2.8/c-utility/README.md similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/README.md rename to third_party/azure_iot-1.2.8/c-utility/README.md diff --git a/third_party/azure_iot-1.2.5/c-utility/adapters/README.md b/third_party/azure_iot-1.2.8/c-utility/adapters/README.md similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/adapters/README.md rename to third_party/azure_iot-1.2.8/c-utility/adapters/README.md diff --git a/third_party/azure_iot-1.2.5/c-utility/adapters/agenttime.c b/third_party/azure_iot-1.2.8/c-utility/adapters/agenttime.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/adapters/agenttime.c rename to third_party/azure_iot-1.2.8/c-utility/adapters/agenttime.c diff --git a/third_party/azure_iot-1.2.5/c-utility/adapters/httpapi_compact.c b/third_party/azure_iot-1.2.8/c-utility/adapters/httpapi_compact.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/adapters/httpapi_compact.c rename to third_party/azure_iot-1.2.8/c-utility/adapters/httpapi_compact.c diff --git a/third_party/azure_iot-1.2.5/c-utility/adapters/platform_msdk.c b/third_party/azure_iot-1.2.8/c-utility/adapters/platform_msdk.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/adapters/platform_msdk.c rename to third_party/azure_iot-1.2.8/c-utility/adapters/platform_msdk.c diff --git a/third_party/azure_iot-1.2.5/c-utility/adapters/socketio_berkeley.c b/third_party/azure_iot-1.2.8/c-utility/adapters/socketio_berkeley.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/adapters/socketio_berkeley.c rename to third_party/azure_iot-1.2.8/c-utility/adapters/socketio_berkeley.c diff --git a/third_party/azure_iot-1.2.5/c-utility/adapters/tlsio_mbedtls.c b/third_party/azure_iot-1.2.8/c-utility/adapters/tlsio_mbedtls.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/adapters/tlsio_mbedtls.c rename to third_party/azure_iot-1.2.8/c-utility/adapters/tlsio_mbedtls.c diff --git a/third_party/azure_iot-1.2.5/c-utility/adapters/uniqueid_stub.c b/third_party/azure_iot-1.2.8/c-utility/adapters/uniqueid_stub.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/adapters/uniqueid_stub.c rename to third_party/azure_iot-1.2.8/c-utility/adapters/uniqueid_stub.c diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/agenttime.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/agenttime.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/agenttime.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/agenttime.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/base32.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/base32.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/base32.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/base32.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/base64.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/base64.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/base64.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/base64.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/buffer_.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/buffer_.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/buffer_.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/buffer_.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/condition.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/condition.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/condition.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/condition.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/connection_string_parser.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/connection_string_parser.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/connection_string_parser.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/connection_string_parser.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/consolelogger.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/consolelogger.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/consolelogger.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/consolelogger.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/const_defines.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/const_defines.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/const_defines.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/const_defines.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/constbuffer.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/constbuffer.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/constbuffer.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/constbuffer.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/constmap.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/constmap.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/constmap.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/constmap.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/crt_abstractions.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/crt_abstractions.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/crt_abstractions.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/crt_abstractions.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/doublylinkedlist.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/doublylinkedlist.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/doublylinkedlist.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/doublylinkedlist.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/etwlogger.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/etwlogger.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/etwlogger.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/etwlogger.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/etwlogger_driver.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/etwlogger_driver.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/etwlogger_driver.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/etwlogger_driver.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/gballoc.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/gballoc.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/gballoc.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/gballoc.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/gbnetwork.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/gbnetwork.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/gbnetwork.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/gbnetwork.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/hmac.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/hmac.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/hmac.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/hmac.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/hmacsha256.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/hmacsha256.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/hmacsha256.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/hmacsha256.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/http_proxy_io.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/http_proxy_io.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/http_proxy_io.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/http_proxy_io.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/httpapi.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/httpapi.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/httpapi.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/httpapi.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/httpapiex.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/httpapiex.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/httpapiex.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/httpapiex.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/httpapiexsas.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/httpapiexsas.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/httpapiexsas.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/httpapiexsas.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/httpheaders.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/httpheaders.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/httpheaders.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/httpheaders.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/lock.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/lock.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/lock.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/lock.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/macro_utils.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/macro_utils.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/macro_utils.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/macro_utils.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/map.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/map.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/map.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/map.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/optimize_size.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/optimize_size.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/optimize_size.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/optimize_size.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/optionhandler.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/optionhandler.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/optionhandler.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/optionhandler.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/platform.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/platform.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/platform.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/platform.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/refcount.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/refcount.h similarity index 94% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/refcount.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/refcount.h index 7fbaac31..3a51e471 100644 --- a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/refcount.h +++ b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/refcount.h @@ -48,14 +48,14 @@ C2(REFCOUNT_, type) REFCOUNT_TYPE(type) \ { \ type counted; \ - COUNT_TYPE count; \ + COUNT_TYPE count; \ }; \ static type* REFCOUNT_TYPE_DECLARE_CREATE(type) (void) \ { \ REFCOUNT_TYPE(type)* result = (REFCOUNT_TYPE(type)*)malloc(sizeof(REFCOUNT_TYPE(type))); \ if (result != NULL) \ { \ - result->count = 1; \ + INIT_REF(type, result); \ } \ return (type*)result; \ } \ @@ -69,6 +69,9 @@ static type* REFCOUNT_TYPE_DECLARE_CREATE(type) (void) #ifndef DEC_REF #error refcount_os.h does not define DEC_REF #endif // !DEC_REF +#ifndef INIT_REF +#error refcount_os.h does not define INIT_REF +#endif // !INIT_REF #ifdef __cplusplus } diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/sastoken.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/sastoken.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/sastoken.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/sastoken.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/sha-private.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/sha-private.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/sha-private.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/sha-private.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/sha.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/sha.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/sha.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/sha.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/shared_util_options.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/shared_util_options.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/shared_util_options.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/shared_util_options.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/singlylinkedlist.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/singlylinkedlist.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/singlylinkedlist.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/singlylinkedlist.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/socketio.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/socketio.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/socketio.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/socketio.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/stdint_ce6.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/stdint_ce6.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/stdint_ce6.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/stdint_ce6.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/string_tokenizer.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/string_tokenizer.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/string_tokenizer.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/string_tokenizer.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/string_tokenizer_types.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/string_tokenizer_types.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/string_tokenizer_types.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/string_tokenizer_types.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/strings.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/strings.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/strings.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/strings.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/strings_types.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/strings_types.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/strings_types.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/strings_types.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/threadapi.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/threadapi.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/threadapi.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/threadapi.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/tickcounter.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/tickcounter.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/tickcounter.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/tickcounter.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/tlsio.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/tlsio.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/tlsio.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/tlsio.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/tlsio_mbedtls.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/tlsio_mbedtls.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/tlsio_mbedtls.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/tlsio_mbedtls.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/tlsio_options.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/tlsio_options.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/tlsio_options.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/tlsio_options.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/umock_c_prod.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/umock_c_prod.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/umock_c_prod.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/umock_c_prod.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/uniqueid.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/uniqueid.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/uniqueid.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/uniqueid.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/urlencode.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/urlencode.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/urlencode.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/urlencode.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/uuid.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/uuid.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/uuid.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/uuid.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/uws_client.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/uws_client.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/uws_client.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/uws_client.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/uws_frame_encoder.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/uws_frame_encoder.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/uws_frame_encoder.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/uws_frame_encoder.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/vector.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/vector.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/vector.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/vector.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/vector_types.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/vector_types.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/vector_types.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/vector_types.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/vector_types_internal.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/vector_types_internal.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/vector_types_internal.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/vector_types_internal.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/wsio.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/wsio.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/wsio.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/wsio.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/xio.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/xio.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/xio.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/xio.h diff --git a/third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/xlogging.h b/third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/xlogging.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/inc/azure_c_shared_utility/xlogging.h rename to third_party/azure_iot-1.2.8/c-utility/inc/azure_c_shared_utility/xlogging.h diff --git a/third_party/azure_iot-1.2.5/c-utility/pal/README.md b/third_party/azure_iot-1.2.8/c-utility/pal/README.md similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/pal/README.md rename to third_party/azure_iot-1.2.8/c-utility/pal/README.md diff --git a/third_party/azure_iot-1.2.5/c-utility/pal/dns_async.c b/third_party/azure_iot-1.2.8/c-utility/pal/dns_async.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/pal/dns_async.c rename to third_party/azure_iot-1.2.8/c-utility/pal/dns_async.c diff --git a/third_party/azure_iot-1.2.5/c-utility/pal/freertos/lock.c b/third_party/azure_iot-1.2.8/c-utility/pal/freertos/lock.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/pal/freertos/lock.c rename to third_party/azure_iot-1.2.8/c-utility/pal/freertos/lock.c diff --git a/third_party/azure_iot-1.2.5/c-utility/pal/freertos/threadapi.c b/third_party/azure_iot-1.2.8/c-utility/pal/freertos/threadapi.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/pal/freertos/threadapi.c rename to third_party/azure_iot-1.2.8/c-utility/pal/freertos/threadapi.c diff --git a/third_party/azure_iot-1.2.5/c-utility/pal/freertos/tickcounter.c b/third_party/azure_iot-1.2.8/c-utility/pal/freertos/tickcounter.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/pal/freertos/tickcounter.c rename to third_party/azure_iot-1.2.8/c-utility/pal/freertos/tickcounter.c diff --git a/third_party/azure_iot-1.2.5/c-utility/pal/generic/refcount_os.h b/third_party/azure_iot-1.2.8/c-utility/pal/generic/refcount_os.h similarity index 88% rename from third_party/azure_iot-1.2.5/c-utility/pal/generic/refcount_os.h rename to third_party/azure_iot-1.2.8/c-utility/pal/generic/refcount_os.h index 4bc257d3..0d814dca 100644 --- a/third_party/azure_iot-1.2.5/c-utility/pal/generic/refcount_os.h +++ b/third_party/azure_iot-1.2.8/c-utility/pal/generic/refcount_os.h @@ -15,5 +15,6 @@ #define DEC_RETURN_ZERO (0) #define INC_REF(type, var) ++((((REFCOUNT_TYPE(type)*)var)->count)) #define DEC_REF(type, var) --((((REFCOUNT_TYPE(type)*)var)->count)) +#define INIT_REF(type, var) do { ((REFCOUNT_TYPE(type)*)var)->count = 1; } while((void)0,0) #endif // REFCOUNT_OS_H__GENERIC diff --git a/third_party/azure_iot-1.2.5/c-utility/pal/inc/dns_async.h b/third_party/azure_iot-1.2.8/c-utility/pal/inc/dns_async.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/pal/inc/dns_async.h rename to third_party/azure_iot-1.2.8/c-utility/pal/inc/dns_async.h diff --git a/third_party/azure_iot-1.2.5/c-utility/pal/inc/sntp.h b/third_party/azure_iot-1.2.8/c-utility/pal/inc/sntp.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/pal/inc/sntp.h rename to third_party/azure_iot-1.2.8/c-utility/pal/inc/sntp.h diff --git a/third_party/azure_iot-1.2.5/c-utility/pal/inc/socket_async.h b/third_party/azure_iot-1.2.8/c-utility/pal/inc/socket_async.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/pal/inc/socket_async.h rename to third_party/azure_iot-1.2.8/c-utility/pal/inc/socket_async.h diff --git a/third_party/azure_iot-1.2.5/c-utility/pal/lwip/sntp_lwip.c b/third_party/azure_iot-1.2.8/c-utility/pal/lwip/sntp_lwip.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/pal/lwip/sntp_lwip.c rename to third_party/azure_iot-1.2.8/c-utility/pal/lwip/sntp_lwip.c diff --git a/third_party/azure_iot-1.2.5/c-utility/pal/lwip/sntp_os.h b/third_party/azure_iot-1.2.8/c-utility/pal/lwip/sntp_os.h similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/pal/lwip/sntp_os.h rename to third_party/azure_iot-1.2.8/c-utility/pal/lwip/sntp_os.h diff --git a/third_party/azure_iot-1.2.5/c-utility/pal/socket_async.c b/third_party/azure_iot-1.2.8/c-utility/pal/socket_async.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/pal/socket_async.c rename to third_party/azure_iot-1.2.8/c-utility/pal/socket_async.c diff --git a/third_party/azure_iot-1.2.5/c-utility/pal/tickcounter.c b/third_party/azure_iot-1.2.8/c-utility/pal/tickcounter.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/pal/tickcounter.c rename to third_party/azure_iot-1.2.8/c-utility/pal/tickcounter.c diff --git a/third_party/azure_iot-1.2.5/c-utility/pal/tlsio_options.c b/third_party/azure_iot-1.2.8/c-utility/pal/tlsio_options.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/pal/tlsio_options.c rename to third_party/azure_iot-1.2.8/c-utility/pal/tlsio_options.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/README.md b/third_party/azure_iot-1.2.8/c-utility/src/README.md similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/README.md rename to third_party/azure_iot-1.2.8/c-utility/src/README.md diff --git a/third_party/azure_iot-1.2.5/c-utility/src/base32.c b/third_party/azure_iot-1.2.8/c-utility/src/base32.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/base32.c rename to third_party/azure_iot-1.2.8/c-utility/src/base32.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/base64_azure.c b/third_party/azure_iot-1.2.8/c-utility/src/base64_azure.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/base64_azure.c rename to third_party/azure_iot-1.2.8/c-utility/src/base64_azure.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/buffer.c b/third_party/azure_iot-1.2.8/c-utility/src/buffer.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/buffer.c rename to third_party/azure_iot-1.2.8/c-utility/src/buffer.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/connection_string_parser.c b/third_party/azure_iot-1.2.8/c-utility/src/connection_string_parser.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/connection_string_parser.c rename to third_party/azure_iot-1.2.8/c-utility/src/connection_string_parser.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/consolelogger.c b/third_party/azure_iot-1.2.8/c-utility/src/consolelogger.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/consolelogger.c rename to third_party/azure_iot-1.2.8/c-utility/src/consolelogger.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/constbuffer.c b/third_party/azure_iot-1.2.8/c-utility/src/constbuffer.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/constbuffer.c rename to third_party/azure_iot-1.2.8/c-utility/src/constbuffer.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/constmap.c b/third_party/azure_iot-1.2.8/c-utility/src/constmap.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/constmap.c rename to third_party/azure_iot-1.2.8/c-utility/src/constmap.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/crt_abstractions.c b/third_party/azure_iot-1.2.8/c-utility/src/crt_abstractions.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/crt_abstractions.c rename to third_party/azure_iot-1.2.8/c-utility/src/crt_abstractions.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/doublylinkedlist.c b/third_party/azure_iot-1.2.8/c-utility/src/doublylinkedlist.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/doublylinkedlist.c rename to third_party/azure_iot-1.2.8/c-utility/src/doublylinkedlist.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/gballoc.c b/third_party/azure_iot-1.2.8/c-utility/src/gballoc.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/gballoc.c rename to third_party/azure_iot-1.2.8/c-utility/src/gballoc.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/hmac_azure.c b/third_party/azure_iot-1.2.8/c-utility/src/hmac_azure.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/hmac_azure.c rename to third_party/azure_iot-1.2.8/c-utility/src/hmac_azure.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/hmacsha256.c b/third_party/azure_iot-1.2.8/c-utility/src/hmacsha256.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/hmacsha256.c rename to third_party/azure_iot-1.2.8/c-utility/src/hmacsha256.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/http_proxy_io.c b/third_party/azure_iot-1.2.8/c-utility/src/http_proxy_io.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/http_proxy_io.c rename to third_party/azure_iot-1.2.8/c-utility/src/http_proxy_io.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/httpapiex.c b/third_party/azure_iot-1.2.8/c-utility/src/httpapiex.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/httpapiex.c rename to third_party/azure_iot-1.2.8/c-utility/src/httpapiex.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/httpapiexsas.c b/third_party/azure_iot-1.2.8/c-utility/src/httpapiexsas.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/httpapiexsas.c rename to third_party/azure_iot-1.2.8/c-utility/src/httpapiexsas.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/httpheaders.c b/third_party/azure_iot-1.2.8/c-utility/src/httpheaders.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/httpheaders.c rename to third_party/azure_iot-1.2.8/c-utility/src/httpheaders.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/map.c b/third_party/azure_iot-1.2.8/c-utility/src/map.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/map.c rename to third_party/azure_iot-1.2.8/c-utility/src/map.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/optionhandler.c b/third_party/azure_iot-1.2.8/c-utility/src/optionhandler.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/optionhandler.c rename to third_party/azure_iot-1.2.8/c-utility/src/optionhandler.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/sastoken.c b/third_party/azure_iot-1.2.8/c-utility/src/sastoken.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/sastoken.c rename to third_party/azure_iot-1.2.8/c-utility/src/sastoken.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/sha1_azure.c b/third_party/azure_iot-1.2.8/c-utility/src/sha1_azure.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/sha1_azure.c rename to third_party/azure_iot-1.2.8/c-utility/src/sha1_azure.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/sha224.c b/third_party/azure_iot-1.2.8/c-utility/src/sha224.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/sha224.c rename to third_party/azure_iot-1.2.8/c-utility/src/sha224.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/sha384-512.c b/third_party/azure_iot-1.2.8/c-utility/src/sha384-512.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/sha384-512.c rename to third_party/azure_iot-1.2.8/c-utility/src/sha384-512.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/singlylinkedlist.c b/third_party/azure_iot-1.2.8/c-utility/src/singlylinkedlist.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/singlylinkedlist.c rename to third_party/azure_iot-1.2.8/c-utility/src/singlylinkedlist.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/string_tokenizer.c b/third_party/azure_iot-1.2.8/c-utility/src/string_tokenizer.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/string_tokenizer.c rename to third_party/azure_iot-1.2.8/c-utility/src/string_tokenizer.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/strings.c b/third_party/azure_iot-1.2.8/c-utility/src/strings.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/strings.c rename to third_party/azure_iot-1.2.8/c-utility/src/strings.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/urlencode.c b/third_party/azure_iot-1.2.8/c-utility/src/urlencode.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/urlencode.c rename to third_party/azure_iot-1.2.8/c-utility/src/urlencode.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/usha.c b/third_party/azure_iot-1.2.8/c-utility/src/usha.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/usha.c rename to third_party/azure_iot-1.2.8/c-utility/src/usha.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/uuid.c b/third_party/azure_iot-1.2.8/c-utility/src/uuid.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/uuid.c rename to third_party/azure_iot-1.2.8/c-utility/src/uuid.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/vector.c b/third_party/azure_iot-1.2.8/c-utility/src/vector.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/vector.c rename to third_party/azure_iot-1.2.8/c-utility/src/vector.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/xio.c b/third_party/azure_iot-1.2.8/c-utility/src/xio.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/xio.c rename to third_party/azure_iot-1.2.8/c-utility/src/xio.c diff --git a/third_party/azure_iot-1.2.5/c-utility/src/xlogging.c b/third_party/azure_iot-1.2.8/c-utility/src/xlogging.c similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/src/xlogging.c rename to third_party/azure_iot-1.2.8/c-utility/src/xlogging.c diff --git a/third_party/azure_iot-1.2.5/c-utility/thirdpartynotice.txt b/third_party/azure_iot-1.2.8/c-utility/thirdpartynotice.txt similarity index 100% rename from third_party/azure_iot-1.2.5/c-utility/thirdpartynotice.txt rename to third_party/azure_iot-1.2.8/c-utility/thirdpartynotice.txt diff --git a/third_party/azure_iot-1.2.5/certs/certs.h b/third_party/azure_iot-1.2.8/certs/certs.h similarity index 100% rename from third_party/azure_iot-1.2.5/certs/certs.h rename to third_party/azure_iot-1.2.8/certs/certs.h diff --git a/third_party/azure_iot-1.2.5/certs/certs_azure.c b/third_party/azure_iot-1.2.8/certs/certs_azure.c similarity index 100% rename from third_party/azure_iot-1.2.5/certs/certs_azure.c rename to third_party/azure_iot-1.2.8/certs/certs_azure.c diff --git a/third_party/azure_iot-1.2.5/certs/certs_azure.h b/third_party/azure_iot-1.2.8/certs/certs_azure.h similarity index 100% rename from third_party/azure_iot-1.2.5/certs/certs_azure.h rename to third_party/azure_iot-1.2.8/certs/certs_azure.h diff --git a/third_party/azure_iot-1.2.5/certs/ms.der b/third_party/azure_iot-1.2.8/certs/ms.der similarity index 100% rename from third_party/azure_iot-1.2.5/certs/ms.der rename to third_party/azure_iot-1.2.8/certs/ms.der diff --git a/third_party/azure_iot-1.2.5/deps/parson/LICENSE b/third_party/azure_iot-1.2.8/deps/parson/LICENSE similarity index 100% rename from third_party/azure_iot-1.2.5/deps/parson/LICENSE rename to third_party/azure_iot-1.2.8/deps/parson/LICENSE diff --git a/third_party/azure_iot-1.2.5/deps/parson/README.md b/third_party/azure_iot-1.2.8/deps/parson/README.md similarity index 100% rename from third_party/azure_iot-1.2.5/deps/parson/README.md rename to third_party/azure_iot-1.2.8/deps/parson/README.md diff --git a/third_party/azure_iot-1.2.5/deps/parson/package.json b/third_party/azure_iot-1.2.8/deps/parson/package.json similarity index 100% rename from third_party/azure_iot-1.2.5/deps/parson/package.json rename to third_party/azure_iot-1.2.8/deps/parson/package.json diff --git a/third_party/azure_iot-1.2.5/deps/parson/parson.c b/third_party/azure_iot-1.2.8/deps/parson/parson.c similarity index 100% rename from third_party/azure_iot-1.2.5/deps/parson/parson.c rename to third_party/azure_iot-1.2.8/deps/parson/parson.c diff --git a/third_party/azure_iot-1.2.5/deps/parson/parson.h b/third_party/azure_iot-1.2.8/deps/parson/parson.h similarity index 100% rename from third_party/azure_iot-1.2.5/deps/parson/parson.h rename to third_party/azure_iot-1.2.8/deps/parson/parson.h diff --git a/third_party/azure_iot-1.2.5/iothub_client/inc/internal/blob.h b/third_party/azure_iot-1.2.8/iothub_client/inc/internal/blob.h similarity index 100% rename from third_party/azure_iot-1.2.5/iothub_client/inc/internal/blob.h rename to third_party/azure_iot-1.2.8/iothub_client/inc/internal/blob.h diff --git a/third_party/azure_iot-1.2.5/iothub_client/inc/internal/iothub_client_authorization.h b/third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothub_client_authorization.h similarity index 86% rename from third_party/azure_iot-1.2.5/iothub_client/inc/internal/iothub_client_authorization.h rename to third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothub_client_authorization.h index b00988c4..d8a9e7fa 100644 --- a/third_party/azure_iot-1.2.5/iothub_client/inc/internal/iothub_client_authorization.h +++ b/third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothub_client_authorization.h @@ -34,17 +34,23 @@ DEFINE_ENUM(IOTHUB_CREDENTIAL_TYPE, IOTHUB_CREDENTIAL_TYPE_VALUES); DEFINE_ENUM(SAS_TOKEN_STATUS, SAS_TOKEN_STATUS_VALUES); -MOCKABLE_FUNCTION(, IOTHUB_AUTHORIZATION_HANDLE, IoTHubClient_Auth_Create, const char*, device_key, const char*, device_id, const char*, device_sas_token); -MOCKABLE_FUNCTION(, IOTHUB_AUTHORIZATION_HANDLE, IoTHubClient_Auth_CreateFromDeviceAuth, const char*, device_id); +MOCKABLE_FUNCTION(, IOTHUB_AUTHORIZATION_HANDLE, IoTHubClient_Auth_Create, const char*, device_key, const char*, device_id, const char*, device_sas_token, const char *, module_id); +MOCKABLE_FUNCTION(, IOTHUB_AUTHORIZATION_HANDLE, IoTHubClient_Auth_CreateFromDeviceAuth, const char*, device_id, const char*, module_id); MOCKABLE_FUNCTION(, void, IoTHubClient_Auth_Destroy, IOTHUB_AUTHORIZATION_HANDLE, handle); MOCKABLE_FUNCTION(, IOTHUB_CREDENTIAL_TYPE, IoTHubClient_Auth_Set_x509_Type, IOTHUB_AUTHORIZATION_HANDLE, handle, bool, enable_x509); MOCKABLE_FUNCTION(, IOTHUB_CREDENTIAL_TYPE, IoTHubClient_Auth_Get_Credential_Type, IOTHUB_AUTHORIZATION_HANDLE, handle); MOCKABLE_FUNCTION(, char*, IoTHubClient_Auth_Get_SasToken, IOTHUB_AUTHORIZATION_HANDLE, handle, const char*, scope, size_t, expiry_time_relative_seconds, const char*, key_name); MOCKABLE_FUNCTION(, int, IoTHubClient_Auth_Set_xio_Certificate, IOTHUB_AUTHORIZATION_HANDLE, handle, XIO_HANDLE, xio); MOCKABLE_FUNCTION(, const char*, IoTHubClient_Auth_Get_DeviceId, IOTHUB_AUTHORIZATION_HANDLE, handle); +MOCKABLE_FUNCTION(, const char*, IoTHubClient_Auth_Get_ModuleId, IOTHUB_AUTHORIZATION_HANDLE, handle); MOCKABLE_FUNCTION(, const char*, IoTHubClient_Auth_Get_DeviceKey, IOTHUB_AUTHORIZATION_HANDLE, handle); MOCKABLE_FUNCTION(, SAS_TOKEN_STATUS, IoTHubClient_Auth_Is_SasToken_Valid, IOTHUB_AUTHORIZATION_HANDLE, handle); +#ifdef USE_EDGE_MODULES +MOCKABLE_FUNCTION(, char*, IoTHubClient_Auth_Get_TrustBundle, IOTHUB_AUTHORIZATION_HANDLE, handle); +#endif + + #ifdef __cplusplus } #endif diff --git a/third_party/azure_iot-1.2.5/iothub_client/inc/internal/iothub_client_diagnostic.h b/third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothub_client_diagnostic.h similarity index 100% rename from third_party/azure_iot-1.2.5/iothub_client/inc/internal/iothub_client_diagnostic.h rename to third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothub_client_diagnostic.h diff --git a/third_party/azure_iot-1.2.5/iothub_client/inc/internal/iothub_client_hsm_ll.h b/third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothub_client_hsm_ll.h similarity index 100% rename from third_party/azure_iot-1.2.5/iothub_client/inc/internal/iothub_client_hsm_ll.h rename to third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothub_client_hsm_ll.h diff --git a/third_party/azure_iot-1.2.5/iothub_client/inc/internal/iothub_client_ll_uploadtoblob.h b/third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothub_client_ll_uploadtoblob.h similarity index 100% rename from third_party/azure_iot-1.2.5/iothub_client/inc/internal/iothub_client_ll_uploadtoblob.h rename to third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothub_client_ll_uploadtoblob.h diff --git a/third_party/azure_iot-1.2.5/iothub_client/inc/internal/iothub_client_private.h b/third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothub_client_private.h similarity index 78% rename from third_party/azure_iot-1.2.5/iothub_client/inc/internal/iothub_client_private.h rename to third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothub_client_private.h index 9907d521..10ae5274 100644 --- a/third_party/azure_iot-1.2.5/iothub_client/inc/internal/iothub_client_private.h +++ b/third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothub_client_private.h @@ -19,6 +19,10 @@ #include "internal/iothub_transport_ll_private.h" #include "internal/iothubtransport.h" +#ifdef USE_EDGE_MODULES +#include "internal/iothub_client_edge.h" +#endif + #ifdef __cplusplus extern "C" { @@ -46,6 +50,14 @@ MOCKABLE_FUNCTION(, void, IoTHubClientCore_LL_ConnectionStatusCallBack, IOTHUB_C MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_LL_SetMessageCallback_Ex, IOTHUB_CLIENT_CORE_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC_EX, messageCallback, void*, userContextCallback); MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_LL_SendMessageDisposition, IOTHUB_CLIENT_CORE_LL_HANDLE, iotHubClientHandle, MESSAGE_CALLBACK_INFO*, messageData, IOTHUBMESSAGE_DISPOSITION_RESULT, disposition); MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_LL_GetOption, IOTHUB_CLIENT_CORE_LL_HANDLE, iotHubClientHandle, const char*, optionName, void**, value); +MOCKABLE_FUNCTION(, bool, IoTHubClientCore_LL_MessageCallbackFromInput, IOTHUB_CLIENT_CORE_LL_HANDLE, handle, MESSAGE_CALLBACK_INFO*, message_data); +MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_LL_SetInputMessageCallbackEx, IOTHUB_CLIENT_CORE_LL_HANDLE, iotHubClientHandle, const char*, inputName, IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC_EX, eventHandlerCallbackEx, void *, userContextCallback, size_t, userContextCallbackLength); + +#ifdef USE_EDGE_MODULES +/* (Should be replaced after iothub_client refactor)*/ +MOCKABLE_FUNCTION(, IOTHUB_CLIENT_EDGE_HANDLE, IoTHubClientCore_LL_GetEdgeHandle, IOTHUB_CLIENT_CORE_LL_HANDLE, iotHubClientHandle); +MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_LL_GenericMethodInvoke, IOTHUB_CLIENT_CORE_LL_HANDLE, iotHubClientHandle, const char*, deviceId, const char*, moduleId, const char*, methodName, const char*, methodPayload, unsigned int, timeout, int*, responseStatus, unsigned char**, responsePayload, size_t*, responsePayloadSize); +#endif typedef struct IOTHUB_MESSAGE_LIST_TAG { diff --git a/third_party/azure_iot-1.2.5/iothub_client/inc/internal/iothub_client_retry_control.h b/third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothub_client_retry_control.h similarity index 100% rename from third_party/azure_iot-1.2.5/iothub_client/inc/internal/iothub_client_retry_control.h rename to third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothub_client_retry_control.h diff --git a/third_party/azure_iot-1.2.5/iothub_client/inc/internal/iothub_transport_ll_private.h b/third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothub_transport_ll_private.h similarity index 90% rename from third_party/azure_iot-1.2.5/iothub_client/inc/internal/iothub_transport_ll_private.h rename to third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothub_transport_ll_private.h index afe57794..6c53eb96 100644 --- a/third_party/azure_iot-1.2.5/iothub_client/inc/internal/iothub_transport_ll_private.h +++ b/third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothub_transport_ll_private.h @@ -44,6 +44,9 @@ extern "C" const char* deviceSasToken; IOTHUB_AUTHORIZATION_HANDLE authorization_module; // with either SAS Token, x509 Certs, and Device SAS Token + + /** @brief A string that identifies the module. Optional. */ + const char* moduleId; } IOTHUB_DEVICE_CONFIG; typedef STRING_HANDLE (*pfIoTHubTransport_GetHostname)(TRANSPORT_LL_HANDLE handle); @@ -64,6 +67,8 @@ extern "C" typedef int(*pfIoTHubTransport_Subscribe_DeviceMethod)(IOTHUB_DEVICE_HANDLE handle); typedef void(*pfIoTHubTransport_Unsubscribe_DeviceMethod)(IOTHUB_DEVICE_HANDLE handle); typedef int(*pfIoTHubTransport_DeviceMethod_Response)(IOTHUB_DEVICE_HANDLE handle, METHOD_HANDLE methodId, const unsigned char* response, size_t response_size, int status_response); + typedef int(*pfIoTHubTransport_Subscribe_InputQueue)(IOTHUB_DEVICE_HANDLE handle); + typedef void(*pfIoTHubTransport_Unsubscribe_InputQueue)(IOTHUB_DEVICE_HANDLE handle); #define TRANSPORT_PROVIDER_FIELDS \ pfIotHubTransport_SendMessageDisposition IoTHubTransport_SendMessageDisposition; \ @@ -83,7 +88,9 @@ pfIoTHubTransport_Subscribe IoTHubTransport_Subscribe; pfIoTHubTransport_Unsubscribe IoTHubTransport_Unsubscribe; \ pfIoTHubTransport_DoWork IoTHubTransport_DoWork; \ pfIoTHubTransport_SetRetryPolicy IoTHubTransport_SetRetryPolicy; \ -pfIoTHubTransport_GetSendStatus IoTHubTransport_GetSendStatus /*there's an intentional missing ; on this line*/ +pfIoTHubTransport_GetSendStatus IoTHubTransport_GetSendStatus; \ +pfIoTHubTransport_Subscribe_InputQueue IoTHubTransport_Subscribe_InputQueue; \ +pfIoTHubTransport_Unsubscribe_InputQueue IoTHubTransport_Unsubscribe_InputQueue /*there's an intentional missing ; on this line*/ struct TRANSPORT_PROVIDER_TAG { diff --git a/third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothubtransport.h b/third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothubtransport.h new file mode 100644 index 00000000..b2cd8a26 --- /dev/null +++ b/third_party/azure_iot-1.2.8/iothub_client/inc/internal/iothubtransport.h @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#ifndef IOTHUB_TRANSPORT_H +#define IOTHUB_TRANSPORT_H + +#include "azure_c_shared_utility/lock.h" +#include "azure_c_shared_utility/crt_abstractions.h" +#include "iothub_transport_ll.h" +#include "iothub_client_core.h" +#include "internal/iothub_client_private.h" +#include "internal/iothub_transport_ll_private.h" +#include "iothub_client_authorization.h" + +#ifndef IOTHUB_CLIENT_CORE_INSTANCE_TYPE +typedef struct IOTHUB_CLIENT_CORE_INSTANCE_TAG* IOTHUB_CLIENT_CORE_HANDLE; +#define IOTHUB_CLIENT_CORE_INSTANCE_TYPE +#endif // IOTHUB_CLIENT_CORE_INSTANCE + +#ifdef __cplusplus +extern "C" +{ +#else +#includeHostName=[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];- *
+ *+ * + * @return A non-NULL @c IOTHUB_DEVICE_CLIENT_HANDLE value that is used when + * invoking other functions for IoT Hub client and @c NULL on failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_DEVICE_CLIENT_HANDLE, IoTHubDeviceClient_CreateFromConnectionString, const char*, connectionString, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol); + + /** + * @brief Creates a IoT Hub client for communication with an existing IoT + * Hub using the specified parameters. + * + * @param config Pointer to an @c IOTHUB_CLIENT_CONFIG structure + * + * The API does not allow sharing of a connection across multiple + * devices. This is a blocking call. + * + * @return A non-NULL @c IOTHUB_DEVICE_CLIENT_HANDLE value that is used when + * invoking other functions for IoT Hub client and @c NULL on failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_DEVICE_CLIENT_HANDLE, IoTHubDeviceClient_Create, const IOTHUB_CLIENT_CONFIG*, config); + + /** + * @brief Creates a IoT Hub client for communication with an existing IoT + * Hub using the specified parameters. + * + * @param transportHandle TRANSPORT_HANDLE which represents a connection. + * @param config Pointer to an @c IOTHUB_CLIENT_CONFIG structure + * + * The API allows sharing of a connection across multiple + * devices. This is a blocking call. + * + * @return A non-NULL @c IOTHUB_DEVICE_CLIENT_HANDLE value that is used when + * invoking other functions for IoT Hub client and @c NULL on failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_DEVICE_CLIENT_HANDLE, IoTHubDeviceClient_CreateWithTransport, TRANSPORT_HANDLE, transportHandle, const IOTHUB_CLIENT_CONFIG*, config); + + /** + * @brief Creates a IoT Hub client for communication with an existing IoT + * Hub using the device auth module. + * + * @param iothub_uri Pointer to an ioThub hostname received in the registration process + * @param device_id Pointer to the device Id of the device + * @param protocol Function pointer for protocol implementation + * + * @return A non-NULL @c IOTHUB_DEVICE_CLIENT_HANDLE value that is used when + * invoking other functions for IoT Hub client and @c NULL on failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_DEVICE_CLIENT_HANDLE, IoTHubDeviceClient_CreateFromDeviceAuth, const char*, iothub_uri, const char*, device_id, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol); + + /** + * @brief Disposes of resources allocated by the IoT Hub client. This is a + * blocking call. + * + * @param iotHubClientHandle The handle created by a call to the create function. + */ + MOCKABLE_FUNCTION(, void, IoTHubDeviceClient_Destroy, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle); + + /** + * @brief Asynchronous call to send the message specified by @p eventMessageHandle. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param eventMessageHandle The handle to an IoT Hub message. + * @param eventConfirmationCallback The callback specified by the device for receiving + * confirmation of the delivery of the IoT Hub message. + * This callback can be expected to invoke the + * ::IoTHubDeviceClient_SendEventAsync function for the + * same message in an attempt to retry sending a failing + * message. The user can specify a @c NULL value here to + * indicate that no callback is required. + * @param userContextCallback User specified context that will be provided to the + * callback. This can be @c NULL. + * + * @b NOTE: The application behavior is undefined if the user calls + * the ::IoTHubDeviceClient_Destroy function from within any callback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_SendEventAsync, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_MESSAGE_HANDLE, eventMessageHandle, IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK, eventConfirmationCallback, void*, userContextCallback); + + /** + * @brief This function returns the current sending status for IoTHubClient. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param iotHubClientStatus The sending state is populated at the address pointed + * at by this parameter. The value will be set to + * @c IOTHUBCLIENT_SENDSTATUS_IDLE if there is currently + * no item to be sent and @c IOTHUBCLIENT_SENDSTATUS_BUSY + * if there are. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_GetSendStatus, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_STATUS*, iotHubClientStatus); + + /** + * @brief Sets up the message callback to be invoked when IoT Hub issues a + * message to the device. This is a blocking call. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param messageCallback The callback specified by the device for receiving + * messages from IoT Hub. + * @param userContextCallback User specified context that will be provided to the + * callback. This can be @c NULL. + * + * @b NOTE: The application behavior is undefined if the user calls + * the ::IoTHubDeviceClient_Destroy function from within any callback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_SetMessageCallback, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC, messageCallback, void*, userContextCallback); + + /** + * @brief Sets up the connection status callback to be invoked representing the status of + * the connection to IOT Hub. This is a blocking call. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param connectionStatusCallback The callback specified by the device for receiving + * updates about the status of the connection to IoT Hub. + * @param userContextCallback User specified context that will be provided to the + * callback. This can be @c NULL. + * + * @b NOTE: The application behavior is undefined if the user calls + * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_SetConnectionStatusCallback, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_CONNECTION_STATUS_CALLBACK, connectionStatusCallback, void*, userContextCallback); + + /** + * @brief Sets up the connection status callback to be invoked representing the status of + * the connection to IOT Hub. This is a blocking call. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param retryPolicy The policy to use to reconnect to IoT Hub when a + * connection drops. + * @param retryTimeoutLimitInSeconds Maximum amount of time(seconds) to attempt reconnection when a + * connection drops to IOT Hub. + * + * @b NOTE: The application behavior is undefined if the user calls + * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_SetRetryPolicy, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY, retryPolicy, size_t, retryTimeoutLimitInSeconds); + + /** + * @brief Sets up the connection status callback to be invoked representing the status of + * the connection to IOT Hub. This is a blocking call. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param retryPolicy Out parameter containing the policy to use to reconnect to IoT Hub. + * @param retryTimeoutLimitInSeconds Out parameter containing maximum amount of time in seconds to attempt reconnection + * to IOT Hub. + * + * @b NOTE: The application behavior is undefined if the user calls + * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_GetRetryPolicy, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY*, retryPolicy, size_t*, retryTimeoutLimitInSeconds); + + /** + * @brief This function returns in the out parameter @p lastMessageReceiveTime + * what was the value of the @c time function when the last message was + * received at the client. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param lastMessageReceiveTime Out parameter containing the value of @c time function + * when the last message was received. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_GetLastMessageReceiveTime, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, time_t*, lastMessageReceiveTime); + + /** + * @brief This API sets a runtime option identified by parameter @p optionName + * to a value pointed to by @p value. @p optionName and the data type + * @p value is pointing to are specific for every option. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param optionName Name of the option. + * @param value The value. + * + * The options that can be set via this API are: + * - @b timeout - the maximum time in milliseconds a communication is + * allowed to use. @p value is a pointer to an @c unsigned @c int with + * the timeout value in milliseconds. This is only supported for the HTTP + * protocol as of now. When the HTTP protocol uses CURL, the meaning of + * the parameter is total request time. When the HTTP protocol uses + * winhttp, the meaning is the same as the @c dwSendTimeout and + * @c dwReceiveTimeout parameters of the + * + * WinHttpSetTimeouts API. + * - @b CURLOPT_LOW_SPEED_LIMIT - only available for HTTP protocol and only + * when CURL is used. It has the same meaning as CURL's option with the same + * name. @p value is pointer to a long. + * - @b CURLOPT_LOW_SPEED_TIME - only available for HTTP protocol and only + * when CURL is used. It has the same meaning as CURL's option with the same + * name. @p value is pointer to a long. + * - @b CURLOPT_FORBID_REUSE - only available for HTTP protocol and only + * when CURL is used. It has the same meaning as CURL's option with the same + * name. @p value is pointer to a long. + * - @b CURLOPT_FRESH_CONNECT - only available for HTTP protocol and only + * when CURL is used. It has the same meaning as CURL's option with the same + * name. @p value is pointer to a long. + * - @b CURLOPT_VERBOSE - only available for HTTP protocol and only + * when CURL is used. It has the same meaning as CURL's option with the same + * name. @p value is pointer to a long. + * - @b messageTimeout - the maximum time in milliseconds until a message + * is timeouted. The time starts at IoTHubDeviceClient_SendEventAsync. By default, + * messages do not expire. @p is a pointer to a uint64_t + * - @b svc2cl_keep_alive_timeout_secs - the AMQP service side keep alive interval in seconds. + * After the connection established the client requests the server to set the + * keep alive interval for given time. + * If it is not set then the default 240 sec applies. + * If it is set to zero the server will not send keep alive messages to the client. + * - @b cl2svc_keep_alive_send_ratio - the AMQP client side keep alive interval in seconds. + * After the connection established the server requests the client to set the + * keep alive interval for given time. + * If it is not set then the default ratio of 1/2 is applied. + * The ratio has to be greater than 0.0 and equal to or less than 0.9 + + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_SetOption, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, const char*, optionName, const void*, value); + + /** + * @brief This API specifies a call back to be used when the device receives a state update. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param deviceTwinCallback The callback specified by the device client to be used for updating + * the desired state. The callback will be called in response to a + * request send by the IoTHub services. The payload will be passed to the + * callback, along with two version numbers: + * - Desired: + * - LastSeenReported: + * @param userContextCallback User specified context that will be provided to the + * callback. This can be @c NULL. + * + * @b NOTE: The application behavior is undefined if the user calls + * the ::IoTHubDeviceClient_Destroy function from within any callback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_SetDeviceTwinCallback, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_DEVICE_TWIN_CALLBACK, deviceTwinCallback, void*, userContextCallback); + + /** + * @brief This API sends a report of the device's properties and their current values. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param reportedState The current device property values to be 'reported' to the IoTHub. + * @param reportedStateCallback The callback specified by the device client to be called with the + * result of the transaction. + * @param userContextCallback User specified context that will be provided to the + * callback. This can be @c NULL. + * + * @b NOTE: The application behavior is undefined if the user calls + * the ::IoTHubDeviceClient_Destroy function from within any callback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_SendReportedState, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, const unsigned char*, reportedState, size_t, size, IOTHUB_CLIENT_REPORTED_STATE_CALLBACK, reportedStateCallback, void*, userContextCallback); + + /** + * @brief This API sets callback for async cloud to device method call. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param inboundDeviceMethodCallback The callback which will be called by IoTHub. + * @param userContextCallback User specified context that will be provided to the + * callback. This can be @c NULL. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_SetDeviceMethodCallback, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_DEVICE_METHOD_CALLBACK_ASYNC, deviceMethodCallback, void*, userContextCallback); + + /** + * @brief This API responses to a asnyc method callback identified the methodId. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param methodId The methodId of the Device Method callback. + * @param response The response data for the method callback. + * @param response_size The size of the response data buffer. + * @param status_response The status response of the method callback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_DeviceMethodResponse, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, METHOD_HANDLE, methodId, const unsigned char*, response, size_t, response_size, int, statusCode); + +#ifndef DONT_USE_UPLOADTOBLOB + /** + * @brief IoTHubDeviceClient_UploadToBlobAsync uploads data from memory to a file in Azure Blob Storage. + * + * @param iotHubClientHandle The handle created by a call to the IoTHubDeviceClient_Create function. + * @param destinationFileName The name of the file to be created in Azure Blob Storage. + * @param source The source of data. + * @param size The size of data. + * @param iotHubClientFileUploadCallback A callback to be invoked when the file upload operation has finished. + * @param context A user-provided context to be passed to the file upload callback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_UploadToBlobAsync, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, const char*, destinationFileName, const unsigned char*, source, size_t, size, IOTHUB_CLIENT_FILE_UPLOAD_CALLBACK, iotHubClientFileUploadCallback, void*, context); + + /** + * @brief Uploads a file to a Blob storage in chunks, fed through the callback function provided by the user. + * @remarks This function allows users to upload large files in chunks, not requiring the whole file content to be passed in memory. + * @param iotHubClientHandle The handle created by a call to the IoTHubDeviceClient_Create function. + * @param destinationFileName The name of the file to be created in Azure Blob Storage. + * @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. + * @param context Any data provided by the user to serve as context on getDataCallback. + * @returns An IOTHUB_CLIENT_RESULT value indicating the success or failure of the API call. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_UploadMultipleBlocksToBlobAsync, IOTHUB_DEVICE_CLIENT_HANDLE, iotHubClientHandle, const char*, destinationFileName, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX, getDataCallbackEx, void*, context); + +#endif /* DONT_USE_UPLOADTOBLOB */ + +#ifdef __cplusplus +} +#endif + +#endif /* IOTHUB_DEVICE_CLIENT_H */ diff --git a/third_party/azure_iot-1.2.8/iothub_client/inc/iothub_device_client_ll.h b/third_party/azure_iot-1.2.8/iothub_client/inc/iothub_device_client_ll.h new file mode 100644 index 00000000..539e1db0 --- /dev/null +++ b/third_party/azure_iot-1.2.8/iothub_client/inc/iothub_device_client_ll.h @@ -0,0 +1,378 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +/** @file iothub_client_ll.h +* @brief APIs that allow a user (usually a device) to communicate +* with an Azure IoTHub. +* +* @details IoTHubDeviceClient_LL is a module that allows a user (usually a +* device) to communicate with an Azure IoTHub. It can send events +* and receive messages. At any given moment in time there can only +* be at most 1 message callback function. +* +* This API surface contains a set of APIs that allows the user to +* interact with the lower layer portion of the IoTHubClient. These APIs +* contain @c _LL_ in their name, but retain the same functionality like the +* @c IoTHubDeviceClient_... APIs, with one difference. If the @c _LL_ APIs are +* used then the user is responsible for scheduling when the actual work done +* by the IoTHubClient happens (when the data is sent/received on/from the wire). +* This is useful for constrained devices where spinning a separate thread is +* often not desired. +*/ + +#ifndef IOTHUB_DEVICE_CLIENT_LL_H +#define IOTHUB_DEVICE_CLIENT_LL_H + +#includeHostName=[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];+ *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];+ *
+ *+ * + * @return A non-NULL @c IOTHUB_DEVICE_CLIENT_LL_HANDLE value that is used when + * invoking other functions for IoT Hub client and @c NULL on failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_DEVICE_CLIENT_LL_HANDLE, IoTHubDeviceClient_LL_CreateFromConnectionString, const char*, connectionString, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol); + + /** + * @brief Creates a IoT Hub client for communication with an existing IoT + * Hub using the specified parameters. + * + * @param config Pointer to an @c IOTHUB_CLIENT_CONFIG structure + * + * The API does not allow sharing of a connection across multiple + * devices. This is a blocking call. + * + * @return A non-NULL @c IOTHUB_DEVICE_CLIENT_LL_HANDLE value that is used when + * invoking other functions for IoT Hub client and @c NULL on failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_DEVICE_CLIENT_LL_HANDLE, IoTHubDeviceClient_LL_Create, const IOTHUB_CLIENT_CONFIG*, config); + + /** + * @brief Creates a IoT Hub client for communication with an existing IoT + * Hub using an existing transport. + * + * @param config Pointer to an @c IOTHUB_CLIENT_DEVICE_CONFIG structure + * + * The API *allows* sharing of a connection across multiple + * devices. This is a blocking call. + * + * @return A non-NULL @c IOTHUB_DEVICE_CLIENT_LL_HANDLE value that is used when + * invoking other functions for IoT Hub client and @c NULL on failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_DEVICE_CLIENT_LL_HANDLE, IoTHubDeviceClient_LL_CreateWithTransport, const IOTHUB_CLIENT_DEVICE_CONFIG*, config); + + /** + * @brief Creates a IoT Hub client for communication with an existing IoT + * Hub using the device auth module. + * + * @param iothub_uri Pointer to an ioThub hostname received in the registration process + * @param device_id Pointer to the device Id of the device + * @param device_auth_handle A device auth handle used to generate the connection string + * @param protocol Function pointer for protocol implementation + * + * @return A non-NULL @c IOTHUB_DEVICE_CLIENT_LL_HANDLE value that is used when + * invoking other functions for IoT Hub client and @c NULL on failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_DEVICE_CLIENT_LL_HANDLE, IoTHubDeviceClient_LL_CreateFromDeviceAuth, const char*, iothub_uri, const char*, device_id, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol); + + /** + * @brief Disposes of resources allocated by the IoT Hub client. This is a + * blocking call. + * + * @param iotHubClientHandle The handle created by a call to the create function. + */ + MOCKABLE_FUNCTION(, void, IoTHubDeviceClient_LL_Destroy, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle); + + /** + * @brief Asynchronous call to send the message specified by @p eventMessageHandle. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param eventMessageHandle The handle to an IoT Hub message. + * @param eventConfirmationCallback The callback specified by the device for receiving + * confirmation of the delivery of the IoT Hub message. + * This callback can be expected to invoke the + * ::IoTHubDeviceClient_LL_SendEventAsync function for the + * same message in an attempt to retry sending a failing + * message. The user can specify a @c NULL value here to + * indicate that no callback is required. + * @param userContextCallback User specified context that will be provided to the + * callback. This can be @c NULL. + * + * @b NOTE: The application behavior is undefined if the user calls + * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_SendEventAsync, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_MESSAGE_HANDLE, eventMessageHandle, IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK, eventConfirmationCallback, void*, userContextCallback); + + /** + * @brief This function returns the current sending status for IoTHubClient. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param iotHubClientStatus The sending state is populated at the address pointed + * at by this parameter. The value will be set to + * @c IOTHUBCLIENT_SENDSTATUS_IDLE if there is currently + * no item to be sent and @c IOTHUBCLIENT_SENDSTATUS_BUSY + * if there are. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_GetSendStatus, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_STATUS*, iotHubClientStatus); + + /** + * @brief Sets up the message callback to be invoked when IoT Hub issues a + * message to the device. This is a blocking call. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param messageCallback The callback specified by the device for receiving + * messages from IoT Hub. + * @param userContextCallback User specified context that will be provided to the + * callback. This can be @c NULL. + * + * @b NOTE: The application behavior is undefined if the user calls + * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_SetMessageCallback, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC, messageCallback, void*, userContextCallback); + + /** + * @brief Sets up the connection status callback to be invoked representing the status of + * the connection to IOT Hub. This is a blocking call. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param connectionStatusCallback The callback specified by the device for receiving + * updates about the status of the connection to IoT Hub. + * @param userContextCallback User specified context that will be provided to the + * callback. This can be @c NULL. + * + * @b NOTE: The application behavior is undefined if the user calls + * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_SetConnectionStatusCallback, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_CONNECTION_STATUS_CALLBACK, connectionStatusCallback, void*, userContextCallback); + + /** + * @brief Sets up the connection status callback to be invoked representing the status of + * the connection to IOT Hub. This is a blocking call. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param retryPolicy The policy to use to reconnect to IoT Hub when a + * connection drops. + * @param retryTimeoutLimitInSeconds Maximum amount of time(seconds) to attempt reconnection when a + * connection drops to IOT Hub. + * + * @b NOTE: The application behavior is undefined if the user calls + * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_SetRetryPolicy, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY, retryPolicy, size_t, retryTimeoutLimitInSeconds); + + + /** + * @brief Sets up the connection status callback to be invoked representing the status of + * the connection to IOT Hub. This is a blocking call. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param retryPolicy Out parameter containing the policy to use to reconnect to IoT Hub. + * @param retryTimeoutLimitInSeconds Out parameter containing maximum amount of time in seconds to attempt reconnection + to IOT Hub. + * + * @b NOTE: The application behavior is undefined if the user calls + * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_GetRetryPolicy, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY*, retryPolicy, size_t*, retryTimeoutLimitInSeconds); + + /** + * @brief This function returns in the out parameter @p lastMessageReceiveTime + * what was the value of the @c time function when the last message was + * received at the client. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param lastMessageReceiveTime Out parameter containing the value of @c time function + * when the last message was received. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_GetLastMessageReceiveTime, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, time_t*, lastMessageReceiveTime); + + /** + * @brief This function is meant to be called by the user when work + * (sending/receiving) can be done by the IoTHubClient. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * + * All IoTHubClient interactions (in regards to network traffic + * and/or user level callbacks) are the effect of calling this + * function and they take place synchronously inside _DoWork. + */ + MOCKABLE_FUNCTION(, void, IoTHubDeviceClient_LL_DoWork, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle); + + /** + * @brief This API sets a runtime option identified by parameter @p optionName + * to a value pointed to by @p value. @p optionName and the data type + * @p value is pointing to are specific for every option. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param optionName Name of the option. + * @param value The value. + * + * The options that can be set via this API are: + * - @b timeout - the maximum time in milliseconds a communication is + * allowed to use. @p value is a pointer to an @c unsigned @c int with + * the timeout value in milliseconds. This is only supported for the HTTP + * protocol as of now. When the HTTP protocol uses CURL, the meaning of + * the parameter is total request time. When the HTTP protocol uses + * winhttp, the meaning is the same as the @c dwSendTimeout and + * @c dwReceiveTimeout parameters of the + * + * WinHttpSetTimeouts API. + * - @b CURLOPT_LOW_SPEED_LIMIT - only available for HTTP protocol and only + * when CURL is used. It has the same meaning as CURL's option with the same + * name. @p value is pointer to a long. + * - @b CURLOPT_LOW_SPEED_TIME - only available for HTTP protocol and only + * when CURL is used. It has the same meaning as CURL's option with the same + * name. @p value is pointer to a long. + * - @b CURLOPT_FORBID_REUSE - only available for HTTP protocol and only + * when CURL is used. It has the same meaning as CURL's option with the same + * name. @p value is pointer to a long. + * - @b CURLOPT_FRESH_CONNECT - only available for HTTP protocol and only + * when CURL is used. It has the same meaning as CURL's option with the same + * name. @p value is pointer to a long. + * - @b CURLOPT_VERBOSE - only available for HTTP protocol and only + * when CURL is used. It has the same meaning as CURL's option with the same + * name. @p value is pointer to a long. + * - @b keepalive - available for MQTT protocol. Integer value that sets the + * interval in seconds when pings are sent to the server. + * - @b logtrace - available for MQTT protocol. Boolean value that turns on and + * off the diagnostic logging. + * - @b sas_token_lifetime - available for MQTT & AMQP protocol. size_t value that that determines the + * sas token timeout length. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_SetOption, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, const char*, optionName, const void*, value); + + /** + * @brief This API specifies a call back to be used when the device receives a desired state update. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param deviceTwinCallback The callback specified by the device client to be used for updating + * the desired state. The callback will be called in response to patch + * request send by the IoTHub services. The payload will be passed to the + * callback, along with two version numbers: + * - Desired: + * - LastSeenReported: + * @param userContextCallback User specified context that will be provided to the + * callback. This can be @c NULL. + * + * @b NOTE: The application behavior is undefined if the user calls + * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_SetDeviceTwinCallback, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_DEVICE_TWIN_CALLBACK, deviceTwinCallback, void*, userContextCallback); + + /** + * @brief This API sneds a report of the device's properties and their current values. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param reportedState The current device property values to be 'reported' to the IoTHub. + * @param reportedStateCallback The callback specified by the device client to be called with the + * result of the transaction. + * @param userContextCallback User specified context that will be provided to the + * callback. This can be @c NULL. + * + * @b NOTE: The application behavior is undefined if the user calls + * the ::IoTHubDeviceClient_LL_Destroy function from within any callback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_SendReportedState, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, const unsigned char*, reportedState, size_t, size, IOTHUB_CLIENT_REPORTED_STATE_CALLBACK, reportedStateCallback, void*, userContextCallback); + /** + * @brief This API sets callback for async cloud to device method call. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param inboundDeviceMethodCallback The callback which will be called by IoTHub. + * @param userContextCallback User specified context that will be provided to the + * callback. This can be @c NULL. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_SetDeviceMethodCallback, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_DEVICE_METHOD_CALLBACK_ASYNC, deviceMethodCallback, void*, userContextCallback); + + /** + * @brief This API responses to a asnyc method callback identified the methodId. + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param methodId The methodId of the Device Method callback. + * @param response The response data for the method callback. + * @param response_size The size of the response data buffer. + * @param status_response The status response of the method callback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_DeviceMethodResponse, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, METHOD_HANDLE, methodId, const unsigned char*, response, size_t, respSize, int, statusCode); + +#ifndef DONT_USE_UPLOADTOBLOB + /** + * @brief This API uploads to Azure Storage the content pointed to by @p source having the size @p size + * under the blob name devicename/@pdestinationFileName + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param destinationFileName name of the file. + * @param source pointer to the source for file content (can be NULL) + * @param size the size of the source in memory (if @p source is NULL then size needs to be 0). + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_UploadToBlob, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, const char*, destinationFileName, const unsigned char*, source, size_t, size); + + /** + * @brief This API uploads to Azure Storage the content provided block by block by @p getDataCallback + * under the blob name devicename/@pdestinationFileName + * + * @param iotHubClientHandle The handle created by a call to the create function. + * @param destinationFileName name of the file. + * @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. + * @param context Any data provided by the user to serve as context on getDataCallback. + * + * @return IOTHUB_CLIENT_OK upon success or an error code upon failure. + */ + MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubDeviceClient_LL_UploadMultipleBlocksToBlob, IOTHUB_DEVICE_CLIENT_LL_HANDLE, iotHubClientHandle, const char*, destinationFileName, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX, getDataCallbackEx, void*, context); + +#endif /*DONT_USE_UPLOADTOBLOB*/ + +#ifdef __cplusplus +} +#endif + +#endif /* IOTHUB_DEVICE_CLIENT_LL_H */ diff --git a/third_party/azure_iot-1.2.5/iothub_client/inc/iothub_message.h b/third_party/azure_iot-1.2.8/iothub_client/inc/iothub_message.h similarity index 76% rename from third_party/azure_iot-1.2.5/iothub_client/inc/iothub_message.h rename to third_party/azure_iot-1.2.8/iothub_client/inc/iothub_message.h index bb89f246..d78c4e0a 100644 --- a/third_party/azure_iot-1.2.5/iothub_client/inc/iothub_message.h +++ b/third_party/azure_iot-1.2.8/iothub_client/inc/iothub_message.h @@ -262,6 +262,90 @@ MOCKABLE_FUNCTION(, const IOTHUB_MESSAGE_DIAGNOSTIC_PROPERTY_DATA*, IoTHubMessag */ MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetDiagnosticPropertyData, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const IOTHUB_MESSAGE_DIAGNOSTIC_PROPERTY_DATA*, diagnosticData); +/** +* @brief Gets the output name from the IOTHUB_MESSAGE_HANDLE. +* +* @param iotHubMessageHandle Handle to the message. +* +* @return A const char* pointing to the Output Id. +*/ +MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetOutputName, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); + + +/** +* @brief Sets output for named queues. CAUTION: SDK user should not call it directly, it is for internal use only. +* +* @param iotHubMessageHandle Handle to the message. +* @param outputName Pointer to the queue to output message to +* +* @return Returns IOTHUB_MESSAGE_OK if the DiagnosticData was set successfully +* or an error code otherwise. +*/ +MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetOutputName, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, outputName); + + +/** +* @brief Gets the input name from the IOTHUB_MESSAGE_HANDLE. +* +* @param iotHubMessageHandle Handle to the message. +* +* @return A const char* pointing to the Input Id. +*/ +MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetInputName, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); + +/** +* @brief Sets input for named queues. CAUTION: SDK user should not call it directly, it is for internal use only. +* +* @param iotHubMessageHandle Handle to the message. +* @param inputName Pointer to the queue to input message to +* +* @return Returns IOTHUB_MESSAGE_OK if the DiagnosticData was set successfully +* or an error code otherwise. +*/ +MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetInputName, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, inputName); + +/** +* @brief Gets the module name from the IOTHUB_MESSAGE_HANDLE. +* +* @param iotHubMessageHandle Handle to the message. +* +* @return A const char* pointing to the connection module Id. +*/ +MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetConnectionModuleId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); + +/** +* @brief Sets connection module ID. CAUTION: SDK user should not call it directly, it is for internal use only. +* +* @param iotHubMessageHandle Handle to the message. +* @param connectionModuleId Pointer to the module ID of connector +* +* @return Returns IOTHUB_MESSAGE_OK if the DiagnosticData was set successfully +* or an error code otherwise. +*/ +MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetConnectionModuleId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, connectionModuleId); + + +/** +* @brief Gets the connection device ID from the IOTHUB_MESSAGE_HANDLE. +* +* @param iotHubMessageHandle Handle to the message. +* +* @return A const char* pointing to the connection device Id. +*/ +MOCKABLE_FUNCTION(, const char*, IoTHubMessage_GetConnectionDeviceId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle); + +/** +* @brief Sets connection device Id. CAUTION: SDK user should not call it directly, it is for internal use only. +* +* @param iotHubMessageHandle Handle to the message. +* @param connectionDeviceId Pointer to the device ID of connector +* +* @return Returns IOTHUB_MESSAGE_OK if the DiagnosticData was set successfully +* or an error code otherwise. +*/ +MOCKABLE_FUNCTION(, IOTHUB_MESSAGE_RESULT, IoTHubMessage_SetConnectionDeviceId, IOTHUB_MESSAGE_HANDLE, iotHubMessageHandle, const char*, connectionDeviceId); + + /** * @brief Frees all resources associated with the given message handle. * diff --git a/third_party/azure_iot-1.2.5/iothub_client/inc/iothub_transport_ll.h b/third_party/azure_iot-1.2.8/iothub_client/inc/iothub_transport_ll.h similarity index 99% rename from third_party/azure_iot-1.2.5/iothub_client/inc/iothub_transport_ll.h rename to third_party/azure_iot-1.2.8/iothub_client/inc/iothub_transport_ll.h index 55559969..e8881b14 100644 --- a/third_party/azure_iot-1.2.5/iothub_client/inc/iothub_transport_ll.h +++ b/third_party/azure_iot-1.2.8/iothub_client/inc/iothub_transport_ll.h @@ -38,3 +38,4 @@ MOCKABLE_FUNCTION(, TRANSPORT_LL_HANDLE, IoTHubTransport_GetLLTransport, TRANSPO #endif #endif /* IOTHUB_TRANSPORT_LL_H */ + diff --git a/third_party/azure_iot-1.2.5/iothub_client/inc/iothubtransporthttp.h b/third_party/azure_iot-1.2.8/iothub_client/inc/iothubtransporthttp.h similarity index 100% rename from third_party/azure_iot-1.2.5/iothub_client/inc/iothubtransporthttp.h rename to third_party/azure_iot-1.2.8/iothub_client/inc/iothubtransporthttp.h diff --git a/third_party/azure_iot-1.2.5/iothub_client/inc/iothubtransportmqtt.h b/third_party/azure_iot-1.2.8/iothub_client/inc/iothubtransportmqtt.h similarity index 100% rename from third_party/azure_iot-1.2.5/iothub_client/inc/iothubtransportmqtt.h rename to third_party/azure_iot-1.2.8/iothub_client/inc/iothubtransportmqtt.h diff --git a/third_party/azure_iot-1.2.5/iothub_client/src/blob.c b/third_party/azure_iot-1.2.8/iothub_client/src/blob.c similarity index 100% rename from third_party/azure_iot-1.2.5/iothub_client/src/blob.c rename to third_party/azure_iot-1.2.8/iothub_client/src/blob.c diff --git a/third_party/azure_iot-1.2.5/iothub_client/src/iothub.c b/third_party/azure_iot-1.2.8/iothub_client/src/iothub.c similarity index 100% rename from third_party/azure_iot-1.2.5/iothub_client/src/iothub.c rename to third_party/azure_iot-1.2.8/iothub_client/src/iothub.c diff --git a/third_party/azure_iot-1.2.5/iothub_client/src/iothub_client.c b/third_party/azure_iot-1.2.8/iothub_client/src/iothub_client.c similarity index 99% rename from third_party/azure_iot-1.2.5/iothub_client/src/iothub_client.c rename to third_party/azure_iot-1.2.8/iothub_client/src/iothub_client.c index c88bd0c4..8e5803ed 100644 --- a/third_party/azure_iot-1.2.5/iothub_client/src/iothub_client.c +++ b/third_party/azure_iot-1.2.8/iothub_client/src/iothub_client.c @@ -116,3 +116,4 @@ IOTHUB_CLIENT_RESULT IoTHubClient_UploadMultipleBlocksToBlobAsyncEx(IOTHUB_CLIEN } #endif /*DONT_USE_UPLOADTOBLOB*/ + diff --git a/third_party/azure_iot-1.2.5/iothub_client/src/iothub_client_authorization.c b/third_party/azure_iot-1.2.8/iothub_client/src/iothub_client_authorization.c similarity index 91% rename from third_party/azure_iot-1.2.5/iothub_client/src/iothub_client_authorization.c rename to third_party/azure_iot-1.2.8/iothub_client/src/iothub_client_authorization.c index 7a60cfd7..8af22a01 100644 --- a/third_party/azure_iot-1.2.5/iothub_client/src/iothub_client_authorization.c +++ b/third_party/azure_iot-1.2.8/iothub_client/src/iothub_client_authorization.c @@ -26,6 +26,7 @@ typedef struct IOTHUB_AUTHORIZATION_DATA_TAG char* device_sas_token; char* device_key; char* device_id; + char* module_id; size_t token_expiry_time_sec; IOTHUB_CREDENTIAL_TYPE cred_type; #ifdef USE_PROV_MODULE @@ -50,7 +51,7 @@ static int get_seconds_since_epoch(size_t* seconds) return result; } -IOTHUB_AUTHORIZATION_HANDLE IoTHubClient_Auth_Create(const char* device_key, const char* device_id, const char* device_sas_token) +IOTHUB_AUTHORIZATION_HANDLE IoTHubClient_Auth_Create(const char* device_key, const char* device_id, const char* device_sas_token, const char *module_id) { IOTHUB_AUTHORIZATION_DATA* result; /* Codes_SRS_IoTHub_Authorization_07_001: [if device_id is NULL IoTHubClient_Auth_Create, shall return NULL. ] */ @@ -89,6 +90,15 @@ IOTHUB_AUTHORIZATION_HANDLE IoTHubClient_Auth_Create(const char* device_key, con free(result); result = NULL; } + else if (module_id != NULL && mallocAndStrcpy_s(&result->module_id, module_id) != 0) + { + /* Codes_SRS_IoTHub_Authorization_07_019: [ On error IoTHubClient_Auth_Create shall return NULL. ] */ + LogError("Failed allocating module_id"); + free(result->device_id); + free(result->device_key); + free(result); + result = NULL; + } else { if (device_key != NULL) @@ -106,6 +116,7 @@ IOTHUB_AUTHORIZATION_HANDLE IoTHubClient_Auth_Create(const char* device_key, con LogError("Failed allocating device_key"); free(result->device_key); free(result->device_id); + free(result->module_id); free(result); result = NULL; } @@ -122,7 +133,7 @@ IOTHUB_AUTHORIZATION_HANDLE IoTHubClient_Auth_Create(const char* device_key, con return result; } -IOTHUB_AUTHORIZATION_HANDLE IoTHubClient_Auth_CreateFromDeviceAuth(const char* device_id) +IOTHUB_AUTHORIZATION_HANDLE IoTHubClient_Auth_CreateFromDeviceAuth(const char* device_id, const char* module_id) { IOTHUB_AUTHORIZATION_DATA* result; if (device_id == NULL) @@ -152,8 +163,16 @@ IOTHUB_AUTHORIZATION_HANDLE IoTHubClient_Auth_CreateFromDeviceAuth(const char* d } else if (mallocAndStrcpy_s(&result->device_id, device_id) != 0) { - LogError("Failed allocating device_key"); + LogError("Failed allocating device_id"); + iothub_device_auth_destroy(result->device_auth_handle); + free(result); + result = NULL; + } + else if ((module_id != NULL) && (mallocAndStrcpy_s(&result->module_id, module_id) != 0)) + { + LogError("Failed allocating module_id"); iothub_device_auth_destroy(result->device_auth_handle); + free(result->device_id); free(result); result = NULL; } @@ -170,6 +189,7 @@ IOTHUB_AUTHORIZATION_HANDLE IoTHubClient_Auth_CreateFromDeviceAuth(const char* d } } #else + (void)module_id; LogError("Failed HSM module is not supported"); result = NULL; #endif @@ -188,6 +208,7 @@ void IoTHubClient_Auth_Destroy(IOTHUB_AUTHORIZATION_HANDLE handle) #endif free(handle->device_key); free(handle->device_id); + free(handle->module_id); free(handle->device_sas_token); free(handle); } @@ -429,6 +450,23 @@ const char* IoTHubClient_Auth_Get_DeviceId(IOTHUB_AUTHORIZATION_HANDLE handle) return result; } +const char* IoTHubClient_Auth_Get_ModuleId(IOTHUB_AUTHORIZATION_HANDLE handle) +{ + const char* result; + if (handle == NULL) + { + /* Codes_SRS_IoTHub_Authorization_31_025: [ if handle is NULL, IoTHubClient_Auth_Get_ModuleId shall return NULL. ] */ + LogError("Invalid Parameter handle: %p", handle); + result = NULL; + } + else + { + /* Codes_SRS_IoTHub_Authorization_31_026: [ IoTHubClient_Auth_Get_ModuleId shall return the module_id specified upon creation. ] */ + result = handle->module_id; + } + return result; +} + const char* IoTHubClient_Auth_Get_DeviceKey(IOTHUB_AUTHORIZATION_HANDLE handle) { const char* result; @@ -496,3 +534,12 @@ SAS_TOKEN_STATUS IoTHubClient_Auth_Is_SasToken_Valid(IOTHUB_AUTHORIZATION_HANDLE } return result; } + + +#ifdef USE_EDGE_MODULES +char* IoTHubClient_Auth_Get_TrustBundle(IOTHUB_AUTHORIZATION_HANDLE handle) +{ + return iothub_device_auth_get_trust_bundle(handle->device_auth_handle); +} +#endif + diff --git a/third_party/azure_iot-1.2.5/iothub_client/src/iothub_client_core.c b/third_party/azure_iot-1.2.8/iothub_client/src/iothub_client_core.c similarity index 91% rename from third_party/azure_iot-1.2.5/iothub_client/src/iothub_client_core.c rename to third_party/azure_iot-1.2.8/iothub_client/src/iothub_client_core.c index 4c3cbccb..871c374a 100644 --- a/third_party/azure_iot-1.2.5/iothub_client/src/iothub_client_core.c +++ b/third_party/azure_iot-1.2.8/iothub_client/src/iothub_client_core.c @@ -82,7 +82,8 @@ typedef struct UPLOADTOBLOB_THREAD_INFO_TAG CALLBACK_TYPE_CONNECTION_STATUS, \ CALLBACK_TYPE_DEVICE_METHOD, \ CALLBACK_TYPE_INBOUD_DEVICE_METHOD, \ - CALLBACK_TYPE_MESSAGE + CALLBACK_TYPE_MESSAGE, \ + CALLBACK_TYPE_INPUTMESSAGE DEFINE_ENUM(USER_CALLBACK_TYPE, USER_CALLBACK_TYPE_VALUES) DEFINE_ENUM_STRINGS(USER_CALLBACK_TYPE, USER_CALLBACK_TYPE_VALUES) @@ -117,6 +118,12 @@ typedef struct METHOD_CALLBACK_INFO_TAG METHOD_HANDLE method_id; } METHOD_CALLBACK_INFO; +typedef struct INPUTMESSAGE_CALLBACK_INFO_TAG +{ + IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC eventHandlerCallback; + MESSAGE_CALLBACK_INFO* message_cb_info; +} INPUTMESSAGE_CALLBACK_INFO; + typedef struct USER_CALLBACK_INFO_TAG { USER_CALLBACK_TYPE type; @@ -129,6 +136,7 @@ typedef struct USER_CALLBACK_INFO_TAG CONNECTION_STATUS_CALLBACK_INFO connection_status_cb_info; METHOD_CALLBACK_INFO method_cb_info; MESSAGE_CALLBACK_INFO* message_cb_info; + INPUTMESSAGE_CALLBACK_INFO inputmessage_cb_info; } iothub_callback; } USER_CALLBACK_INFO; @@ -138,9 +146,25 @@ typedef struct IOTHUB_QUEUE_CONTEXT_TAG void* userContextCallback; } IOTHUB_QUEUE_CONTEXT; +typedef struct IOTHUB_INPUTMESSAGE_CALLBACK_CONTEXT_TAG +{ + IOTHUB_CLIENT_CORE_HANDLE iotHubClientHandle; + IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC eventHandlerCallback; + void* userContextCallback; +} IOTHUB_INPUTMESSAGE_CALLBACK_CONTEXT; + /*used by unittests only*/ const size_t IoTHubClientCore_ThreadTerminationOffset = offsetof(IOTHUB_CLIENT_CORE_INSTANCE, StopThread); +typedef enum CREATE_HUB_INSTANCE_TYPE_TAG +{ + CREATE_HUB_INSTANCE_FROM_CONNECTION_STRING, + CREATE_HUB_INSTANCE_FROM_EDGE_ENVIRONMENT, + CREATE_HUB_INSTANCE_FROM_TRANSPORT, + CREATE_HUB_INSTANCE_FROM_CLIENT_CONFIG, + CREATE_HUB_INSTANCE_FROM_DEVICE_AUTH +} CREATE_HUB_INSTANCE_TYPE; + #ifndef DONT_USE_UPLOADTOBLOB static void freeUploadToBlobThreadInfo(UPLOADTOBLOB_THREAD_INFO* threadInfo) { @@ -223,6 +247,37 @@ static bool iothub_ll_message_callback(MESSAGE_CALLBACK_INFO* messageData, void* return result; } +static bool iothub_ll_inputmessage_callback(MESSAGE_CALLBACK_INFO* message_cb_info, void* userContextCallback) +{ + bool result; + IOTHUB_INPUTMESSAGE_CALLBACK_CONTEXT *inputMessageCallbackContext = (IOTHUB_INPUTMESSAGE_CALLBACK_CONTEXT *)userContextCallback; + if (inputMessageCallbackContext == NULL) + { + LogError("invalid parameter userContextCallback(NULL)"); + result = false; + } + else + { + USER_CALLBACK_INFO queue_cb_info; + queue_cb_info.type = CALLBACK_TYPE_INPUTMESSAGE; + queue_cb_info.userContextCallback = inputMessageCallbackContext->userContextCallback; + queue_cb_info.iothub_callback.inputmessage_cb_info.eventHandlerCallback = inputMessageCallbackContext->eventHandlerCallback; + queue_cb_info.iothub_callback.inputmessage_cb_info.message_cb_info = message_cb_info; + + if (VECTOR_push_back(inputMessageCallbackContext->iotHubClientHandle->saved_user_callback_list, &queue_cb_info, 1) == 0) + { + result = true; + } + else + { + LogError("message callback vector push failed."); + result = false; + } + } + + return result; +} + static int make_method_calback_queue_context(USER_CALLBACK_INFO* queue_cb_info, const char* method_name, const unsigned char* payload, size_t size, METHOD_HANDLE method_id, IOTHUB_QUEUE_CONTEXT* queue_context) { int result; @@ -563,6 +618,28 @@ static void dispatch_user_callbacks(IOTHUB_CLIENT_CORE_INSTANCE* iotHubClientIns } } break; + + case CALLBACK_TYPE_INPUTMESSAGE: + { + const INPUTMESSAGE_CALLBACK_INFO *inputmessage_cb_info = &queued_cb->iothub_callback.inputmessage_cb_info; + IOTHUBMESSAGE_DISPOSITION_RESULT disposition = inputmessage_cb_info->eventHandlerCallback(inputmessage_cb_info->message_cb_info->messageHandle, queued_cb->userContextCallback); + + if (Lock(iotHubClientInstance->LockHandle) == LOCK_OK) + { + IOTHUB_CLIENT_RESULT result = IoTHubClientCore_LL_SendMessageDisposition(iotHubClientInstance->IoTHubClientLLHandle, inputmessage_cb_info->message_cb_info, disposition); + (void)Unlock(iotHubClientInstance->LockHandle); + if (result != IOTHUB_CLIENT_OK) + { + LogError("IoTHubClient_LL_SendMessageDisposition failed"); + } + } + else + { + LogError("Lock failed"); + } + } + break; + default: LogError("Invalid callback type '%s'", ENUM_TO_STRING(USER_CALLBACK_TYPE, queued_cb->type)); break; @@ -679,10 +756,11 @@ static IOTHUB_CLIENT_RESULT StartWorkerThreadIfNeeded(IOTHUB_CLIENT_CORE_INSTANC return result; } -static IOTHUB_CLIENT_CORE_INSTANCE* create_iothub_instance(const IOTHUB_CLIENT_CONFIG* config, TRANSPORT_HANDLE transportHandle, const char* connectionString, IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol, const char* iothub_uri, const char* device_id) +static IOTHUB_CLIENT_CORE_INSTANCE* create_iothub_instance(CREATE_HUB_INSTANCE_TYPE create_hub_instance_type, const IOTHUB_CLIENT_CONFIG* config, TRANSPORT_HANDLE transportHandle, const char* connectionString, IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol, const char* iothub_uri, const char* device_id) { /* Codes_SRS_IOTHUBCLIENT_12_020: [** `IoTHubClient_CreateFromDeviceAuth` shall allocate a new `IoTHubClient` instance. **] */ IOTHUB_CLIENT_CORE_INSTANCE* result = (IOTHUB_CLIENT_CORE_INSTANCE*)malloc(sizeof(IOTHUB_CLIENT_CORE_INSTANCE)); + (void)create_hub_instance_type; /* Codes_SRS_IOTHUBCLIENT_12_021: [** If allocating memory for the new `IoTHubClient` instance fails, then `IoTHubClient_CreateFromDeviceAuth` shall return `NULL`. **] */ /* Codes_SRS_IOTHUBCLIENT_01_004: [If allocating memory for the new IoTHubClient instance fails, then IoTHubClient_Create shall return NULL.] */ @@ -798,6 +876,23 @@ static IOTHUB_CLIENT_CORE_INSTANCE* create_iothub_instance(const IOTHUB_CLIENT_C result->IoTHubClientLLHandle = NULL; #endif } +#ifdef USE_EDGE_MODULES + else if (create_hub_instance_type == CREATE_HUB_INSTANCE_FROM_EDGE_ENVIRONMENT) + { + result->LockHandle = Lock_Init(); + if (result->LockHandle == NULL) + { + /* Codes_SRS_IOTHUBCLIENT_01_030: [If creating the lock fails, then IoTHubClient_Create shall return NULL.] */ + /* Codes_SRS_IOTHUBCLIENT_01_031: [If IoTHubClient_Create fails, all resources allocated by it shall be freed.] */ + LogError("Failure creating Lock object"); + result->IoTHubClientLLHandle = NULL; + } + else + { + result->IoTHubClientLLHandle = IoTHubClientCore_LL_CreateFromEnvironment(protocol); + } + } +#endif else { result->LockHandle = Lock_Init(); @@ -866,7 +961,7 @@ IOTHUB_CLIENT_CORE_HANDLE IoTHubClientCore_CreateFromConnectionString(const char } else { - result = create_iothub_instance(NULL, NULL, connectionString, protocol, NULL, NULL); + result = create_iothub_instance(CREATE_HUB_INSTANCE_FROM_CONNECTION_STRING, NULL, NULL, connectionString, protocol, NULL, NULL); } return result; } @@ -881,7 +976,7 @@ IOTHUB_CLIENT_CORE_HANDLE IoTHubClientCore_Create(const IOTHUB_CLIENT_CONFIG* co } else { - result = create_iothub_instance(config, NULL, NULL, NULL, NULL, NULL); + result = create_iothub_instance(CREATE_HUB_INSTANCE_FROM_CLIENT_CONFIG, config, NULL, NULL, NULL, NULL, NULL); } return result; } @@ -898,7 +993,7 @@ IOTHUB_CLIENT_CORE_HANDLE IoTHubClientCore_CreateWithTransport(TRANSPORT_HANDLE } else { - result = create_iothub_instance(config, transportHandle, NULL, NULL, NULL, NULL); + result = create_iothub_instance(CREATE_HUB_INSTANCE_FROM_TRANSPORT, config, transportHandle, NULL, NULL, NULL, NULL); } return result; } @@ -930,12 +1025,20 @@ IOTHUB_CLIENT_CORE_HANDLE IoTHubClientCore_CreateFromDeviceAuth(const char* ioth /* Codes_SRS_IOTHUBCLIENT_12_022: [** `IoTHubClient_CreateFromDeviceAuth` shall create a lock object to be used later for serializing IoTHubClient calls. **] */ /* Codes_SRS_IOTHUBCLIENT_12_023: [** If creating the lock fails, then IoTHubClient_CreateFromDeviceAuth shall return NULL. **] */ /* Codes_SRS_IOTHUBCLIENT_12_024: [** If IoTHubClient_CreateFromDeviceAuth fails, all resources allocated by it shall be freed. **] */ - /* Codes_SRS_IOTHUBCLIENT_12_025: [** `IoTHubClient_CreateFromDeviceAuth` shall instantiate a new `IoTHubClientCore_LL` instance by calling `IoTHubClientCore_LL_CreateFromDeviceAuth` and passing iothub_uri, device_id and protocol argument. **] */ - result = create_iothub_instance(NULL, NULL, NULL, protocol, iothub_uri, device_id); + /* Codes_SRS_IOTHUBCLIENT_12_025: [** `IoTHubClient_CreateFromDeviceAuth` shall instantiate a new `IoTHubClientCore_LL` instance by calling `IoTHubClientCore_LL_CreateFromDeviceAuth` and passing iothub_uri, device_id and protocol argument. **] */ + result = create_iothub_instance(CREATE_HUB_INSTANCE_FROM_DEVICE_AUTH, NULL, NULL, NULL, protocol, iothub_uri, device_id); } return result; } +#ifdef USE_EDGE_MODULES +IOTHUB_CLIENT_CORE_HANDLE IoTHubClientCore_CreateFromEnvironment(IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol) +{ + return create_iothub_instance(CREATE_HUB_INSTANCE_FROM_EDGE_ENVIRONMENT, NULL, NULL, NULL, protocol, NULL, NULL); +} +#endif + + /* Codes_SRS_IOTHUBCLIENT_01_005: [IoTHubClient_Destroy shall free all resources associated with the iotHubClientHandle instance.] */ void IoTHubClientCore_Destroy(IOTHUB_CLIENT_CORE_HANDLE iotHubClientHandle) { @@ -2147,3 +2250,100 @@ IOTHUB_CLIENT_RESULT IoTHubClientCore_UploadMultipleBlocksToBlobAsync(IOTHUB_CLI } #endif /*DONT_USE_UPLOADTOBLOB*/ + +IOTHUB_CLIENT_RESULT IoTHubClientCore_SendEventToOutputAsync(IOTHUB_CLIENT_CORE_HANDLE iotHubClientHandle, IOTHUB_MESSAGE_HANDLE eventMessageHandle, const char* outputName, IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK eventConfirmationCallback, void* userContextCallback) +{ + IOTHUB_CLIENT_RESULT result; + + if ((iotHubClientHandle == NULL) || (outputName == NULL) || (eventMessageHandle == NULL)) + { + // Codes_SRS_IOTHUBCLIENT_31_100: [ If `iotHubClientHandle`, `outputName`, or `eventConfirmationCallback` is `NULL`, `IoTHubClient_SendEventToOutputAsync` shall return `IOTHUB_CLIENT_INVALID_ARG`. ] + LogError("Invalid argument (iotHubClientHandle=%p, outputName=%p, eventMessageHandle=%p)", iotHubClientHandle, outputName, eventMessageHandle); + result = IOTHUB_CLIENT_INVALID_ARG; + } + else + { + // Codes_SRS_IOTHUBCLIENT_31_101: [ `IoTHubClient_SendEventToOutputAsync` shall set the outputName of the message to send. ] + if (IoTHubMessage_SetOutputName(eventMessageHandle, outputName) != IOTHUB_MESSAGE_OK) + { + LogError("IoTHubMessage_SetOutputName failed"); + result = IOTHUB_CLIENT_ERROR; + } + // Codes_SRS_IOTHUBCLIENT_31_102: [ `IoTHubClient_SendEventToOutputAsync` shall invoke `IoTHubClient_SendEventAsync` to send the message. ] + else if ((result = IoTHubClientCore_SendEventAsync(iotHubClientHandle, eventMessageHandle, eventConfirmationCallback, userContextCallback)) != IOTHUB_CLIENT_OK) + { + LogError("Call into IoTHubClient_SendEventAsync failed, result=%d", result); + } + } + + return result; +} + + +IOTHUB_CLIENT_RESULT IoTHubClientCore_SetInputMessageCallback(IOTHUB_CLIENT_CORE_HANDLE iotHubClientHandle, const char* inputName, IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC eventHandlerCallback, void* userContextCallback) +{ + IOTHUB_CLIENT_RESULT result; + + if (iotHubClientHandle == NULL) + { + result = IOTHUB_CLIENT_INVALID_ARG; + LogError("NULL iothubClientHandle"); + } + else + { + IOTHUB_CLIENT_CORE_INSTANCE* iotHubClientInstance = (IOTHUB_CLIENT_CORE_INSTANCE*)iotHubClientHandle; + + // Codes_SRS_IOTHUBCLIENT_31_098: [ `IoTHubClient_SetMessageCallback` shall start the worker thread if it was not previously started. ] + if ((result = StartWorkerThreadIfNeeded(iotHubClientInstance)) != IOTHUB_CLIENT_OK) + { + result = IOTHUB_CLIENT_ERROR; + LogError("Could not start worker thread"); + } + else + { + if (Lock(iotHubClientInstance->LockHandle) != LOCK_OK) + { + result = IOTHUB_CLIENT_ERROR; + LogError("Could not acquire lock"); + } + else + { + // Codes_SRS_IOTHUBCLIENT_31_099: [ `IoTHubClient_SetMessageCallback` shall call `IoTHubClient_LL_SetInputMessageCallback`, passing its input arguments ] + IOTHUB_INPUTMESSAGE_CALLBACK_CONTEXT inputMessageCallbackContext; + inputMessageCallbackContext.iotHubClientHandle = iotHubClientHandle; + inputMessageCallbackContext.eventHandlerCallback = eventHandlerCallback; + inputMessageCallbackContext.userContextCallback = userContextCallback; + + result = IoTHubClientCore_LL_SetInputMessageCallbackEx(iotHubClientInstance->IoTHubClientLLHandle, inputName, iothub_ll_inputmessage_callback, (void*)&inputMessageCallbackContext, sizeof(inputMessageCallbackContext)); + (void)Unlock(iotHubClientInstance->LockHandle); + } + } + } + + return result; +} + +/* Temporary function until replacement during iothub_client refactor*/ +#ifdef USE_EDGE_MODULES +IOTHUB_CLIENT_RESULT IoTHubClientCore_GenericMethodInvoke(IOTHUB_CLIENT_CORE_HANDLE iotHubClientHandle, const char* deviceId, const char* moduleId, const char* methodName, const char* methodPayload, unsigned int timeout, int* responseStatus, unsigned char** responsePayload, size_t* responsePayloadSize) +{ + IOTHUB_CLIENT_RESULT result; + if (iotHubClientHandle == NULL) + { + LogError("Argument cannot be NULL"); + result = IOTHUB_CLIENT_INVALID_ARG; + } + else if (Lock(iotHubClientHandle->LockHandle) != LOCK_OK) + { + LogError("failed locking for dispatch_user_callbacks"); + result = IOTHUB_CLIENT_ERROR; + } + else + { + result = IoTHubClientCore_LL_GenericMethodInvoke(iotHubClientHandle->IoTHubClientLLHandle, deviceId, moduleId, methodName, methodPayload, timeout, responseStatus, responsePayload, responsePayloadSize); + (void)Unlock(iotHubClientHandle->LockHandle); + } + + return result; +} +#endif /* USE_EDGE_MODULES */ diff --git a/third_party/azure_iot-1.2.5/iothub_client/src/iothub_client_core_ll.c b/third_party/azure_iot-1.2.8/iothub_client/src/iothub_client_core_ll.c similarity index 77% rename from third_party/azure_iot-1.2.5/iothub_client/src/iothub_client_core_ll.c rename to third_party/azure_iot-1.2.8/iothub_client/src/iothub_client_core_ll.c index 4616b6d7..38ddb648 100644 --- a/third_party/azure_iot-1.2.5/iothub_client/src/iothub_client_core_ll.c +++ b/third_party/azure_iot-1.2.8/iothub_client/src/iothub_client_core_ll.c @@ -12,6 +12,9 @@ #include "azure_c_shared_utility/tickcounter.h" #include "azure_c_shared_utility/constbuffer.h" #include "azure_c_shared_utility/platform.h" +#include "azure_c_shared_utility/singlylinkedlist.h" +#include "azure_c_shared_utility/shared_util_options.h" +#include "azure_c_shared_utility/agenttime.h" #include "iothub_client_core_ll.h" #include "internal/iothub_client_authorization.h" @@ -20,12 +23,19 @@ #include "iothub_client_options.h" #include "iothub_client_version.h" #include "internal/iothub_client_diagnostic.h" +#includeHostName=[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];+ *