AWS IoT Device SDK C:
Shadow
AWS IoT Device Shadow library
|
Return to main page ↑ |
Send a Thing Shadow update and receive an asynchronous notification when the Shadow Update completes.
This function modifies the Thing Shadow document stored by the Shadow service. If a given Thing has no Shadow and this function is called, then a new Shadow is created.
New JSON keys in the Shadow document will be appended. For example, if the Shadow service currently has a document containing key example1
and this function sends a document only containing key example2
, then the resulting document in the Shadow service will contain both example1
and example2
.
Existing JSON keys in the Shadow document will be replaced. For example, if the Shadow service currently has a document containing "example1": [0,1,2]
and this function sends a document containing key "example1": [1,2,3]
, then the resulting document in the Shadow service will contain "example1": [1,2,3]
.
Successful Shadow updates will trigger the Shadow updated callback. If the resulting Shadow document contains different desired
and reported
keys, then the Shadow delta callback will be triggered as well.
clientToken
. The client token is a string used to distinguish between Shadow updates. They are limited to 64 characters; attempting to use a client token longer than 64 characters will cause the Shadow update to fail. They must be unique at any given time, i.e. they may be reused as long as no two Shadow updates are using the same client token at the same time.[in] | mqttConnection | The MQTT connection to use for Shadow update. |
[in] | pUpdateInfo | Shadow document parameters. |
[in] | flags | Flags which modify the behavior of this function. See Shadow Function Flags. |
[in] | pCallbackInfo | Asynchronous notification of this function's completion. |
[out] | pUpdateOperation | Set to a handle by which this operation may be referenced after this function returns. This reference is invalidated once the Shadow update completes. |
Example
See AwsIotShadow_Wait Example 1 for an example of using this function with AWS_IOT_SHADOW_FLAG_WAITABLE and AwsIotShadow_Wait.