Class CMMqttEventCONNACK


public class CMMqttEventCONNACK extends CMMqttEventFixedHeader
This class represents a CM event that belongs to the variable header and payload of MQTT CONNACK packet.
See Also:
  • Constructor Details

    • CMMqttEventCONNACK

      public CMMqttEventCONNACK()
      Creates an instance of the CMMqttEventCONNACK class.
    • CMMqttEventCONNACK

      public CMMqttEventCONNACK(ByteBuffer msg)
  • Method Details

    • setVarHeader

      public void setVarHeader(boolean bConnAckFlag, byte returnCode)
      Sets the variable header of the MQTT CONNACK packet.
      Parameters:
      bConnAckFlag - - session present flag
      returnCode - - return code
    • setConnAckFlag

      public void setConnAckFlag(boolean bFlag)
      Sets the session present flag.
      Parameters:
      bFlag - - session present flag
    • isConnAckFlag

      public boolean isConnAckFlag()
      Returns if the session present flag is set or not.
      Returns:
      true if the session present flag is set; false otherwise.
    • setReturnCode

      public void setReturnCode(byte code)
      Sets the return code.
      Parameters:
      code - - the return code.
    • getReturnCode

      public byte getReturnCode()
      Returns the return code.
      Returns:
      the return code.
    • getVarHeaderByteNum

      protected int getVarHeaderByteNum()
      Specified by:
      getVarHeaderByteNum in class CMMqttEvent
    • marshallVarHeader

      protected void marshallVarHeader()
      Specified by:
      marshallVarHeader in class CMMqttEvent
    • unmarshallVarHeader

      protected void unmarshallVarHeader(ByteBuffer buf)
      Specified by:
      unmarshallVarHeader in class CMMqttEvent
    • getPayloadByteNum

      protected int getPayloadByteNum()
      Specified by:
      getPayloadByteNum in class CMMqttEvent
    • marshallPayload

      protected void marshallPayload()
      Specified by:
      marshallPayload in class CMMqttEvent
    • unmarshallPayload

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

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