public abstract class BleNode extends java.lang.Object implements UsesCustomNull
Modifier and Type | Field and Description |
---|---|
java.lang.Object |
appData
Field for app to associate any data it wants with instances of this class
instead of having to subclass or manage associative hash maps or something.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
appData()
Convenience method that casts
appData for you. |
<T extends BleNode> |
cast()
Just some sugar for casting to subclasses.
|
<T extends BleNode> |
cast(java.lang.Class<T> type)
Safer version of
cast() that will return BleDevice.NULL or BleServer.NULL
if the cast cannot be made. |
abstract java.lang.String |
getMacAddress()
|
BleManager |
getManager()
Returns this endpoint's manager.
|
BleCharacteristic |
getNativeBleCharacteristic(java.util.UUID charUuid)
Returns the native characteristic for the given UUID in case you need lower-level access.
|
BleCharacteristic |
getNativeBleCharacteristic(java.util.UUID serviceUuid,
java.util.UUID charUuid)
Overload of
getNativeBleCharacteristic(UUID) for when you have characteristics with identical uuids under different services. |
BleDescriptor |
getNativeBleDescriptor_inChar(java.util.UUID charUuid,
java.util.UUID descUuid)
Overload of
getNativeBleDescriptor(UUID, UUID, UUID) that will return the first descriptor we find
inside the given characteristic matching the given UUID . |
BleDescriptor |
getNativeBleDescriptor_inService(java.util.UUID serviceUuid,
java.util.UUID descUuid)
Overload of
getNativeBleDescriptor(UUID, UUID, UUID) that will return the first descriptor we find
inside the given service matching the given UUID . |
BleDescriptor |
getNativeBleDescriptor(java.util.UUID descUuid)
Overload of
getNativeBleDescriptor(UUID, UUID, UUID) that will return the first descriptor we find
matching the given UUID . |
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.
|
BleCharacteristic |
getNativeCharacteristic(java.util.UUID serviceUuid,
java.util.UUID charUuid,
DescriptorFilter descriptorFilter)
Overload of
getNativeBleCharacteristic(UUID, UUID) for when you have characteristics with identical uuids within the same service. |
java.util.List<BleCharacteristic> |
getNativeCharacteristics_List()
Convenience overload of
getNativeCharacteristics() that returns a List . |
java.util.List<BleCharacteristic> |
getNativeCharacteristics_List(java.util.UUID serviceUuid)
Convenience overload of
getNativeCharacteristics(UUID) that returns a List . |
java.util.Iterator<BleCharacteristic> |
getNativeCharacteristics()
Returns all
BluetoothGattCharacteristic instances. |
void |
getNativeCharacteristics(ForEach_Breakable<BleCharacteristic> forEach)
Overload of
getNativeCharacteristics() that uses a for each construct instead of returning an iterator. |
void |
getNativeCharacteristics(ForEach_Void<BleCharacteristic> forEach)
Overload of
getNativeCharacteristics() that uses a for each construct instead of returning an iterator. |
java.util.Iterator<BleCharacteristic> |
getNativeCharacteristics(java.util.UUID serviceUuid)
Same as
getNativeCharacteristics() 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_inChar_List(java.util.UUID charUuid)
Returns all descriptors on this node in the given characteristic as a list.
|
java.util.Iterator<BleDescriptor> |
getNativeDescriptors_inChar(java.util.UUID charUuid)
Returns all descriptors on this node in the given characteristic.
|
void |
getNativeDescriptors_inChar(java.util.UUID charUuid,
ForEach_Breakable<BleDescriptor> forEach)
Overload of
getNativeDescriptors_inChar(UUID) using a for each construct. |
void |
getNativeDescriptors_inChar(java.util.UUID charUuid,
ForEach_Void<BleDescriptor> forEach)
Overload of
getNativeDescriptors_inChar(UUID) using a for each construct. |
java.util.List<BleDescriptor> |
getNativeDescriptors_inService_List(java.util.UUID serviceUuid)
Returns all descriptors on this node in the given service as a list.
|
java.util.Iterator<BleDescriptor> |
getNativeDescriptors_inService(java.util.UUID serviceUuid)
Returns all descriptors on this node in the given service.
|
void |
getNativeDescriptors_inService(java.util.UUID serviceUuid,
ForEach_Breakable<BleDescriptor> forEach)
Overload of
getNativeDescriptors_inService(UUID) using a for each construct. |
void |
getNativeDescriptors_inService(java.util.UUID serviceUuid,
ForEach_Void<BleDescriptor> forEach)
Overload of
getNativeDescriptors_inService(UUID) using a for each construct. |
java.util.List<BleDescriptor> |
getNativeDescriptors_List()
Returns all descriptors on this node as a list.
|
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()
Returns all descriptors on this node.
|
void |
getNativeDescriptors(ForEach_Breakable<BleDescriptor> forEach)
Overload of
getNativeDescriptors() using a for each construct. |
void |
getNativeDescriptors(ForEach_Void<BleDescriptor> forEach)
Overload of
getNativeDescriptors() using a for each construct. |
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
getNativeDescriptors(UUID, UUID) using a for each construct. |
void |
getNativeDescriptors(java.util.UUID serviceUuid,
java.util.UUID charUuid,
ForEach_Void<BleDescriptor> forEach)
Overload of
getNativeDescriptors(UUID, UUID) using a for each construct. |
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. |
HistoricalData |
newHistoricalData(byte[] data,
EpochTime epochTime)
Returns a new
HistoricalData instance using
BleNodeConfig.historicalDataFactory if available. |
HistoricalDataQueryListener.HistoricalDataQueryEvent |
queryHistoricalData(java.lang.String query)
Provides a means to perform a raw SQL query on the database storing the historical data for this node.
|
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 . |
HistoricalDataQuery.Part_Select |
select()
Provides a way to perform a statically checked SQL query by chaining method calls.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isNull
public java.lang.Object appData
BleManager.appData
,
appData
public BleDescriptor getNativeBleDescriptor(java.util.UUID descUuid)
getNativeBleDescriptor(UUID, UUID, UUID)
that will return the first descriptor we find
matching the given UUID
.
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).
public BleDescriptor getNativeBleDescriptor_inChar(java.util.UUID charUuid, java.util.UUID descUuid)
getNativeBleDescriptor(UUID, UUID, UUID)
that will return the first descriptor we find
inside the given characteristic matching the given UUID
.
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).
public BleDescriptor getNativeBleDescriptor_inService(java.util.UUID serviceUuid, java.util.UUID descUuid)
getNativeBleDescriptor(UUID, UUID, UUID)
that will return the first descriptor we find
inside the given service matching the given UUID
.
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).
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).
public BleCharacteristic getNativeBleCharacteristic(java.util.UUID charUuid)
Note that this will never return a 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).
public BleCharacteristic getNativeBleCharacteristic(java.util.UUID serviceUuid, java.util.UUID charUuid)
getNativeBleCharacteristic(UUID)
for when you have characteristics with identical uuids under different services.
Note that this will never return a 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).
public BleCharacteristic getNativeCharacteristic(java.util.UUID serviceUuid, java.util.UUID charUuid, DescriptorFilter descriptorFilter)
getNativeBleCharacteristic(UUID, UUID)
for when you have characteristics with identical uuids within the same service.public BleService getNativeBleService(java.util.UUID serviceUuid)
Note that this will never return a 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).
public java.util.Iterator<BleService> getNativeServices()
BluetoothGattService
instances.public java.util.List<BleService> getNativeServices_List()
getNativeServices()
that returns a List
.public void getNativeServices(ForEach_Void<BleService> forEach)
getNativeServices()
that uses a for each construct instead of returning an iterator.public void getNativeServices(ForEach_Breakable<BleService> forEach)
getNativeServices()
that uses a for each construct instead of returning an iterator.public void getNativeCharacteristics(ForEach_Void<BleCharacteristic> forEach)
getNativeCharacteristics()
that uses a for each construct instead of returning an iterator.public void getNativeCharacteristics(ForEach_Breakable<BleCharacteristic> forEach)
getNativeCharacteristics()
that uses a for each construct instead of returning an iterator.public void getNativeCharacteristics(java.util.UUID serviceUuid, ForEach_Void<BleCharacteristic> forEach)
getNativeCharacteristics(UUID)
that uses a for each construct instead of returning an iterator.public void getNativeCharacteristics(java.util.UUID serviceUuid, ForEach_Breakable<BleCharacteristic> forEach)
getNativeCharacteristics(UUID)
that uses a for each construct instead of returning an iterator.public java.util.Iterator<BleCharacteristic> getNativeCharacteristics()
BluetoothGattCharacteristic
instances.public java.util.List<BleCharacteristic> getNativeCharacteristics_List()
getNativeCharacteristics()
that returns a List
.public java.util.Iterator<BleCharacteristic> getNativeCharacteristics(java.util.UUID serviceUuid)
getNativeCharacteristics()
but you can filter on the service UUID
.public java.util.List<BleCharacteristic> getNativeCharacteristics_List(java.util.UUID serviceUuid)
getNativeCharacteristics(UUID)
that returns a List
.public java.util.Iterator<BleDescriptor> getNativeDescriptors()
public java.util.List<BleDescriptor> getNativeDescriptors_List()
public java.util.Iterator<BleDescriptor> getNativeDescriptors_inService(java.util.UUID serviceUuid)
public java.util.List<BleDescriptor> getNativeDescriptors_inService_List(java.util.UUID serviceUuid)
public java.util.Iterator<BleDescriptor> getNativeDescriptors_inChar(java.util.UUID charUuid)
public java.util.List<BleDescriptor> getNativeDescriptors_inChar_List(java.util.UUID charUuid)
public java.util.Iterator<BleDescriptor> getNativeDescriptors(java.util.UUID serviceUuid, java.util.UUID charUuid)
public java.util.List<BleDescriptor> getNativeDescriptors_List(java.util.UUID serviceUuid, java.util.UUID charUuid)
public void getNativeDescriptors(ForEach_Void<BleDescriptor> forEach)
getNativeDescriptors()
using a for each construct.public void getNativeDescriptors(ForEach_Breakable<BleDescriptor> forEach)
getNativeDescriptors()
using a for each construct.public void getNativeDescriptors_inService(java.util.UUID serviceUuid, ForEach_Void<BleDescriptor> forEach)
getNativeDescriptors_inService(UUID)
using a for each construct.public void getNativeDescriptors_inService(java.util.UUID serviceUuid, ForEach_Breakable<BleDescriptor> forEach)
getNativeDescriptors_inService(UUID)
using a for each construct.public void getNativeDescriptors_inChar(java.util.UUID charUuid, ForEach_Void<BleDescriptor> forEach)
getNativeDescriptors_inChar(UUID)
using a for each construct.public void getNativeDescriptors_inChar(java.util.UUID charUuid, ForEach_Breakable<BleDescriptor> forEach)
getNativeDescriptors_inChar(UUID)
using a for each construct.public void getNativeDescriptors(java.util.UUID serviceUuid, java.util.UUID charUuid, ForEach_Void<BleDescriptor> forEach)
getNativeDescriptors(UUID, UUID)
using a for each construct.public void getNativeDescriptors(java.util.UUID serviceUuid, java.util.UUID charUuid, ForEach_Breakable<BleDescriptor> forEach)
getNativeDescriptors(UUID, UUID)
using a for each construct.public HistoricalData newHistoricalData(byte[] data, EpochTime epochTime)
HistoricalData
instance using
BleNodeConfig.historicalDataFactory
if available.public BleManager getManager()
public <T> T appData()
appData
for you.public HistoricalDataQueryListener.HistoricalDataQueryEvent queryHistoricalData(java.lang.String query)
BleDevice.getHistoricalDataTableName(UUID)
to generate table names and HistoricalDataColumn
to get column names.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
.public HistoricalDataQuery.Part_Select select()
public <T extends BleNode> T cast()
public <T extends BleNode> T cast(java.lang.Class<T> type)
cast()
that will return BleDevice.NULL
or BleServer.NULL
if the cast cannot be made.public abstract java.lang.String getMacAddress()