BluetoothConnection

BluetoothConnection - Handles Web Bluetooth connections to GNSS receivers

Constructor

new BluetoothConnection()

Classes

BluetoothConnection

Methods

(async) connect(options) → {Promise.<boolean>}

Connect to a GNSS receiver

Parameters:
NameTypeDescription
optionsObject

Connection options

Returns:

Whether connection was successful

Type: 
Promise.<boolean>

(async) connectToSparkFunFacet(options) → {Promise.<boolean>}

Special connection method for SparkFun Facet RTK Rover

Parameters:
NameTypeDescription
optionsObject

Connection options

Returns:

Whether connection was successful

Type: 
Promise.<boolean>

(async) disconnect()

Disconnect from the device

getConnectionInfo() → {Object}

Get connection status information

Returns:

Connection status

Type: 
Object

handleIncomingData(event)

Handle incoming data from the device

Parameters:
NameTypeDescription
eventEvent

Characteristic value changed event

isDeviceConnected() → {boolean}

Check if device is connected

Returns:

Whether device is connected

Type: 
boolean

(async) onDisconnected()

Handle device disconnection

(async) sendCommand(command) → {Promise.<boolean>}

Send a command to configure the device

Parameters:
NameTypeDescription
commandstring

Command string

Returns:

Whether command was sent successfully

Type: 
Promise.<boolean>

(async) sendData(data) → {Promise.<boolean>}

Send data to the device

Parameters:
NameTypeDescription
datastring | ArrayBuffer

Data to send

Returns:

Whether send was successful

Type: 
Promise.<boolean>