Skip to main content

WebBluetoothTransport

@neurosity/sdk


@neurosity/sdk / WebBluetoothTransport

Class: WebBluetoothTransport

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:30

Implements​

  • BluetoothTransport

Constructors​

Constructor​

new WebBluetoothTransport(options): WebBluetoothTransport

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:57

Parameters​

options​

Options = {}

Returns​

WebBluetoothTransport

Properties​

_isAutoConnectEnabled$​

_isAutoConnectEnabled$: ReplaySubject<boolean>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:55


characteristicsByName​

characteristicsByName: object = {}

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:37

Index Signature​

[name: string]: BluetoothRemoteGATTCharacteristic


connection$​

connection$: BehaviorSubject<BLUETOOTH_CONNECTION>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:41


connectionStream$​

connectionStream$: Observable<BLUETOOTH_CONNECTION>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:47


device​

device: BluetoothDevice

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:34


logs$​

logs$: ReplaySubject<string>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:45

Implementation of​

BluetoothTransport.logs$


onDisconnected$​

onDisconnected$: Observable<void>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:46


options​

options: Options

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:33


pendingActions$​

pendingActions$: BehaviorSubject<any[]>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:44


server​

server: BluetoothRemoteGATTServer

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:35


service​

service: BluetoothRemoteGATTService

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:36


textCodec​

textCodec: TextCodec

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:32


type​

type: TRANSPORT_TYPE = TRANSPORT_TYPE.WEB

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:31

Implementation of​

BluetoothTransport.type

Methods​

_addPendingAction()​

_addPendingAction(actionId): void

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:410

Parameters​

actionId​

number

Returns​

void


_autoConnect()​

_autoConnect(selectedDevice$): Observable<void>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:85

Parameters​

selectedDevice$​

Observable<DeviceInfo>

Returns​

Observable<void>

Implementation of​

BluetoothTransport._autoConnect


_autoToggleActionNotifications()​

_autoToggleActionNotifications(): Observable<any>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:422

Returns​

Observable<any>


_getPairedDevices()​

_getPairedDevices(): Promise<BluetoothDevice[]>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:81

Returns​

Promise<BluetoothDevice[]>


_onDisconnected()​

_onDisconnected(): Observable<any>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:254

Returns​

Observable<any>


_removePendingAction()​

_removePendingAction(actionId): void

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:415

Parameters​

actionId​

number

Returns​

void


addLog()​

addLog(log): void

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:156

Parameters​

log​

string

Returns​

void

Implementation of​

BluetoothTransport.addLog


connect()​

connect(deviceNickname?): Promise<void>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:169

Parameters​

deviceNickname?​

string

Returns​

Promise<void>

Implementation of​

BluetoothTransport.connect


connection()​

connection(): Observable<BLUETOOTH_CONNECTION>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:165

Returns​

Observable<BLUETOOTH_CONNECTION>

Implementation of​

BluetoothTransport.connection


disconnect()​

disconnect(): Promise<void>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:266

Returns​

Promise<void>

Implementation of​

BluetoothTransport.disconnect


dispatchAction()​

dispatchAction(__namedParameters): Promise<any>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:471

Parameters​

__namedParameters​

ActionOptions

Returns​

Promise<any>

Implementation of​

BluetoothTransport.dispatchAction


enableAutoConnect()​

enableAutoConnect(autoConnect): void

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:152

Parameters​

autoConnect​

boolean

Returns​

void

Implementation of​

BluetoothTransport.enableAutoConnect


getCharacteristicByName()​

getCharacteristicByName(characteristicName): Promise<BluetoothRemoteGATTCharacteristic>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:280

Bluetooth GATT attributes, services, characteristics, etc. are invalidated when a device disconnects. This means your code should always retrieve (through getPrimaryService(s), getCharacteristic(s), etc.) these attributes after reconnecting.

Parameters​

characteristicName​

string

Returns​

Promise<BluetoothRemoteGATTCharacteristic>


getServerServiceAndCharacteristics()​

getServerServiceAndCharacteristics(device): Promise<never>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:217

Parameters​

device​

BluetoothDevice

Returns​

Promise<never>


isConnected()​

isConnected(): boolean

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:160

Returns​

boolean


readCharacteristic()​

readCharacteristic(characteristicName, parse): Promise<any>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:355

Parameters​

characteristicName​

string

parse​

boolean = false

Returns​

Promise<any>

Implementation of​

BluetoothTransport.readCharacteristic


requestDevice()​

requestDevice(deviceNickname?): Promise<BluetoothDevice>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:180

Parameters​

deviceNickname?​

string

Returns​

Promise<BluetoothDevice>

Implementation of​

BluetoothTransport.requestDevice


subscribeToCharacteristic()​

subscribeToCharacteristic(__namedParameters): Observable<any>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:286

Parameters​

__namedParameters​

SubscribeOptions

Returns​

Observable<any>

Implementation of​

BluetoothTransport.subscribeToCharacteristic


writeCharacteristic()​

writeCharacteristic(characteristicName, data): Promise<void>

Defined in: api/bluetooth/web/WebBluetoothTransport.ts:388

Parameters​

characteristicName​

string

data​

string

Returns​

Promise<void>

Implementation of​

BluetoothTransport.writeCharacteristic