API MQTT
Le protocole MQTT IotCore est utilisé pour fournir la communication sécurisée entre la plateforme et les passerelles.
Un ensemble de topics permet de réaliser un échange bi-directionnel.
Exemple de topics possibles
<mqtt_prefix>/gw/<gateway-uuid>/<verbe>
<mqtt_prefix>/feature/<gateway-uuid>/<device-uuid>/<feature_id>/<verbe>
Liste des verbes possibles
verbe |
définition |
direction |
|---|---|---|
cfg |
envoi de config |
gw->iotiothub |
cfg-ack |
confirmation de la config |
iotiothub->gw |
cmd |
commande |
iotiothub->gw |
cmd-ack |
confirmation de la commande |
gw->iotiothub |
req |
commande |
gw->iotiothub |
req-ack |
confirmation de la commande |
iotiothub->gw |
evt |
évènement |
gw->iotiothub |
sts |
statuts |
gw->iotiothub |
Format des messages
Le format général du payload est un json :
Payload :
{
"action":"featureCmd",
"msg_id": 0,
"status": "<status de retour dans le cas d'un ack>",
"data":{"type": "<type>",
"<action1>": "<value_to_write>",
"<action2>": "<value_to_write>"
}
}