BluetoothButtonHandler

class BluetoothButtonHandler(context: Context, scope: CoroutineScope)

This class will scan for bluetooth devices and connect to a specified device. Upon connection it will look for notification characteristics and if found listen for updates on those characteristics. This class is meant to support push to talk buttons so only notifications with a value of 0 or 1 will be processed. When a 0 or 1 is received a button state is emitted.

This class assumes all necessary bluetooth permissions have already been granted. In the context of Dash these permissions are handled in MapGptPermissions.

Constructors

Link copied to clipboard
constructor(context: Context, scope: CoroutineScope)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun connectToDevice(deviceName: String)
Link copied to clipboard
Link copied to clipboard
fun disConnectDevice(deviceName: String)
Link copied to clipboard
Link copied to clipboard