public class Pdu extends Object
| Modifier and Type | Field and Description |
|---|---|
static byte |
GATT_SERVICE_UUID_PDU_TYPE |
static byte |
MANUFACTURER_DATA_PDU_TYPE |
| Constructor and Description |
|---|
Pdu() |
| Modifier and Type | Method and Description |
|---|---|
int |
getActualLength()
Actual PDU length (may be less than declared length if fewer bytes are actually available.)
|
int |
getDeclaredLength()
PDU length from header
|
int |
getEndIndex()
End index within byte buffer of PDU
|
int |
getStartIndex()
Start index within byte buffer of PDU
This is the start of the payload data that starts after the length and the type, so the PDU
actually starts two bytes earlier
|
byte |
getType()
PDU type field
|
static Pdu |
parse(byte[] bytes,
int startIndex)
Parse a PDU from a byte array looking offset by startIndex
|
public static final byte MANUFACTURER_DATA_PDU_TYPE
public static final byte GATT_SERVICE_UUID_PDU_TYPE
public static Pdu parse(byte[] bytes, int startIndex)
bytes - startIndex - public byte getType()
public int getDeclaredLength()
public int getActualLength()
public int getStartIndex()
public int getEndIndex()