public final class P_BleServerImpl extends java.lang.Object implements IBleServer
IBleServer.DefaultFactory, IBleServer.Factory
Modifier and Type | Field and Description |
---|---|
static P_BleServerImpl |
NULL
Special value that is used in place of Java's built-in
null . |
DEFAULT_FACTORY
Modifier and Type | Method and Description |
---|---|
AddServiceListener.ServiceAddEvent |
addService(BleService service,
AddServiceListener listener)
Starts the process of adding a service to this server.
|
<T extends com.idevicesinc.sweetblue.internal.BleNodeImpl> |
cast()
Just some sugar for casting to subclasses.
|
<T extends com.idevicesinc.sweetblue.internal.BleNodeImpl> |
cast(java.lang.Class<T> type)
Safer version of
cast() that will return BleDevice.NULL or BleServer.NULL
if the cast cannot be made. |
void |
clearListeners() |
BleManagerConfig |
conf_mngr() |
BleNodeConfig |
conf_node() |
ServerReconnectFilter.ConnectFailEvent |
connect_internal(P_DeviceHolder nativeDevice,
boolean isRetrying) |
ServerReconnectFilter.ConnectFailEvent |
connect(java.lang.String macAddress,
ServerConnectListener connectListener,
ServerReconnectFilter connectionFailListener)
Connect to the given client mac address and provided listeners that are shorthand for calling
setListener_State(ServerStateListener)
setListener_ReconnectFilter(ServerReconnectFilter) . |
void |
disconnect_internal(AddServiceListener.Status status_serviceAdd,
ServerReconnectFilter.Status status_connectionFail,
State.ChangeIntent intent) |
void |
disconnect() |
boolean |
disconnect(java.lang.String macAddress) |
boolean |
equals(IBleServer server_nullable)
Does a referential equality check on the two servers.
|
boolean |
equals(java.lang.Object object_nullable)
Returns
equals(IBleServer) if object is an instance of BleServer . |
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.
|
java.util.List<java.lang.String> |
getClients_List()
Overload of
getClients() that returns a List for you. |
java.util.List<java.lang.String> |
getClients_List(BleServerState... states)
Overload of
getClients(BleServerState[]) that returns a List for you. |
java.util.List<java.lang.String> |
getClients_List(BleServerState state)
Overload of
getClients(BleServerState) that returns a List for you. |
java.util.Iterator<java.lang.String> |
getClients()
Returns all the clients connected or connecting (or previously so) to this server.
|
java.util.Iterator<java.lang.String> |
getClients(BleServerState... states)
Returns all the clients connected or connecting (or previously so) to this server.
|
java.util.Iterator<java.lang.String> |
getClients(BleServerState state)
Returns all the clients connected or connecting (or previously so) to this server.
|
void |
getClients(ForEach_Breakable<java.lang.String> forEach)
Overload of
getClients(ForEach_Void)
if you need to break out of the iteration at any point. |
void |
getClients(ForEach_Breakable<java.lang.String> forEach,
BleServerState... states)
Same as
getClients(ForEach_Breakable) but will only return clients
in any of the given states provided. |
void |
getClients(ForEach_Breakable<java.lang.String> forEach,
BleServerState state)
Overload of
getClients(ForEach_Void, BleServerState)
if you need to break out of the iteration at any point. |
void |
getClients(ForEach_Void<java.lang.String> forEach)
Offers a more "functional" means of iterating through the internal list of clients instead of
using
getClients() or getClients_List() . |
void |
getClients(ForEach_Void<java.lang.String> forEach,
BleServerState... states)
Same as
getClients(ForEach_Void) but will only return clients
in any of the given states provided. |
void |
getClients(ForEach_Void<java.lang.String> forEach,
BleServerState state)
Same as
getClients(ForEach_Void) but will only return clients
in the given state provided. |
IBleManager |
getIManager()
Returns this endpoint's manager.
|
IServerListener |
getInternalListener() |
AdvertisingListener |
getListener_Advertise() |
IncomingListener |
getListener_Incoming()
Returns the listener provided to
setListener_Incoming(IncomingListener) . |
java.lang.String |
getMacAddress()
Returns the local mac address provided by
BluetoothAdapter.getAddress() . |
java.lang.String |
getName()
Returns the name this
BleServer is using (and will be advertised as, if applicable). |
android.bluetooth.BluetoothGattServer |
getNative()
Provides just-in-case lower-level access to the native server instance.
|
BleCharacteristic |
getNativeBleCharacteristic(java.util.UUID serviceUuid,
java.util.UUID charUuid)
Returns the native characteristic for the given UUID for when you have characteristics with identical uuids under different services.
|
BleCharacteristic |
getNativeBleCharacteristic(java.util.UUID serviceUuid,
java.util.UUID charUuid,
DescriptorFilter descriptorFilter) |
BleDescriptor |
getNativeBleDescriptor(java.util.UUID serviceUuid,
java.util.UUID charUuid,
java.util.UUID descUuid)
Returns the
BleDescriptor for the given UUID in case you need lower-level access. |
BleService |
getNativeBleService(java.util.UUID serviceUuid)
Returns the native service for the given UUID in case you need lower-level access.
|
java.util.List<BleCharacteristic> |
getNativeCharacteristics_List(java.util.UUID serviceUuid)
Convenience overload of
getNativeCharacteristics(UUID) that returns a List . |
java.util.Iterator<BleCharacteristic> |
getNativeCharacteristics(java.util.UUID serviceUuid)
Same as
getNativeCharacteristics(UUID) but you can filter on the service UUID . |
void |
getNativeCharacteristics(java.util.UUID serviceUuid,
ForEach_Breakable<BleCharacteristic> forEach)
Overload of
getNativeCharacteristics(UUID) that uses a for each construct instead of returning an iterator. |
void |
getNativeCharacteristics(java.util.UUID serviceUuid,
ForEach_Void<BleCharacteristic> forEach)
Overload of
getNativeCharacteristics(UUID) that uses a for each construct instead of returning an iterator. |
java.util.List<BleDescriptor> |
getNativeDescriptors_List(java.util.UUID serviceUuid,
java.util.UUID charUuid)
Returns all descriptors on this node in the given characteristic as a list.
|
java.util.Iterator<BleDescriptor> |
getNativeDescriptors(java.util.UUID serviceUuid,
java.util.UUID charUuid)
Returns all descriptors on this node in the given characteristic.
|
void |
getNativeDescriptors(java.util.UUID serviceUuid,
java.util.UUID charUuid,
ForEach_Breakable<BleDescriptor> forEach)
Overload of
BleNode.getNativeDescriptors(UUID, UUID) using a for each construct. |
void |
getNativeDescriptors(java.util.UUID serviceUuid,
java.util.UUID charUuid,
ForEach_Void<BleDescriptor> forEach)
Overload of
BleNode.getNativeDescriptors(UUID, UUID) using a for each construct. |
IBluetoothServer |
getNativeLayer()
Provides just-in-case access to the abstracted server instance.
|
com.idevicesinc.sweetblue.internal.P_BleServerNativeManager |
getNativeManager() |
java.util.List<BleService> |
getNativeServices_List()
Convenience overload of
getNativeServices() that returns a List . |
java.util.Iterator<BleService> |
getNativeServices()
Returns all
BluetoothGattService instances. |
void |
getNativeServices(ForEach_Breakable<BleService> forEach)
Overload of
getNativeServices() that uses a for each construct instead of returning an iterator. |
void |
getNativeServices(ForEach_Void<BleService> forEach)
Overload of
getNativeServices() that uses a for each construct instead of returning an iterator. |
com.idevicesinc.sweetblue.internal.P_ServerServiceManager |
getServerServiceManager() |
<T extends com.idevicesinc.sweetblue.internal.PA_ServiceManager> |
getServiceManager() |
int |
getStateMask(java.lang.String macAddress)
Returns the bitwise state mask representation of
BleServerState for the given client mac address. |
void |
invokeConnectListeners(ServerConnectListener.ConnectEvent event) |
void |
invokeOutgoingListeners(OutgoingListener.OutgoingEvent e,
OutgoingListener listener_specific_nullable) |
boolean |
is(java.lang.String macAddress,
BleServerState state)
Returns true if the given client is in the state provided.
|
boolean |
isAdvertising()
Checks to see if the device is currently advertising.
|
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() |
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()
Returns
true if the object's state represents what would otherwise be Java's built-in null . |
P_Logger |
logger() |
HistoricalData |
newHistoricalData(byte[] data,
EpochTime epochTime)
Returns a new
HistoricalData instance using
BleNodeConfig.historicalDataFactory if available. |
void |
onAdvertiseStarted(BleScanRecord packet,
AdvertisingListener listener) |
void |
onAdvertiseStartFailed(AdvertisingListener.Status status,
AdvertisingListener listener) |
void |
onNativeConnect(java.lang.String macAddress,
boolean explicit) |
void |
onNativeConnectFail(P_DeviceHolder nativeDevice,
ServerReconnectFilter.Status status,
int gattStatus) |
void |
onNativeConnecting_implicit(java.lang.String macAddress) |
void |
onNativeDisconnect(java.lang.String macAddress,
boolean explicit,
int gattStatus) |
HistoricalDataQueryListener.HistoricalDataQueryEvent |
queryHistoricalData(java.lang.String query) |
void |
queryHistoricalData(java.lang.String query,
HistoricalDataQueryListener listener)
Same as
queryHistoricalData(String) but performs the query on a background thread and returns the result back on the main thread
through the provided HistoricalDataQueryListener . |
void |
removeAllServices()
Convenience to remove all services previously added with
addService(BleService, AddServiceListener) (or overloads). |
BleService |
removeService(java.util.UUID serviceUuid) |
void |
resetAdaptorName() |
HistoricalDataQuery.Part_Select |
select()
Provides a way to perform a statically checked SQL query by chaining method calls.
|
OutgoingListener.OutgoingEvent |
sendIndication(java.lang.String macAddress,
java.util.UUID charUuid,
byte[] data)
|
OutgoingListener.OutgoingEvent |
sendIndication(java.lang.String macAddress,
java.util.UUID charUuid,
byte[] data,
OutgoingListener listener)
|
OutgoingListener.OutgoingEvent |
sendIndication(java.lang.String macAddress,
java.util.UUID charUuid,
FutureData futureData)
|
OutgoingListener.OutgoingEvent |
sendIndication(java.lang.String macAddress,
java.util.UUID charUuid,
FutureData futureData,
OutgoingListener listener)
|
OutgoingListener.OutgoingEvent |
sendIndication(java.lang.String macAddress,
java.util.UUID serviceUuid,
java.util.UUID charUuid,
byte[] data)
|
OutgoingListener.OutgoingEvent |
sendIndication(java.lang.String macAddress,
java.util.UUID serviceUuid,
java.util.UUID charUuid,
byte[] data,
OutgoingListener listener)
|
OutgoingListener.OutgoingEvent |
sendIndication(java.lang.String macAddress,
java.util.UUID serviceUuid,
java.util.UUID charUuid,
FutureData futureData)
|
OutgoingListener.OutgoingEvent |
sendIndication(java.lang.String macAddress,
java.util.UUID serviceUuid,
java.util.UUID charUuid,
FutureData futureData,
OutgoingListener listener)
Same as
sendNotification(String, UUID, UUID, FutureData, OutgoingListener) but sends an indication instead. |
OutgoingListener.OutgoingEvent |
sendNotification(java.lang.String macAddress,
java.util.UUID charUuid,
byte[] data)
|
OutgoingListener.OutgoingEvent |
sendNotification(java.lang.String macAddress,
java.util.UUID charUuid,
byte[] data,
OutgoingListener listener)
|
OutgoingListener.OutgoingEvent |
sendNotification(java.lang.String macAddress,
java.util.UUID charUuid,
FutureData futureData)
|
OutgoingListener.OutgoingEvent |
sendNotification(java.lang.String macAddress,
java.util.UUID charUuid,
FutureData futureData,
OutgoingListener listener)
|
OutgoingListener.OutgoingEvent |
sendNotification(java.lang.String macAddress,
java.util.UUID serviceUuid,
java.util.UUID charUuid,
byte[] data)
|
OutgoingListener.OutgoingEvent |
sendNotification(java.lang.String macAddress,
java.util.UUID serviceUuid,
java.util.UUID charUuid,
byte[] data,
OutgoingListener listener)
|
OutgoingListener.OutgoingEvent |
sendNotification(java.lang.String macAddress,
java.util.UUID serviceUuid,
java.util.UUID charUuid,
FutureData futureData)
|
OutgoingListener.OutgoingEvent |
sendNotification(java.lang.String macAddress,
java.util.UUID serviceUuid,
java.util.UUID charUuid,
FutureData futureData,
OutgoingListener listener) |
void |
setConfig(BleNodeConfig config_nullable)
Optionally sets overrides for any custom options given to
BleManager.get(android.content.Context, BleManagerConfig)
for this individual server. |
void |
setListener_Advertising(AdvertisingListener listener_nullable) |
void |
setListener_Connect(ServerConnectListener listener_nullable)
Set a listener here to be notified whenever this server's clients state changes eg.
|
void |
setListener_Incoming(IncomingListener listener_nullable)
Set a listener here to override any listener provided previously.
|
void |
setListener_Outgoing(OutgoingListener listener) |
void |
setListener_ReconnectFilter(ServerReconnectFilter listener)
Set a listener here to override any listener provided previously.
|
void |
setListener_ServiceAdd(AddServiceListener listener_nullable)
Set a listener here to override any listener provided previously and provide a default backup that will be called
after any listener provided to
addService(BleService, AddServiceListener) . |
void |
setListener_State(ServerStateListener listener_nullable)
Set a listener here to be notified whenever this server's state changes in relation to a specific client.
|
boolean |
setName(java.lang.String name)
Set the name you wish this
BleServer to be known as. |
AdvertisingListener.AdvertisingEvent |
startAdvertising(BleScanRecord advertisePacket,
BleAdvertisingSettings settings,
AdvertisingListener listener)
Starts advertising serviceUuids with the information supplied in
BleScanRecord . |
void |
stopAdvertising()
Stops the server from advertising.
|
com.idevicesinc.sweetblue.internal.P_TaskManager |
taskManager() |
java.lang.String |
toString()
Pretty-prints the list of connecting or connected clients.
|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
conf_mngr, getIManager, getNativeBleCharacteristic, getNativeBleCharacteristic, getNativeBleDescriptor, getNativeBleService, getNativeCharacteristics_List, getNativeCharacteristics, getNativeCharacteristics, getNativeCharacteristics, getNativeDescriptors_List, getNativeDescriptors, getNativeDescriptors, getNativeDescriptors, getNativeServices_List, getNativeServices, getNativeServices, getNativeServices, newHistoricalData, queryHistoricalData, queryHistoricalData, select
public static final P_BleServerImpl NULL
null
.public BleNodeConfig conf_node()
public com.idevicesinc.sweetblue.internal.P_BleServerNativeManager getNativeManager()
public final void setConfig(BleNodeConfig config_nullable)
BleManager.get(android.content.Context, BleManagerConfig)
for this individual server.public final void setListener_State(ServerStateListener listener_nullable)
public final void setListener_Connect(ServerConnectListener listener_nullable)
public final void setListener_Incoming(IncomingListener listener_nullable)
public final void setListener_ServiceAdd(AddServiceListener listener_nullable)
addService(BleService, AddServiceListener)
.public final void setListener_Advertising(AdvertisingListener listener_nullable)
public final AdvertisingListener getListener_Advertise()
public final IncomingListener getListener_Incoming()
setListener_Incoming(IncomingListener)
.public final void setListener_Outgoing(OutgoingListener listener)
public final void setListener_ReconnectFilter(ServerReconnectFilter listener)
public final OutgoingListener.OutgoingEvent sendIndication(java.lang.String macAddress, java.util.UUID charUuid, byte[] data)
public final OutgoingListener.OutgoingEvent sendIndication(java.lang.String macAddress, java.util.UUID charUuid, byte[] data, OutgoingListener listener)
public final OutgoingListener.OutgoingEvent sendIndication(java.lang.String macAddress, java.util.UUID serviceUuid, java.util.UUID charUuid, byte[] data)
public final OutgoingListener.OutgoingEvent sendIndication(java.lang.String macAddress, java.util.UUID serviceUuid, java.util.UUID charUuid, byte[] data, OutgoingListener listener)
public final OutgoingListener.OutgoingEvent sendIndication(java.lang.String macAddress, java.util.UUID charUuid, FutureData futureData)
public final OutgoingListener.OutgoingEvent sendIndication(java.lang.String macAddress, java.util.UUID charUuid, FutureData futureData, OutgoingListener listener)
public final OutgoingListener.OutgoingEvent sendIndication(java.lang.String macAddress, java.util.UUID serviceUuid, java.util.UUID charUuid, FutureData futureData)
public final OutgoingListener.OutgoingEvent sendIndication(java.lang.String macAddress, java.util.UUID serviceUuid, java.util.UUID charUuid, FutureData futureData, OutgoingListener listener)
sendNotification(String, UUID, UUID, FutureData, OutgoingListener)
but sends an indication instead.public final OutgoingListener.OutgoingEvent sendNotification(java.lang.String macAddress, java.util.UUID charUuid, byte[] data)
public final OutgoingListener.OutgoingEvent sendNotification(java.lang.String macAddress, java.util.UUID charUuid, byte[] data, OutgoingListener listener)
public final OutgoingListener.OutgoingEvent sendNotification(java.lang.String macAddress, java.util.UUID serviceUuid, java.util.UUID charUuid, byte[] data)
public final OutgoingListener.OutgoingEvent sendNotification(java.lang.String macAddress, java.util.UUID serviceUuid, java.util.UUID charUuid, byte[] data, OutgoingListener listener)
public final OutgoingListener.OutgoingEvent sendNotification(java.lang.String macAddress, java.util.UUID charUuid, FutureData futureData)
public final OutgoingListener.OutgoingEvent sendNotification(java.lang.String macAddress, java.util.UUID charUuid, FutureData futureData, OutgoingListener listener)
public final OutgoingListener.OutgoingEvent sendNotification(java.lang.String macAddress, java.util.UUID serviceUuid, java.util.UUID charUuid, FutureData futureData)
public final OutgoingListener.OutgoingEvent sendNotification(java.lang.String macAddress, java.util.UUID serviceUuid, java.util.UUID charUuid, FutureData futureData, OutgoingListener listener)
public final boolean isAdvertisingSupportedByAndroidVersion()
public final boolean isAdvertisingSupportedByChipset()
BleManager.isAdvertisingSupportedByChipset()
.public final boolean isAdvertisingSupported()
BleManager.isAdvertisingSupported()
.public final boolean isAdvertising()
public final boolean isAdvertising(java.util.UUID serviceUuid)
UUID
.public final AdvertisingListener.AdvertisingEvent startAdvertising(BleScanRecord advertisePacket, BleAdvertisingSettings settings, AdvertisingListener listener)
BleScanRecord
. Note that this will
only work for devices on Lollipop, or above. Even then, not every device supports advertising. Use
BleManager.isAdvertisingSupported()
to check to see if the phone supports it.public final void stopAdvertising()
public final java.lang.String getName()
BleServer
is using (and will be advertised as, if applicable).public final boolean setName(java.lang.String name)
BleServer
to be known as. This will affect how other devices see this server, and sets the name
on the lower level BluetoothAdapter
. If you DO change this, please be aware this will affect everything, including apps outside
of your own. It's probably best NOT to use this, but it's here for flexibility.true
if the name was successfully set. This can return false
if BLE is turned off -- so the underlying
BluetoothAdapter
is null
.public final void resetAdaptorName()
public final android.bluetooth.BluetoothGattServer getNative()
BleDevice.getNative()
.public final IBluetoothServer getNativeLayer()
BleDevice.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 ServerReconnectFilter.ConnectFailEvent connect(java.lang.String macAddress, ServerConnectListener connectListener, ServerReconnectFilter connectionFailListener)
setListener_State(ServerStateListener)
setListener_ReconnectFilter(ServerReconnectFilter)
.public final boolean disconnect(java.lang.String macAddress)
public final void disconnect()
public final boolean isNull()
UsesCustomNull
true
if the object's state represents what would otherwise be Java's built-in null
.isNull
in interface UsesCustomNull
public final boolean equals(IBleServer server_nullable)
public final boolean equals(java.lang.Object object_nullable)
equals(IBleServer)
if object is an instance of BleServer
. Otherwise calls super.equals
in class java.lang.Object
public final AddServiceListener.ServiceAddEvent addService(BleService service, AddServiceListener listener)
public final BleService removeService(java.util.UUID serviceUuid)
public final void removeAllServices()
addService(BleService, AddServiceListener)
(or overloads). This is slightly more performant too.public final void getClients(ForEach_Void<java.lang.String> forEach)
getClients()
or getClients_List()
.public final void getClients(ForEach_Void<java.lang.String> forEach, BleServerState state)
getClients(ForEach_Void)
but will only return clients
in the given state provided.public final void getClients(ForEach_Void<java.lang.String> forEach, BleServerState... states)
getClients(ForEach_Void)
but will only return clients
in any of the given states provided.public final void getClients(ForEach_Breakable<java.lang.String> forEach)
getClients(ForEach_Void)
if you need to break out of the iteration at any point.public final void getClients(ForEach_Breakable<java.lang.String> forEach, BleServerState state)
getClients(ForEach_Void, BleServerState)
if you need to break out of the iteration at any point.public final void getClients(ForEach_Breakable<java.lang.String> forEach, BleServerState... states)
getClients(ForEach_Breakable)
but will only return clients
in any of the given states provided.public final java.util.Iterator<java.lang.String> getClients()
public final java.util.Iterator<java.lang.String> getClients(BleServerState state)
public final java.util.Iterator<java.lang.String> getClients(BleServerState... states)
public final java.util.List<java.lang.String> getClients_List()
getClients()
that returns a List
for you.public final java.util.List<java.lang.String> getClients_List(BleServerState state)
getClients(BleServerState)
that returns a List
for you.public final java.util.List<java.lang.String> getClients_List(BleServerState... states)
getClients(BleServerState[])
that returns a List
for you.public final int getClientCount()
public final int getClientCount(BleServerState state)
public final int getClientCount(BleServerState... states)
public final java.lang.String toString()
toString
in class java.lang.Object
public final java.lang.String getMacAddress()
BluetoothAdapter.getAddress()
.public final void onAdvertiseStarted(BleScanRecord packet, AdvertisingListener listener)
public final void onAdvertiseStartFailed(AdvertisingListener.Status status, AdvertisingListener listener)
public final void disconnect_internal(AddServiceListener.Status status_serviceAdd, ServerReconnectFilter.Status status_connectionFail, State.ChangeIntent intent)
public BleServer getBleServer()
public final void onNativeConnectFail(P_DeviceHolder nativeDevice, ServerReconnectFilter.Status status, int gattStatus)
public final void onNativeDisconnect(java.lang.String macAddress, boolean explicit, int gattStatus)
public final void onNativeConnect(java.lang.String macAddress, boolean explicit)
public final void onNativeConnecting_implicit(java.lang.String macAddress)
public com.idevicesinc.sweetblue.internal.P_ServerServiceManager getServerServiceManager()
public final void invokeOutgoingListeners(OutgoingListener.OutgoingEvent e, OutgoingListener listener_specific_nullable)
public final void invokeConnectListeners(ServerConnectListener.ConnectEvent event)
public final ServerReconnectFilter.ConnectFailEvent connect_internal(P_DeviceHolder nativeDevice, boolean isRetrying)
public final IServerListener getInternalListener()
public final void clearListeners()
public <T extends com.idevicesinc.sweetblue.internal.PA_ServiceManager> T getServiceManager()
public BleDescriptor getNativeBleDescriptor(java.util.UUID serviceUuid, java.util.UUID charUuid, java.util.UUID descUuid)
BleDescriptor
for the given UUID in case you need lower-level access.
Note that this will never return a null
instance. You need to call P_NativeGattObject.isNull()
to check if the BluetoothGattDescriptor
actually exists (in other words, it will return true
if we were unable to find the requested descriptor).getNativeBleDescriptor
in interface IBleNode
public BleCharacteristic getNativeBleCharacteristic(java.util.UUID serviceUuid, java.util.UUID charUuid)
null
instance. You need to call P_NativeGattObject.isNull()
to check if the BluetoothGattCharacteristic
actually exists (in other words, it will return true
if we were unable to find the requested characteristic).getNativeBleCharacteristic
in interface IBleNode
public BleCharacteristic getNativeBleCharacteristic(java.util.UUID serviceUuid, java.util.UUID charUuid, DescriptorFilter descriptorFilter)
getNativeBleCharacteristic
in interface IBleNode
public BleService getNativeBleService(java.util.UUID serviceUuid)
null
instance. You need to call P_NativeGattObject.isNull()
to check if the BluetoothGattService
actually exists (in other words, it will return true
if we were unable to find the requested service).getNativeBleService
in interface IBleNode
public java.util.Iterator<BleService> getNativeServices()
BluetoothGattService
instances.getNativeServices
in interface IBleNode
public java.util.List<BleService> getNativeServices_List()
getNativeServices()
that returns a List
.getNativeServices_List
in interface IBleNode
public void getNativeServices(ForEach_Void<BleService> forEach)
getNativeServices()
that uses a for each construct instead of returning an iterator.getNativeServices
in interface IBleNode
public void getNativeServices(ForEach_Breakable<BleService> forEach)
getNativeServices()
that uses a for each construct instead of returning an iterator.getNativeServices
in interface IBleNode
public void getNativeCharacteristics(java.util.UUID serviceUuid, ForEach_Void<BleCharacteristic> forEach)
getNativeCharacteristics(UUID)
that uses a for each construct instead of returning an iterator.getNativeCharacteristics
in interface IBleNode
public void getNativeCharacteristics(java.util.UUID serviceUuid, ForEach_Breakable<BleCharacteristic> forEach)
getNativeCharacteristics(UUID)
that uses a for each construct instead of returning an iterator.getNativeCharacteristics
in interface IBleNode
public java.util.Iterator<BleCharacteristic> getNativeCharacteristics(java.util.UUID serviceUuid)
getNativeCharacteristics(UUID)
but you can filter on the service UUID
.getNativeCharacteristics
in interface IBleNode
public java.util.List<BleCharacteristic> getNativeCharacteristics_List(java.util.UUID serviceUuid)
getNativeCharacteristics(UUID)
that returns a List
.getNativeCharacteristics_List
in interface IBleNode
public java.util.Iterator<BleDescriptor> getNativeDescriptors(java.util.UUID serviceUuid, java.util.UUID charUuid)
getNativeDescriptors
in interface IBleNode
public java.util.List<BleDescriptor> getNativeDescriptors_List(java.util.UUID serviceUuid, java.util.UUID charUuid)
getNativeDescriptors_List
in interface IBleNode
public void getNativeDescriptors(java.util.UUID serviceUuid, java.util.UUID charUuid, ForEach_Void<BleDescriptor> forEach)
BleNode.getNativeDescriptors(UUID, UUID)
using a for each construct.getNativeDescriptors
in interface IBleNode
public void getNativeDescriptors(java.util.UUID serviceUuid, java.util.UUID charUuid, ForEach_Breakable<BleDescriptor> forEach)
BleNode.getNativeDescriptors(UUID, UUID)
using a for each construct.getNativeDescriptors
in interface IBleNode
public HistoricalData newHistoricalData(byte[] data, EpochTime epochTime)
HistoricalData
instance using
BleNodeConfig.historicalDataFactory
if available.newHistoricalData
in interface IBleNode
public IBleManager getIManager()
getIManager
in interface IBleNode
public BleManagerConfig conf_mngr()
public com.idevicesinc.sweetblue.internal.P_TaskManager taskManager()
public P_Logger logger()
public HistoricalDataQueryListener.HistoricalDataQueryEvent queryHistoricalData(java.lang.String query)
queryHistoricalData
in interface IBleNode
public void queryHistoricalData(java.lang.String query, HistoricalDataQueryListener listener)
queryHistoricalData(String)
but performs the query on a background thread and returns the result back on the main thread
through the provided HistoricalDataQueryListener
.queryHistoricalData
in interface IBleNode
public HistoricalDataQuery.Part_Select select()
public <T extends com.idevicesinc.sweetblue.internal.BleNodeImpl> T cast()
public <T extends com.idevicesinc.sweetblue.internal.BleNodeImpl> T cast(java.lang.Class<T> type)
cast()
that will return BleDevice.NULL
or BleServer.NULL
if the cast cannot be made.