AWS IoT Device SDK C:
Shadow
AWS IoT Device Shadow library
|
Return to main page ↑ |
Wait for a Shadow operation to complete.
This function blocks to wait for a delete, get, or update to complete. These operations are by default asynchronous; the function calls queue an operation for processing, and a callback is invoked once the operation is complete.
To use this function, the flag AWS_IOT_SHADOW_FLAG_WAITABLE must have been set in the operation's function call. Additionally, this function must always be called with any waitable operation to clean up resources.
Regardless of its return value, this function always clean up resources used by the waitable operation. This means operation
is invalidated as soon as this function returns, even if it returns AWS_IOT_SHADOW_TIMEOUT or another error.
[in] | operation | Reference to the Shadow operation to wait for. The flag AWS_IOT_SHADOW_FLAG_WAITABLE must have been set for this operation. |
[in] | timeoutMs | How long to wait before returning AWS_IOT_SHADOW_TIMEOUT. |
[out] | pShadowDocument | A pointer to a buffer containing the Shadow document retrieved by a Shadow get is placed here. The buffer was allocated with the function AwsIotShadowDocumentInfo_t.mallocDocument passed to AwsIotShadow_GetAsync. This parameter is only valid for a Shadow get and ignored for other Shadow operations. This output parameter is only valid if this function returns AWS_IOT_SHADOW_SUCCESS. |
[out] | pShadowDocumentLength | The length of the Shadow document in pShadowDocument is placed here. This parameter is only valid for a Shadow get and ignored for other Shadow operations. This output parameter is only valid if this function returns AWS_IOT_SHADOW_SUCCESS. |
Example 1 (Shadow Update)
Example 2 (Shadow Get)