public class RxBleDevice
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
addHistoricalData(java.util.UUID uuid,
byte[] data)
Same as
addHistoricalData(UUID, byte[], EpochTime) but uses System.currentTimeMillis() for the timestamp. |
void |
addHistoricalData(java.util.UUID uuid,
byte[] data,
EpochTime epochTime)
Manual way to add data to the historical data list managed by this device.
|
void |
addHistoricalData(java.util.UUID uuid,
EpochTime epochTime,
byte[] data)
Just an overload of
addHistoricalData(UUID, byte[], EpochTime) with the data and epochTime parameters switched around. |
void |
addHistoricalData(java.util.UUID uuid,
ForEach_Returning<HistoricalData> historicalData)
Same as
addHistoricalData(UUID, byte[], EpochTime) but for large datasets this is more efficient when writing to disk. |
void |
addHistoricalData(java.util.UUID uuid,
HistoricalData historicalData)
|
void |
addHistoricalData(java.util.UUID uuid,
java.util.Iterator<HistoricalData> historicalData)
Same as
addHistoricalData(UUID, byte[], EpochTime) but for large datasets this is more efficient when writing to disk. |
void |
addHistoricalData(java.util.UUID uuid,
java.util.List<HistoricalData> historicalData)
Same as
addHistoricalData(UUID, byte[], EpochTime) but for large datasets this is more efficient when writing to disk. |
<any> |
bond()
Bonds this device.
|
void |
clearAllData()
One method to remove absolutely all "metadata" related to this device that is stored on disk and/or cached in memory in any way.
|
void |
clearHistoricalData_memoryOnly()
Clears all
HistoricalData tracked by this device. |
void |
clearHistoricalData_memoryOnly(EpochTimeRange range)
Clears all
HistoricalData tracked by this device within the given range. |
void |
clearHistoricalData_memoryOnly(EpochTimeRange range,
long count)
Clears the first
count number of HistoricalData tracked by this device within the given range. |
void |
clearHistoricalData_memoryOnly(long count)
Clears the first
count number of HistoricalData tracked by this device. |
void |
clearHistoricalData_memoryOnly(java.util.UUID uuid)
Clears all
HistoricalData tracked by this device for a particular
characteristic UUID . |
void |
clearHistoricalData_memoryOnly(java.util.UUID characteristicUuid,
EpochTimeRange range)
Clears all
HistoricalData tracked by this device for a particular
characteristic UUID within the given range. |
void |
clearHistoricalData_memoryOnly(java.util.UUID characteristicUuid,
EpochTimeRange range,
long count)
Clears the first
count number of HistoricalData tracked by this device for a particular
characteristic UUID within the given range. |
void |
clearHistoricalData_memoryOnly(java.util.UUID uuid,
long count)
Clears the first
count number of HistoricalData tracked by this device for a particular
characteristic UUID . |
void |
clearHistoricalData()
Clears all
HistoricalData tracked by this device. |
void |
clearHistoricalData(EpochTimeRange range)
Clears all
HistoricalData tracked by this device within the given range. |
void |
clearHistoricalData(EpochTimeRange range,
long count)
Clears the first
count number of HistoricalData tracked by this device within the given range. |
void |
clearHistoricalData(long count)
Clears the first
count number of HistoricalData tracked by this device. |
void |
clearHistoricalData(java.util.UUID... uuids)
Overload of
clearHistoricalData(UUID) that just calls that method multiple times. |
void |
clearHistoricalData(java.util.UUID uuid)
Clears all
HistoricalData tracked by this device for a particular
characteristic UUID . |
void |
clearHistoricalData(java.util.UUID uuid,
EpochTimeRange range)
Clears all
HistoricalData tracked by this device for a particular
characteristic UUID within the given range. |
void |
clearHistoricalData(java.util.UUID uuid,
EpochTimeRange range,
long count)
Clears the first
count number of HistoricalData tracked by this device for a particular
characteristic UUID within the given range. |
void |
clearHistoricalData(java.util.UUID uuid,
long count)
Clears the first
count number of HistoricalData tracked by this device for a particular
characteristic UUID . |
void |
clearName()
Clears any name previously provided through
setName(String) or overloads. |
void |
clearSharedPreferences()
Convenience forwarding of
RxBleManager.clearSharedPreferences(String) . |
<any> |
connect_withRetries()
Similar to
connect() , only the ObservableEmitter#onNext(Object) method can get called multiple times depending on what
logic is implemented in BleDeviceConfig.reconnectFilter . |
<any> |
connect_withRetries(RxBleTransaction.RxAuth authTxn)
|
<any> |
connect_withRetries(RxBleTransaction.RxAuth authTxn,
RxBleTransaction.RxInit initTxn)
Similar to
connect_withRetries() , only this method allows you to pass in RxBleTransaction.RxAuth , and RxBleTransaction.RxInit
instances for this specific device -- instead of using BleDeviceConfig.defaultAuthFactory , or BleDeviceConfig.defaultInitFactory . |
<any> |
connect_withRetries(RxBleTransaction.RxInit initTxn)
|
Completable |
connect()
Connect to this BLE device.
|
Completable |
connect(RxBleTransaction.RxAuth authTxn)
|
Completable |
connect(RxBleTransaction.RxAuth authTxn,
RxBleTransaction.RxInit initTxn)
Similar to
connect() , only this method allows you to pass in RxBleTransaction.RxAuth , and RxBleTransaction.RxInit
instances for this specific device -- instead of using BleDeviceConfig.defaultAuthFactory , or BleDeviceConfig.defaultInitFactory . |
Completable |
connect(RxBleTransaction.RxInit initTxn)
|
<any> |
disableNotifies(java.util.List<BleNotify> notifies) |
<any> |
disableNotify(BleNotify notify)
Disable notifications for a characteristic on this BLE device.
|
boolean |
disconnect_remote()
Same as
disconnect() but this call roughly simulates the disconnect as if it's because of the remote device going down, going out of range, etc. |
boolean |
disconnect()
Disconnects from a connected device or does nothing if already
BleDeviceState.BLE_DISCONNECTED . |
boolean |
disconnectWhenReady()
Similar to
disconnect() with the difference being the disconnect task is set to a low priority. |
<any> |
enableNotifies(java.util.List<BleNotify> notifies) |
<any> |
enableNotify(BleNotify notify)
Enable notifications for a characteristic on this BLE device.
|
boolean |
equals(java.lang.Object object_nullable)
Returns
equals(RxBleDevice) if object is an instance of RxBleDevice . |
boolean |
equals(RxBleDevice device_nullable)
First checks referential equality and if
false checks
equality of getMacAddress() . |
int |
getAdvertisingFlags()
Returns the advertising flags, if any, parsed from
getScanRecord() . |
Interval |
getAverageReadTime()
See similar explanation for
getAverageWriteTime() . |
Interval |
getAverageWriteTime()
Returns the average round trip time in seconds for all write operations started with
write(BleWrite) . |
BleDevice |
getBleDevice() |
RxBleDeviceConfig |
getConfig()
Return the
RxBleDeviceConfig this device is set to use. |
BleConnectionPriority |
getConnectionPriority()
Returns the connection priority value set by
setConnectionPriority(BleConnectionPriority) , or BleNodeConfig.DEFAULT_MTU_SIZE if
it was never set explicitly. |
int |
getConnectionRetryCount()
Returns the connection failure retry count during a retry loop.
|
Distance |
getDistance()
Returns the approximate distance in meters based on
getRssi() and
getTxPower() . |
int |
getEffectiveWriteMtuSize()
Returns the effective MTU size for a write.
|
<any> |
getHistoricalData_atOffset(java.util.UUID uuid,
EpochTimeRange range,
int offsetFromStart) |
<any> |
getHistoricalData_atOffset(java.util.UUID uuid,
int offsetFromStart) |
<any> |
getHistoricalData_latest(java.util.UUID uuid)
Returns the cached data from the latest successful read or notify received for a given uuid.
|
<any> |
getHistoricalData(java.util.UUID uuid)
Overload of
getHistoricalData(UUID, EpochTimeRange) , which uses a range of EpochTimeRange.FROM_MIN_TO_MAX . |
<any> |
getHistoricalData(java.util.UUID uuid,
EpochTimeRange range)
Returns an
Observable which emits HistoricalData for each data item for the UUID given, and within the specified range. |
int |
getHistoricalDataCount(java.util.UUID uuid)
Returns the number of historical data entries that have been logged for the device's given characteristic.
|
int |
getHistoricalDataCount(java.util.UUID uuid,
EpochTimeRange range)
Returns the number of historical data entries that have been logged
for the device's given characteristic within the range provided.
|
State.ChangeIntent |
getLastDisconnectIntent()
This enum gives you an indication of the last interaction with a device across app sessions or in-app BLE
BleManagerState.OFF ->BleManagerState.ON cycles or undiscovery->rediscovery, which
basically means how it was last BleDeviceState.BLE_DISCONNECTED . |
EpochTime |
getLastDiscoveryTime()
Returns the last time the device was
DiscoveryListener.LifeCycle.DISCOVERED
or DiscoveryListener.LifeCycle.REDISCOVERED . |
java.lang.String |
getMacAddress()
Returns the MAC address of this device, as retrieved from the native stack or provided through
RxBleManager.newDevice(String) (or overloads thereof). |
byte[] |
getManufacturerData()
Returns the manufacturer data, if any, parsed from
getScanRecord() . |
int |
getManufacturerId()
Returns the manufacturer id, if any, parsed from
getScanRecord() }. |
int |
getMtu()
Returns the "maximum transmission unit" value set by
negotiateMtu(int) , or BleNodeConfig.DEFAULT_MTU_SIZE if
it was never set explicitly. |
java.lang.String |
getName_debug()
Returns a name useful for logging and debugging.
|
java.lang.String |
getName_native()
Returns the raw, unmodified device name retrieved from the stack.
|
java.lang.String |
getName_normalized()
The name retrieved from
getName_native() can change arbitrarily,
like the last 4 of the MAC address can get appended sometimes, and spaces
might get changed to underscores or vice-versa, caps to lowercase, etc. |
java.lang.String |
getName_override()
By default returns the same value as
getName_native() . |
android.bluetooth.BluetoothDevice |
getNative()
Provides just-in-case lower-level access to the native device instance.
|
android.bluetooth.BluetoothGatt |
getNativeGatt()
See pertinent warning for
getNative() . |
int |
getNativeStateMask()
Returns the actual native state mask representation of the
BleDeviceState for this device. |
BleDeviceOrigin |
getOrigin()
How the device was originally created, either from scanning or explicit creation.
|
int |
getRssi()
Returns the raw RSSI retrieved from when the device was discovered,
rediscovered, or when you call
readRssi() or startRssiPoll(Interval) . |
Percent |
getRssiPercent()
Raw RSSI from
getRssi() is a little cryptic, so this gives you a friendly 0%-100% value for signal strength. |
BleScanRecord |
getScanInfo()
Returns the
BleScanRecord instance held by this RxBleDevice . |
byte[] |
getScanRecord()
Returns the scan record from when we discovered the device.
|
int |
getStateMask()
Returns the bitwise state mask representation of
BleDeviceState for this device. |
Interval |
getTimeInState(BleDeviceState state)
If
is(BleDeviceState) returns true for the given state (i.e. |
int |
getTxPower()
Returns the calibrated transmission power of the device.
|
int |
hashCode() |
boolean |
hasHistoricalData()
Returns
true if there is any historical data at all for this device. |
boolean |
hasHistoricalData(EpochTimeRange range)
Returns
true if there is any historical data at all for this device within the given range. |
boolean |
hasHistoricalData(java.util.UUID uuid)
Returns
true if there is any historical data for the given uuid. |
boolean |
hasHistoricalData(java.util.UUID[] uuids)
Returns
true if there is any historical data for any of the given uuids. |
boolean |
hasHistoricalData(java.util.UUID uuid,
EpochTimeRange range)
Returns
true if there is any historical data for the given uuid within the given range. |
boolean |
is(BleDeviceState state)
Returns whether the device is in the provided state.
|
boolean |
is(java.lang.Object... query)
Similar to
is(BleDeviceState) and isAny(BleDeviceState...) but allows you to give a simple query
made up of BleDeviceState and Boolean pairs. |
boolean |
isAll(BleDeviceState... states)
Returns whether the device is in all of the provided states.
|
boolean |
isAll(int mask_BleDeviceState)
Returns
true if there is complete bitwise overlap between the provided value and getStateMask() . |
boolean |
isAny(BleDeviceState... states)
Returns whether the device is in any of the provided states.
|
boolean |
isAny(int mask_BleDeviceState)
Returns
true if there is any bitwise overlap between the provided value and getStateMask() . |
boolean |
isConnectable()
Convenience method to tell you whether a call to
connect() (or overloads) has a chance of succeeding. |
boolean |
isHistoricalDataLoaded()
Returns
true if the historical data for all historical data for
this device is loaded into memory. |
boolean |
isHistoricalDataLoaded(java.util.UUID uuid)
Returns
true if the historical data for a given uuid is loaded into memory. |
boolean |
isHistoricalDataLoading()
Returns whether the device is currently loading any historical data to memory, either through
loadHistoricalData() (or overloads) or getHistoricalData(UUID) (or overloads). |
boolean |
isHistoricalDataLoading(java.util.UUID uuid)
Returns whether the device is currently loading any historical data to memory for the given uuid, either through
loadHistoricalData() (or overloads) or getHistoricalData(UUID) (or overloads). |
boolean |
isNotifyEnabled(java.util.UUID uuid)
Returns
true if notifications are enabled for the given uuid. |
boolean |
isNotifyEnabling(java.util.UUID uuid)
Returns
true if SweetBlue is in the process of enabling notifications for the given uuid. |
boolean |
isNull()
As you should never get an instance of this class which is
null , use this method to see if the device is considered to be
null or not. |
<any> |
loadHistoricalData()
Loads all historical data to memory for this device.
|
<any> |
loadHistoricalData(java.util.UUID uuid)
Loads all historical data to memory for this device for the given
UUID . |
<any> |
negotiateMtu(int mtu)
Wrapper for
BluetoothGatt.requestMtu(int) which attempts to change the "maximum transmission unit" for a given connection. |
<any> |
negotiateMtuToDefault()
Overload of
negotiateMtu(int) that returns the "maximum transmission unit" to the default. |
<any> |
observeBondEvents()
Returns a
Flowable which emits RxBondEvent when any bonding events happen for this device. |
<any> |
observeHistoricalDataLoadEvents()
Returns a
Flowable which emits RxHistoricalDataLoadEvent when any HistoricalDataLoadListener.HistoricalDataLoadEvent is posted
for this device. |
<any> |
observeNotifyEvents()
Returns a
Flowable which emits RxNotificationEvent when any notifications are received for this
RxBleDevice . |
<any> |
observeReadWriteEvents()
Returns a
Flowable which emits RxReadWriteEvent when any read, or write operation completes for this device. |
<any> |
observeStateEvents()
|
boolean |
performOta(RxBleTransaction.RxOta txn)
Kicks off an "over the air" long-term transaction if it's not already
taking place and the device is
BleDeviceState.INITIALIZED . |
boolean |
performTransaction(RxBleTransaction txn)
Allows you to perform an arbitrary transaction that is not associated with any
BleDeviceState like
BleDeviceState.PERFORMING_OTA , BleDeviceState.AUTHENTICATING or BleDeviceState.INITIALIZING . |
boolean |
popListener_Reconnect()
Pops the current
DeviceReconnectFilter off the stack of listeners. |
java.lang.String |
printState()
Returns a string of all the states this
RxBleDevice is currently in. |
void |
pushListener_Reconnect(DeviceReconnectFilter listener)
Pushes the provided
DeviceReconnectFilter on to the top of the stack of listeners. |
<any> |
read(BleDescriptorRead read) |
<any> |
read(BleRead read)
Perform a BLE read on this device.
|
<any> |
readMany(BleRead[] bleReads)
Overload for
read(BleRead) for many writes. |
<any> |
readMany(java.lang.Iterable<BleRead> bleReads)
Overload for
read(BleRead) for many writes. |
<any> |
readPhyOptions()
Method to get the current "phy options" (physical layer), or current bluetooth 5 feature.
|
<any> |
readRssi()
Wrapper for
BluetoothGatt.readRemoteRssi() . |
void |
refreshGattDatabase()
Overload of
refreshGattDatabase(Interval) which uses the default gatt refresh delay of BleDeviceConfig.DEFAULT_GATT_REFRESH_DELAY . |
void |
refreshGattDatabase(Interval gattPause)
This only applies to a device which is
BleDeviceState.BLE_CONNECTED . |
RxReadWriteEvent |
reliableWrite_abort()
Wrapper for
BluetoothGatt.abortReliableWrite() - will return an event such that RxReadWriteEvent.isNull() will
return false if there are no problems. |
<any> |
reliableWrite_begin()
Wrapper for
BluetoothGatt.beginReliableWrite() - will return an Observable which emits RxReadWriteEvent s. |
RxReadWriteEvent |
reliableWrite_execute()
Wrapper for
BluetoothGatt.abortReliableWrite() - will return an event such that RxReadWriteEvent.isNull() will
return false if there are no problems. |
void |
setConfig(RxBleDeviceConfig config_nullable)
Optionally sets overrides for any custom options given to
RxBleManager.get(android.content.Context, RxBleManagerConfig)
for this individual device. |
<any> |
setConnectionPriority(BleConnectionPriority priority)
Wrapper for
BluetoothGatt.requestConnectionPriority(int) which attempts to change the connection priority for a given connection. |
void |
setListener_Reconnect(DeviceReconnectFilter listener_nullable)
Set a listener here to be notified whenever a connection fails and to
have control over retry behavior.
|
<any> |
setName(java.lang.String name)
Same as
setName(String, UUID) but will not attempt to propagate the
name change to the remote device. |
<any> |
setName(java.lang.String name,
java.util.UUID characteristicUuid)
Sets the local name of the device and also attempts a
write(BleWrite)
using the given UUID . |
<any> |
setPhyOptions(Phy phyOption)
Use this method to manually set the bluetooth 5 physical layer to use a bluetooth 5 feature (high speed/long range).
|
<any> |
startChangeTrackingPoll(java.util.UUID characteristicUuid,
Interval interval) |
<any> |
startChangeTrackingPoll(java.util.UUID serviceUuid,
java.util.UUID characteristicUuid,
DescriptorFilter descriptorFilter,
Interval interval)
Similar to
startPoll(UUID, Interval) but only
invokes a callback when a change in the characteristic value is detected. |
<any> |
startChangeTrackingPoll(java.util.UUID serviceUuid,
java.util.UUID characteristicUuid,
Interval interval) |
<any> |
startPoll(java.lang.Iterable<java.util.UUID> uuids,
Interval interval) |
<any> |
startPoll(java.util.UUID[] uuids,
Interval interval) |
<any> |
startPoll(java.util.UUID characteristicUuid,
Interval interval) |
<any> |
startPoll(java.util.UUID serviceUuid,
java.util.UUID characteristicUuid,
DescriptorFilter descriptorFilter,
Interval interval)
Starts a periodic read of a particular characteristic.
|
<any> |
startPoll(java.util.UUID serviceUuid,
java.util.UUID characteristicUuid,
Interval interval) |
<any> |
startRssiPoll(Interval interval)
Kicks off a poll that automatically calls
readRssi() at the Interval frequency
specified. |
java.lang.String |
toString() |
void |
unbond()
Forwards
BleDevice.unbond() . |
boolean |
undiscover()
Convenience method that calls
RxBleManager.undiscover(RxBleDevice) . |
<any> |
write(BleDescriptorWrite write) |
<any> |
write(BleWrite write)
Performs a BLE write on this device.
|
<any> |
writeMany(BleWrite[] writes)
Overload for
write(BleWrite) for many writes. |
<any> |
writeMany(java.lang.Iterable<BleWrite> writes)
Overload for
write(BleWrite) for many writes. |
public final <any> observeStateEvents()
public final <any> observeNotifyEvents()
Flowable
which emits RxNotificationEvent
when any notifications are received for this
RxBleDevice
.public final <any> observeBondEvents()
Flowable
which emits RxBondEvent
when any bonding events happen for this device.public final <any> observeReadWriteEvents()
Flowable
which emits RxReadWriteEvent
when any read, or write operation completes for this device.public final <any> observeHistoricalDataLoadEvents()
Flowable
which emits RxHistoricalDataLoadEvent
when any HistoricalDataLoadListener.HistoricalDataLoadEvent
is posted
for this device.public final void setListener_Reconnect(DeviceReconnectFilter listener_nullable)
DeviceReconnectFilter
s, and set
the one provided here to be the only one in the stack. If the provided listener is null
, then the stack of listeners will be cleared.public final void pushListener_Reconnect(DeviceReconnectFilter listener)
DeviceReconnectFilter
on to the top of the stack of listeners.
This method will early-out if the provided listener is null
public final boolean popListener_Reconnect()
DeviceReconnectFilter
off the stack of listeners.
Returns true
if a listener was actually removed from the stack (it will only be false if the stack is already empty).public final <any> reliableWrite_begin()
BluetoothGatt.beginReliableWrite()
- will return an Observable
which emits RxReadWriteEvent
s.
After calling this you should do your write(BleWrite)
calls then call reliableWrite_execute()
.public final RxReadWriteEvent reliableWrite_abort()
BluetoothGatt.abortReliableWrite()
- will return an event such that RxReadWriteEvent.isNull()
will
return false
if there are no problems. This call requires a previous call to reliableWrite_begin()
.public final RxReadWriteEvent reliableWrite_execute()
BluetoothGatt.abortReliableWrite()
- will return an event such that RxReadWriteEvent.isNull()
will
return false
if there are no problems. This call requires a previous call to reliableWrite_begin()
.public final java.lang.String printState()
RxBleDevice
is currently in.public final void setConfig(RxBleDeviceConfig config_nullable)
RxBleManager.get(android.content.Context, RxBleManagerConfig)
for this individual device.public final RxBleDeviceConfig getConfig()
RxBleDeviceConfig
this device is set to use. If none has been set explicitly, then the instance
of RxBleManagerConfig
is returned.public final BleDeviceOrigin getOrigin()
BleDeviceOrigin.EXPLICIT
may still be
DiscoveryListener.LifeCycle.REDISCOVERED
through RxBleManager.scan(ScanOptions)
.public final EpochTime getLastDiscoveryTime()
DiscoveryListener.LifeCycle.DISCOVERED
or DiscoveryListener.LifeCycle.REDISCOVERED
. If getOrigin()
returns
BleDeviceOrigin.EXPLICIT
then this will return EpochTime.NULL
unless or until
the device is DiscoveryListener.LifeCycle.REDISCOVERED
.public final State.ChangeIntent getLastDisconnectIntent()
BleManagerState.OFF
->BleManagerState.ON
cycles or undiscovery->rediscovery, which
basically means how it was last BleDeviceState.BLE_DISCONNECTED
.
State.ChangeIntent.NULL
, then the last disconnect is unknown because
(a) device has never been seen before,
(b) reason for disconnect was app being killed and BleDeviceConfig.manageLastDisconnectOnDisk
was false
,
(c) app user cleared app data between app sessions or reinstalled the app.
State.ChangeIntent.UNINTENTIONAL
, then from a user experience perspective, the user may not have wanted
the disconnect to happen, and thus *probably* would want to be automatically connected again as soon as the device is discovered.
State.ChangeIntent.INTENTIONAL
, then the last reason the device was BleDeviceState.BLE_DISCONNECTED
was because
disconnect()
was called, which most-likely means the user doesn't want to automatically connect to this device again.
BleDeviceConfig.manageLastDisconnectOnDisk
.public final int getConnectionRetryCount()
setListener_Reconnect(DeviceReconnectFilter)
and update your application's UI with this method's return value downstream of your
ReconnectFilter.onConnectFailed(ReconnectFilter.ConnectFailEvent)
override.public final int getStateMask()
BleDeviceState
for this device.BleDeviceState
public final int getNativeStateMask()
BleDeviceState
for this device.
The main purpose of this is to reflect what's going on under the hood while is(BleDeviceState)
with BleDeviceState.RECONNECTING_SHORT_TERM
is true
.public final Interval getAverageReadTime()
getAverageWriteTime()
.public final Interval getAverageWriteTime()
write(BleWrite)
.
This is a running average with N being defined by BleDeviceConfig.nForAverageRunningWriteTime
. This may
be useful for estimating how long a series of reads and/or writes will take. For example for displaying the estimated
time remaining for a firmware update.public final int getRssi()
readRssi()
or startRssiPoll(Interval)
.getDistance()
public final Percent getRssiPercent()
getRssi()
is a little cryptic, so this gives you a friendly 0%-100% value for signal strength.public final Distance getDistance()
getRssi()
and
getTxPower()
. NOTE: the higher the distance, the less the accuracy.public final int getTxPower()
BleDeviceConfig.defaultTxPower
.BleDeviceConfig.defaultTxPower
public final byte[] getManufacturerData()
getScanRecord()
. May be empty but never null
.public final int getManufacturerId()
getScanRecord()
}. May be -1 if not setpublic final byte[] getScanRecord()
null
.public final BleScanRecord getScanInfo()
BleScanRecord
instance held by this RxBleDevice
.public final int getAdvertisingFlags()
getScanRecord()
.public final <any> loadHistoricalData()
public final <any> loadHistoricalData(java.util.UUID uuid)
UUID
.public final boolean isHistoricalDataLoading()
loadHistoricalData()
(or overloads) or getHistoricalData(UUID)
(or overloads).public final boolean isHistoricalDataLoading(java.util.UUID uuid)
loadHistoricalData()
(or overloads) or getHistoricalData(UUID)
(or overloads).public final boolean isHistoricalDataLoaded()
true
if the historical data for all historical data for
this device is loaded into memory.
Use HistoricalDataLoadListener
to listen for when the load actually completes. If hasHistoricalData(UUID)
returns false
then this will also always return false
.public final boolean isHistoricalDataLoaded(java.util.UUID uuid)
true
if the historical data for a given uuid is loaded into memory.
Use HistoricalDataLoadListener
to listen for when the load actually completes. If hasHistoricalData(UUID)
returns false
then this will also always return false
.public final <any> getHistoricalData_latest(java.util.UUID uuid)
ReadWriteListener.ReadWriteEvent
for which
ReadWriteListener.ReadWriteEvent.isRead()
and
ReadWriteListener.ReadWriteEvent.wasSuccess()
both return
true
then ReadWriteListener.ReadWriteEvent.data()
,
will be cached and is retrievable by this method.HistoricalData.NULL
otherwise.BleNodeConfig.HistoricalDataLogFilter
,
BleNodeConfig.DefaultHistoricalDataLogFilter
public final <any> getHistoricalData(java.util.UUID uuid)
getHistoricalData(UUID, EpochTimeRange)
, which uses a range of EpochTimeRange.FROM_MIN_TO_MAX
.public final <any> getHistoricalData(java.util.UUID uuid, EpochTimeRange range)
Observable
which emits HistoricalData
for each data item for the UUID given, and within the specified range.public final <any> getHistoricalData_atOffset(java.util.UUID uuid, int offsetFromStart)
public final <any> getHistoricalData_atOffset(java.util.UUID uuid, EpochTimeRange range, int offsetFromStart)
public final int getHistoricalDataCount(java.util.UUID uuid)
public final int getHistoricalDataCount(java.util.UUID uuid, EpochTimeRange range)
public final boolean hasHistoricalData()
true
if there is any historical data at all for this device.public final boolean hasHistoricalData(EpochTimeRange range)
true
if there is any historical data at all for this device within the given range.public final boolean hasHistoricalData(java.util.UUID uuid)
true
if there is any historical data for the given uuid.public final boolean hasHistoricalData(java.util.UUID[] uuids)
true
if there is any historical data for any of the given uuids.public final boolean hasHistoricalData(java.util.UUID uuid, EpochTimeRange range)
true
if there is any historical data for the given uuid within the given range.public final void addHistoricalData(java.util.UUID uuid, byte[] data, EpochTime epochTime)
public final void addHistoricalData(java.util.UUID uuid, EpochTime epochTime, byte[] data)
addHistoricalData(UUID, byte[], EpochTime)
with the data and epochTime parameters switched around.public final void addHistoricalData(java.util.UUID uuid, byte[] data)
addHistoricalData(UUID, byte[], EpochTime)
but uses System.currentTimeMillis()
for the timestamp.public final void addHistoricalData(java.util.UUID uuid, HistoricalData historicalData)
public final void addHistoricalData(java.util.UUID uuid, java.util.Iterator<HistoricalData> historicalData)
addHistoricalData(UUID, byte[], EpochTime)
but for large datasets this is more efficient when writing to disk.public final void addHistoricalData(java.util.UUID uuid, java.util.List<HistoricalData> historicalData)
addHistoricalData(UUID, byte[], EpochTime)
but for large datasets this is more efficient when writing to disk.public final void addHistoricalData(java.util.UUID uuid, ForEach_Returning<HistoricalData> historicalData)
addHistoricalData(UUID, byte[], EpochTime)
but for large datasets this is more efficient when writing to disk.public final boolean isAny(BleDeviceState... states)
is(BleDeviceState)
public final boolean isAll(BleDeviceState... states)
isAny(BleDeviceState...)
public final boolean isConnectable()
connect()
(or overloads) has a chance of succeeding.
For example if the device is BleDeviceState.CONNECTING_OVERALL
or BleDeviceState.INITIALIZED
then this will return false
.public final boolean is(BleDeviceState state)
isAny(BleDeviceState...)
public final boolean isAny(int mask_BleDeviceState)
true
if there is any bitwise overlap between the provided value and getStateMask()
.isAll(int)
public final boolean isAll(int mask_BleDeviceState)
true
if there is complete bitwise overlap between the provided value and getStateMask()
.isAny(int)
public final boolean is(java.lang.Object... query)
is(BleDeviceState)
and isAny(BleDeviceState...)
but allows you to give a simple query
made up of BleDeviceState
and Boolean
pairs. So an example would be
myDevice.is(BleDeviceState.BLE_CONNECTING
, true, BleDeviceState.RECONNECTING_LONG_TERM
, false)
.public final Interval getTimeInState(BleDeviceState state)
is(BleDeviceState)
returns true for the given state (i.e. if
the device is in the given state) then this method will (a) return the
amount of time that the device has been in the state. Otherwise, this
will (b) return the amount of time that the device was *previously* in
that state. Otherwise, if the device has never been in the state, it will
(c) return 0.0 seconds. Case (b) might be useful for example for checking
how long you were connected for after becoming
BleDeviceState.BLE_DISCONNECTED
, for analytics purposes or whatever.public final void refreshGattDatabase()
refreshGattDatabase(Interval)
which uses the default gatt refresh delay of BleDeviceConfig.DEFAULT_GATT_REFRESH_DELAY
.public final void refreshGattDatabase(Interval gattPause)
BleDeviceState.BLE_CONNECTED
. This is meant to be used mainly after performing a
firmware update, and the Gatt database has changed. This will clear the device's gatt cache, and perform discover services again.
The device will drop out of BleDeviceState.SERVICES_DISCOVERED
, and enter BleDeviceState.DISCOVERING_SERVICES
. So,
you can listen in your device's DeviceStateListener
for when it enters BleDeviceState.SERVICES_DISCOVERED
to know
when the operation is complete.public final <any> setName(java.lang.String name)
setName(String, UUID)
but will not attempt to propagate the
name change to the remote device. Only getName_override()
will be affected by this.public final <any> setName(java.lang.String name, java.util.UUID characteristicUuid)
write(BleWrite)
using the given UUID
. Further calls to getName_override()
will immediately reflect the name given here.
Further calls to getName_native()
, getName_debug()
and getName_normalized()
will only reflect
the name given here if the write is successful. It is somewhat assumed that doing this write will cause the remote device
to use the new name given here for its device information service Uuids.DEVICE_NAME
.
If BleDeviceConfig.saveNameChangesToDisk
is true
then this name
will always be returned for getName_override()
, even if you kill/restart the app.public final void clearName()
setName(String)
or overloads.public final java.lang.String getName_override()
getName_native()
.
If you call setName(String)
(or overloads)
then calling this will return the same string provided in that setter.public final java.lang.String getName_native()
BluetoothDevice.getName()
. It's suggested to use
getName_normalized()
if you're using the name to match/filter
against something, e.g. an entry in a config file or for advertising
filtering.public final java.lang.String getName_normalized()
getName_native()
can change arbitrarily,
like the last 4 of the MAC address can get appended sometimes, and spaces
might get changed to underscores or vice-versa, caps to lowercase, etc.
This may somehow be standard, to-the-spec behavior but to the newcomer
it's confusing and potentially time-bomb-bug-inducing, like if you're
using device name as a filter for something and everything's working
until one day your app is suddenly broken and you don't know why. This
method is an attempt to normalize name behavior and always return the
same name regardless of the underlying stack's whimsy. The target format
is all lowercase and underscore-delimited with no trailing MAC address.public final java.lang.String getName_debug()
getName_normalized()
plus the last four digits of the device's
MAC address from getMacAddress()
. BleDevice.toString()
uses this.public final android.bluetooth.BluetoothDevice getNative()
public final android.bluetooth.BluetoothGatt getNativeGatt()
getNative()
. Generally speaking, this
will return null
if the BleDevice is BleDeviceState.BLE_DISCONNECTED
.
public final java.lang.String getMacAddress()
RxBleManager.newDevice(String)
(or overloads thereof).
You may treat this as the unique ID of the device, suitable as a key in a HashMap
, SharedPreferences
, etc.public final boolean disconnect()
BleDeviceState.BLE_DISCONNECTED
. You can call this at any point
during the connection process as a whole, during reads and writes, during transactions, whenever, and the device will cleanly cancel all ongoing
operations. This method will also bring the device out of the BleDeviceState.RECONNECTING_LONG_TERM
state.true
if this call "had an effect", such as if the device was previously BleDeviceState.RECONNECTING_LONG_TERM
,
BleDeviceState.CONNECTING_OVERALL
, or BleDeviceState.INITIALIZED
DeviceReconnectFilter.Status.EXPLICIT_DISCONNECT
public final boolean disconnectWhenReady()
disconnect()
with the difference being the disconnect task is set to a low priority. This allows all current calls to finish
executing before finally disconnecting. Note that this can cause issues if you keep executing reads/writes, as they have a higher priority.true
if this call "had an effect", such as if the device was previously BleDeviceState.RECONNECTING_LONG_TERM
,
BleDeviceState.CONNECTING_OVERALL
, or BleDeviceState.INITIALIZED
DeviceReconnectFilter.Status.EXPLICIT_DISCONNECT
public final boolean disconnect_remote()
disconnect()
but this call roughly simulates the disconnect as if it's because of the remote device going down, going out of range, etc.
For example getLastDisconnectIntent()
will be State.ChangeIntent.UNINTENTIONAL
instead of
State.ChangeIntent.INTENTIONAL
.
BleDeviceState.CONNECTING_OVERALL
then your
ReconnectFilter.onConnectFailed(ReconnectFilter.ConnectFailEvent)
implementation will be called with DeviceReconnectFilter.Status.ROGUE_DISCONNECT
.
BleDeviceState.RECONNECTING_SHORT_TERM
or BleDeviceState.RECONNECTING_LONG_TERM
.public final boolean undiscover()
RxBleManager.undiscover(RxBleDevice)
.true
if the device was successfully BleDeviceState.UNDISCOVERED
, false
if BleDevice isn't known to the BleManager
.BleManager.undiscover(BleDevice)
public final void clearSharedPreferences()
RxBleManager.clearSharedPreferences(String)
.public final boolean equals(RxBleDevice device_nullable)
false
checks
equality of getMacAddress()
. Note that ideally this method isn't
useful to you and never returns true (besides the identity case, which
isn't useful to you). Otherwise it probably means your app is holding on
to old references that have been undiscovered, and this may be a bug or
bad design decision in your code. This library will (well, should) never
hold references to two devices such that this method returns true for them.public final boolean equals(java.lang.Object object_nullable)
equals(RxBleDevice)
if object is an instance of RxBleDevice
. Otherwise calls super.equals
in class java.lang.Object
equals(RxBleDevice)
public final <any> startPoll(java.util.UUID characteristicUuid, Interval interval)
public final <any> startPoll(java.util.UUID serviceUuid, java.util.UUID characteristicUuid, Interval interval)
public final <any> startPoll(java.util.UUID[] uuids, Interval interval)
public final <any> startPoll(java.lang.Iterable<java.util.UUID> uuids, Interval interval)
public final <any> startPoll(java.util.UUID serviceUuid, java.util.UUID characteristicUuid, DescriptorFilter descriptorFilter, Interval interval)
enableNotify(BleNotify)
. One
use case would be to periodically read wind speed from a weather device. You *could* develop your device firmware to send notifications to the app
only when the wind speed changes, but Android has observed stability issues with notifications, so use them only when needed.
BleDeviceState
, even BleDeviceState.BLE_DISCONNECTED
. However, you will not receive
any events until the device is connected.public final <any> startChangeTrackingPoll(java.util.UUID characteristicUuid, Interval interval)
public final <any> startChangeTrackingPoll(java.util.UUID serviceUuid, java.util.UUID characteristicUuid, Interval interval)
public final <any> startChangeTrackingPoll(java.util.UUID serviceUuid, java.util.UUID characteristicUuid, DescriptorFilter descriptorFilter, Interval interval)
startPoll(UUID, Interval)
but only
invokes a callback when a change in the characteristic value is detected.
Use this in preference to enableNotify(BleNotify)
if possible,
due to instability issues (rare, but still) with notifications on Android.
BleDeviceState
, even BleDeviceState.BLE_DISCONNECTED
. However, you will not receive any
events until the device is connected.public Completable connect()
Returns a Completable
which holds nothing. CompletableEmitter#onComplete()
will be called when connected, otherwise
a ConnectException
will be returned in CompletableEmitter#onError(Throwable)
, which contains the
DeviceReconnectFilter.ConnectFailEvent
. The onError method will only be called when SweetBlue
has run through all retries -- set via DeviceReconnectFilter
.
public Completable connect(RxBleTransaction.RxAuth authTxn, RxBleTransaction.RxInit initTxn)
connect()
, only this method allows you to pass in RxBleTransaction.RxAuth
, and RxBleTransaction.RxInit
instances for this specific device -- instead of using BleDeviceConfig.defaultAuthFactory
, or BleDeviceConfig.defaultInitFactory
.public Completable connect(RxBleTransaction.RxAuth authTxn)
connect(RxBleTransaction.RxAuth, RxBleTransaction.RxInit)
. This will use BleDeviceConfig.defaultInitFactory
for the init transaction,
if one has been set. If you don't want this behavior, then call connect(RxBleTransaction.RxAuth, RxBleTransaction.RxInit)
, and pass in null
for the init transaction.public Completable connect(RxBleTransaction.RxInit initTxn)
connect(RxBleTransaction.RxAuth, RxBleTransaction.RxInit)
. This will use BleDeviceConfig.defaultAuthFactory
for the auth transaction,
if one has been set. If you don't want this behavior, then call connect(RxBleTransaction.RxAuth, RxBleTransaction.RxInit)
, and pass in null
for the auth transaction.public <any> connect_withRetries()
connect()
, only the ObservableEmitter#onNext(Object)
method can get called multiple times depending on what
logic is implemented in BleDeviceConfig.reconnectFilter
. ObservableEmitter#onError(Throwable)
will be called on the last
failed connection attempt (ie the library has tried all retries, and will no longer be attempting to connect).
It's best not to use this method, and to use connect()
instead.public <any> connect_withRetries(RxBleTransaction.RxAuth authTxn, RxBleTransaction.RxInit initTxn)
connect_withRetries()
, only this method allows you to pass in RxBleTransaction.RxAuth
, and RxBleTransaction.RxInit
instances for this specific device -- instead of using BleDeviceConfig.defaultAuthFactory
, or BleDeviceConfig.defaultInitFactory
.public <any> connect_withRetries(RxBleTransaction.RxAuth authTxn)
connect_withRetries(RxBleTransaction.RxAuth, RxBleTransaction.RxInit)
. This will use BleDeviceConfig.defaultInitFactory
for the init transaction,
if one has been set. If you don't want this behavior, then call connect_withRetries(RxBleTransaction.RxAuth)
, and pass in null
for the init transaction.public <any> connect_withRetries(RxBleTransaction.RxInit initTxn)
connect_withRetries(RxBleTransaction.RxAuth, RxBleTransaction.RxInit)
. This will use BleDeviceConfig.defaultAuthFactory
for the auth transaction,
if one has been set. If you don't want this behavior, then call connect(RxBleTransaction.RxAuth, RxBleTransaction.RxInit)
, and pass in null
for the auth transaction.public <any> bond()
Returns a Single
which holds an instance of BondListener.BondEvent
. If the bond fails,
SingleEmitter#onError(Throwable)
will be called which holds an instance of BondException
, which also holds an instance
of BondListener.BondEvent
, so you can get more information on what went wrong.
public void unbond()
BleDevice.unbond()
.public <any> read(BleRead read)
Returns a Single
which holds an instance of ReadWriteListener.ReadWriteEvent
. If the bond fails,
SingleEmitter#onError(Throwable)
will be called which holds an instance of ReadWriteException
, which also holds an instance
of ReadWriteListener.ReadWriteEvent
, so you can get more information on what went wrong.
public final <any> readMany(BleRead[] bleReads)
read(BleRead)
for many writes. This calls Observable#merge(Iterable)
after calling
Single#toObservable()
to merge all Singles into one Observable.public final <any> readMany(java.lang.Iterable<BleRead> bleReads)
read(BleRead)
for many writes. This calls Observable#mergeWith(ObservableSource)
after calling
Single#toObservable()
to merge all Singles into one Observable.public final <any> read(BleDescriptorRead read)
public <any> write(BleWrite write)
Returns a Single
which holds an instance of ReadWriteListener.ReadWriteEvent
. If the bond fails,
SingleEmitter#onError(Throwable)
will be called which holds an instance of ReadWriteException
, which also holds an instance
of ReadWriteListener.ReadWriteEvent
, so you can get more information on what went wrong.
public final <any> writeMany(BleWrite[] writes)
write(BleWrite)
for many writes. This calls Observable#mergeWith(ObservableSource)
after calling
Single#toObservable()
to merge all Singles into one Observable.public final <any> writeMany(java.lang.Iterable<BleWrite> writes)
write(BleWrite)
for many writes. This calls Observable#mergeWith(ObservableSource)
after calling
Single#toObservable()
to merge all Singles into one Observable.public final <any> write(BleDescriptorWrite write)
public <any> enableNotify(BleNotify notify)
Returns a Single
which holds an instance of NotificationListener.NotificationEvent
. If the bond fails,
SingleEmitter#onError(Throwable)
will be called which holds an instance of NotifyEnableException
, which also holds an instance
of NotificationListener.NotificationEvent
, so you can get more information on what went wrong.
public <any> enableNotifies(java.util.List<BleNotify> notifies)
public <any> disableNotify(BleNotify notify)
Returns a Single
which holds an instance of NotificationListener.NotificationEvent
. If the bond fails,
SingleEmitter#onError(Throwable)
will be called which holds an instance of NotifyEnableException
, which also holds an instance
of NotificationListener.NotificationEvent
, so you can get more information on what went wrong.
public <any> disableNotifies(java.util.List<BleNotify> notifies)
public final <any> readRssi()
BluetoothGatt.readRemoteRssi()
. This will eventually update the value returned by getRssi()
but it is not
instantaneous. When a new RSSI is actually received the given listener will be called. The device must be BleDeviceState.BLE_CONNECTED
for
this call to succeed. When the device is not BleDeviceState.BLE_CONNECTED
then the value returned by
getRssi()
will be automatically updated every time this device is discovered (or rediscovered) by a scan operation.public final <any> setConnectionPriority(BleConnectionPriority priority)
BluetoothGatt.requestConnectionPriority(int)
which attempts to change the connection priority for a given connection.
This will eventually update the value returned by getConnectionPriority()
but it is not
instantaneous. When we receive confirmation from the native stack then this value will be updated. The device must be BleDeviceState.BLE_CONNECTED
for
this call to succeed.getConnectionPriority()
public final BleConnectionPriority getConnectionPriority()
setConnectionPriority(BleConnectionPriority)
, or BleNodeConfig.DEFAULT_MTU_SIZE
if
it was never set explicitly.public final int getMtu()
negotiateMtu(int)
, or BleNodeConfig.DEFAULT_MTU_SIZE
if
it was never set explicitly.public final <any> negotiateMtuToDefault()
negotiateMtu(int)
that returns the "maximum transmission unit" to the default.
Unlike negotiateMtu(int)
, this can be called when the device is BleDeviceState.BLE_DISCONNECTED
in the event that you don't want the
MTU to be auto-set upon next reconnection.public final <any> negotiateMtu(int mtu)
BluetoothGatt.requestMtu(int)
which attempts to change the "maximum transmission unit" for a given connection.
This will eventually update the value returned by getMtu()
but it is not
instantaneous. When we receive confirmation from the native stack then this value will be updated. The device must be BleDeviceState.BLE_CONNECTED
for
this call to succeed.
NOTE 1: This will only work on devices running Android Lollipop (5.0) or higher. Otherwise it will be ignored. NOTE 2: Some phones will request an MTU, and accept a higher number, but will fail (time out) when writing a characteristic with a large payload. Namely, we've found the Moto Pure X, and the OnePlus OnePlus2 to have this behavior. For those phones any MTU above 50 failed.
public final <any> setPhyOptions(Phy phyOption)
public final <any> readPhyOptions()
public final <any> startRssiPoll(Interval interval)
readRssi()
at the Interval
frequency
specified. This can be called before the device is actually BleDeviceState.BLE_CONNECTED
. If you call this more than once in a
row then the most recent call's parameters will be respected.
BleDeviceState
, even BleDeviceState.BLE_DISCONNECTED
, however, a scan must
be running in order to receive any updates (and of course, the device must be found in the scan).public final void clearAllData()
public final void clearHistoricalData()
HistoricalData
tracked by this device.public final void clearHistoricalData(long count)
count
number of HistoricalData
tracked by this device.public final void clearHistoricalData(EpochTimeRange range)
HistoricalData
tracked by this device within the given range.public final void clearHistoricalData(EpochTimeRange range, long count)
count
number of HistoricalData
tracked by this device within the given range.public final void clearHistoricalData(java.util.UUID uuid)
HistoricalData
tracked by this device for a particular
characteristic UUID
.public final void clearHistoricalData(java.util.UUID... uuids)
clearHistoricalData(UUID)
that just calls that method multiple times.public final void clearHistoricalData(java.util.UUID uuid, long count)
count
number of HistoricalData
tracked by this device for a particular
characteristic UUID
.public final void clearHistoricalData(java.util.UUID uuid, EpochTimeRange range)
HistoricalData
tracked by this device for a particular
characteristic UUID
within the given range.public final void clearHistoricalData(java.util.UUID uuid, EpochTimeRange range, long count)
count
number of HistoricalData
tracked by this device for a particular
characteristic UUID
within the given range.public final void clearHistoricalData_memoryOnly()
HistoricalData
tracked by this device.public final void clearHistoricalData_memoryOnly(long count)
count
number of HistoricalData
tracked by this device.public final void clearHistoricalData_memoryOnly(EpochTimeRange range)
HistoricalData
tracked by this device within the given range.public final void clearHistoricalData_memoryOnly(EpochTimeRange range, long count)
count
number of HistoricalData
tracked by this device within the given range.public final void clearHistoricalData_memoryOnly(java.util.UUID uuid)
HistoricalData
tracked by this device for a particular
characteristic UUID
.public final void clearHistoricalData_memoryOnly(java.util.UUID uuid, long count)
count
number of HistoricalData
tracked by this device for a particular
characteristic UUID
.public final void clearHistoricalData_memoryOnly(java.util.UUID characteristicUuid, EpochTimeRange range)
HistoricalData
tracked by this device for a particular
characteristic UUID
within the given range.public final void clearHistoricalData_memoryOnly(java.util.UUID characteristicUuid, EpochTimeRange range, long count)
count
number of HistoricalData
tracked by this device for a particular
characteristic UUID
within the given range.public final boolean isNotifyEnabled(java.util.UUID uuid)
true
if notifications are enabled for the given uuid.
NOTE: isNotifyEnabling(UUID)
may return true even if this method returns false.isNotifyEnabling(UUID)
public final boolean isNotifyEnabling(java.util.UUID uuid)
true
if SweetBlue is in the process of enabling notifications for the given uuid.isNotifyEnabled(UUID)
public final boolean performOta(RxBleTransaction.RxOta txn)
BleDeviceState.INITIALIZED
. This
will put the device into the BleDeviceState.PERFORMING_OTA
state
if true
is returned. You can use this to do firmware
updates, file transfers, etc.
TimeEstimator
class to let your users know roughly
how much time it will take for the ota to complete.
performTransaction(RxBleTransaction)
.true
if OTA has started, otherwise false
if device is either already
BleDeviceState.PERFORMING_OTA
or is not BleDeviceState.INITIALIZED
.BleDeviceConfig.includeOtaReadWriteTimesInAverage
,
BleManagerConfig.autoScanDuringOta
,
performTransaction(RxBleTransaction)
public final boolean performTransaction(RxBleTransaction txn)
BleDeviceState
like
BleDeviceState.PERFORMING_OTA
, BleDeviceState.AUTHENTICATING
or BleDeviceState.INITIALIZING
.
Generally this transaction should be short, several reads and writes. For longer-term transaction consider using
performOta(RxBleTransaction.RxOta)
.
BleDeviceState.INITIALIZED
.
performOta(RxBleTransaction.RxOta)
.true
if the transaction successfully started, false
otherwise if device is not BleDeviceState.INITIALIZED
.public final int getEffectiveWriteMtuSize()
BleNodeConfig.GATT_WRITE_MTU_OVERHEAD
. The method simply returns the MTU size minus
the overhead. This is just used internally, but is exposed in case it's needed for some other use app-side.public boolean isNull()
null
, use this method to see if the device is considered to be
null
or not.public BleDevice getBleDevice()
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object