Class GattLocalCharacteristic
java.lang.Object
com.codename1.bluetooth.le.server.GattLocalCharacteristic
A characteristic definition of a local GattLocalService served by
this device's GattServer. Properties use the
invalid reference
GattCharacteristic
PERMISSION_* bits defined here.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe characteristic may be read (bit0x01).static final intThe characteristic may be read over an encrypted link only (bit0x02).static final intThe characteristic may be written (bit0x10).static final intThe characteristic may be written over an encrypted link only (bit0x20). -
Constructor Summary
ConstructorsConstructorDescriptionGattLocalCharacteristic(BluetoothUuid uuid, int properties, int permissions) Creates a characteristic definition. -
Method Summary
Modifier and TypeMethodDescriptionAdds a descriptor definition.The descriptor definitions added viaaddDescriptor(GattLocalDescriptor).intThePERMISSION_*bitmask.intThe
`.PROPERTY_*` bitmask.invalid reference
GattCharacteristicgetUuid()The UUID identifying this characteristic.byte[]getValue()The static value, ornullwhen reads are served via theGattServerListener.setValue(byte[] staticValue) Serves a static value without routing read requests to theGattServerListener.toString()Returns a string representation of the object.
-
Field Details
-
PERMISSION_READ
public static final int PERMISSION_READThe characteristic may be read (bit0x01).- See Also:
-
PERMISSION_READ_ENCRYPTED
public static final int PERMISSION_READ_ENCRYPTEDThe characteristic may be read over an encrypted link only (bit0x02).- See Also:
-
PERMISSION_WRITE
public static final int PERMISSION_WRITEThe characteristic may be written (bit0x10).- See Also:
-
PERMISSION_WRITE_ENCRYPTED
public static final int PERMISSION_WRITE_ENCRYPTEDThe characteristic may be written over an encrypted link only (bit0x20).- See Also:
-
-
Constructor Details
-
GattLocalCharacteristic
Creates a characteristic definition.
propertiesuses`.PROPERTY_*` bits; `permissions` uses theinvalid reference
GattCharacteristicPERMISSION_*bits of this class.
-
-
Method Details
-
setValue
Serves a static value without routing read requests to theGattServerListener. Without a static value, every read arrives as aGattReadRequest. -
addDescriptor
Adds a descriptor definition. -
getUuid
The UUID identifying this characteristic. -
getProperties
public int getProperties()The
`.PROPERTY_*` bitmask.invalid reference
GattCharacteristic -
getPermissions
public int getPermissions()ThePERMISSION_*bitmask. -
getValue
public byte[] getValue()The static value, ornullwhen reads are served via theGattServerListener. -
getDescriptors
The descriptor definitions added viaaddDescriptor(GattLocalDescriptor). -
toString
Description copied from class:ObjectReturns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
-