AWS IoT Device SDK C: Shadow
AWS IoT Device Shadow library
Return to main page ↑
AwsIotShadow_GetSync

Retrieve a Thing Shadow with a timeout.

const AwsIotShadowDocumentInfo_t * pGetInfo,
uint32_t flags,
uint32_t timeoutMs,
const char ** const pShadowDocument,
size_t * const pShadowDocumentLength );

This function queues a Shadow get, then waits for the result. Internally, this function is a call to AwsIotShadow_GetAsync followed by AwsIotShadow_Wait. See AwsIotShadow_GetAsync for more information on the Shadow get operation.

Parameters
[in]mqttConnectionThe MQTT connection to use for Shadow get.
[in]pGetInfoShadow document parameters.
[in]flagsFlags which modify the behavior of this function. See Shadow Function Flags.
[in]timeoutMsIf the Shadow service does not respond to the Shadow get within this timeout, this function returns AWS_IOT_SHADOW_TIMEOUT.
[out]pShadowDocumentA pointer to a buffer containing the Shadow document retrieved by a Shadow get is placed here. The buffer was allocated with the function pGetInfo->get.mallocDocument. This output parameter is only valid if this function returns AWS_IOT_SHADOW_SUCCESS.
[out]pShadowDocumentLengthThe length of the Shadow document in pShadowDocument is placed here. This output parameter is only valid if this function returns AWS_IOT_SHADOW_SUCCESS.
Returns
One of the following: