Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Enhancing put requests, formatting and description

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


</s>;rt="simple.sen";if="core.b"
DescriptionResponse
List of parameters as a link list interface</d>;rt="simple.dev";if="core.ll",
List of sensors parameters as a batch interfacePossible Answer
Sensor Board information/d
Sensor Data/s

 

Parameters

...

 

GET /d

 
 
 
 
DescriptionExampleRequestPossible AnswersAnswer
Sensor Board Identification (summary)
GET /d
{ "itfv": "123", "model":"model_name", 
    "id": "sensor_board_ID", "npts":10 }
{ "itfv": "undefined" }
{ }
Interface Version
GET /d/itfv
{ "itfv": "123" }
{ "itfv": "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
{ "name": "point_name", 
  "type": 2, "unit": 3, 
"rights": 1, "scan": 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/line1line
PUT /d/dsp/line1line/line2line
{ "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

...

 

DescriptionResourceRequestPossible Answer
Get all sensor values 
GET /s
[ { "sensor1sens_name_1": val1val_1 }, 
  { "sensor2sens_name_2": val2val_2 }, 
  { "sensor3sens_name_3": val3val_3 } ] 
{ }
Get sensor1sensor(1)
GET /s/sensor1n
{ "val": val1 value } 
{ }
Put sensor1sensor(1)(2)
PUT /s/sensor1n/val1value
{ "result": 0 }

(1) Replace n by point index, starting at 0

(2) Replace value by the desired value

References


...