web_sdk_neiry
v1.1.5
Published
Web sdk
Readme
Connection to device functions
A list of functions that connects to specific device:
startScannerBrainBit() - function that connects BrainBit, return device object and uuid of device;;
startScannerHeadband() - function that connects HeadBand, return device object and uuid of device;
connectFlex() - function that connects Flex device, return device object and uuid of device;;
connectFlexPro() - function that connects Flex Pro device, return device object and uuid of device;;
Disconnect device
A function that disconnects device from pc:
- disconnectDevice(device: BluetoothDevice) - disconnects device, get device object in function's props
Commands
Functions that control state of device:
getDeviceStatus(service: BluetoothDevice, uuidService: string) - get current device status
goIdle(service: BluetoothDevice, uuidService: string) - set device to idle state;
goPowerDown(service: BluetoothDevice, uuidService: string) - set device to powerdown state;
goSignal(service: BluetoothDevice, uuidService: string) - set device to signal state and get values from device;
- You should connect to notifications from device to your project. For example,
const notifyCharacteristic = await service?.getCharacteristic(changeUUID(uuid, 4));notifyCharacteristic.startNotifications();notifyCharacteristic.addEventListener('characteristicvaluechanged', (event) => {const resp = handleSignalNotification(event);console.log(resp);});goResist(service: BluetoothDevice, uuidService: string) - set device to resist state and get values from device;
