Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | Static Public Member Functions | List of all members
org.direct_bt.DBGattValue Class Reference

A copy of the native GATT value of DBGattChar or DBGattDesc. More...

Collaboration diagram for org.direct_bt.DBGattValue:

Public Member Functions

 DBGattValue (final byte[] value, final int capacity)
 Constructor, using default variable_length = false. More...
 
 DBGattValue (final byte[] value, final int capacity, final boolean variable_length)
 Constructor. More...
 
void bzero ()
 Fill value with zero bytes. More...
 
int capacity ()
 Return the set capacity for this value. More...
 
byte[] data ()
 Returns the actual data of this value. More...
 
boolean equals (final Object other)
 Only compares the actual value, not hasVariableLength() nor capacity(). More...
 
boolean hasVariableLength ()
 Returns true if this value has variable length. More...
 
void setVariableLength (final boolean v)
 
int size ()
 Return the size of this value, i.e. More...
 
String toString ()
 

Static Public Member Functions

static DBGattValue make (final byte[] p)
 Convenience DBGattValue ctor function. More...
 
static DBGattValue make (final int capacity, final int size)
 Convenience DBGattValue ctor function. More...
 
static DBGattValue make (final int capacity, final int size, final byte[] s)
 Convenience DBGattValue ctor function. More...
 
static DBGattValue make (final short v)
 Convenience DBGattValue ctor function. More...
 
static DBGattValue make (final String name)
 Convenience DBGattValue ctor function. More...
 
static DBGattValue make (final String name, final int capacity)
 Convenience DBGattValue ctor function. More...
 

Detailed Description

A copy of the native GATT value of DBGattChar or DBGattDesc.

Its capacity() defines the maximum writable variable length and its size() defines the maximum writable fixed length. See hasVariableLength().

Since
2.4.0

Definition at line 42 of file DBGattValue.java.

Constructor & Destructor Documentation

◆ DBGattValue() [1/2]

org.direct_bt.DBGattValue.DBGattValue ( final byte[]  value,
final int  capacity,
final boolean  variable_length 
)

Constructor.

Parameters
valuethe data, which length defines the maximum writable fixed length if variable length is false. If variable length is true, capacity limits the maximum writable length.
capacity_defines the maximum writable variable length, if variable length is true
variable_length_defaults to false.

Definition at line 94 of file DBGattValue.java.

Here is the caller graph for this function:

◆ DBGattValue() [2/2]

org.direct_bt.DBGattValue.DBGattValue ( final byte[]  value,
final int  capacity 
)

Constructor, using default variable_length = false.

Parameters
valuethe data, which length defines the maximum writable fixed length, if variable length is disabled.
capacity_defines the maximum writable variable length, if variable length is true

Definition at line 106 of file DBGattValue.java.

Member Function Documentation

◆ make() [1/6]

static DBGattValue org.direct_bt.DBGattValue.make ( final String  name)
static

Convenience DBGattValue ctor function.

Definition at line 51 of file DBGattValue.java.

◆ make() [2/6]

static DBGattValue org.direct_bt.DBGattValue.make ( final String  name,
final int  capacity 
)
static

Convenience DBGattValue ctor function.

Definition at line 56 of file DBGattValue.java.

◆ make() [3/6]

static DBGattValue org.direct_bt.DBGattValue.make ( final short  v)
static

Convenience DBGattValue ctor function.

Definition at line 61 of file DBGattValue.java.

◆ make() [4/6]

static DBGattValue org.direct_bt.DBGattValue.make ( final int  capacity,
final int  size 
)
static

Convenience DBGattValue ctor function.

Definition at line 68 of file DBGattValue.java.

◆ make() [5/6]

static DBGattValue org.direct_bt.DBGattValue.make ( final byte[]  p)
static

Convenience DBGattValue ctor function.

Definition at line 75 of file DBGattValue.java.

◆ make() [6/6]

static DBGattValue org.direct_bt.DBGattValue.make ( final int  capacity,
final int  size,
final byte[]  s 
)
static

Convenience DBGattValue ctor function.

Definition at line 80 of file DBGattValue.java.

◆ hasVariableLength()

boolean org.direct_bt.DBGattValue.hasVariableLength ( )

Returns true if this value has variable length.

Variable length impacts GATT value write behavior.

See also
capacity()
size()

Definition at line 119 of file DBGattValue.java.

Here is the caller graph for this function:

◆ setVariableLength()

void org.direct_bt.DBGattValue.setVariableLength ( final boolean  v)

Definition at line 121 of file DBGattValue.java.

Here is the caller graph for this function:

◆ capacity()

int org.direct_bt.DBGattValue.capacity ( )

Return the set capacity for this value.

Capacity defines the maximum writable variable length, if variable length is enabled.

See also
hasVariableLength()

Definition at line 131 of file DBGattValue.java.

Here is the caller graph for this function:

◆ size()

int org.direct_bt.DBGattValue.size ( )

Return the size of this value, i.e.

byte[] length.

Size defines the maximum writable fixed length, if variable length is disabled.

See also
hasVariableLength()

Definition at line 141 of file DBGattValue.java.

Here is the caller graph for this function:

◆ data()

byte[] org.direct_bt.DBGattValue.data ( )

Returns the actual data of this value.

Definition at line 146 of file DBGattValue.java.

Here is the caller graph for this function:

◆ bzero()

void org.direct_bt.DBGattValue.bzero ( )

Fill value with zero bytes.

Definition at line 149 of file DBGattValue.java.

◆ equals()

boolean org.direct_bt.DBGattValue.equals ( final Object  other)

Only compares the actual value, not hasVariableLength() nor capacity().

Parent description:

Definition at line 163 of file DBGattValue.java.

◆ toString()

String org.direct_bt.DBGattValue.toString ( )

Definition at line 184 of file DBGattValue.java.


The documentation for this class was generated from the following file: