Package ej.bluetooth
Class BluetoothAdapter
- java.lang.Object
-
- ej.bluetooth.BluetoothAdapter
-
- All Implemented Interfaces:
ej.kf.FeatureStateListener
public class BluetoothAdapter extends java.lang.Object implements ej.kf.FeatureStateListener
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BluetoothServiceaddService(BluetoothServiceDefinition definition)booleanconnect(BluetoothAddress address)voiddisable()booleanenable()static BluetoothAdaptergetAdapter()voidhandleAdvertisementCompleted()Not in API.voidhandleConnected(short connHandle, BluetoothAddress deviceAddress)Not in API.voidhandleConnectFailed(BluetoothAddress deviceAddress)Not in API.voidhandleDisconnected(short connHandle)Not in API.voidhandleDiscoveryCompleted(short connHandle)Not in API.voidhandleDiscoveryResult(short connHandle, BluetoothService service)Not in API.voidhandleExecuteWriteRequest(short connHandle, short attributeHandle, boolean execute)Not in API.voidhandleNotificationReceived(short connHandle, short attributeHandle, byte[] value)Not in API.voidhandleNotificationSent(short connHandle, short attributeHandle, boolean success)Not in API.voidhandlePairCompleted(short connHandle, boolean success)Not in API.voidhandlePairRequest(short connHandle)Not in API.voidhandlePasskeyGenerated(short connHandle, int passkey)Not in API.voidhandlePasskeyRequest(short connHandle)Not in API.voidhandleReadCompleted(short connHandle, short attributeHandle, byte status, byte[] value)Not in API.voidhandleReadRequest(short connHandle, short attributeHandle, int offset)Not in API.voidhandleScanCompleted()Not in API.voidhandleScanResult(BluetoothAddress deviceAddress, byte[] advertisementData, int rssi)Not in API.voidhandleWriteCompleted(short connHandle, short attributeHandle, byte status)Not in API.voidhandleWriteRequest(short connHandle, short attributeHandle, byte[] value, short offset, boolean prepare)Not in API.voidsetConnectionListener(ConnectionListener connectionListener)booleanstartAdvertising(byte[] advertisementData)booleanstartScanning(BluetoothScanFilter scanFilter)voidstateChanged(ej.kf.Feature feature, ej.kf.Feature.State previousState)booleanstopAdvertising()booleanstopScanning()
-
-
-
Method Detail
-
getAdapter
public static BluetoothAdapter getAdapter()
-
enable
public boolean enable()
-
disable
public void disable()
-
stateChanged
public void stateChanged(@Nullable ej.kf.Feature feature, @Nullable ej.kf.Feature.State previousState)- Specified by:
stateChangedin interfaceej.kf.FeatureStateListener
-
addService
@Nullable public BluetoothService addService(BluetoothServiceDefinition definition)
-
setConnectionListener
public void setConnectionListener(ConnectionListener connectionListener)
-
startAdvertising
public boolean startAdvertising(byte[] advertisementData)
-
stopAdvertising
public boolean stopAdvertising()
-
startScanning
public boolean startScanning(BluetoothScanFilter scanFilter)
-
stopScanning
public boolean stopScanning()
-
connect
public boolean connect(BluetoothAddress address)
-
handleScanResult
public void handleScanResult(BluetoothAddress deviceAddress, byte[] advertisementData, int rssi)
Not in API.
-
handleScanCompleted
public void handleScanCompleted()
Not in API.
-
handleAdvertisementCompleted
public void handleAdvertisementCompleted()
Not in API.
-
handleConnectFailed
public void handleConnectFailed(BluetoothAddress deviceAddress)
Not in API.
-
handleConnected
public void handleConnected(short connHandle, BluetoothAddress deviceAddress)Not in API.
-
handleDisconnected
public void handleDisconnected(short connHandle)
Not in API.
-
handlePairRequest
public void handlePairRequest(short connHandle)
Not in API.
-
handlePairCompleted
public void handlePairCompleted(short connHandle, boolean success)Not in API.
-
handlePasskeyRequest
public void handlePasskeyRequest(short connHandle)
Not in API.
-
handlePasskeyGenerated
public void handlePasskeyGenerated(short connHandle, int passkey)Not in API.
-
handleDiscoveryResult
public void handleDiscoveryResult(short connHandle, BluetoothService service)Not in API.
-
handleDiscoveryCompleted
public void handleDiscoveryCompleted(short connHandle)
Not in API.
-
handleReadCompleted
public void handleReadCompleted(short connHandle, short attributeHandle, byte status, byte[] value)Not in API.
-
handleWriteCompleted
public void handleWriteCompleted(short connHandle, short attributeHandle, byte status)Not in API.
-
handleNotificationReceived
public void handleNotificationReceived(short connHandle, short attributeHandle, byte[] value)Not in API.
-
handleReadRequest
public void handleReadRequest(short connHandle, short attributeHandle, int offset)Not in API.
-
handleWriteRequest
public void handleWriteRequest(short connHandle, short attributeHandle, byte[] value, short offset, boolean prepare)Not in API.
-
handleExecuteWriteRequest
public void handleExecuteWriteRequest(short connHandle, short attributeHandle, boolean execute)Not in API.
-
handleNotificationSent
public void handleNotificationSent(short connHandle, short attributeHandle, boolean success)Not in API.
-
-