Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: azure_umqtt_c iothub_mqtt_transport mbed-rtos mbed wolfSSL Socket lwip-eth lwip-sys lwip
iothub_client_ll.h File Reference
APIs that allow a user (usually a device) to communicate with an Azure IoTHub. More...
Go to the source code of this file.
Data Structures | |
| struct | IOTHUB_CLIENT_CONFIG_TAG |
| This struct captures IoTHub client configuration. More... | |
| struct | IOTHUB_CLIENT_DEVICE_CONFIG_TAG |
| This struct captures IoTHub client device configuration. More... | |
| struct | IOTHUBTRANSPORT_CONFIG_TAG |
| This struct captures IoTHub transport configuration. More... | |
Typedefs | |
| typedef struct IOTHUB_CLIENT_CONFIG_TAG | IOTHUB_CLIENT_CONFIG |
| This struct captures IoTHub client configuration. | |
| typedef struct IOTHUB_CLIENT_DEVICE_CONFIG_TAG | IOTHUB_CLIENT_DEVICE_CONFIG |
| This struct captures IoTHub client device configuration. | |
Functions | |
| DEFINE_ENUM (IOTHUB_CLIENT_RESULT, IOTHUB_CLIENT_RESULT_VALUES) | |
| Enumeration specifying the status of calls to various APIs in this module. | |
| DEFINE_ENUM (IOTHUB_CLIENT_RETRY_POLICY, IOTHUB_CLIENT_RETRY_POLICY_VALUES) | |
| Enumeration passed in by the IoT Hub when the event confirmation callback is invoked to indicate status of the event processing in the hub. | |
| DEFINE_ENUM (IOTHUB_CLIENT_STATUS, IOTHUB_CLIENT_STATUS_VALUES) | |
| Enumeration returned by the IoTHubClient_LL_GetSendStatus API to indicate the current sending status of the IoT Hub client. | |
| DEFINE_ENUM (IOTHUB_CLIENT_IOTHUB_METHOD_STATUS, IOTHUB_CLIENT_IOTHUB_METHOD_STATUS_VALUES) | |
| Enumeration returned by remotely executed functions. | |
| DEFINE_ENUM (IOTHUB_CLIENT_CONFIRMATION_RESULT, IOTHUB_CLIENT_CONFIRMATION_RESULT_VALUES) | |
| Enumeration passed in by the IoT Hub when the event confirmation callback is invoked to indicate status of the event processing in the hub. | |
| DEFINE_ENUM (IOTHUB_CLIENT_CONNECTION_STATUS, IOTHUB_CLIENT_CONNECTION_STATUS_VALUES) | |
| Enumeration passed in by the IoT Hub when the connection status callback is invoked to indicate status of the connection in the hub. | |
| DEFINE_ENUM (IOTHUB_CLIENT_CONNECTION_STATUS_REASON, IOTHUB_CLIENT_CONNECTION_STATUS_REASON_VALUES) | |
| Enumeration passed in by the IoT Hub when the connection status callback is invoked to indicate status of the connection in the hub. | |
| DEFINE_ENUM (IOTHUBMESSAGE_DISPOSITION_RESULT, IOTHUBMESSAGE_DISPOSITION_RESULT_VALUES) | |
| Enumeration returned by the callback which is invoked whenever the IoT Hub sends a message to the device. | |
| MOCKABLE_FUNCTION (, IOTHUB_CLIENT_LL_HANDLE, IoTHubClient_LL_CreateFromConnectionString, const char *, connectionString, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol) | |
| Creates a IoT Hub client for communication with an existing IoT Hub using the specified connection string parameter. | |
| MOCKABLE_FUNCTION (, IOTHUB_CLIENT_LL_HANDLE, IoTHubClient_LL_Create, const IOTHUB_CLIENT_CONFIG *, config) | |
| Creates a IoT Hub client for communication with an existing IoT Hub using the specified parameters. | |
| MOCKABLE_FUNCTION (, IOTHUB_CLIENT_LL_HANDLE, IoTHubClient_LL_CreateWithTransport, const IOTHUB_CLIENT_DEVICE_CONFIG *, config) | |
| Creates a IoT Hub client for communication with an existing IoT Hub using an existing transport. | |
| MOCKABLE_FUNCTION (, void, IoTHubClient_LL_Destroy, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle) | |
| Disposes of resources allocated by the IoT Hub client. | |
| MOCKABLE_FUNCTION (, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SendEventAsync, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_MESSAGE_HANDLE, eventMessageHandle, IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK, eventConfirmationCallback, void *, userContextCallback) | |
Asynchronous call to send the message specified by eventMessageHandle. | |
| MOCKABLE_FUNCTION (, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_GetSendStatus, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_STATUS *, iotHubClientStatus) | |
| This function returns the current sending status for IoTHubClient. | |
| MOCKABLE_FUNCTION (, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SetMessageCallback, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC, messageCallback, void *, userContextCallback) | |
| Sets up the message callback to be invoked when IoT Hub issues a message to the device. | |
| MOCKABLE_FUNCTION (, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SetConnectionStatusCallback, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_CONNECTION_STATUS_CALLBACK, connectionStatusCallback, void *, userContextCallback) | |
| Sets up the connection status callback to be invoked representing the status of the connection to IOT Hub. | |
| MOCKABLE_FUNCTION (, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SetRetryPolicy, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY, retryPolicy, size_t, retryTimeoutLimitInSeconds) | |
| Sets up the connection status callback to be invoked representing the status of the connection to IOT Hub. | |
| MOCKABLE_FUNCTION (, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_GetRetryPolicy, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY *, retryPolicy, size_t *, retryTimeoutLimitInSeconds) | |
| Sets up the connection status callback to be invoked representing the status of the connection to IOT Hub. | |
| MOCKABLE_FUNCTION (, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_GetLastMessageReceiveTime, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, time_t *, lastMessageReceiveTime) | |
This function returns in the out parameter lastMessageReceiveTime what was the value of the time function when the last message was received at the client. | |
| MOCKABLE_FUNCTION (, void, IoTHubClient_LL_DoWork, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle) | |
| This function is meant to be called by the user when work (sending/receiving) can be done by the IoTHubClient. | |
| MOCKABLE_FUNCTION (, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SetOption, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, const char *, optionName, const void *, value) | |
This API sets a runtime option identified by parameter optionName to a value pointed to by value. | |
| MOCKABLE_FUNCTION (, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SetDeviceTwinCallback, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_DEVICE_TWIN_CALLBACK, deviceTwinCallback, void *, userContextCallback) | |
| This API specifies a call back to be used when the device receives a desired state update. | |
| MOCKABLE_FUNCTION (, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SendReportedState, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, const unsigned char *, reportedState, size_t, size, IOTHUB_CLIENT_REPORTED_STATE_CALLBACK, reportedStateCallback, void *, userContextCallback) | |
| This API sneds a report of the device's properties and their current values. | |
| MOCKABLE_FUNCTION (, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_SetDeviceMethodCallback, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_DEVICE_METHOD_CALLBACK_ASYNC, deviceMethodCallback, void *, userContextCallback) | |
| This API sets callback for cloud to device method call. | |
| MOCKABLE_FUNCTION (, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_UploadToBlob, IOTHUB_CLIENT_LL_HANDLE, iotHubClientHandle, const char *, destinationFileName, const unsigned char *, source, size_t, size) | |
This API uploads to Azure Storage the content pointed to by source having the size size under the blob name devicename/. | |
Detailed Description
APIs that allow a user (usually a device) to communicate with an Azure IoTHub.
IoTHubClient_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 _LL_ in their name, but retain the same functionality like the IoTHubClient_... APIs, with one difference. If the _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.
Definition in file iothub_client_ll.h.
Typedef Documentation
| typedef struct IOTHUB_CLIENT_CONFIG_TAG IOTHUB_CLIENT_CONFIG |
This struct captures IoTHub client configuration.
| typedef struct IOTHUB_CLIENT_DEVICE_CONFIG_TAG IOTHUB_CLIENT_DEVICE_CONFIG |
This struct captures IoTHub client device configuration.
Function Documentation
| DEFINE_ENUM | ( | IOTHUB_CLIENT_RESULT | , |
| IOTHUB_CLIENT_RESULT_VALUES | |||
| ) |
Enumeration specifying the status of calls to various APIs in this module.
| DEFINE_ENUM | ( | IOTHUB_CLIENT_RETRY_POLICY | , |
| IOTHUB_CLIENT_RETRY_POLICY_VALUES | |||
| ) |
Enumeration passed in by the IoT Hub when the event confirmation callback is invoked to indicate status of the event processing in the hub.
| DEFINE_ENUM | ( | IOTHUB_CLIENT_CONNECTION_STATUS | , |
| IOTHUB_CLIENT_CONNECTION_STATUS_VALUES | |||
| ) |
Enumeration passed in by the IoT Hub when the connection status callback is invoked to indicate status of the connection in the hub.
| DEFINE_ENUM | ( | IOTHUB_CLIENT_CONNECTION_STATUS_REASON | , |
| IOTHUB_CLIENT_CONNECTION_STATUS_REASON_VALUES | |||
| ) |
Enumeration passed in by the IoT Hub when the connection status callback is invoked to indicate status of the connection in the hub.
| DEFINE_ENUM | ( | IOTHUBMESSAGE_DISPOSITION_RESULT | , |
| IOTHUBMESSAGE_DISPOSITION_RESULT_VALUES | |||
| ) |
Enumeration returned by the callback which is invoked whenever the IoT Hub sends a message to the device.
| DEFINE_ENUM | ( | IOTHUB_CLIENT_STATUS | , |
| IOTHUB_CLIENT_STATUS_VALUES | |||
| ) |
Enumeration returned by the IoTHubClient_LL_GetSendStatus API to indicate the current sending status of the IoT Hub client.
| DEFINE_ENUM | ( | IOTHUB_CLIENT_IOTHUB_METHOD_STATUS | , |
| IOTHUB_CLIENT_IOTHUB_METHOD_STATUS_VALUES | |||
| ) |
Enumeration returned by remotely executed functions.
| DEFINE_ENUM | ( | IOTHUB_CLIENT_CONFIRMATION_RESULT | , |
| IOTHUB_CLIENT_CONFIRMATION_RESULT_VALUES | |||
| ) |
Enumeration passed in by the IoT Hub when the event confirmation callback is invoked to indicate status of the event processing in the hub.
| MOCKABLE_FUNCTION | ( | IOTHUB_CLIENT_RESULT | , |
| IoTHubClient_LL_GetSendStatus | , | ||
| IOTHUB_CLIENT_LL_HANDLE | , | ||
| iotHubClientHandle | , | ||
| IOTHUB_CLIENT_STATUS * | , | ||
| iotHubClientStatus | |||
| ) |
This function returns the current sending status for IoTHubClient.
- Parameters:
-
iotHubClientHandle The handle created by a call to the create function. iotHubClientStatus The sending state is populated at the address pointed at by this parameter. The value will be set to IOTHUBCLIENT_SENDSTATUS_IDLEif there is currently no item to be sent andIOTHUBCLIENT_SENDSTATUS_BUSYif there are.
- Returns:
- IOTHUB_CLIENT_OK upon success or an error code upon failure.
| MOCKABLE_FUNCTION | ( | IOTHUB_CLIENT_RESULT | , |
| IoTHubClient_LL_SendEventAsync | , | ||
| IOTHUB_CLIENT_LL_HANDLE | , | ||
| iotHubClientHandle | , | ||
| IOTHUB_MESSAGE_HANDLE | , | ||
| eventMessageHandle | , | ||
| IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK | , | ||
| eventConfirmationCallback | , | ||
| void * | , | ||
| userContextCallback | |||
| ) |
Asynchronous call to send the message specified by eventMessageHandle.
- Parameters:
-
iotHubClientHandle The handle created by a call to the create function. eventMessageHandle The handle to an IoT Hub message. 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 IoTHubClient_LL_SendEventAsync function for the same message in an attempt to retry sending a failing message. The user can specify a NULLvalue here to indicate that no callback is required.userContextCallback User specified context that will be provided to the callback. This can be NULL.
NOTE: The application behavior is undefined if the user calls the IoTHubClient_LL_Destroy function from within any callback.
- Returns:
- IOTHUB_CLIENT_OK upon success or an error code upon failure.
| MOCKABLE_FUNCTION | ( | void | , |
| IoTHubClient_LL_Destroy | , | ||
| IOTHUB_CLIENT_LL_HANDLE | , | ||
| iotHubClientHandle | |||
| ) |
Disposes of resources allocated by the IoT Hub client.
This is a blocking call.
- Parameters:
-
iotHubClientHandle The handle created by a call to the create function.
| MOCKABLE_FUNCTION | ( | IOTHUB_CLIENT_LL_HANDLE | , |
| IoTHubClient_LL_CreateWithTransport | , | ||
| const IOTHUB_CLIENT_DEVICE_CONFIG * | , | ||
| config | |||
| ) |
Creates a IoT Hub client for communication with an existing IoT Hub using an existing transport.
- Parameters:
-
config Pointer to an IOTHUB_CLIENT_DEVICE_CONFIGstructure
The API *allows* sharing of a connection across multiple devices. This is a blocking call.
- Returns:
- A non-NULL
IOTHUB_CLIENT_LL_HANDLEvalue that is used when invoking other functions for IoT Hub client andNULLon failure.
| MOCKABLE_FUNCTION | ( | IOTHUB_CLIENT_LL_HANDLE | , |
| IoTHubClient_LL_Create | , | ||
| const IOTHUB_CLIENT_CONFIG * | , | ||
| config | |||
| ) |
Creates a IoT Hub client for communication with an existing IoT Hub using the specified parameters.
- Parameters:
-
config Pointer to an IOTHUB_CLIENT_CONFIGstructure
The API does not allow sharing of a connection across multiple devices. This is a blocking call.
- Returns:
- A non-NULL
IOTHUB_CLIENT_LL_HANDLEvalue that is used when invoking other functions for IoT Hub client andNULLon failure.
| MOCKABLE_FUNCTION | ( | IOTHUB_CLIENT_LL_HANDLE | , |
| IoTHubClient_LL_CreateFromConnectionString | , | ||
| const char * | , | ||
| connectionString | , | ||
| IOTHUB_CLIENT_TRANSPORT_PROVIDER | , | ||
| protocol | |||
| ) |
Creates a IoT Hub client for communication with an existing IoT Hub using the specified connection string parameter.
- Parameters:
-
connectionString Pointer to a character string protocol Function pointer for protocol implementation
Sample connection string: <blockquote>
HostName=[IoT Hub name goes here].[IoT Hub suffix goes here, e.g., private.azure-devices-int.net];DeviceId=[Device ID goes here];SharedAccessKey=[Device key goes here];
</blockquote>
- Returns:
- A non-NULL
IOTHUB_CLIENT_LL_HANDLEvalue that is used when invoking other functions for IoT Hub client andNULLon failure.
| MOCKABLE_FUNCTION | ( | IOTHUB_CLIENT_RESULT | , |
| IoTHubClient_LL_GetRetryPolicy | , | ||
| IOTHUB_CLIENT_LL_HANDLE | , | ||
| iotHubClientHandle | , | ||
| IOTHUB_CLIENT_RETRY_POLICY * | , | ||
| retryPolicy | , | ||
| size_t * | , | ||
| retryTimeoutLimitInSeconds | |||
| ) |
Sets up the connection status callback to be invoked representing the status of the connection to IOT Hub.
This is a blocking call.
- Parameters:
-
iotHubClientHandle The handle created by a call to the create function. retryPolicy Out parameter containing the policy to use to reconnect to IoT Hub. retryTimeoutLimitInSeconds Out parameter containing maximum amount of time in seconds to attempt reconnection to IOT Hub.
NOTE: The application behavior is undefined if the user calls the IoTHubClient_LL_Destroy function from within any callback.
- Returns:
- IOTHUB_CLIENT_OK upon success or an error code upon failure.
| MOCKABLE_FUNCTION | ( | IOTHUB_CLIENT_RESULT | , |
| IoTHubClient_LL_SetOption | , | ||
| IOTHUB_CLIENT_LL_HANDLE | , | ||
| iotHubClientHandle | , | ||
| const char * | , | ||
| optionName | , | ||
| const void * | , | ||
| value | |||
| ) |
This API sets a runtime option identified by parameter optionName to a value pointed to by value.
optionName and the data type value is pointing to are specific for every option.
- Parameters:
-
iotHubClientHandle The handle created by a call to the create function. optionName Name of the option. value The value.
The options that can be set via this API are:
- timeout - the maximum time in milliseconds a communication is allowed to use.
valueis a pointer to anunsignedintwith 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 thedwSendTimeoutanddwReceiveTimeoutparameters of the WinHttpSetTimeouts API. - 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.
valueis pointer to a long. - 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.
valueis pointer to a long. - 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.
valueis pointer to a long. - 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.
valueis pointer to a long. - 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.
valueis pointer to a long.
keepalive - available for MQTT protocol. Integer value that sets the interval in seconds when pings are sent to the server.
- logtrace - available for MQTT protocol. Boolean value that turns on and off the diagnostic logging.
- Returns:
- IOTHUB_CLIENT_OK upon success or an error code upon failure.
| MOCKABLE_FUNCTION | ( | IOTHUB_CLIENT_RESULT | , |
| IoTHubClient_LL_SetDeviceTwinCallback | , | ||
| IOTHUB_CLIENT_LL_HANDLE | , | ||
| iotHubClientHandle | , | ||
| IOTHUB_CLIENT_DEVICE_TWIN_CALLBACK | , | ||
| deviceTwinCallback | , | ||
| void * | , | ||
| userContextCallback | |||
| ) |
This API specifies a call back to be used when the device receives a desired state update.
- Parameters:
-
iotHubClientHandle The handle created by a call to the create function. 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:
userContextCallback User specified context that will be provided to the callback. This can be NULL.
NOTE: The application behavior is undefined if the user calls the IoTHubClient_LL_Destroy function from within any callback.
- Returns:
- IOTHUB_CLIENT_OK upon success or an error code upon failure.
| MOCKABLE_FUNCTION | ( | IOTHUB_CLIENT_RESULT | , |
| IoTHubClient_LL_SetDeviceMethodCallback | , | ||
| IOTHUB_CLIENT_LL_HANDLE | , | ||
| iotHubClientHandle | , | ||
| IOTHUB_CLIENT_DEVICE_METHOD_CALLBACK_ASYNC | , | ||
| deviceMethodCallback | , | ||
| void * | , | ||
| userContextCallback | |||
| ) |
This API sets callback for cloud to device method call.
- Parameters:
-
iotHubClientHandle The handle created by a call to the create function. deviceMethodCallback The callback which will be called by IoTHub. userContextCallback User specified context that will be provided to the callback. This can be NULL.
- Returns:
- IOTHUB_CLIENT_OK upon success or an error code upon failure.
| MOCKABLE_FUNCTION | ( | IOTHUB_CLIENT_RESULT | , |
| IoTHubClient_LL_UploadToBlob | , | ||
| IOTHUB_CLIENT_LL_HANDLE | , | ||
| iotHubClientHandle | , | ||
| const char * | , | ||
| destinationFileName | , | ||
| const unsigned char * | , | ||
| source | , | ||
| size_t | , | ||
| size | |||
| ) |
This API uploads to Azure Storage the content pointed to by source having the size size under the blob name devicename/.
- Parameters:
-
iotHubClientHandle The handle created by a call to the create function. destinationFileName name of the file. source pointer to the source for file content (can be NULL) size the size of the source in memory (if sourceis NULL then size needs to be 0).
- Returns:
- IOTHUB_CLIENT_OK upon success or an error code upon failure.
| MOCKABLE_FUNCTION | ( | IOTHUB_CLIENT_RESULT | , |
| IoTHubClient_LL_SetConnectionStatusCallback | , | ||
| IOTHUB_CLIENT_LL_HANDLE | , | ||
| iotHubClientHandle | , | ||
| IOTHUB_CLIENT_CONNECTION_STATUS_CALLBACK | , | ||
| connectionStatusCallback | , | ||
| void * | , | ||
| userContextCallback | |||
| ) |
Sets up the connection status callback to be invoked representing the status of the connection to IOT Hub.
This is a blocking call.
- Parameters:
-
iotHubClientHandle The handle created by a call to the create function. connectionStatusCallback The callback specified by the device for receiving updates about the status of the connection to IoT Hub. userContextCallback User specified context that will be provided to the callback. This can be NULL.
NOTE: The application behavior is undefined if the user calls the IoTHubClient_LL_Destroy function from within any callback.
- Returns:
- IOTHUB_CLIENT_OK upon success or an error code upon failure.
| MOCKABLE_FUNCTION | ( | IOTHUB_CLIENT_RESULT | , |
| IoTHubClient_LL_SetRetryPolicy | , | ||
| IOTHUB_CLIENT_LL_HANDLE | , | ||
| iotHubClientHandle | , | ||
| IOTHUB_CLIENT_RETRY_POLICY | , | ||
| retryPolicy | , | ||
| size_t | , | ||
| retryTimeoutLimitInSeconds | |||
| ) |
Sets up the connection status callback to be invoked representing the status of the connection to IOT Hub.
This is a blocking call.
- Parameters:
-
iotHubClientHandle The handle created by a call to the create function. retryPolicy The policy to use to reconnect to IoT Hub when a connection drops. retryTimeoutLimitInSeconds Maximum amount of time(seconds) to attempt reconnection when a connection drops to IOT Hub.
NOTE: The application behavior is undefined if the user calls the IoTHubClient_LL_Destroy function from within any callback.
- Returns:
- IOTHUB_CLIENT_OK upon success or an error code upon failure.
| MOCKABLE_FUNCTION | ( | void | , |
| IoTHubClient_LL_DoWork | , | ||
| IOTHUB_CLIENT_LL_HANDLE | , | ||
| iotHubClientHandle | |||
| ) |
This function is meant to be called by the user when work (sending/receiving) can be done by the IoTHubClient.
- Parameters:
-
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 | ( | IOTHUB_CLIENT_RESULT | , |
| IoTHubClient_LL_SendReportedState | , | ||
| IOTHUB_CLIENT_LL_HANDLE | , | ||
| iotHubClientHandle | , | ||
| const unsigned char * | , | ||
| reportedState | , | ||
| size_t | , | ||
| size | , | ||
| IOTHUB_CLIENT_REPORTED_STATE_CALLBACK | , | ||
| reportedStateCallback | , | ||
| void * | , | ||
| userContextCallback | |||
| ) |
This API sneds a report of the device's properties and their current values.
- Parameters:
-
iotHubClientHandle The handle created by a call to the create function. reportedState The current device property values to be 'reported' to the IoTHub. reportedStateCallback The callback specified by the device client to be called with the result of the transaction. userContextCallback User specified context that will be provided to the callback. This can be NULL.
NOTE: The application behavior is undefined if the user calls the IoTHubClient_LL_Destroy function from within any callback.
- Returns:
- IOTHUB_CLIENT_OK upon success or an error code upon failure.
| MOCKABLE_FUNCTION | ( | IOTHUB_CLIENT_RESULT | , |
| IoTHubClient_LL_SetMessageCallback | , | ||
| IOTHUB_CLIENT_LL_HANDLE | , | ||
| iotHubClientHandle | , | ||
| IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC | , | ||
| messageCallback | , | ||
| void * | , | ||
| userContextCallback | |||
| ) |
Sets up the message callback to be invoked when IoT Hub issues a message to the device.
This is a blocking call.
- Parameters:
-
iotHubClientHandle The handle created by a call to the create function. messageCallback The callback specified by the device for receiving messages from IoT Hub. userContextCallback User specified context that will be provided to the callback. This can be NULL.
NOTE: The application behavior is undefined if the user calls the IoTHubClient_LL_Destroy function from within any callback.
- Returns:
- IOTHUB_CLIENT_OK upon success or an error code upon failure.
| MOCKABLE_FUNCTION | ( | IOTHUB_CLIENT_RESULT | , |
| IoTHubClient_LL_GetLastMessageReceiveTime | , | ||
| IOTHUB_CLIENT_LL_HANDLE | , | ||
| iotHubClientHandle | , | ||
| time_t * | , | ||
| lastMessageReceiveTime | |||
| ) |
This function returns in the out parameter lastMessageReceiveTime what was the value of the time function when the last message was received at the client.
- Parameters:
-
iotHubClientHandle The handle created by a call to the create function. lastMessageReceiveTime Out parameter containing the value of timefunction when the last message was received.
- Returns:
- IOTHUB_CLIENT_OK upon success or an error code upon failure.
Generated on Wed Jul 13 2022 07:19:04 by
1.7.2