Skip to content

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.

Device

Gadget



netInfoObj: Network information

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

Example

{
    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 
    }
}



devAttrsObj: Attributes on the remote device

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

Example

{
    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'
    }
}



devPropsObj: User-defined properties on the server-side proxy device

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

Example

{
    name: 'home sensor 1',
    description: 'It measures temp and humidity in kitchen.',
    location: 'kitchen'
}



panelInfoObj: Panel information

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

<< Important >>

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'.

Example

{
    enabled: true,
    profile: 'Home',
    classId: 'temperature'
}



gadAttrsObj: Attributes on the remote gadget

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.

Example

{
    sensorValue: 26.4 ,
    unit: 'Cels'
}



gadPropsObj: User-defined properties on the server-side proxy gadget

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

Example

{
    name: 'sivann temperature sensor',
    description: 'Do not remove this sensor'
}