-
public interface IThingBleAbility
-
-
Method Summary
Modifier and Type Method Description abstract void
connect(String mac, BleConnectParams bleConnectParams, BleConnectAbilityResponse response)
connect ble device abstract void
discoveryServices(String mac, BleConnectAbilityResponse response)
discovery ble services abstract void
requestConnectionPriority(int priority, String mac)
Set the connection priority of a device with a mac address abstract void
disconnect(String mac)
disconnect a device with mac address abstract void
onlyDisconnect(String mac)
abstract void
registerConnectStatusListener(String mac, BleConnectStatusResponse listener)
Monitor Bluetooth connection status abstract void
unregisterConnectStatusListener(String mac, BleConnectStatusResponse listener)
Cancel monitoring Bluetooth connection status abstract void
read(String mac, UUID service, UUID character, BleReadAbilityBaseResponse response)
Read the characteristic value under a service of Bluetooth abstract void
write(String mac, UUID service, UUID character, Array<byte> value, BleBaseResponse response)
Write a characteristic value under a service of Bluetooth abstract int
write(String mac, UUID service, UUID character, Array<Array<byte>> value, long packTimeout)
Write a characteristic value under a service of Bluetooth with a timeout abstract int
writeNoRsp(String mac, UUID service, UUID character, Array<Array<byte>> value, int packTimeout)
Write a characteristic value under a service of Bluetooth with a timeout,and no response abstract void
readDescriptor(String mac, UUID service, UUID character, UUID descriptor, BleReadAbilityBaseResponse response)
Read a characteristic value abstract void
writeDescriptor(String mac, UUID service, UUID character, UUID descriptor, Array<byte> value, BleBaseResponse response)
Write a descriptor value under a service of Bluetooth with a timeout abstract void
writeNoRsp(String mac, UUID service, UUID character, Array<byte> value, BleBaseResponse response)
Write a character value under a service of Bluetooth abstract void
notify(String mac, UUID service, UUID character, BleNotifyAbilityResponse response)
notify a character value under a service of Bluetooth abstract void
unnotify(String mac, UUID service, UUID character, BleBaseResponse response)
abstract void
readRssi(String mac, BleGetRssiBaseResponse response)
read a rssi by mac abstract void
configMtu(String mac, int mtu, BleConfigMtuBaseResponse response)
abstract void
registerBluetoothStateListener(BluetoothStateChangedReponse reponse)
abstract void
unregisterBluetoothStateListener(BluetoothStateChangedReponse reponse)
abstract void
refreshCache(String mac)
-
-
Method Detail
-
connect
abstract void connect(String mac, BleConnectParams bleConnectParams, BleConnectAbilityResponse response)
connect ble device
- Parameters:
mac
- ble device's macAddressbleConnectParams
- connection strategyBleConnectParamsresponse
- connection callbackBleConnectAbilityResponse
-
discoveryServices
abstract void discoveryServices(String mac, BleConnectAbilityResponse response)
discovery ble services
- Parameters:
mac
- ble device's macAddressresponse
- callback BleConnectAbilityResponse
-
requestConnectionPriority
abstract void requestConnectionPriority(int priority, String mac)
Set the connection priority of a device with a mac address
- Parameters:
priority
- prioritymac
- ble device's macAddress
-
disconnect
abstract void disconnect(String mac)
disconnect a device with mac address
- Parameters:
mac
- ble device's macAddress
-
onlyDisconnect
abstract void onlyDisconnect(String mac)
-
registerConnectStatusListener
abstract void registerConnectStatusListener(String mac, BleConnectStatusResponse listener)
Monitor Bluetooth connection status
- Parameters:
mac
- ble device's macAddresslistener
- Bluetooth connection status callbackBleConnectStatusResponse
-
unregisterConnectStatusListener
abstract void unregisterConnectStatusListener(String mac, BleConnectStatusResponse listener)
Cancel monitoring Bluetooth connection status
- Parameters:
mac
- ble device's macAddresslistener
- The previously registered Bluetooth listener callbackregisterConnectStatusListener
-
read
abstract void read(String mac, UUID service, UUID character, BleReadAbilityBaseResponse response)
Read the characteristic value under a service of Bluetooth
- Parameters:
mac
- ble device's macAddressservice
- Unique sign of bluetooth servicecharacter
- A characteristic value under the Bluetooth serviceresponse
- The callback result of reading a characteristic value under the Bluetooth serviceBleReadAbilityBaseResponse
-
write
abstract void write(String mac, UUID service, UUID character, Array<byte> value, BleBaseResponse response)
Write a characteristic value under a service of Bluetooth
- Parameters:
mac
- ble device's macAddressservice
- Unique sign of bluetooth servicecharacter
- A characteristic value under the Bluetooth servicevalue
- The value of the bluetooth characteristic writtenresponse
- The callback result of writing a characteristic value under the Bluetooth serviceBleBaseResponse
-
write
abstract int write(String mac, UUID service, UUID character, Array<Array<byte>> value, long packTimeout)
Write a characteristic value under a service of Bluetooth with a timeout
- Parameters:
mac
- ble device's macAddressservice
- Unique sign of bluetooth servicecharacter
- A characteristic value under the Bluetooth servicevalue
- The value of the bluetooth characteristic writtenpackTimeout
- timeout of write
-
writeNoRsp
abstract int writeNoRsp(String mac, UUID service, UUID character, Array<Array<byte>> value, int packTimeout)
Write a characteristic value under a service of Bluetooth with a timeout,and no response
- Parameters:
mac
- ble device's macAddressservice
- Unique sign of bluetooth servicecharacter
- A characteristic value under the Bluetooth servicevalue
- The value of the bluetooth characteristic writtenpackTimeout
- timeout of write
-
readDescriptor
abstract void readDescriptor(String mac, UUID service, UUID character, UUID descriptor, BleReadAbilityBaseResponse response)
Read a characteristic value
- Parameters:
mac
- ble device's macAddressservice
- Unique sign of bluetooth servicecharacter
- A characteristic value under the Bluetooth servicedescriptor
- The value of the bluetooth characteristicresponse
- The callback result of read a characteristic value under the Bluetooth service,BleReadAbilityBaseResponse
-
writeDescriptor
abstract void writeDescriptor(String mac, UUID service, UUID character, UUID descriptor, Array<byte> value, BleBaseResponse response)
Write a descriptor value under a service of Bluetooth with a timeout
- Parameters:
mac
- ble device's macAddressservice
- Unique sign of bluetooth servicecharacter
- A characteristic value under the Bluetooth servicedescriptor
- A descriptor value under the Bluetooth charactervalue
- The value of the bluetooth characteristic writtenresponse
- The callback result of writing a characteristic value under the Bluetooth serviceBleBaseResponse
-
writeNoRsp
abstract void writeNoRsp(String mac, UUID service, UUID character, Array<byte> value, BleBaseResponse response)
Write a character value under a service of Bluetooth
- Parameters:
mac
- ble device's macAddressservice
- Unique sign of bluetooth servicecharacter
- A characteristic value under the Bluetooth servicevalue
- The value of the bluetooth characteristic writtenresponse
- The callback result of writing a characteristic value under the Bluetooth serviceBleBaseResponse
-
notify
abstract void notify(String mac, UUID service, UUID character, BleNotifyAbilityResponse response)
notify a character value under a service of Bluetooth
- Parameters:
mac
- ble device's macAddressservice
- Unique sign of bluetooth servicecharacter
- A characteristic value under the Bluetooth serviceresponse
- The callback result of writing a characteristic value under the Bluetooth serviceBleBaseResponse
-
unnotify
abstract void unnotify(String mac, UUID service, UUID character, BleBaseResponse response)
-
readRssi
abstract void readRssi(String mac, BleGetRssiBaseResponse response)
read a rssi by mac
- Parameters:
mac
- ble device's macAddressresponse
- callback
-
configMtu
abstract void configMtu(String mac, int mtu, BleConfigMtuBaseResponse response)
-
registerBluetoothStateListener
abstract void registerBluetoothStateListener(BluetoothStateChangedReponse reponse)
-
unregisterBluetoothStateListener
abstract void unregisterBluetoothStateListener(BluetoothStateChangedReponse reponse)
-
refreshCache
abstract void refreshCache(String mac)
-
-
-
-