-
public class Pdu
Converts a byte string from a Bluetooth LE scan into a Payload Data Unit (PDU) Created by dyoung on 4/14/15.
-
-
Field Summary
Fields Modifier and Type Field Description public final static byte
MANUFACTURER_DATA_PDU_TYPE
public final static byte
GATT_SERVICE_UUID_PDU_TYPE
public final static byte
GATT_SERVICE_UUID_128_BIT_PDU_TYPE
-
Method Summary
Modifier and Type Method Description static Pdu
parse(Array<byte> bytes, int startIndex)
Parse a PDU from a byte array looking offset by startIndex byte
getType()
PDU type field int
getDeclaredLength()
PDU length from header int
getActualLength()
Actual PDU length (may be less than declared length if fewer bytes are actually available. 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 int
getEndIndex()
End index within byte buffer of PDU -
-
Method Detail
-
parse
static Pdu parse(Array<byte> bytes, int startIndex)
Parse a PDU from a byte array looking offset by startIndex
-
getType
byte getType()
PDU type field
-
getDeclaredLength
int getDeclaredLength()
PDU length from header
-
getActualLength
int getActualLength()
Actual PDU length (may be less than declared length if fewer bytes are actually available.)
-
getStartIndex
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
-
getEndIndex
int getEndIndex()
End index within byte buffer of PDU
-
-
-
-