public final class RxBleServer
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
<any> |
addService(BleService service) |
<any> |
connect_withRetries(java.lang.String macAddress) |
<any> |
connect_withRetries(java.lang.String macAddress,
ServerReconnectFilter reconnectFilter) |
Completable |
connect(java.lang.String macAddress) |
Completable |
connect(java.lang.String macAddress,
ServerReconnectFilter failListener) |
void |
disconnect() |
boolean |
disconnect(java.lang.String macAddress) |
boolean |
equals(java.lang.Object object_nullable)
Returns
equals(RxBleServer) if object is an instance of RxBleServer . |
boolean |
equals(RxBleServer server_nullable)
Does a referential equality check on the two servers.
|
BleServer |
getBleServer() |
int |
getClientCount()
Returns the total number of clients this server is connecting or connected to (or previously so).
|
int |
getClientCount(BleServerState... states)
Returns the number of clients that are in any of the given states.
|
int |
getClientCount(BleServerState state)
Returns the number of clients that are in the current state.
|
<any> |
getClients() |
java.lang.String |
getMacAddress() |
java.lang.String |
getName() |
android.bluetooth.BluetoothGattServer |
getNative()
Provides just-in-case lower-level access to the native server instance.
|
IBluetoothServer |
getNativeLayer()
Provides just-in-case access to the abstracted server instance.
|
int |
getStateMask(java.lang.String macAddress)
Returns the bitwise state mask representation of
BleServerState for the given client mac address. |
boolean |
hasClient(BleServerState... states)
Returns
true if this server has any clients in any of the given states. |
boolean |
hasClient(BleServerState state)
Returns
true if this server has any clients in the given state. |
boolean |
hasClients()
Returns
true if this server has any connected or connecting clients (or previously so). |
boolean |
is(java.lang.String macAddress,
BleServerState state)
Returns true if the given client is in the state provided.
|
boolean |
isAdvertising() |
boolean |
isAdvertising(java.util.UUID serviceUuid)
Checks to see if the device is currently advertising the given
UUID . |
boolean |
isAdvertisingSupported()
Checks to see if the device supports advertising BLE services.
|
boolean |
isAdvertisingSupportedByAndroidVersion()
Checks to see if the device is running an Android OS which supports
advertising.
|
boolean |
isAdvertisingSupportedByChipset()
Checks to see if the device supports advertising.
|
boolean |
isAll(java.lang.String macAddress,
int mask_BleServerState)
Returns
true if there is complete bitwise overlap between the provided value and getStateMask(String) . |
boolean |
isAny(java.lang.String macAddress,
BleServerState... states)
Returns true if the given client is in any of the states provided.
|
boolean |
isAny(java.lang.String macAddress,
int mask_BleServerState)
Returns
true if there is any bitwise overlap between the provided value and getStateMask(String) . |
boolean |
isNull() |
<any> |
observeAdvertisingEvents() |
<any> |
observeOutgoingEvents() |
<any> |
observeServiceAddEvents() |
<any> |
observeStateEvents() |
void |
removeAllServices() |
BleService |
removeBleService(java.util.UUID serviceUuid) |
android.bluetooth.BluetoothGattService |
removeService(java.util.UUID serviceUuid) |
<any> |
sendIndication(java.lang.String macAddress,
java.util.UUID serviceUuid,
java.util.UUID charUuid,
byte[] data) |
<any> |
sendNotification(java.lang.String macAddress,
java.util.UUID serviceUuid,
java.util.UUID charUuid,
byte[] data) |
void |
setConfig(BleNodeConfig config) |
void |
setListener_Incoming(IncomingListener listener_nullable)
Set a listener here to override any listener provided previously.
|
void |
setListener_ReconnectFilter(ServerReconnectFilter listener)
Set a listener here to override any listener provided previously.
|
void |
setName(java.lang.String name) |
<any> |
startAdvertising(BleScanRecord advPacket) |
void |
stopAdvertising() |
java.lang.String |
toString()
Pretty-prints the list of connecting or connected clients.
|
public final BleServer getBleServer()
public final <any> observeStateEvents()
public final <any> observeOutgoingEvents()
public final <any> observeServiceAddEvents()
public final <any> observeAdvertisingEvents()
public final void setListener_Incoming(IncomingListener listener_nullable)
public final void setListener_ReconnectFilter(ServerReconnectFilter listener)
public final void setConfig(BleNodeConfig config)
public final <any> sendIndication(java.lang.String macAddress, java.util.UUID serviceUuid, java.util.UUID charUuid, byte[] data)
public final <any> sendNotification(java.lang.String macAddress, java.util.UUID serviceUuid, java.util.UUID charUuid, byte[] data)
public final Completable connect(java.lang.String macAddress)
public final Completable connect(java.lang.String macAddress, ServerReconnectFilter failListener)
public final <any> connect_withRetries(java.lang.String macAddress)
public final <any> connect_withRetries(java.lang.String macAddress, ServerReconnectFilter reconnectFilter)
public final boolean disconnect(java.lang.String macAddress)
public final void disconnect()
public final <any> addService(BleService service)
public final BleService removeBleService(java.util.UUID serviceUuid)
public final android.bluetooth.BluetoothGattService removeService(java.util.UUID serviceUuid)
public final void removeAllServices()
public final java.lang.String getMacAddress()
public final java.lang.String getName()
public final void setName(java.lang.String name)
public final boolean isAdvertisingSupportedByAndroidVersion()
RxBleManager.isAdvertisingSupportedByAndroidVersion()
.public final boolean isAdvertisingSupportedByChipset()
RxBleManager.isAdvertisingSupportedByChipset()
.public final boolean isAdvertisingSupported()
RxBleManager.isAdvertisingSupported()
.public final boolean isAdvertising()
public final boolean isAdvertising(java.util.UUID serviceUuid)
UUID
.public final <any> getClients()
public final int getClientCount()
public final int getClientCount(BleServerState state)
public final int getClientCount(BleServerState... states)
public final boolean hasClients()
true
if this server has any connected or connecting clients (or previously so).public final boolean hasClient(BleServerState state)
true
if this server has any clients in the given state.public final boolean hasClient(BleServerState... states)
true
if this server has any clients in any of the given states.public final <any> startAdvertising(BleScanRecord advPacket)
public final void stopAdvertising()
public final android.bluetooth.BluetoothGattServer getNative()
RxBleDevice.getNative()
.public final IBluetoothServer getNativeLayer()
RxBleDevice.getNative()
.public final int getStateMask(java.lang.String macAddress)
BleServerState
for the given client mac address.BleServerState
public final boolean isAny(java.lang.String macAddress, int mask_BleServerState)
true
if there is any bitwise overlap between the provided value and getStateMask(String)
.isAll(String, int)
public final boolean isAll(java.lang.String macAddress, int mask_BleServerState)
true
if there is complete bitwise overlap between the provided value and getStateMask(String)
.isAny(String, int)
public final boolean is(java.lang.String macAddress, BleServerState state)
public final boolean isAny(java.lang.String macAddress, BleServerState... states)
public final boolean isNull()
public final boolean equals(RxBleServer server_nullable)
public final boolean equals(java.lang.Object object_nullable)
equals(RxBleServer)
if object is an instance of RxBleServer
. Otherwise calls super.equals
in class java.lang.Object
equals(RxBleServer)
public final java.lang.String toString()
toString
in class java.lang.Object