BluetoothGattDescriptor
open class BluetoothGattDescriptor : Parcelable
| kotlin.Any | |
| ↳ | android.bluetooth.BluetoothGattDescriptor |
Represents a Bluetooth GATT Descriptor
GATT Descriptors contain additional information and attributes of a GATT characteristic, BluetoothGattCharacteristic. They can be used to describe the characteristic's features or to control certain behaviours of the characteristic.
Summary
| Constants | |
|---|---|
| static Int |
Descriptor read permission |
| static Int |
Descriptor permission: Allow encrypted read operations |
| static Int |
Descriptor permission: Allow reading with person-in-the-middle protection |
| static Int |
Descriptor write permission |
| static Int |
Descriptor permission: Allow encrypted writes |
| static Int |
Descriptor permission: Allow encrypted writes with person-in-the-middle protection |
| static Int |
Descriptor permission: Allow signed write operations |
| static Int |
Descriptor permission: Allow signed write operations with person-in-the-middle protection |
| Inherited constants | |
|---|---|
| Public constructors | |
|---|---|
BluetoothGattDescriptor(uuid: UUID!, permissions: Int)Create a new BluetoothGattDescriptor. |
|
| Public methods | |
|---|---|
| open Int |
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| open BluetoothGattCharacteristic! |
Returns the characteristic this descriptor belongs to. |
| open Int |
Returns the permissions for this descriptor. |
| open UUID! |
getUuid()Returns the UUID of this descriptor. |
| open ByteArray! |
getValue()Returns the stored value for this descriptor |
| open Boolean |
Updates the locally stored value of this descriptor. |
| open Unit |
writeToParcel(out: Parcel, flags: Int)Flatten this object in to a Parcel. |
| Properties | |
|---|---|
| static Parcelable.Creator<BluetoothGattDescriptor!> | |
| static ByteArray! |
Value used to disable notifications or indications |
| static ByteArray! |
Value used to enable indication for a client configuration descriptor |
| static ByteArray! |
Value used to enable notification for a client configuration descriptor |
Constants
PERMISSION_READ
static val PERMISSION_READ: Int
Descriptor read permission
Value: 1PERMISSION_READ_ENCRYPTED
static val PERMISSION_READ_ENCRYPTED: Int
Descriptor permission: Allow encrypted read operations
Value: 2PERMISSION_READ_ENCRYPTED_MITM
static val PERMISSION_READ_ENCRYPTED_MITM: Int
Descriptor permission: Allow reading with person-in-the-middle protection
Value: 4PERMISSION_WRITE
static val PERMISSION_WRITE: Int
Descriptor write permission
Value: 16PERMISSION_WRITE_ENCRYPTED
static val PERMISSION_WRITE_ENCRYPTED: Int
Descriptor permission: Allow encrypted writes
Value: 32PERMISSION_WRITE_ENCRYPTED_MITM
static val PERMISSION_WRITE_ENCRYPTED_MITM: Int
Descriptor permission: Allow encrypted writes with person-in-the-middle protection
Value: 64PERMISSION_WRITE_SIGNED
static val PERMISSION_WRITE_SIGNED: Int
Descriptor permission: Allow signed write operations
Value: 128PERMISSION_WRITE_SIGNED_MITM
static val PERMISSION_WRITE_SIGNED_MITM: Int
Descriptor permission: Allow signed write operations with person-in-the-middle protection
Value: 256Public constructors
BluetoothGattDescriptor
BluetoothGattDescriptor(
uuid: UUID!,
permissions: Int)
Create a new BluetoothGattDescriptor.
| Parameters | |
|---|---|
uuid |
UUID!: The UUID for this descriptor |
permissions |
Int: Permissions for this descriptor |
Public methods
describeContents
open fun describeContents(): Int
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or
|
getCharacteristic
open fun getCharacteristic(): BluetoothGattCharacteristic!
Returns the characteristic this descriptor belongs to.
| Return | |
|---|---|
BluetoothGattCharacteristic! |
The characteristic. |
getPermissions
open fun getPermissions(): Int
Returns the permissions for this descriptor.
| Return | |
|---|---|
Int |
Permissions of this descriptor |
getUuid
open fun getUuid(): UUID!
Returns the UUID of this descriptor.
| Return | |
|---|---|
UUID! |
UUID of this descriptor |
getValue
open fungetValue(): ByteArray!
Deprecated: Use BluetoothGatt.readDescriptor(BluetoothGattDescriptor) instead
Returns the stored value for this descriptor
This function returns the stored value for this descriptor as retrieved by calling BluetoothGatt.readDescriptor. The cached value of the descriptor is updated as a result of a descriptor read operation.
| Return | |
|---|---|
ByteArray! |
Cached value of the descriptor |
setValue
open funsetValue(value: ByteArray!): Boolean
Deprecated: Pass the descriptor value directly into BluetoothGatt.writeDescriptor(BluetoothGattDescriptor, byte[])
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 android.bluetooth.BluetoothGatt#writeDescriptor to send the value to the remote device.
| Parameters | |
|---|---|
value |
ByteArray!: New value for this descriptor |
| Return | |
|---|---|
Boolean |
true if the locally stored value has been set, false if the requested value could not be stored locally. |
writeToParcel
open fun writeToParcel(
out: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
dest |
The Parcel in which the object should be written. This value cannot be null. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of the following:
|
Properties
DISABLE_NOTIFICATION_VALUE
static val DISABLE_NOTIFICATION_VALUE: ByteArray!
Value used to disable notifications or indications
ENABLE_INDICATION_VALUE
static val ENABLE_INDICATION_VALUE: ByteArray!
Value used to enable indication for a client configuration descriptor
ENABLE_NOTIFICATION_VALUE
static val ENABLE_NOTIFICATION_VALUE: ByteArray!
Value used to enable notification for a client configuration descriptor