Package 

Class Pdu


  • 
    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.

    • 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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

      • 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