-
Notifications
You must be signed in to change notification settings - Fork 2
Data Object Formats
simen edited this page May 4, 2017
·
9 revisions
This document shows the format of data objects you may come across when using the Device and Gadget instances.
Property | Type | Description |
---|---|---|
enabled | Boolean | Tells if this device is enabled. |
joinTime | Number | Device joined time, which is an UNIX(POSIX) time in ms. |
timestamp | Number | Timestamp at the last activity. |
traffic | Object | The traffic record of this device. |
role | String | Device role, which depends on protocol. For example, it may be 'peripheral' of a BLE device. |
parent | String | The parent of this device. It is '0' if the parent is the netcore, otherwise parent's permanent address. |
maySleep | Boolean | Tells whether this device may sleep or not. |
sleepPeriod | Number | The sleep period in seconds. This property is only valid when maySleep is true . |
status | String | Can be 'unknown' , 'online' , 'offline' , or 'sleep' . |
address | Object | The permanent and dynamic addresses of this device. This object is in the shape of { permanent, dynamic } . |
Others | Depends | Other network information |
{
enabled: true,
joinTime: 1458008311,
timestamp: 1458008617,
traffic: {
in: { hits: 882, bytes: 77826 }
out: { hits: 67, bytes: 1368 }
},
role: 'end-device',
parent: '0x24576052cdef',
maySleep: true,
sleepPeriod: 60,
status: 'online',
address: {
permanent: '0x12345678abcd',
dynamic: 10163
}
}
Property | Type | Description |
---|---|---|
manufacturer | String | Manufacturer name |
model | String | Model name |
serial | String | Serial number of this device. |
version | Object | Version tags. This object is in the shape of { hw: '', sw: 'v1.2.2', fw: 'v0.0.8' }
|
power | Object | Power source. This object is in the shape of { type: 'battery', voltage: '5 V' } . The type can be 'line', 'battery' or 'harvester'. |
Others | Depends | Other attrs |
{
manufacturer: 'freebird',
model: 'lwmqn-7688-duo',
serial: 'lwmqn-2016-03-15-01',
version: {
hw: 'v1.2.0',
sw: 'v0.8.4',
fw: 'v2.0.0'
},
power: {
type: 'line',
voltage: '5V'
}
}
Property | Type | Description |
---|---|---|
name | String | Human-readable name of this device, default will be an empty string '' if not set. |
description | String | Device description. Default will be an empty string '' if not set. |
location | String | Location of this device. Default will be an empty string '' if not set. |
Others | Depends | Other props |
{
name: 'home sensor 1',
description: 'It measures temp and humidity in kitchen.',
location: 'kitchen'
}
Property | Type | Description |
---|---|---|
enabled | Boolean | Indicate whether this gadget is enabled |
profile | String | Profile of this gadget, can be any string, such as 'Home' |
classId | String | Gadget class to tell what kind of an application is on this gadget |
Here classId is an IPSO-defined identifier, where the string ids are listed in this table.
Generally, only ids start from 3200 will suit the needs. For example, 3303 is an Object Id for a temperature sensor, and the classId will thus be its string version: 'temperature'
.
{
enabled: true,
profile: 'Home',
classId: 'temperature'
}
Property | Type | Description |
---|---|---|
Others | Depends | Remote attributes depend on classId of gadget. For a temperature sensor, it will have an attribute sensorValue , and may have attributes like units and resetMinMaxMeaValues . The possible attributes are listed here. |
{
sensorValue: 26.4 ,
unit: 'Cels'
}
Property | Type | Description |
---|---|---|
name | String | Human-readable name of this gadget, default will be a string of 'unknown' if not set |
description | String | Gadget description. Default will be an empty string '' if not set |
Others | Depends | Other props |
{
name: 'sivann temperature sensor',
description: 'Do not remove this sensor'
}
freebird team
Overview
Main Classes
Design Your Own Netcore
- Workflow
- APIs for Implementer
- Unified data model
- What should be implemented
Appendix
- Device data object format
- Gadget data object format