|
AWS IoT Device SDK C:
Shadow
AWS IoT Device Shadow library
|
| Return to main page ↑ |
Set a callback to be invoked when a Thing Shadow changes.
The Shadow service publishes a state document to the update/documents topic whenever a Thing Shadow is successfully updated. This document reports the complete previous and current Shadow documents in previous and current sections, respectively. Therefore, the update/documents topic is useful for monitoring Shadow updates.
An updated callback may be invoked whenever a document is published to update/documents. Each Thing may have a single updated callback set. This function modifies the updated callback for a specific Thing depending on the pUpdatedCallback parameter and the presence of any existing updated callback.
pUpdatedCallback is not NULL, then the existing callback function and parameter are replaced with pUpdatedCallback.pUpdatedCallback is NULL, then the updated callback is removed.| [in] | mqttConnection | The MQTT connection to use for the subscription to update/documents. |
| [in] | pThingName | The subscription to update/documents 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] | pUpdatedCallback | Callback function to invoke for incoming updated documents. |
update/documents will be large, as they contain 2 complete Shadow state documents. If an updated callback is used, ensure that the device has sufficient memory for incoming documents.Example