The node descriptor file (at /osdl.js) is a JSON formatted string that describes the sensors and/or actuators provided by the node. The string contains four arrays: General, Sensors, Triggers and Actuators. The general array contains information that applies to all sensors,triggers and actuators on that node. The remaining arrays define zero or more interfaces of the sensors, triggers and actuators on that node. Control nodes do not define their own interfaces, instead interacting with the interfaces defined on other nodes.
General
A URL-keyed array of properties that are common to all sensors and actuators on the node. As an example the geographic location in latitude and longitude of the node is likely to apply also to all sensors and actuators of that node. The DarwinCore terms decimalLatitude and decimalLongitude could be used to describe the location of the sensor with the array keys in this instance being http://rs.tdwg.org/dwc/terms/decimalLatitude and http://rs.tdwg.org/dwc/terms/decimalLongitude respectively. The use of well established ontologies is recommended when this is possible.
Terms may be overridden on a per-sensor, per-trigger or per-actuator basis by assigning a value to the same URL key in the respective details section of Sensors or Actuators.
Sensor
For each sensor the Node Descriptor File should contain the following:
id | |
name | Human readable name of the sensor |
info_url | URL of a sensor descriptor |
process | Array of integer-keyed URLs of process descriptors |
req_path | URL to request an observation from the sensor |
signal | URL of a signal descriptor |
measures | URL of a measurement descriptor |
details | URL-keyed properties of an individual sensor (overrides Instances if same key defined in both sections) |
Optionally a sensor with id ‘all’ may be defined. The only required key in this case is req_url which should return a JSON array of sensor readings for all sensors defined within the Node Descriptor File.
Triggers
For each trigger the Node Descriptor File should contain the following:
id | |
name | Human readable name of the trigger |
info_url | URL of a trigger descriptor |
req_url | URL to register/unregister for trigger notifications |
req_method | GET or POST |
is_bool |
1 if the trigger is boolean (e.g. a trip wire) 0 if the trigger is numeric (e.g. a humidity sensor) |
range |
12-25 indicates you may request notifications in the range 12-25. Not set if is_bool=TRUE. |
details | URL-keyed properties of an individual trigger (overrides Instances if same key defined in both sections) |
Actuators
Several actions may be carried out on a single actuator. For example a camera (actuator) may have actions relating to setting modes and resolutions as well as taking a photograph. For each actuator the Node Descriptor File should contain the following:
id | |
name | Human readable name of the actuator |
info_url | URL of an actuator descriptor |
req_url | URL to request an action from the actuator (if set_value is used this is suffixed to the URL using: ?val=XX) |
type | Request: perform a single action Set_value: |
allowed_values | If set_value is used for type |
details | URL-keyed properties of an individual actuator (overrides Instances if same key defined in both sections) |