Class Pdu


  • public class Pdu
    extends Object
    Converts a byte string from a Bluetooth LE scan into a Payload Data Unit (PDU) Created by dyoung on 4/14/15.
    • Field Detail

      • MANUFACTURER_DATA_PDU_TYPE

        public static final byte MANUFACTURER_DATA_PDU_TYPE
        See Also:
        Constant Field Values
      • GATT_SERVICE_UUID_PDU_TYPE

        public static final byte GATT_SERVICE_UUID_PDU_TYPE
        See Also:
        Constant Field Values
    • Constructor Detail

      • Pdu

        public Pdu()
    • Method Detail

      • parse

        public static Pdu parse​(byte[] bytes,
                                int startIndex)
        Parse a PDU from a byte array looking offset by startIndex
        Parameters:
        bytes -
        startIndex -
        Returns:
      • getType

        public byte getType()
        PDU type field
        Returns:
      • getDeclaredLength

        public int getDeclaredLength()
        PDU length from header
        Returns:
      • getActualLength

        public int getActualLength()
        Actual PDU length (may be less than declared length if fewer bytes are actually available.)
        Returns:
      • getStartIndex

        public 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
        Returns:
      • getEndIndex

        public int getEndIndex()
        End index within byte buffer of PDU
        Returns: