The Device Manager is able to manage IoT devices with its sensors / actuators (eg create, remove). It also allows to monitor data collected from these devices.
This Hyperty handles a standard Device Data Object with:
example
to be updated
{
"scheme": "context",
"id": "1276020076",
"time": 1465070579,
"values": [ {
"type": "location_context",
"unit": "lat",
"value": 23.55052 },
{
"scheme": "context",
"id": "1276020076",
"time": 1465070579,
"values": [ {
"type": "location_context",
"unit": "lon",
"value": -46.633309 }]
}
The Device Manager configuration comprises:
deviceManager: <wallet manager server address>
The Device Manager Hyperty provides an API to create and remove devices, as well as to create and remove endpoints associated to it.
This function creates one device.
<Promise> createDevice()
parameters
No input parameter.
returns
A promise with the new created Device data object.
A execute type message is sent torwards <wallet manager server address>
set in the configuration, having in the body createDevice
function name.
This function removes one device.
boolean removeDevice(string deviceId)
parameters
deviceId - the id of the device to be removed.
returns
A boolean is returned where true is for a successfull remove and false for a failed remove.
A execute type message is sent torwards <wallet manager server address>
set in the configuration, having in the body removeDevice
function name and associated parameter.
This function creates one endpoint at one device.
<Promise> createEndpoint(string deviceId, string type, string name, string ?extId)
parameters
deviceId - the id of the device where the endpoint is created.
type - endpoint type ie “sensor” or “actuator”.
name - name to be given to the endpoint.
extId - (optional) to be used in case this is a virtual endpoint and data is coming from a separated device or plataform.
returns
A promise with the new created Endpoint object.
A execute type message is sent torwards <wallet manager server address>
set in the configuration, having in the body createEndpoint
function name with associated parameters.
This function removes one endpoint from the device.
boolean removeEndpoint(string name)
parameters
name - the id of the Endpoint to be removed.
returns
A boolean is returned where true is for a successfull remove and false for a failed remove.
A execute type message is sent torwards <wallet manager server address>
set in the configuration, having in the body removeEndpoint
function name and associated parameter.
to be updated
The Hyperty descriptor is:
"LocationObserver": {
"sourcePackage": {
"sourceCode": ""
"sourceCodeClassname": "LocationObserver",
"encoding": "base64",
"signature": ""
},
"hypertyType": ["location_context"],
"cguid": 10004,
"version": "0.1",
"description": "Descriptor of LocationObserver Hyperty",
"objectName": "LocationObserver",
"configuration": {},
"sourcePackageURL": "/sourcePackage",
"language": "javascript",
"signature": "",
"messageSchemas": "",
"dataObjects": [
"https://catalogue.hybroker.rethink.ptinovacao.pt/.well-known/dataschema/Context"
],
"accessControlPolicy": "somePolicy"
}
Since the Hyperty supports the standard context data schema, any Catalog URL for that schema can be used.