31 #ifndef _AWS_SHADOW_H_ 32 #define _AWS_SHADOW_H_ 57 #define eShadowJSMNPart ( -3 ) 58 #define eShadowJSMNInval ( -2 ) 59 #define eShadowJSMNNoMem ( -1 ) 63 #define eShadowSuccess ( 0 ) 75 #define eShadowTimeout ( 1 ) 79 #define eShadowFailure ( 2 ) 83 #define eShadowUnknown ( 3 ) 88 #define eShadowRejectedBadRequest ( 400 ) 89 #define eShadowRejectedUnauthorized ( 401 ) 90 #define eShadowRejectedForbidden ( 403 ) 91 #define eShadowRejectedNotFound ( 404 ) 92 #define eShadowRejectedConflict ( 409 ) 93 #define eShadowRejectedPayloadTooLarge ( 413 ) 94 #define eShadowRejectedUnsupportedMediaType ( 415 ) 95 #define eShadowRejectedTooManyRequests ( 429 ) 96 #define eShadowRejectedInternalServerError ( 500 ) 97 typedef int16_t ShadowReturnCode_t;
222 const char *
const pcThingName,
223 const char *
const pcUpdateDocument,
224 uint32_t ulDocumentLength,
225 MQTTBufferHandle_t xBuffer );
238 const char *
const pcThingName );
265 const char *
const pcThingName,
266 const char *
const pcDeltaDocument,
267 uint32_t ulDocumentLength,
268 MQTTBufferHandle_t xBuffer );
342 TickType_t xTimeoutTicks );
394 TickType_t xTimeoutTicks );
417 TickType_t xTimeoutTicks );
440 TickType_t xTimeoutTicks );
465 TickType_t xTimeoutTicks );
489 MQTTBufferHandle_t xBufferHandle );
MQTTAgentHandle_t xMQTTClientHandle
Handle of a shared MQTT client.
ShadowReturnCode_t SHADOW_Delete(ShadowClientHandle_t xShadowClientHandle, ShadowOperationParams_t *const pxDeleteParams, TickType_t xTimeoutTicks)
Delete a Thing Shadow in the cloud.
const char * pcThingName
Thing name of Shadow.
ShadowDeletedCallback_t xShadowDeletedCallback
Called to notify users that another client has deleted the Thing Shadow.
struct ShadowCreateParams ShadowCreateParams_t
Parameters to pass into SHADOW_ClientCreate.
BaseType_t(* ShadowDeltaCallback_t)(void *pvUserData, const char *const pcThingName, const char *const pcDeltaDocument, uint32_t ulDocumentLength, MQTTBufferHandle_t xBuffer)
Function header of a callback function registered for /update/delta.
enum ShadowMQTTClientType ShadowMQTTClientType_t
Type of MQTT client in a new Shadow Client.
uint8_t ucKeepSubscriptions
Controls whether topic subscriptions remain active after a Shadow operation completes.
ShadowReturnCode_t SHADOW_ClientCreate(ShadowClientHandle_t *pxShadowClientHandle, const ShadowCreateParams_t *const pxShadowCreateParams)
Create a new Shadow Client.
struct ShadowCallbackParams ShadowCallbackParams_t
Parameters to SHADOW_RegisterCallbacks.
ShadowReturnCode_t SHADOW_ReturnMQTTBuffer(ShadowClientHandle_t xShadowClientHandle, MQTTBufferHandle_t xBufferHandle)
Return an MQTT Buffer to the MQTT client.
void * MQTTAgentHandle_t
Opaque handle to represent an MQTT client.
ShadowReturnCode_t SHADOW_ClientDelete(ShadowClientHandle_t xShadowClientHandle)
Free resources used by a Shadow Client.
ShadowMQTTClientType
Type of MQTT client in a new Shadow Client.
MQTTQoS_t
Quality of Service (QoS).
struct ShadowOperationParams ShadowOperationParams_t
Parameters for a Shadow API operation.
ShadowMQTTClientType_t xMQTTClientType
MQTT Client type.
ShadowReturnCode_t SHADOW_Update(ShadowClientHandle_t xShadowClientHandle, ShadowOperationParams_t *const pxUpdateParams, TickType_t xTimeoutTicks)
Update a Thing Shadow.
MQTTBufferHandle_t xBuffer
Output parameter of SHADOW_Get.
MQTTQoS_t xQoS
MQTT QoS when publishing from the Shadow Client to the Shadow Service.
const char * pcThingName
Thing Name for which callbacks are registered.
BaseType_t(* ShadowUpdatedCallback_t)(void *pvUserData, const char *const pcThingName, const char *const pcUpdateDocument, uint32_t ulDocumentLength, MQTTBufferHandle_t xBuffer)
Function signature of a callback function registered for /update/documents.
ShadowReturnCode_t SHADOW_ClientDisconnect(ShadowClientHandle_t xShadowClientHandle)
Disconnect from the Shadow service.
ShadowReturnCode_t SHADOW_Get(ShadowClientHandle_t xShadowClientHandle, ShadowOperationParams_t *const pxGetParams, TickType_t xTimeoutTicks)
Get a Thing Shadow from the cloud.
ShadowReturnCode_t SHADOW_RegisterCallbacks(ShadowClientHandle_t xShadowClientHandle, ShadowCallbackParams_t *const pxCallbackParams, TickType_t xTimeoutTicks)
Register callback functions.
Parameters passed to the MQTT_AGENT_Connect API.
ShadowUpdatedCallback_t xShadowUpdatedCallback
Called to notify users that a Thing Shadow has been updated.
ShadowDeltaCallback_t xShadowDeltaCallback
Called to notify users that a delta document has been generated.
Parameters to SHADOW_RegisterCallbacks.
uint32_t ulDataLength
Input parameter for SHADOW_Update; output parameter of SHADOW_Get.
Parameters for a Shadow API operation.
const char * pcData
Input parameter for SHADOW_Update; output parameter of SHADOW_Get.
Parameters to pass into SHADOW_ClientCreate.
ShadowReturnCode_t SHADOW_ClientConnect(ShadowClientHandle_t xShadowClientHandle, MQTTAgentConnectParams_t *const pxConnectParams, TickType_t xTimeoutTicks)
Connect to the Shadow service.
void * ShadowClientHandle_t
The handle of a Shadow Client.
void(* ShadowDeletedCallback_t)(void *pvUserData, const char *const pcThingName)
Function header of a callback function registered for /delete/accepted.