Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

SimpleJsonConvertor

Martin Strouhal edited this page Sep 12, 2016 · 8 revisions

This page describes format of json data for SimpleJsonConvertor. This convertor is very simple usable for as DPA communication as non-DPA communication.

Note: All json examples should be correct. The most important thing to update are descriptions.

Requests

Topic

Earlier: [mid]/dpa/requests
Now: gateway/[mac]/tx

Structure

{   
    "payload": "00.00.05.01.FF.FF.00.01.02",   
    "dpa": true,   
    "dpa-pn": 1,   
    "size": 9,   
    "mac": "74E50B186E8A",   
    "time": "2016-06-10T14:04:53Z"   
}
Element Description
payload main data, which will be forwared to iqrf network
dpa is dpa packet (needs to be implemented yet for correct work)
packetNumber linking dpa request with confirmation and response (needs to be implemented yet for correct work)
size length of iqrf data
mac mac address of bridge
data timestamp

The message in example is request for writing 2 bytes (0x01, 0x02) into RAM to address 0x00.

Confirmations = TODO update

Topic

Earlier: [mid]/dpa/confirmations
Now: gateway/[mac]/rx

Structure

{
   "time":"2016-09-06 22:09:46.259",
   "timestamp":1473192586259,
   "payload":"01.00.07.01.FF.FF.FF.00.01.03.01",
   "mac":"00000000000000E0",
   "size":11
}
Element Description
timestamp timestamp of converting from iqrf to json
nadr node address
per peripheral id
cmd command id
hwpid hardware profiles id
dpaValue DPA value, see DPA tech guide.
hops Count of hops used to deliver the DPA request to the addressed node.
timeslotLength Timeslot length used to deliver the DPA request to the addressed node.
hopsResponse Count of hops used to deliver the DPA response from the addressed node back to the coordinator. In the case of broadcast, this parameter is 0 as there is no response sent back to the coordinator.

Responses = TODO update

Topic

Earlier: [mid]/dpa/responses
Now: gateway/[mac]/rx

Structure

{
   "time":"2016-09-06 22:09:46.361",
   "timestamp":1473192586361,
   "payload":"01.00.07.81.0F.00.00.49",
   "mac":"00000000000000E0",
   "size":8
}
Element Description
timestamp timestamp of converting from iqrf to json
nadr node address
per peripheral id
cmd command id
hwpid hardware profiles id
data user data (array)

Next examples

There are next examples of requests:

Request Description
{"payload": "00.00.06.01.FF.FF","dpa": true,"dpa-pn": 1,"size": 6,"mac": "74E50B186E8A","time": "2016-06-10T14:04:53Z"} Turn red LED on
{"payload": "00.00.06.00.FF.FF","dpa": true,"dpa-pn": 1,"size": 6,"mac": "74E50B186E8A","time": "2016-06-10T14:04:53Z"} Turn red LED off
{"payload": "00.00.07.01.FF.FF","dpa": true,"dpa-pn": 1,"size": 6,"mac": "74E50B186E8A","time": "2016-06-10T14:04:53Z"} Turn green LED on
{"payload": "00.00.07.00.FF.FF","dpa": true,"dpa-pn": 1,"size": 6,"mac": "74E50B186E8A","time": "2016-06-10T14:04:53Z"} Turn green LED off

Clone this wiki locally