...
Just as the hardware authenticates with the Gumband Cloud, it also needs to authenticate with the SDK to ensure only expected hardware interacts with exhibits. The SDK gets the list of connected hardware from the Gumband Cloud, and then allows hardware to connect and authenticate with the same ID / token combination.
Info |
---|
Available in version |
SDK “Waiting for Auth” Queue
When the exhibit connection to the Gumband Cloud is pending or unstable, the following connections are added to a “Waiting for Authentication” queue until the SDK receives the connected hardware list from the Gumband Cloud. If the SDK does not receive that list within 10 sec
of the hardware connection, the SDK initiates a disconnection at which point the hardware would will back off and retry. That cycle would continue continues until the SDK had has the required hardware info and the hardware is able to successfully connect.
...
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 |
...
Info |
---|
Available in version 1.0.30 and later in the Node.js SDK |
...
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
. I also added a hardware 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 current docs have this heartbeat at 13s
per, is that accurate?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',
} |