...
Code Block |
---|
{ noInternetConnection: true, noInternetHardwareIds: [100, 121, 10], // list hardware IDs to allow } |
SDK Events
Event Name | Description |
---|---|
Sockets.HARDWARE_ONLINE | Emitted when a hardware device connects to the SDK |
Sockets.HARDWARE_OFFLINE | Emitted when a hardware device disconnects from the SDK |
Sockets.HARDWARE_PROPERTY_RECEIVED | Emitted when the SDK receives a property sent by the hardware. |
SDK HARDWARE_ONLINE
& HARDWARE_OFFLINE
Callbacks
There is a HARDWARE_ONLINE
callback for the SDK that is used when the token is accepted and the SDK sends back true
on hardwareId/authenticate
. There is also an "expiry" timeout that triggers a HARDWARE_OFFLINE
event in the SDK if the heartbeat for a particular harwareId
isn’t received within 20s
. The hardware currently sends a heartbeat every 16s
Online Data Payload
Code Block | ||
---|---|---|
| ||
{
hardwareId: ##,
name: 'Name of device',
peripherals:
{
'examplePeripheral':
{
'Example Property 1':
{
peripheral: 'examplePeripheral',
property: 'Example Property 1',
order: 0,
numProperties: 2,
type: 'gmbnd_byte',
length: 1,
settable: 'false',
gettable: 'false',
hidden: 'false',
info: 'example property description',
},
'Example Property 2': {},
},
'anotherPeripheral':
{
'Example Property 3': {},
}
}
} |
Offline Data Payload
Code Block | ||
---|---|---|
| ||
{
hardwareId: ##,
name: 'Name of device',
} |
SDK HARDWARE_PROPERTY_RECEIVED
Callbacks
There is a HARDWARE_PROPERTY_RECEIVED
callback for the SDK triggered whenever a property is published by the hardware device.
Property Data Payload
Code Block | ||
---|---|---|
| ||
{
hardwareId: ##,
name: 'Name of device',
value: ###,
peripheral: 'examplePeripheral',
property: 'Example Property 1',
} |