AWS IoT Device SDK C: Shadow
AWS IoT Device Shadow library
Return to main page ↑
AwsIotShadowCallbackParam_t Struct Reference

Parameter to a Shadow callback function. More...

#include <aws_iot_shadow_types.h>

Data Fields

AwsIotShadowCallbackType_t callbackType
 Reason for invoking the Shadow callback function to provide context.
 
const char * pThingName
 The Thing Name associated with this Shadow callback.
 
size_t thingNameLength
 Length of AwsIotShadowCallbackParam_t.pThingName.
 
IotMqttConnection_t mqttConnection
 The MQTT connection associated with the Shadow callback.
 
union {
   struct {
      struct {
         const char *   pDocument
 Retrieved Shadow document.
 
         size_t   documentLength
 Length of retrieved Shadow document.
 
      }   get
 Retrieved Shadow document, valid only for a completed Shadow Get.
 
      AwsIotShadowError_t   result
 Result of Shadow operation, e.g. succeeded or failed.
 
      AwsIotShadowOperation_t   reference
 Reference to the Shadow operation that completed.
 
   }   operation
 Information on a completed Shadow operation.
 
   struct {
      const char *   pDocument
 Shadow delta or updated document.
 
      size_t   documentLength
 Length of Shadow delta or updated document.
 
   }   callback
 Shadow document from an incoming delta or updated topic.
 
u
 Valid member depends on callback type.
 

Detailed Description

Parameter to a Shadow callback function.

Parameter for: Shadow callback functions

The Shadow library passes this struct to a callback function whenever a Shadow operation completes or a message is received on a Shadow delta or updated topic.

The valid members of this struct are different based on AwsIotShadowCallbackParam_t.callbackType. If the callback type is AWS_IOT_SHADOW_DELETE_COMPLETE, AWS_IOT_SHADOW_GET_COMPLETE, or AWS_IOT_SHADOW_UPDATE_COMPLETE, then AwsIotShadowCallbackParam_t.operation is valid. Otherwise, if the callback type is AWS_IOT_SHADOW_DELTA_CALLBACK or AWS_IOT_SHADOW_UPDATED_CALLBACK, then AwsIotShadowCallbackParam_t.callback is valid.

Attention
Any pointers in this callback parameter may be freed as soon as the callback function returns. Therefore, data must be copied if it is needed after the callback function returns.
The Shadow library may set strings that are not NULL-terminated.
See also
AwsIotShadowCallbackInfo_t for the signature of a callback function.

Field Documentation

◆ pDocument

const char* AwsIotShadowCallbackParam_t::pDocument

Retrieved Shadow document.

Shadow delta or updated document.

◆ documentLength

size_t AwsIotShadowCallbackParam_t::documentLength

Length of retrieved Shadow document.

Length of Shadow delta or updated document.


The documentation for this struct was generated from the following file: