The DeviceBuilder Input format is to list all resources that needs to be included in the device that will make up the application. It lists the resources that will be sensor/actuators/etc. that make up the functionality of the device. The input file format supports additional information per resource so that the OCF data model can be changed. The changes that are allowed are limited: the result still needs to be OCF compliant. for example:
The property that is being used to find the resource is the rt value. The rt value is being used as lookup towards the IoTDataModels/Core github repos where the resource will be used from.
In OCF devices are defined by the Device Type. The Device Types can have mandatory resources.
Device Types are defined in the device specification.
But for ease of use (search) the list also can be found as interactive web page.
The list of standardized resources can be found in the Resource Type Specification.
For ease of use (search) the resources can also be found in the interactive web page.
The DeviceBuilder input file format is an JSON array that define each resource separately. The following properties are defined:
The advantage of the file format that it is:
This input file describes the minimal light device, implementing only binary switch (on/off).
[
{
"path" : "/binaryswitch",
"rt" : [ "oic.r.switch.binary" ],
"if" : ["oic.if.a", "oic.if.baseline" ],
"remove_properties" : [ "range", "step" , "id", "precision", "n" ]
}
]
Note: IoTivity classic needs /oic/p entry, IoTivity Lite does NOT require and /oic/p entry. since IoTivity classic has optional implemented properties in the /oic/p resource.
sh DeviceBuilder_IotivityLiteServer.sh ./test/input_DeviceBuilderInputFormat/input-lightdevice.json ../lightdevice "oic.d.light"
The light device implementing binary switch (on/off) and the dimming resource.
The input file is here
sh DeviceBuilder_IotivityLiteServer.sh ./test/input_DeviceBuilderInputFormat/input-lightdevice-dimming.json ../lightdevice-dimming "oic.d.light"
The light device implementing binary switch (on/off), dimming and colour chroma.
The input file is here
sh DeviceBuilder_IotivityLiteServer.sh ./test/input_DeviceBuilderInputFormat/
input-lightdevice-dimming-chroma.json ../input-lightdevice-dimming-chroma "oic.d.light"
A device as thermostat, having 2 temperature resourses.
actuator resource, stripped out: units.
The input file is here
sh DeviceBuilder_IotivityLiteServer.sh ./test/input_DeviceBuilderInputFormat/
input-thermostat.json ../input-thermostat "oic.d.sensor"