public final class BleCharacteristic extends P_NativeGattObject<android.bluetooth.BluetoothGattCharacteristic> implements UsesInstanceId
BluetoothGattCharacteristic
. You should always check P_NativeGattObject.isNull()
before
doing anything with the BluetoothGattCharacteristic
returned from getCharacteristic()
.Modifier and Type | Field and Description |
---|---|
static BleCharacteristic |
NULL |
static int |
PROPERTY_INDICATE |
static int |
PROPERTY_NOTIFY |
static int |
PROPERTY_READ |
static int |
PROPERTY_SIGNED_WRITE |
static int |
PROPERTY_WRITE |
static int |
PROPERTY_WRITE_NO_RESPONSE |
static int |
WRITE_TYPE_NO_RESPONSE |
static int |
WRITE_TYPE_SIGNED |
Constructor and Description |
---|
BleCharacteristic(android.bluetooth.BluetoothGattCharacteristic characteristic) |
BleCharacteristic(UhOhListener.UhOh uhoh) |
Modifier and Type | Method and Description |
---|---|
android.bluetooth.BluetoothGattCharacteristic |
getCharacteristic()
Returns the instance of
BluetoothGattCharacteristic held in this class. |
BleDescriptor |
getDescriptor(java.util.UUID descriptorUuid)
Returns an instance of
BleDescriptor that holds the native BluetoothGattDescriptor for the
UUID requested. |
java.util.List<BleDescriptor> |
getDescriptors()
Returns a list of
BleDescriptor s held in this characteristic. |
int |
getInstanceId() |
BleService |
getService()
Returns an instance of
BleService that holds the native BluetoothGattService which this
characteristic belongs to. |
java.util.UUID |
getUuid()
Forwards
BluetoothGattCharacteristic.getUuid() . |
byte[] |
getValue()
Forwards
BluetoothGattCharacteristic.getValue() . |
void |
setInstanceId(int id) |
equals, getGattObject, getUhOh, hasUhOh, isNull
public static final int PROPERTY_NOTIFY
public static final int PROPERTY_INDICATE
public static final int PROPERTY_WRITE
public static final int PROPERTY_WRITE_NO_RESPONSE
public static final int PROPERTY_SIGNED_WRITE
public static final int PROPERTY_READ
public static final int WRITE_TYPE_NO_RESPONSE
public static final int WRITE_TYPE_SIGNED
public static final BleCharacteristic NULL
public BleCharacteristic(android.bluetooth.BluetoothGattCharacteristic characteristic)
public BleCharacteristic(UhOhListener.UhOh uhoh)
public final android.bluetooth.BluetoothGattCharacteristic getCharacteristic()
BluetoothGattCharacteristic
held in this class.public final java.util.List<BleDescriptor> getDescriptors()
BleDescriptor
s held in this characteristic.public final java.util.UUID getUuid()
BluetoothGattCharacteristic.getUuid()
. Will return Uuids.INVALID
if the backing
characteristic is null
.public final byte[] getValue()
BluetoothGattCharacteristic.getValue()
. Will return an empty array if the backing
characteristic is null
.public final BleService getService()
BleService
that holds the native BluetoothGattService
which this
characteristic belongs to. If the backing characteristic is null
, BleService.NULL
will be returned.public final BleDescriptor getDescriptor(java.util.UUID descriptorUuid)
BleDescriptor
that holds the native BluetoothGattDescriptor
for the
UUID
requested. If the descriptor is not found, BleDescriptor.NULL
will be returned.public void setInstanceId(int id)
setInstanceId
in interface UsesInstanceId
public int getInstanceId()
getInstanceId
in interface UsesInstanceId