-
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_AD_TYPEpublic final static byteGATT_SERVICE_DATA_UUID_16_BIT_AD_TYPEpublic final static byteGATT_SERVICE_DATA_UUID_32_BIT_AD_TYPEpublic final static byteGATT_SERVICE_DATA_UUID_128_BIT_AD_TYPEpublic final static byteGATT_SERVICE_COMPLETE_UUID_128_BIT_AD_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 PDUThis is the start of the payload data that starts after the length and the type, so the PDUactually 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 PDUThis is the start of the payload data that starts after the length and the type, so the PDUactually starts two bytes earlier
-
getEndIndex
int getEndIndex()
End index within byte buffer of PDU
-
-
-
-