Fields Summary |
---|
public static final byte[] | ENABLE_NOTIFICATION_VALUEValue used to enable notification for a client configuration descriptor |
public static final byte[] | ENABLE_INDICATION_VALUEValue used to enable indication for a client configuration descriptor |
public static final byte[] | DISABLE_NOTIFICATION_VALUEValue used to disable notifications or indicatinos |
public static final int | PERMISSION_READDescriptor read permission |
public static final int | PERMISSION_READ_ENCRYPTEDDescriptor permission: Allow encrypted read operations |
public static final int | PERMISSION_READ_ENCRYPTED_MITMDescriptor permission: Allow reading with man-in-the-middle protection |
public static final int | PERMISSION_WRITEDescriptor write permission |
public static final int | PERMISSION_WRITE_ENCRYPTEDDescriptor permission: Allow encrypted writes |
public static final int | PERMISSION_WRITE_ENCRYPTED_MITMDescriptor permission: Allow encrypted writes with man-in-the-middle
protection |
public static final int | PERMISSION_WRITE_SIGNEDDescriptor permission: Allow signed write operations |
public static final int | PERMISSION_WRITE_SIGNED_MITMDescriptor permission: Allow signed write operations with
man-in-the-middle protection |
protected UUID | mUuidThe UUID of this descriptor. |
protected int | mInstanceInstance ID for this descriptor. |
protected int | mPermissionsPermissions for this descriptor |
protected BluetoothGattCharacteristic | mCharacteristicBack-reference to the characteristic this descriptor belongs to. |
protected byte[] | mValueThe value for this descriptor. |
Methods Summary |
---|
public BluetoothGattCharacteristic | getCharacteristic()Returns the characteristic this descriptor belongs to.
return mCharacteristic;
|
public int | getInstanceId()Returns the instance ID for this descriptor.
If a remote device offers multiple descriptors with the same UUID,
the instance ID is used to distuinguish between descriptors.
Requires {@link android.Manifest.permission#BLUETOOTH} permission.
return mInstance;
|
public int | getPermissions()Returns the permissions for this descriptor.
return mPermissions;
|
public java.util.UUID | getUuid()Returns the UUID of this descriptor.
return mUuid;
|
public byte[] | getValue()Returns the stored value for this descriptor
This function returns the stored value for this descriptor as
retrieved by calling {@link BluetoothGatt#readDescriptor}. The cached
value of the descriptor is updated as a result of a descriptor read
operation.
return mValue;
|
private void | initDescriptor(BluetoothGattCharacteristic characteristic, java.util.UUID uuid, int instance, int permissions)
mCharacteristic = characteristic;
mUuid = uuid;
mInstance = instance;
mPermissions = permissions;
|
void | setCharacteristic(BluetoothGattCharacteristic characteristic)Set the back-reference to the associated characteristic
mCharacteristic = characteristic;
|
public boolean | setValue(byte[] value)Updates the locally stored value of this descriptor.
This function modifies the locally stored cached value of this
descriptor. To send the value to the remote device, call
{@link BluetoothGatt#writeDescriptor} to send the value to the
remote device.
mValue = value;
return true;
|