public class BluetoothDeviceCharacteristic
extends android.bluetooth.BluetoothGattCharacteristic
BluetoothGattCharacteristic).
Please note that CharacteristicWrapper can create only characteristics identified by UUID ids
described in kontakt.io iBeacon and Eddystone specification.CREATOR, FORMAT_FLOAT, FORMAT_SFLOAT, FORMAT_SINT16, FORMAT_SINT32, FORMAT_SINT8, FORMAT_UINT16, FORMAT_UINT32, FORMAT_UINT8, PERMISSION_READ, PERMISSION_READ_ENCRYPTED, PERMISSION_READ_ENCRYPTED_MITM, PERMISSION_WRITE, PERMISSION_WRITE_ENCRYPTED, PERMISSION_WRITE_ENCRYPTED_MITM, PERMISSION_WRITE_SIGNED, PERMISSION_WRITE_SIGNED_MITM, PROPERTY_BROADCAST, PROPERTY_EXTENDED_PROPS, PROPERTY_INDICATE, PROPERTY_NOTIFY, PROPERTY_READ, PROPERTY_SIGNED_WRITE, PROPERTY_WRITE, PROPERTY_WRITE_NO_RESPONSE, WRITE_TYPE_DEFAULT, WRITE_TYPE_NO_RESPONSE, WRITE_TYPE_SIGNED| Constructor and Description |
|---|
BluetoothDeviceCharacteristic(android.bluetooth.BluetoothGattCharacteristic characteristic)
Instantiates a new CharacteristicWrapper.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addDescriptor(android.bluetooth.BluetoothGattDescriptor descriptor) |
android.bluetooth.BluetoothGattDescriptor |
getDescriptor(java.util.UUID uuid) |
java.util.List<android.bluetooth.BluetoothGattDescriptor> |
getDescriptors() |
java.lang.Float |
getFloatValue(int formatType,
int offset) |
java.lang.String |
getHexStringValue()
Gets hex string value.
|
java.util.UUID |
getId()
Gets id of the characteristic.
|
int |
getInstanceId()
Gets characteristic instance id.
|
int |
getIntValue()
Gets characteristic's value as Integer.
|
java.lang.Integer |
getIntValue(int formatType,
int offset) |
KontaktDeviceCharacteristic |
getKontaktDeviceCharacteristic() |
long |
getLongValue()
Gets characteristic's valueas Lon.
|
java.lang.String |
getName()
Gets characteristic name.
|
int |
getPermissions()
Gets characteristic permissions.
|
int |
getProperties()
Gets characteristic properties.
|
android.bluetooth.BluetoothGattService |
getService() |
java.lang.String |
getStringValue()
Gets characteristic's value as String.
|
java.lang.String |
getStringValue(int offset) |
java.util.UUID |
getUuid() |
java.util.UUID |
getUUIDValue()
Gets characteristic's value as UUID.
|
byte[] |
getValue()
Gets characteristic's value as byte array.
|
int |
getWriteType()
Gets characteristic write type.
|
boolean |
isNotifiable()
Checks whether wrapped characteristic is notifiable.
|
boolean |
isReadable()
Checks whether wrapped characteristic is readable.
|
boolean |
isWritable()
Checks whether wrapped characteristic is writable.
|
boolean |
setValue(byte[] value) |
void |
setValue(int value)
Sets Integer as characteristic's value.
|
boolean |
setValue(int value,
int formatType,
int offset) |
boolean |
setValue(int mantissa,
int exponent,
int formatType,
int offset) |
boolean |
setValue(long value)
Sets Long as characteristic's value.
|
boolean |
setValue(java.lang.String value)
Sets String as characteristic's value.
|
void |
setWriteType(int writeType) |
public BluetoothDeviceCharacteristic(android.bluetooth.BluetoothGattCharacteristic characteristic)
characteristic - the characteristicpublic java.util.UUID getUuid()
getUuid in class android.bluetooth.BluetoothGattCharacteristicpublic boolean addDescriptor(android.bluetooth.BluetoothGattDescriptor descriptor)
addDescriptor in class android.bluetooth.BluetoothGattCharacteristicpublic android.bluetooth.BluetoothGattService getService()
getService in class android.bluetooth.BluetoothGattCharacteristicpublic void setWriteType(int writeType)
setWriteType in class android.bluetooth.BluetoothGattCharacteristicpublic java.util.List<android.bluetooth.BluetoothGattDescriptor> getDescriptors()
getDescriptors in class android.bluetooth.BluetoothGattCharacteristicpublic android.bluetooth.BluetoothGattDescriptor getDescriptor(java.util.UUID uuid)
getDescriptor in class android.bluetooth.BluetoothGattCharacteristicpublic java.lang.Integer getIntValue(int formatType,
int offset)
getIntValue in class android.bluetooth.BluetoothGattCharacteristicpublic java.lang.Float getFloatValue(int formatType,
int offset)
getFloatValue in class android.bluetooth.BluetoothGattCharacteristicpublic java.lang.String getStringValue(int offset)
getStringValue in class android.bluetooth.BluetoothGattCharacteristicpublic boolean setValue(int value,
int formatType,
int offset)
setValue in class android.bluetooth.BluetoothGattCharacteristicpublic boolean setValue(int mantissa,
int exponent,
int formatType,
int offset)
setValue in class android.bluetooth.BluetoothGattCharacteristicpublic java.util.UUID getId()
public java.lang.String getName()
public boolean isWritable()
public boolean isReadable()
public boolean isNotifiable()
public void setValue(int value)
value - the int valuepublic boolean setValue(java.lang.String value)
setValue in class android.bluetooth.BluetoothGattCharacteristicvalue - the String valuepublic boolean setValue(long value)
value - the long valuepublic boolean setValue(byte[] value)
setValue in class android.bluetooth.BluetoothGattCharacteristicpublic byte[] getValue()
getValue in class android.bluetooth.BluetoothGattCharacteristicpublic java.lang.String getStringValue()
public java.lang.String getHexStringValue()
public java.util.UUID getUUIDValue()
public int getIntValue()
public long getLongValue()
public int getPermissions()
getPermissions in class android.bluetooth.BluetoothGattCharacteristicpublic int getWriteType()
getWriteType in class android.bluetooth.BluetoothGattCharacteristicpublic int getProperties()
getProperties in class android.bluetooth.BluetoothGattCharacteristicpublic int getInstanceId()
getInstanceId in class android.bluetooth.BluetoothGattCharacteristicpublic KontaktDeviceCharacteristic getKontaktDeviceCharacteristic()