|
AWS IoT Embedded C Device SDK
|
Echo received Delta message. More...
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include <unistd.h>#include <limits.h>#include "aws_iot_log.h"#include "aws_iot_version.h"#include "aws_iot_mqtt_client_interface.h"#include "aws_iot_shadow_interface.h"#include "aws_iot_config.h"Functions | |
| void | parseInputArgsForConnectParams (int argc, char **argv) |
| void | DeltaCallback (const char *pJsonValueBuffer, uint32_t valueLength, jsonStruct_t *pJsonStruct_t) |
| void | UpdateStatusCallback (const char *pThingName, ShadowActions_t action, Shadow_Ack_Status_t status, const char *pReceivedJsonDocument, void *pContextData) |
| int | main (int argc, char **argv) |
| bool | buildJSONForReported (char *pJsonDocument, size_t maxSizeOfJsonDocument, const char *pReceivedDeltaData, uint32_t lengthDelta) |
| This function builds a full Shadow expected JSON document by putting the data in the reported section. More... | |
This application will echo the message received in delta, as reported. for example: Received Delta message { "state": { "switch": "on" } } This delta message means the desired switch position has changed to "on"
This application will take this delta message and publish it back as the reported message from the device. { "state": { "reported": { "switch": "on" } } }
This update message will remove the delta that was created. If this message was not removed then the AWS IoT Thing Shadow is going to always have a delta and keep sending delta any time an update is applied to the Shadow This example will not use any of the json builder/helper functions provided in the aws_iot_shadow_json_data.h.
| bool buildJSONForReported | ( | char * | pJsonDocument, |
| size_t | maxSizeOfJsonDocument, | ||
| const char * | pReceivedDeltaData, | ||
| uint32_t | lengthDelta | ||
| ) |
| pJsonDocument | Buffer to be filled up with the JSON data |
| maxSizeOfJsonDocument | maximum size of the buffer that could be used to fill |
| pReceivedDeltaData | This is the data that will be embedded in the reported section of the JSON document |
| lengthDelta | Length of the data |
1.8.10