Command Configuration & Status
A device command might need parameters to be executed correctly. It can then be executed, which may take a few minutes.
BioT allows command configurations and status to be specified in the command template.
Command Configuration
Configuration attributes in the command template are sent during the initial command execution and are delivered to the device using command shadow.
For example, a "message" attribute of a "Reboot" command will arrive to the device in the following way:
Topic: $aws/things/<clientId>/shadow/name/<commandName>/update/delta
{
"version": 35,
"timestamp": 1661173677,
"state": {
"metadata": {
"context": "eyJjb21tYW5kSWQiOiI3MzY5Y2ZiYS0wYzBjLTRmYTEtOTMyMy0yZjIzYTZiOTgyNWQifQ==",
"state": "ACTIVE"
},
"data": {
"message": "The device will reboot in 10 seconds"
}
},
"metadata": {
"metadata": {
"context": {
"timestamp": 1661173677
},
"state": {
"timestamp": 1661173677
}
},
"data": {
"message": {
"timestamp": 1661173677
}
}
}
}
It is up to the device to use the configuration sent in the command.
Command Status
Status attributes in the command can be sent back to BioT by adding them to the reported section of the command shadow.
For example, a "progress" attribute of a "Reboot" command can be sent back to BioT in the following way:
Topic: $aws/things/<clientId>/shadow/name/<commandName>/update
{
"state": {
"reported": {
"metadata": {
"context": "eyJjb21tYW5kSWQiOiI3MzY5Y2ZiYS0wYzBjLTRmYTEtOTMyMy0yZjIzYTZiOTgyNWQifQ==",
"state": "ACTIVE"
},
"data": {
"progress": 50
}
}
}
}
The update status will appear in the BioT Manufacturer Portal.
Updated 11 months ago