-
public class PduConverts 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 byteMANUFACTURER_DATA_PDU_TYPEpublic final static byteGATT_SERVICE_UUID_PDU_TYPEpublic final static byteGATT_SERVICE_UUID_128_BIT_PDU_TYPE
-
Method Summary
Modifier and Type Method Description static Pduparse(Array<byte> bytes, int startIndex)Parse a PDU from a byte array looking offset by startIndex bytegetType()PDU type field intgetDeclaredLength()PDU length from header intgetActualLength()Actual PDU length (may be less than declared length if fewer bytes are actually available. intgetStartIndex()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 intgetEndIndex()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
-
-
-
-