SmartCampus
1 december 2014 – Version 1.0
Written by: Cyril Cecchinel / I3S-Modalis
Bridge - Middleware API
Technical documentation
Queries respect the HTTP 1.1 standard. A GET request only read and returns resources. A POST request may cause the creation of a new resource and is not idempotent. A PUT request is idempotent and refers directly to a resource that will be created if it doesn’t exists, or updated otherwise. A DELETE request delete a resource.
Parameters specified in this documentations refers to data that can or must be transmitted to the server. Depending on the type of request, the parameters are given in a different way:
The API returns standard HTTP codes, and in particular:
200 | Request processed successfully. Indicates that recovery, modification or deletion of a resource was successful. |
201 | Resource created successfully. Indicates that the operation of adding the resource was successful (after a PUT or POST for example). |
400 | Incorrect parameters. Indicates that the request parameters are incorrect (e.g. required parameter unspecified). |
404 | Resource not found. Indicates that one wants to access a resource that does not exist (e.g with the wrong ID). |
A value is a triplet (measure - sensor name - timestamp) sent to a SmartCampus collector.
DESCRIPTION | Send a value to the collector | |
PARAMETERS | n REQUIRED Sensor name v REQUIRED Raw measure t REQUIRED Timestamp of measurement | |
EXAMPLE
|
SmartCampus bridges allow to expose the sensor network to Internet. They act as “Border routers”.
DESCRIPTION | Retrieve all sensor platforms connected to the Bridge | |
RESULT | Boards array EXEMPLE
|
DESCRIPTION | Push a Sensor Network configuration | |
PARAMETERS | sensors REQUIRED A JSON array of Sensor objects | |
OBJECT SENSOR | id Sensor ID board Sensor board pin Pin number on which the sensor is connected freq Sensor period (in second) end-point Collector URL | |
NOTE | If a previous configuration was deployed on the sensor network, it will be replaced with the new one. | |
EXAMPLE
|