Bluetooth Management
OpenAndroidBluetoothSetting
Open Android Bluetooth settings.
RegisterBluetoothCallback
Register bluetooth callback.
Parameter | Description |
btAdapter | callback when local bluetooth on/off state change |
btDevice | callback when bluetooth device scan finished |
btDeviceBond | device bonding state, ref:DeviceBondState |
btConDeviceState | callback when connected device state change |
Prototype for OnBtLocalStateCallback
Parameter | Description |
state | local bluetooth state |
Prototype for OnBtLocalScanCallback
Parameter | Description |
scanState | true -> is scanning state |
deviceInfo | bluetooth device info, exp:{"DeviceClass":1024,"address":"30:21:30:45:17:7B","name":"ifkoo Q8","rssi":-39} |
Prototype for OnBtDeviceBondCallback
Parameter | Description |
deviceName | device name |
bondState | device bond state |
Prototype for OnBtDeviceConnectionStateCallback
Parameter | Description |
name | device name |
preState | device previous state |
currentState | device current state |
IsBluetoothEnabled
check local bluetooth is enabled
UnregisterBluetoothCallback
unregister bluetooth callback.
Warning: this method will remove all bluetooth listeners registered
GetConnectedDeviceNameList
get connected device name list
SetBluetoothEnabled
enable/disable local bluetooth state
Parameter | Description |
enable |
|
GetBluetoothState
get local bluetooth state
GetLocalName
get local bluetooth name
SetLocalName
set local bluetooth device name
Parameter | Description |
localName | local bluetooth name user want |
StartDiscovery
start scan bluetooth device
IsDiscovering
Return true if the local Bluetooth adapter is currently in the device discovery process
CancelDiscovery
Cancel the current device discovery process
GetBluetoothBondedDevices
Return the json string of objects that are bonded (paired) to the local adapter.
ConnectBluetoothDevice
Connect bluetooth device by address
warning: only supported DeviceClass is AUDIO_VIDEO or PERIPHERAL
Parameter | Description |
address | device address |
RemoveBluetoothDevice
remove bluetooth device
Parameter | Description |
address | device address |
Last updated