public static enum ReadWriteListener.Type extends java.lang.Enum<ReadWriteListener.Type> implements UsesCustomNull
ReadWriteListener.ReadWriteEvent
- read, write, poll, etc.Enum Constant and Description |
---|
DISABLING_NOTIFICATION
Opposite of
ENABLING_NOTIFICATION . |
ENABLING_NOTIFICATION
Associated with
BleDevice.enableNotify(UUID, ReadWriteListener) and called when enabling the notification completes by writing to the
Descriptor of the given UUID . |
NULL
As of now, only used for
DeviceReconnectFilter.ConnectFailEvent.txnFailReason() in some cases. |
POLL
|
PSUEDO_NOTIFICATION
Associated with
BleDevice.startChangeTrackingPoll(UUID, Interval, ReadWriteListener)
or BleDevice.enableNotify(UUID, Interval, ReadWriteListener) where a force-read timeout is invoked. |
READ
Associated with
BleDevice.read(UUID, ReadWriteListener) or BleDevice.readRssi(ReadWriteListener) . |
WRITE
|
WRITE_NO_RESPONSE
Similar to
WRITE but under the hood BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE is used. |
WRITE_SIGNED
Similar to
WRITE but under the hood BluetoothGattCharacteristic.WRITE_TYPE_SIGNED is used. |
Modifier and Type | Method and Description |
---|---|
boolean |
isNull()
Returns
true if the object's state represents what would otherwise be Java's built-in null . |
boolean |
isRead()
|
boolean |
isWrite()
|
BleNodeConfig.HistoricalDataLogFilter.Source |
toHistoricalDataSource()
Returns the
BleNodeConfig.HistoricalDataLogFilter.Source equivalent
for this ReadWriteListener.Type , or BleNodeConfig.HistoricalDataLogFilter.Source.NULL . |
static ReadWriteListener.Type |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ReadWriteListener.Type[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ReadWriteListener.Type NULL
DeviceReconnectFilter.ConnectFailEvent.txnFailReason()
in some cases.public static final ReadWriteListener.Type READ
BleDevice.read(UUID, ReadWriteListener)
or BleDevice.readRssi(ReadWriteListener)
.public static final ReadWriteListener.Type WRITE
BleDevice.write(UUID, byte[])
or BleDevice.write(UUID, byte[], ReadWriteListener)
or BleDevice.negotiateMtu(int)
or BleDevice.setName(String, UUID, ReadWriteListener)
.isWrite()
public static final ReadWriteListener.Type WRITE_NO_RESPONSE
WRITE
but under the hood BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE
is used.
See also BluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE
.isWrite()
public static final ReadWriteListener.Type WRITE_SIGNED
WRITE
but under the hood BluetoothGattCharacteristic.WRITE_TYPE_SIGNED
is used.
See also BluetoothGattCharacteristic.PROPERTY_SIGNED_WRITE
.isWrite()
public static final ReadWriteListener.Type POLL
public static final ReadWriteListener.Type PSUEDO_NOTIFICATION
BleDevice.startChangeTrackingPoll(UUID, Interval, ReadWriteListener)
or BleDevice.enableNotify(UUID, Interval, ReadWriteListener)
where a force-read timeout is invoked. You should never see this
ReadWriteListener.Type
via GenericListener_Void.onEvent(Event)
. Any event with this type will be emitted in the NotificationListener
.public static final ReadWriteListener.Type ENABLING_NOTIFICATION
BleDevice.enableNotify(UUID, ReadWriteListener)
and called when enabling the notification completes by writing to the
Descriptor of the given UUID
. ReadWriteListener.Status.SUCCESS
doesn't necessarily mean that notifications will
definitely now work (there may be other issues in the underlying stack), but it's a reasonable guarantee.public static final ReadWriteListener.Type DISABLING_NOTIFICATION
ENABLING_NOTIFICATION
.public static ReadWriteListener.Type[] values()
for (ReadWriteListener.Type c : ReadWriteListener.Type.values()) System.out.println(c);
public static ReadWriteListener.Type valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic final boolean isRead()
true
for every ReadWriteListener.Type
except isWrite()
. Overall this convenience method is meant
to tell you when we've received something from the device as opposed to writing something to it.public final boolean isWrite()
public final BleNodeConfig.HistoricalDataLogFilter.Source toHistoricalDataSource()
BleNodeConfig.HistoricalDataLogFilter.Source
equivalent
for this ReadWriteListener.Type
, or BleNodeConfig.HistoricalDataLogFilter.Source.NULL
.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