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 | |
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) |
Properties | |
---|---|
static Parcelable.Creator<BluetoothGattDescriptor!> | |
static ByteArray! |
Value used to disable notifications or indicatinos |
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: 1
PERMISSION_READ_ENCRYPTED
static val PERMISSION_READ_ENCRYPTED: Int
Descriptor permission: Allow encrypted read operations
Value: 2
PERMISSION_READ_ENCRYPTED_MITM
static val PERMISSION_READ_ENCRYPTED_MITM: Int
Descriptor permission: Allow reading with person-in-the-middle protection
Value: 4
PERMISSION_WRITE
static val PERMISSION_WRITE: Int
Descriptor write permission
Value: 16
PERMISSION_WRITE_ENCRYPTED
static val PERMISSION_WRITE_ENCRYPTED: Int
Descriptor permission: Allow encrypted writes
Value: 32
PERMISSION_WRITE_ENCRYPTED_MITM
static val PERMISSION_WRITE_ENCRYPTED_MITM: Int
Descriptor permission: Allow encrypted writes with person-in-the-middle protection
Value: 64
PERMISSION_WRITE_SIGNED
static val PERMISSION_WRITE_SIGNED: Int
Descriptor permission: Allow signed write operations
Value: 128
PERMISSION_WRITE_SIGNED_MITM
static val PERMISSION_WRITE_SIGNED_MITM: Int
Descriptor permission: Allow signed write operations with person-in-the-middle protection
Value: 256
Public 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
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
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 android.bluetooth.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 android.bluetooth.BluetoothGatt#writeDescriptor(android.bluetooth.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
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 android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |
Properties
DISABLE_NOTIFICATION_VALUE
static val DISABLE_NOTIFICATION_VALUE: ByteArray!
Value used to disable notifications or indicatinos
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