CoAP server specification for motes with sensor board

All information collected from sensor board should be available via a CoAP server, mapped as below, 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


DescriptionPossible Answer
Sensor Board information/d
Sensor Data/s

 

Parameters

 

DescriptionRequestPossible Answer
Sensor Board 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" }
Hardware Revision
GET /d/hw_rev
{ "hw_rev": "hardware_revision" }
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
{ "status": 1 }
Sensor board Command (send)
PUT /d/cmd/cmd_id
{ "status": "status_result" }
Sensor board Command (answer)
GET /d/cmd
{ "result": "cmd_result" } 
Battery Status
GET /d/bat_status
{ "status": "Discharging" }
Battery Charge (0 to 100%)
GET /d/bat_charge
{ "charge": "75" }
Wireless Status
GET /d/wl_status
{ "status": "Connected" }
Wireless Strength
GET /d/wl_strength
{ "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

 

DescriptionRequestPossible 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