Overview of the Cortex API flow

Basic Flow

  1. Import the CortexPlugin namespace

  2. Call Cortex.Start with your cortex app's client id and secret

  3. Subscribe to Cortex.HeadsetQueryResult to periodically receive a list of available headsets

  4. Connect to a headset or start a session if the device is already connected

The underlying Cortex API runs on an asynchronous request response paradigm standard to web communication. This Package adapts this approach slightly to provide responses as subscribable events, materially disconnected from the requests that might have initiated them.

This approach is intended primarily to simplify the use of the device information and mental command data streams by allowing you to subscribe to them anywhere using the headset id once a session has been started.

Practically, this leads to one primary workflow. Scripts subscribe to relevant events when initialized or enabled, unsubscribing when destroyed or disabled. Requests are made when needed, with care taken outside of the plugin through subscription or checks that only relevant events are being acted upon. This is Demonstrated in the Headset Manager sample class:

Last updated