AWS IoT Device SDK C:
Shadow
AWS IoT Device Shadow library
|
Return to main page ↑ |
Set a callback to be invoked when the Thing Shadow desired
and reported
states differ.
A Thing Shadow contains reported
and desired
states, meant to represent the current device status and some desired status, respectively. When the reported
and desired
states differ, the Thing Shadow service generates a delta document and publishes it to the topic update/delta
. Devices with a subscription for this topic will receive the delta document and may act based on the different reported
and desired
states. See this page for more information about using delta documents.
A delta callback may be invoked whenever a delta document is generated. Each Thing may have a single delta callback set. This function modifies the delta callback for a specific Thing depending on the pDeltaCallback
parameter and the presence of any existing delta callback:
pDeltaCallback
is not NULL
, then the existing callback function and parameter are replaced with pDeltaCallback
.pDeltaCallback
is NULL
, then the delta callback is removed.This function is always blocking; it may block for up to the default MQTT timeout. This timeout is set as a parameter to AwsIotShadow_Init, and defaults to AWS_IOT_SHADOW_DEFAULT_MQTT_TIMEOUT_MS if not set. If this function's underlying MQTT operations fail to complete within this timeout, then this function returns AWS_IOT_SHADOW_TIMEOUT.
[in] | mqttConnection | The MQTT connection to use for the subscription to update/delta . |
[in] | pThingName | The subscription to update/delta will be added for this Thing Name. |
[in] | thingNameLength | The length of pThingName . |
[in] | flags | This parameter is for future-compatibility. Currently, flags are not supported for this function and this parameter is ignored. |
[in] | pDeltaCallback | Callback function to invoke for incoming delta documents. |
Example