All information collected from sensor board should be available as via a CoRE resourceCoAP server, mapped as below.This , and using simple json responses. This mapping is created after the mote identifies the sensor board and starts to collect sensor data.
Well knows REST resources
GET /.well-known/core
Description | Response |
---|---|
List of parameters as a link list interface | </d>;rt="simple.dev";if="core.ll", |
List of sensors parameters as a batch interface | </s>;rt="simple.sen";if="core.b"Possible Answer |
Sensor Board information | /d |
Sensor Data | /s |
Parameters
...
GET /d
Description | ResponseRequest | Example | Possible Answer | ||||||
---|---|---|---|---|---|---|---|---|---|
Sensor Board Interface Version | </d/itf_ver>;rt="simple.dev.itfv";if="core.rp" | GET /d/iter_ver | {"e": [ { "n": "version", "sv": "123" } ] } | Sensor Board Identification | </d/brd_id>;rt="simple.dev.brdid";if="core.rp" | GET /d/brd_id | {"e": [ { "n": "model", "sv": "model_name" }, { "n": "manufacturer", "sv": "manufacturer_name" }, { "n": "id", "sv": Identification (summary) | GET /d | { "v": "123", "m":"model_name", "id": "sensor_board_ID", "npts":10 } { "v": "undefined" } { } |
Interface Version | GET /d/ver | { "ver": "123" } { "ver": "undefined" } { } | |||||||
Model Name | GET /d/model | { "model": "model_name" } | |||||||
Manufacturer Name | GET /d/manuf | { "manuf": "manufacturer name" } | |||||||
Sensor Board ID | GET /d/id | { "id": "sensor_board_ID"}, { "n": " } | |||||||
Hardware Revision | GET /d/hw_rev | { "hw_rev", " sv": "hardware_revision"}, { "n": "has_display", "bv": true/false }, { "n": "has_battery", "bv": true/false }, { "n": "num_points", "v":10 } ] } | Sensor Board Status | </d/brd_status>;rt="simple.dev.brdst";if="core.rp" | GET } | ||||
Display Capability | GET /d/has_dsp | { "has_dsp": "yes" } | |||||||
Battery Capability | GET /d/has_bat | { "has_bat": "no" } | |||||||
Number of Points | GET /d/npts | { "npts": 10 } | |||||||
Point Description(1)(2) | GET /d/pt/n | { "n": "point_name", "t": 2, "u": 3, "ar": 1, "s": 10 } | |||||||
Sensor Board Status | GET /d/brd_status | { "e": [ { "n": "status", "sv": "status_result" } ] "status": 1 } | |||||||
Sensor board Command (send) | <PUT /d/cmd>;rt="simple.dev. cmd ";if="core.p"PUT / d/cmd ?id=cmd_id | { "status": "status_result" } | |||||||
Sensor board Command (answer) | </d/cmd>;rt="simple.dev.cmd";if="core.p" | GET GET /d/cmd | { "e result":[ { "n": "cmd", "sv": "cmd _result" }] } | ||||||
Battery Status | </d/bat_status>;rt="simple.dev.batst";if="core.rp" | GET GET /d/bat_status | { "e": [ { "n": "status", "sv"status": "Discharging" }] } | ||||||
Battery Charge | </d/bat_charge>;rt="simple.dev.batcg";if="core.rp" | GET (0 to 100%) | GET /d/bat_charge | { "e": [ { "n": "charge", "v": 50 "u":"%EL" } ] "charge": "75" } | |||||
Wireless Status | </d/wl_status>;rt="simple.dev.wlst";if="core.rp" | GET GET /d/wl_status | { "e": [ { "n": "status", "sv": "status": "Connected" }] } | ||||||
Wireless Strength</d/wl_strength>;rt="simple.dev.wlstg";if="core.rp" | GET /d/wl_strength | ||||||||
Description | Resource | Examples | |||||||
Get list of sensors | GET /s | {"e": [ { "n": "sensor1", "v": val1, "u": "unity1" }, { "n": "sensor2", "v": val2, "u": "unity2" }, { "n": "sensor3", "v": val3, "u": "unity3" }, { "n": "sensor4", "v": val4, "u": "unity4" } ] } | |||||||
Get sensor1 | GET /s/sensor1 | {"e": [ { "n": "sensor1", "v": val1 "u":"unit1" } ] } | |||||||
Put sensor1 | PUT /s/sensor1?v=val1 | { "e": [ { "n": "strength", "v": 50 "u":"%EL" } ] } | |||||||
Display | </d/dsp>;rt="simple.dev.dsp";if="core.p" | PUT /d/dsp?l1=line1&l2=line2 |
Sensors parameters (batch)
GET /s
"strength": "-10dBm" } | ||
Display(3) | PUT /d/dsp/line PUT /d/dsp/line/line | { "result": 1 } |
(1) Replace n by point index, starting at 0
(2) See this page for proper values in unit, right access and scan (sampling time)
(3) Each display line must be separated by slashes
Sensors parameters
Description | Request | Possible Answer |
---|---|---|
Get all sensor values | GET /s | [ "idx": 0, "v": val_1 }, { "idx": 1, "v": val_2 }] [{ }] |
Get sensor(1) | GET /s/n | { "v": value } { } |
Put sensor(1)(2) | PUT /s/n/value | |
(1) Replace n by point index, starting at 0
(2) Replace value by the desired value
References
- http://tools.ietf.org/id/draft-ietf-core-interfaces-01.txt
- http://tools.ietf.org/html/draft-jennings-senml-08
- https://datatracker.ietf.org/wg/core/charter/
...