Class BluetoothHost
- java.lang.Object
-
- ej.library.iot.rcommand.bluetooth.BluetoothHost
-
public class BluetoothHost extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddService(byte[] service, short[] handles)booleanconnect(byte[] deviceAddress)voiddisable()booleandisconnect(short connHandle)booleandiscoverServices(short connHandle, byte[] uuid)booleanenable()static BluetoothHostgetInstance()voidonEventAvailable()booleansendExecuteWriteResponse(short connHandle, short attributeHandle, byte status)booleansendNotification(short connHandle, short attributeHandle, byte[] value, int valueSize, boolean confirm)booleansendPairRequest(short connHandle)booleansendPairResponse(short connHandle, boolean accept)booleansendPasskeyResponse(short connHandle, boolean accept, int passkey)booleansendPrepareWriteResponse(short connHandle, short attributeHandle, byte status, byte[] value, int valueSize, int offset)booleansendReadRequest(short connHandle, short attributeHandle)booleansendReadResponse(short connHandle, short attributeHandle, byte status, byte[] value, int valueSize)booleansendWriteRequest(short connHandle, short attributeHandle, byte[] value, int valueSize, boolean noResponse)booleansendWriteResponse(short connHandle, short attributeHandle, byte status)voidsetup(RemoteCommandClient rcommandClient, long commandTimeout)booleanstartAdvertising(byte[] advertisementData, int advertisementDataSize)booleanstartScanning(byte filterAction, byte filterType, byte[] filterData, int filterDataSize)booleanstopAdvertising()booleanstopScanning()intwaitEvent(byte[] buffer, int bufferLength)
-
-
-
Method Detail
-
getInstance
public static BluetoothHost getInstance()
-
setup
public void setup(RemoteCommandClient rcommandClient, long commandTimeout)
-
onEventAvailable
public void onEventAvailable()
-
waitEvent
public int waitEvent(byte[] buffer, int bufferLength)
-
enable
public boolean enable()
-
disable
public void disable()
-
startScanning
public boolean startScanning(byte filterAction, byte filterType, byte[] filterData, int filterDataSize)
-
stopScanning
public boolean stopScanning()
-
startAdvertising
public boolean startAdvertising(byte[] advertisementData, int advertisementDataSize)
-
stopAdvertising
public boolean stopAdvertising()
-
connect
public boolean connect(byte[] deviceAddress)
-
disconnect
public boolean disconnect(short connHandle)
-
sendPairRequest
public boolean sendPairRequest(short connHandle)
-
sendPairResponse
public boolean sendPairResponse(short connHandle, boolean accept)
-
sendPasskeyResponse
public boolean sendPasskeyResponse(short connHandle, boolean accept, int passkey)
-
discoverServices
public boolean discoverServices(short connHandle, @Nullable byte[] uuid)
-
addService
public boolean addService(byte[] service, short[] handles)
-
sendReadRequest
public boolean sendReadRequest(short connHandle, short attributeHandle)
-
sendWriteRequest
public boolean sendWriteRequest(short connHandle, short attributeHandle, byte[] value, int valueSize, boolean noResponse)
-
sendReadResponse
public boolean sendReadResponse(short connHandle, short attributeHandle, byte status, byte[] value, int valueSize)
-
sendWriteResponse
public boolean sendWriteResponse(short connHandle, short attributeHandle, byte status)
-
sendPrepareWriteResponse
public boolean sendPrepareWriteResponse(short connHandle, short attributeHandle, byte status, byte[] value, int valueSize, int offset)
-
sendExecuteWriteResponse
public boolean sendExecuteWriteResponse(short connHandle, short attributeHandle, byte status)
-
sendNotification
public boolean sendNotification(short connHandle, short attributeHandle, byte[] value, int valueSize, boolean confirm)
-
-