Skip to main content

Standard BRIDGE Data Pipeline

alt text Example pipeline for imaginary "Device_X" which is a BLE Input Device used in an example Visualizer Page

Frontend (App) side

(See System Architecture for more details)

Device and Data Context:

  • Device and Data Context (See ...)

This essential component will contain a reference to all active devices being used by the app.

info

Think of the DDC as the hub through which all components of the app talk to devices through.

Hooks:

info

Hooks are effectivley complex functions we can pass around to access and store information.

  • useDeviceStream: Returns a reference to device data when provided with a device reference
  • useConnectionState: Returns a reference to the connection state of a device, useful for dynamic connection indicators and error handling.

Also...

  • useDeviceScanner: Handles the scanning for bluetooth device logic. If you select a BLEInputDevice type for example, this hook is used to scan and filter for that specific device.

Pages:

Assume you have connected via the standard Connections Page. See Pages for more details.

When using the Connections Page, you will typically add a device.

info

Available devices are always defined using the Device Registry. This is a separate component to the Device-and-Data-Context.

Example Page:

  • Visualizer Page: Listens to an active device stream and visualizes its data, updating every 16 ms.

Backend side

The backend runs outside of the React ecosystem. This allows us to more intuitively control and interact with them at a higher level while allowing some degree of abstraction between components (example: Calling Device.connect() instead of complex custom connection logic in every page for every device...)

Devices

Devices all have standard behavior, defined by the root-level Base Device class. (See System Architecture: Base Device)

We have several device sub-types defined, they inherit properties from Base Device, but expand on them with some unique functionality. (See beneath System Architecture: Base Device)

info

In the example pipeline shown, a device, "Device_X" extends the System Architecture: BLE Input Device which itself extends System Architecture: Base Device.