15 #ifndef AWS_IOT_SDK_SRC_IOT_SHADOW_H_
16 #define AWS_IOT_SDK_SRC_IOT_SHADOW_H_
36 #include "aws_iot_mqtt_client_interface.h"
136 SHADOW_ACK_TIMEOUT, SHADOW_ACK_REJECTED, SHADOW_ACK_ACCEPTED
146 SHADOW_GET, SHADOW_UPDATE, SHADOW_DELETE
163 const char *pReceivedJsonDocument,
void *pContextData);
189 fpActionCallback_t callback,
void *pContextData, uint8_t timeout_seconds,
bool isPersistentSubscribe);
206 void *pContextData, uint8_t timeout_seconds,
bool isPersistentSubscribe);
222 void *pContextData, uint8_t timeout_seconds,
bool isPersistentSubscriptions);
278 #endif //AWS_IOT_SDK_SRC_IOT_SHADOW_H_
char * pMyThingName
Every device has a Thing Shadow and this is the placeholder for name.
Definition: aws_iot_shadow_interface.h:68
IoT_Error_t aws_iot_shadow_delete(AWS_IoT_Client *pClient, const char *pThingName, fpActionCallback_t callback, void *pContextData, uint8_t timeout_seconds, bool isPersistentSubscriptions)
This function is the one used to perform an Delete action to a Thing Name's Shadow.
Definition: aws_iot_shadow.c:148
IoT_Error_t aws_iot_shadow_connect(AWS_IoT_Client *pClient, ShadowConnectParameters_t *pParams)
Connect to the AWS IoT Thing Shadow service over MQTT.
Definition: aws_iot_shadow.c:82
Shadow Connect parameters.
Definition: aws_iot_shadow_interface.h:67
MQTT Client.
Definition: aws_iot_mqtt_client.h:285
IoT_Error_t aws_iot_shadow_register_delta(AWS_IoT_Client *pClient, jsonStruct_t *pStruct)
This function is used to listen on the delta topic of #AWS_IOT_MY_THING_NAME mentioned in the aws_iot...
Definition: aws_iot_shadow.c:113
uint16_t port
By default the port is 8883.
Definition: aws_iot_shadow_interface.h:50
void(* iot_disconnect_handler)(AWS_IoT_Client *, void *)
Disconnect Callback Handler Type.
Definition: aws_iot_mqtt_client.h:152
const ShadowConnectParameters_t ShadowConnectParametersDefault
This is set to defaults from the configuration file.
Definition: aws_iot_shadow_interface.h:85
IoT_Error_t aws_iot_shadow_disconnect(AWS_IoT_Client *pClient)
Disconnect from the AWS IoT Thing Shadow service over MQTT.
Definition: aws_iot_shadow.c:130
uint32_t aws_iot_shadow_get_last_received_version(void)
Version of a document is received with every accepted/rejected and the SDK keeps track of the last re...
Definition: aws_iot_shadow.c:42
char * pClientKey
Location of Device private key.
Definition: aws_iot_shadow_interface.h:53
IoT_Error_t aws_iot_shadow_update(AWS_IoT_Client *pClient, const char *pThingName, char *pJsonString, fpActionCallback_t callback, void *pContextData, uint8_t timeout_seconds, bool isPersistentSubscribe)
This function is the one used to perform an Update action to a Thing Name's Shadow.
Definition: aws_iot_shadow.c:133
void aws_iot_shadow_disable_discard_old_delta_msgs(void)
Disable the ignoring of delta messages with old version number.
Definition: aws_iot_shadow.c:50
This file is the interface for all the Shadow related JSON functions.
IoT_Error_t
IoT Error enum.
Definition: aws_iot_error.h:36
bool enableAutoReconnect
Set to true to enable auto reconnect.
Definition: aws_iot_shadow_interface.h:54
void aws_iot_shadow_reset_last_received_version(void)
Reset the last received version number to zero. This will be useful if the Thing Shadow is deleted an...
Definition: aws_iot_shadow.c:38
void aws_iot_shadow_enable_discard_old_delta_msgs(void)
Enable the ignoring of delta messages with old version number.
Definition: aws_iot_shadow.c:46
ShadowActions_t
Thing Shadow Action type enum.
Definition: aws_iot_shadow_interface.h:145
Shadow_Ack_Status_t
Thing Shadow Acknowledgment enum.
Definition: aws_iot_shadow_interface.h:135
This is the struct form of a JSON Key value pair.
Definition: aws_iot_shadow_json_data.h:58
IoT_Error_t aws_iot_shadow_set_autoreconnect_status(AWS_IoT_Client *pClient, bool newStatus)
This function is used to enable or disable autoreconnect.
Definition: aws_iot_shadow.c:182
IoT_Error_t aws_iot_shadow_get(AWS_IoT_Client *pClient, const char *pThingName, fpActionCallback_t callback, void *pContextData, uint8_t timeout_seconds, bool isPersistentSubscribe)
This function is the one used to perform an Get action to a Thing Name's Shadow.
Definition: aws_iot_shadow.c:164
IoT_Error_t aws_iot_shadow_yield(AWS_IoT_Client *pClient, uint32_t timeout)
Yield function to let the background tasks of MQTT and Shadow.
Definition: aws_iot_shadow.c:125
char * pHost
This will be unique to a customer and can be retrieved from the console.
Definition: aws_iot_shadow_interface.h:49
IoT_Error_t aws_iot_shadow_init(AWS_IoT_Client *pClient, ShadowInitParameters_t *pParams)
Initialize the Thing Shadow before use.
Definition: aws_iot_shadow.c:54
iot_disconnect_handler disconnectHandler
Callback to be invoked upon connection loss.
Definition: aws_iot_shadow_interface.h:55
char * pMqttClientId
Currently the Shadow uses MQTT to connect and it is important to ensure we have unique client id...
Definition: aws_iot_shadow_interface.h:69
const ShadowInitParameters_t ShadowInitParametersDefault
This is set to defaults from the configuration file The certs are set to NULL because they need the p...
Definition: aws_iot_shadow_interface.h:78
char * pRootCA
Location with the Filename of the Root CA.
Definition: aws_iot_shadow_interface.h:51
char * pClientCRT
Location of Device certs signed by AWS IoT service.
Definition: aws_iot_shadow_interface.h:52
void(* fpActionCallback_t)(const char *pThingName, ShadowActions_t action, Shadow_Ack_Status_t status, const char *pReceivedJsonDocument, void *pContextData)
Function Pointer typedef used as the callback for every action.
Definition: aws_iot_shadow_interface.h:162
Shadow Initialization parameters.
Definition: aws_iot_shadow_interface.h:48