37 #ifndef SHADOW_DO_NOT_USE_CUSTOM_CONFIG
39 #include "shadow_config.h"
53 typedef enum ShadowMessageType
55 ShadowMessageTypeGetAccepted = 0,
56 ShadowMessageTypeGetRejected,
57 ShadowMessageTypeDeleteAccepted,
58 ShadowMessageTypeDeleteRejected,
59 ShadowMessageTypeUpdateAccepted,
60 ShadowMessageTypeUpdateRejected,
61 ShadowMessageTypeUpdateDocuments,
62 ShadowMessageTypeUpdateDelta,
63 ShadowMessageTypeMaxNum
73 typedef enum ShadowTopicStringType
75 ShadowTopicStringTypeGet = 0,
76 ShadowTopicStringTypeGetAccepted,
77 ShadowTopicStringTypeGetRejected,
78 ShadowTopicStringTypeDelete,
79 ShadowTopicStringTypeDeleteAccepted,
80 ShadowTopicStringTypeDeleteRejected,
81 ShadowTopicStringTypeUpdate,
82 ShadowTopicStringTypeUpdateAccepted,
83 ShadowTopicStringTypeUpdateRejected,
84 ShadowTopicStringTypeUpdateDocuments,
85 ShadowTopicStringTypeUpdateDelta,
86 ShadowTopicStringTypeMaxNum
93 typedef enum ShadowStatus
110 #define SHADOW_PREFIX "$aws/things/"
116 #define SHADOW_PREFIX_LENGTH ( ( uint16_t ) ( sizeof( SHADOW_PREFIX ) - 1U ) )
122 #define SHADOW_OP_DELETE "/shadow/delete"
128 #define SHADOW_OP_DELETE_LENGTH ( ( uint16_t ) ( sizeof( SHADOW_OP_DELETE ) - 1U ) )
134 #define SHADOW_OP_GET "/shadow/get"
140 #define SHADOW_OP_GET_LENGTH ( ( uint16_t ) ( sizeof( SHADOW_OP_GET ) - 1U ) )
146 #define SHADOW_OP_UPDATE "/shadow/update"
152 #define SHADOW_OP_UPDATE_LENGTH ( ( uint16_t ) ( sizeof( SHADOW_OP_UPDATE ) - 1U ) )
158 #define SHADOW_SUFFIX_ACCEPTED "/accepted"
164 #define SHADOW_SUFFIX_ACCEPTED_LENGTH ( ( uint16_t ) ( sizeof( SHADOW_SUFFIX_ACCEPTED ) - 1U ) )
170 #define SHADOW_SUFFIX_REJECTED "/rejected"
176 #define SHADOW_SUFFIX_REJECTED_LENGTH ( ( uint16_t ) ( sizeof( SHADOW_SUFFIX_REJECTED ) - 1U ) )
182 #define SHADOW_SUFFIX_DELTA "/delta"
188 #define SHADOW_SUFFIX_DELTA_LENGTH ( ( uint16_t ) ( sizeof( SHADOW_SUFFIX_DELTA ) - 1U ) )
194 #define SHADOW_SUFFIX_DOCUMENTS "/documents"
200 #define SHADOW_SUFFIX_DOCUMENTS_LENGTH ( ( uint16_t ) ( sizeof( SHADOW_SUFFIX_DOCUMENTS ) - 1U ) )
206 #define SHADOW_SUFFIX_NULL
212 #define SHADOW_SUFFIX_NULL_LENGTH ( 0U )
218 #define SHADOW_THINGNAME_LENGTH_MAX ( 128U )
258 #define SHADOW_TOPIC_LENGTH( operationLength, suffixLength, thingNameLength ) \
259 ( operationLength + suffixLength + thingNameLength + SHADOW_PREFIX_LENGTH )
264 #define SHADOW_TOPIC_LENGTH_UPDATE( thingNameLength ) \
265 SHADOW_TOPIC_LENGTH( SHADOW_OP_UPDATE_LENGTH, SHADOW_SUFFIX_NULL_LENGTH, thingNameLength )
270 #define SHADOW_TOPIC_LENGTH_UPDATE_ACCEPTED( thingNameLength ) \
271 SHADOW_TOPIC_LENGTH( SHADOW_OP_UPDATE_LENGTH, SHADOW_SUFFIX_ACCEPTED_LENGTH, thingNameLength )
276 #define SHADOW_TOPIC_LENGTH_UPDATE_REJECTED( thingNameLength ) \
277 SHADOW_TOPIC_LENGTH( SHADOW_OP_UPDATE_LENGTH, SHADOW_SUFFIX_REJECTED_LENGTH, thingNameLength )
282 #define SHADOW_TOPIC_LENGTH_UPDATE_DOCUMENTS( thingNameLength ) \
283 SHADOW_TOPIC_LENGTH( SHADOW_OP_UPDATE_LENGTH, SHADOW_SUFFIX_DOCUMENTS_LENGTH, thingNameLength )
288 #define SHADOW_TOPIC_LENGTH_UPDATE_DELTA( thingNameLength ) \
289 SHADOW_TOPIC_LENGTH( SHADOW_OP_UPDATE_LENGTH, SHADOW_SUFFIX_DELTA_LENGTH, thingNameLength )
294 #define SHADOW_TOPIC_LENGTH_GET( thingNameLength ) \
295 SHADOW_TOPIC_LENGTH( SHADOW_OP_GET_LENGTH, SHADOW_SUFFIX_NULL_LENGTH, thingNameLength )
300 #define SHADOW_TOPIC_LENGTH_GET_ACCEPTED( thingNameLength ) \
301 SHADOW_TOPIC_LENGTH( SHADOW_OP_GET_LENGTH, SHADOW_SUFFIX_ACCEPTED_LENGTH, thingNameLength )
306 #define SHADOW_TOPIC_LENGTH_GET_REJECTED( thingNameLength ) \
307 SHADOW_TOPIC_LENGTH( SHADOW_OP_GET_LENGTH, SHADOW_SUFFIX_REJECTED_LENGTH, thingNameLength )
312 #define SHADOW_TOPIC_LENGTH_DELETE( thingNameLength ) \
313 SHADOW_TOPIC_LENGTH( SHADOW_OP_DELETE_LENGTH, SHADOW_SUFFIX_NULL_LENGTH, thingNameLength )
318 #define SHADOW_TOPIC_LENGTH_DELETE_ACCEPTED( thingNameLength ) \
319 SHADOW_TOPIC_LENGTH( SHADOW_OP_DELETE_LENGTH, SHADOW_SUFFIX_ACCEPTED_LENGTH, thingNameLength )
324 #define SHADOW_TOPIC_LENGTH_DELETE_REJECTED( thingNameLength ) \
325 SHADOW_TOPIC_LENGTH( SHADOW_OP_DELETE_LENGTH, SHADOW_SUFFIX_REJECTED_LENGTH, thingNameLength )
331 #define SHADOW_TOPIC_LENGTH_MAX( thingNameLength ) \
332 SHADOW_TOPIC_LENGTH( SHADOW_OP_UPDATE_LENGTH, SHADOW_SUFFIX_DOCUMENTS_LENGTH, thingNameLength )
360 #define SHADOW_TOPIC_STRING( thingName, operation, suffix ) \
361 ( SHADOW_PREFIX thingName operation suffix )
366 #define SHADOW_TOPIC_STRING_UPDATE( thingName ) \
367 SHADOW_TOPIC_STRING( thingName, SHADOW_OP_UPDATE, SHADOW_SUFFIX_NULL )
372 #define SHADOW_TOPIC_STRING_UPDATE_ACCEPTED( thingName ) \
373 SHADOW_TOPIC_STRING( thingName, SHADOW_OP_UPDATE, SHADOW_SUFFIX_ACCEPTED )
378 #define SHADOW_TOPIC_STRING_UPDATE_REJECTED( thingName ) \
379 SHADOW_TOPIC_STRING( thingName, SHADOW_OP_UPDATE, SHADOW_SUFFIX_REJECTED )
384 #define SHADOW_TOPIC_STRING_UPDATE_DOCUMENTS( thingName ) \
385 SHADOW_TOPIC_STRING( thingName, SHADOW_OP_UPDATE, SHADOW_SUFFIX_DOCUMENTS )
390 #define SHADOW_TOPIC_STRING_UPDATE_DELTA( thingName ) \
391 SHADOW_TOPIC_STRING( thingName, SHADOW_OP_UPDATE, SHADOW_SUFFIX_DELTA )
396 #define SHADOW_TOPIC_STRING_GET( thingName ) \
397 SHADOW_TOPIC_STRING( thingName, SHADOW_OP_GET, SHADOW_SUFFIX_NULL )
402 #define SHADOW_TOPIC_STRING_GET_ACCEPTED( thingName ) \
403 SHADOW_TOPIC_STRING( thingName, SHADOW_OP_GET, SHADOW_SUFFIX_ACCEPTED )
408 #define SHADOW_TOPIC_STRING_GET_REJECTED( thingName ) \
409 SHADOW_TOPIC_STRING( thingName, SHADOW_OP_GET, SHADOW_SUFFIX_REJECTED )
414 #define SHADOW_TOPIC_STRING_DELETE( thingName ) \
415 SHADOW_TOPIC_STRING( thingName, SHADOW_OP_DELETE, SHADOW_SUFFIX_NULL )
420 #define SHADOW_TOPIC_STRING_DELETE_ACCEPTED( thingName ) \
421 SHADOW_TOPIC_STRING( thingName, SHADOW_OP_DELETE, SHADOW_SUFFIX_ACCEPTED )
426 #define SHADOW_TOPIC_STRING_DELETE_REJECTED( thingName ) \
427 SHADOW_TOPIC_STRING( thingName, SHADOW_OP_DELETE, SHADOW_SUFFIX_REJECTED )
490 const char * pThingName,
491 uint8_t thingNameLength,
494 uint16_t * pOutLength );
550 uint16_t topicLength,
552 const char ** pThingName,
553 uint16_t * pThingNameLength );