public final class AndroidBluetoothServer extends java.lang.Object implements IBluetoothServer
IBluetoothServer
, and wraps BluetoothGattServer
. This class is used by default
by the library, and the only time it should NOT be used, is when unit testing.BleManagerConfig.serverFactory
IBluetoothServer.DefaultFactory, IBluetoothServer.Factory
Modifier and Type | Field and Description |
---|---|
static AndroidBluetoothServer |
NULL |
DEFAULT_FACTORY
Modifier and Type | Method and Description |
---|---|
boolean |
addService(BleService service) |
void |
cancelConnection(P_DeviceHolder device) |
void |
clearServices() |
void |
close() |
boolean |
connect(P_DeviceHolder device,
boolean autoConnect) |
android.bluetooth.BluetoothGattServer |
getNativeServer() |
BleService |
getService(java.util.UUID uuid) |
java.util.List<BleService> |
getServices() |
boolean |
isServerNull() |
boolean |
notifyCharacteristicChanged(P_DeviceHolder device,
BleCharacteristic characteristic,
boolean confirm) |
boolean |
removeService(BleService service) |
boolean |
sendResponse(P_DeviceHolder device,
int requestId,
int status,
int offset,
byte[] value) |
public static final AndroidBluetoothServer NULL
public final boolean isServerNull()
isServerNull
in interface IBluetoothServer
public final boolean addService(BleService service)
addService
in interface IBluetoothServer
public final void cancelConnection(P_DeviceHolder device)
cancelConnection
in interface IBluetoothServer
public final void clearServices()
clearServices
in interface IBluetoothServer
public final void close()
close
in interface IBluetoothServer
public final boolean connect(P_DeviceHolder device, boolean autoConnect)
connect
in interface IBluetoothServer
public final BleService getService(java.util.UUID uuid)
getService
in interface IBluetoothServer
public final java.util.List<BleService> getServices()
getServices
in interface IBluetoothServer
public final boolean notifyCharacteristicChanged(P_DeviceHolder device, BleCharacteristic characteristic, boolean confirm)
notifyCharacteristicChanged
in interface IBluetoothServer
public final boolean removeService(BleService service)
removeService
in interface IBluetoothServer
public final boolean sendResponse(P_DeviceHolder device, int requestId, int status, int offset, byte[] value)
sendResponse
in interface IBluetoothServer
public final android.bluetooth.BluetoothGattServer getNativeServer()
getNativeServer
in interface IBluetoothServer