How can I read aws device shadow attributes?
Posted: Fri Jun 25, 2021 10:42 am
Hi.
I want to read aws shadow attributes and get desired states.
{
"desired": {
"A": "TEST1",
"B": "TEST2",
"C": 1234,
"D": 5678
},
"reported": {
.
.
.
}
I want to read value of A , B, C and D.
How can I read these?
#define AWS_SHADOW_GET "$aws/things/thingname/shadow/get"
aws_iot_mqtt_publish(&client, AWS_SHADOW_GET, strlen(AWS_SHADOW_GET), ¶msQOS1);
In aws documents , I must published empty message for this reason. But what means the empty message???
Is this empty message :
sprintf(cPayload, "{"state":{}, "clientToken":"thingname-0"}");
or
sprintf(cPayload, "{"state":{}}");
or ... ?
Thanks.
I want to read aws shadow attributes and get desired states.
{
"desired": {
"A": "TEST1",
"B": "TEST2",
"C": 1234,
"D": 5678
},
"reported": {
.
.
.
}
I want to read value of A , B, C and D.
How can I read these?
#define AWS_SHADOW_GET "$aws/things/thingname/shadow/get"
aws_iot_mqtt_publish(&client, AWS_SHADOW_GET, strlen(AWS_SHADOW_GET), ¶msQOS1);
In aws documents , I must published empty message for this reason. But what means the empty message???
Is this empty message :
sprintf(cPayload, "{"state":{}, "clientToken":"thingname-0"}");
or
sprintf(cPayload, "{"state":{}}");
or ... ?
Thanks.