Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

SDK HARDWARE_ONLINE & HARDWARE_OFFLINE Callbacks

The exhibit SDK emits a HARDWARE_ONLINE event with the after a hardware connection is established and successfully authenticates. It also emits a HARDWARE_OFFLINE event if the MQTT heartbeat for a particular harwareId connection isn’t received by the SDK within 20 seconds.

Code Block
// gumband sdk initalization above...
// register hardware connection callbacks
gb.on(Sockets.HARDWARE_ONLINE, (payload) => {
    console.log(payload);
});
gb.on(Sockets.HARDWARE_OFFLINE, (payload) => {
    console.log(payload);
});

Both events contain the following payload:

Code Block
{
  hardwareId: 123,
  name: 'Exhibit Gizmo'
}

SDK Hardware Authentication Scenarios

...

If two connections try to authenticate with the same hardwareId, the SDK responds whether or not the existing connection is authenticated. If that case is true, then the new hardware connection is rejected. If the existing connection is not authenticated (ie. in the “Waiting for Auth” queue), then that connection will be severed and the new connection will be accepted.

SDK HARDWARE_ONLINE & HARDWARE_OFFLINE Callbacks

The exhibit SDK emits a HARDWARE_ONLINE event with the after a hardware connection is established and successfully authenticates. It also emits a HARDWARE_OFFLINE event if the MQTT heartbeat for a particular harwareId connection isn’t received within 20 seconds. Both events contain the following payload

...