Class CMMqttEventFixedHeader

Direct Known Subclasses:
CMMqttEventCONNACK, CMMqttEventCONNECT, CMMqttEventDISCONNECT, CMMqttEventPINGREQ, CMMqttEventPINGRESP, CMMqttEventPUBACK, CMMqttEventPUBCOMP, CMMqttEventPUBLISH, CMMqttEventPUBREC, CMMqttEventPUBREL, CMMqttEventSUBACK, CMMqttEventSUBSCRIBE, CMMqttEventUNSUBACK, CMMqttEventUNSUBSCRIBE

public abstract class CMMqttEventFixedHeader extends CMMqttEvent
This class represents CM events that belong to the fixed header of MQTT control packets.
See Also:
  • Field Details

    • m_packetType

      protected byte m_packetType
    • m_flag

      protected byte m_flag
    • m_nRemainingLength

      protected int m_nRemainingLength
  • Constructor Details

    • CMMqttEventFixedHeader

      public CMMqttEventFixedHeader()
  • Method Details

    • setFixedHeader

      public void setFixedHeader(byte packetType, byte flag)
      Sets the fixed header.
      Parameters:
      packetType - - the packet type
      flag - - the flag
    • setPacketType

      public void setPacketType(byte type)
      Sets the packet type
      Parameters:
      type - - the packet type
    • getPacketType

      public byte getPacketType()
      Returns the packet type.
      Returns:
      the packet type
    • setFlag

      public void setFlag(byte flag)
      Sets the flag.
      Parameters:
      flag - - the flag
    • getFlag

      public byte getFlag()
      Returns the flag.
      Returns:
      the flag
    • setRemainingLength

      public void setRemainingLength(int len)
    • getRemainingLength

      public int getRemainingLength()
      Returns the remaining length.

      This value is set after a CMMqttEvent is marshalled.

      Returns:
      the remaining length.
    • getBinaryStringOfByte

      protected String getBinaryStringOfByte(byte inputByte)
    • getBinaryString

      protected String getBinaryString(byte inputByte, int nLSBits)
    • getFixedHeaderByteNum

      protected int getFixedHeaderByteNum()
      Specified by:
      getFixedHeaderByteNum in class CMMqttEvent
    • marshallFixedHeader

      protected void marshallFixedHeader()
      Specified by:
      marshallFixedHeader in class CMMqttEvent
    • unmarshallFixedHeader

      protected void unmarshallFixedHeader(ByteBuffer buf)
      Specified by:
      unmarshallFixedHeader in class CMMqttEvent
    • toString

      public String toString()
      Returns the string representation of the CMMqttEventFixedHeader.
      Overrides:
      toString in class CMMqttEvent
      Returns:
      string of this object.