-
public interface IThingBleOperatorBLE operate manager. Provide basic ability of Normal BLE
-
-
Method Summary
Modifier and Type Method Description abstract IThingThirdProtocolSupportgetThingThirdProtocolSupport()abstract voidstartLeScan(int timeout, ScanType type, BleScanResponse response)Scan surrounding Bluetooth devices abstract voidstartLeScan(LeScanSetting setting, BleScanResponse response)Scan surrounding Bluetooth devices ,support multi scan type abstract voidclearLeCache()clear scan cache abstract voidstartScan(List<ScanFilter> filters, ScanSettings settings, PendingIntent callbackIntent)pendingIntent scan by Android system api abstract voidstopScan(PendingIntent callbackIntent)stop pendingIntent scan abstract voidstopLeScan()stop scan abstract voidconnectBleDevice(String address, LeConnectResponse response)Connect normal bluetooth devices, only physical connection, you can connect all Bluetooth devices. abstract voidregisterBleConnectStatus(String address, LeConnectStatusResponse response)Register normal bluetooth connection status monitoring. abstract voidunregisterBleConnectStatus(String address)unregister normal bluetooth connection status monitoring. abstract voiddisconnectBleDevice(String address)disconnect normal bluetooth abstract voidreadBluetoothRssi(String mac, BleRssiListener listener)read device rssi abstract booleanisBluetoothOpened()is phone bluetooth open abstract booleanopenBluetooth()open the phone bluetooth abstract booleancloseBluetooth()close the phone bluetooth abstract booleanisBleSupported()Does the phone support Bluetooth abstract intgetBondState(String mac)Get Bluetooth binding statusBOND_NONE = 10BOND_BONDING = 11BOND_BONDED = 12code = -1 ,maybe no bluetooth connect permission abstract voidregisterBluetoothStateListener(BluetoothStateChangedListener listener)abstract voidunregisterBluetoothStateListener(BluetoothStateChangedListener listener)abstract voidcreateBond(String deviceMac, IResultCallback response)Start the bonding (pairing) process with the remote device. abstract voidremoveBond(String deviceMac, IResultCallback removeBondResponse)Remove bond (pairing) with the remote device. abstract voidaddConnectHidListener(String deviceMac, IResultCallback listener)abstract voidremoveConnectHidListener(String deviceMac)abstract voidstartScanBindDevice(int timeout, ScanType type, IThingResultCallback<String> response)Scan surrounding Bluetooth devices -
-
Method Detail
-
getThingThirdProtocolSupport
abstract IThingThirdProtocolSupport getThingThirdProtocolSupport()
-
startLeScan
abstract void startLeScan(int timeout, ScanType type, BleScanResponse response)
Scan surrounding Bluetooth devices
- Parameters:
timeout- scan timeouttype- scan type see ScanTyperesponse- response BleScanResponse
-
startLeScan
abstract void startLeScan(LeScanSetting setting, BleScanResponse response)
Scan surrounding Bluetooth devices ,support multi scan type
- Parameters:
setting- scan setting LeScanSettingresponse- response BleScanResponse
-
clearLeCache
abstract void clearLeCache()
clear scan cache
-
startScan
abstract void startScan(List<ScanFilter> filters, ScanSettings settings, PendingIntent callbackIntent)
pendingIntent scan by Android system api
- Parameters:
filters- see ScanFiltersettings- see ScanSettingscallbackIntent- see PendingIntent
-
stopScan
abstract void stopScan(PendingIntent callbackIntent)
stop pendingIntent scan
- Parameters:
callbackIntent- see PendingIntent
-
stopLeScan
abstract void stopLeScan()
stop scan
-
connectBleDevice
abstract void connectBleDevice(String address, LeConnectResponse response)
Connect normal bluetooth devices, only physical connection, you can connect all Bluetooth devices.This type of connect returns only after the connection is successful
- Parameters:
address- Bluetooth device addressresponse- connect response LeConnectResponse
-
registerBleConnectStatus
abstract void registerBleConnectStatus(String address, LeConnectStatusResponse response)
Register normal bluetooth connection status monitoring.
- Parameters:
address- device's addressresponse- response
-
unregisterBleConnectStatus
abstract void unregisterBleConnectStatus(String address)
unregister normal bluetooth connection status monitoring.
- Parameters:
address- device's address
-
disconnectBleDevice
abstract void disconnectBleDevice(String address)
disconnect normal bluetooth
- Parameters:
address- device's address
-
readBluetoothRssi
abstract void readBluetoothRssi(String mac, BleRssiListener listener)
read device rssi
-
isBluetoothOpened
@Deprecated() abstract boolean isBluetoothOpened()
is phone bluetooth open
-
openBluetooth
@Deprecated() abstract boolean openBluetooth()
open the phone bluetooth
-
closeBluetooth
@Deprecated() abstract boolean closeBluetooth()
close the phone bluetooth
-
isBleSupported
abstract boolean isBleSupported()
Does the phone support Bluetooth
-
getBondState
abstract int getBondState(String mac)
Get Bluetooth binding statusBOND_NONE = 10BOND_BONDING = 11BOND_BONDED = 12code = -1 ,maybe no bluetooth connect permission
- Parameters:
mac- device's address
-
registerBluetoothStateListener
abstract void registerBluetoothStateListener(BluetoothStateChangedListener listener)
-
unregisterBluetoothStateListener
abstract void unregisterBluetoothStateListener(BluetoothStateChangedListener listener)
-
createBond
abstract void createBond(String deviceMac, IResultCallback response)
Start the bonding (pairing) process with the remote device.
This is an asynchronous call, it will return immediately. Registerfor ACTION_BOND_STATE_CHANGED intents to be notified whenthe bonding process completes, and its result.
Android system services will handle the necessary user interactionsto confirm and complete the bonding process.
-
removeBond
abstract void removeBond(String deviceMac, IResultCallback removeBondResponse)
Remove bond (pairing) with the remote device.
Delete the link key associated with the remote device, andimmediately terminate connections to that device that requireauthentication and encryption.
- Parameters:
deviceMac- device's mac
-
addConnectHidListener
abstract void addConnectHidListener(String deviceMac, IResultCallback listener)
-
removeConnectHidListener
abstract void removeConnectHidListener(String deviceMac)
-
startScanBindDevice
abstract void startScanBindDevice(int timeout, ScanType type, IThingResultCallback<String> response)
Scan surrounding Bluetooth devices
- Parameters:
timeout- scan timeouttype- scan type see ScanTyperesponse- response the devId of bind device
-
-
-
-