Android蓝牙4.0API-类-BluetoothGattCharacteristic

来源:互联网 发布:生产数据化管理 编辑:程序博客网 时间:2024/05/29 16:59

Represents a Bluetooth GATT Characteristic

A GATT characteristic is a basic data element 元素used to construct构建 a GATT service, BluetoothGattService. The characteristic contains a value as well as additional附加的 information and optional可选的 GATT descriptors,BluetoothGattDescriptor.

常量

int FORMAT_FLOAT 

Characteristic 特有的value format type float (32-bit float)

int FORMAT_SFLOAT

Characteristic value format type sfloat (16-bit float)

int FORMAT_SINT16
Characteristic value format type sint16

int FORMAT_SINT32

int FORMAT_SINT8

int FORMAT_UINT16 

int FORMAT_UINT32

int FORMAT_UINT8

int PERMISSION_READ

Characteristic read permission读的权限

int PERMISSION_READ_ENCRYPTED

Characteristic permission: Allow encrypted加密 read operations

int PERMISSION_READ_ENCRYPTED_MITM

Characteristic permission: Allow reading with man-in-the-middle protection

int     PERMISSION_WRITE

Characteristic write permission

int PERMISSION_WRITE_ENCRYPTED

int PERMISSION_WRITE_ENCRYPTED_MITM

int PERMISSION_WRITE_SIGNED

Characteristic permission: Allow signed有符号的 write operations

int PERMISSION_WRITE_SIGNED_MITM

int PROPERTY_BROADCAST

Characteristic proprty属性: Characteristic is broadcastable

int PROPERTY_EXTENDED_PROPS

Characteristic property: Characteristic has extended properties

int PROPERTY_INDICATE

Characteristic property: Characteristic supports indication特征

int PROPERTY_NOTIFY

Characteristic property: Characteristic supports notification

int PROPERTY_SIGNED_WRITE

Characteristic property: Characteristic supports write with signature

int PROPERTY_WRITE

Characteristic property: Characteristic can be written.

int PROPERTY_WRITE_NO_RESPONSE

Characteristic property: Characteristic can be written without response.

int WRITE_TYPE_DEFAULT

Write characteristic, requesting acknoledgement by the remote device

int WRITE_TYPE_NO_RESPONSE

Wrtite characteristic without requiring a response by the remote device

int WRITE_TYPE_SIGNED

Write characteristic including authentication signature

公有方法

boolean addDescriptor(BluetoothGattDescriptor descriptor)

Adds a descriptor描述 to this characteristic.

BluetoothGattDescriptorgetDescriptor(UUID uuid)

Returns a descriptor with a given UUID out of the list of descriptors for this characteristic.

List<BluetoothGattDescriptorgetDescriptors()

Returns a list of descriptors for this characteristic.

FloatgetFloatValue(int formatType, int offset)

Return the stored存储 value of this characteristic.

int getInstanceId()

Returns the instance实例 ID for this characteristic.
Integer getIntValue(int formatType, int offset)

Return the stored value of this characteristic.

int getPermissions()

Returns the permissions for this characteristic.

int getProperties()

Returns the properties of this characteristic.

BluetoothGattService getService()

Returns the service this characteristic belongs to.

String getStringValue(int offset)

Return the stored value of this characteristic.

UUID getUuid()

Returns the UUID of this characteristic

byte[] getValue()

Get the stored value for this characteristic.

int getWriteType() 

Gets the write type for this characteristic.

boolean setValue(int value, int formatType, int offset)

Set the locally stored value of this characteristic.

boolean setValue(byte[] value)

Updates the locally stored value of this characteristic.

boolean setValue(String value)

Set the locally stored value of this characteristic.

boolean setValue(int mantissa, int exponent, int formatType, int offset)

Set the locally stored value of this characteristic.

void setWriteType(int writeType)

Set the write type for this characteristic

Setting the write type of a characteristic determines how the writeCharacteristic(BluetoothGattCharacteristic) function write this characteristic.


0 0
原创粉丝点击