Class CMMqttEventSUBACK


public class CMMqttEventSUBACK extends CMMqttEventFixedHeader
This class represents a CM event that is the variable header and payload of MQTT SUBACK packet.
See Also:
  • Constructor Details

    • CMMqttEventSUBACK

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

      public CMMqttEventSUBACK(ByteBuffer msg)
  • Method Details

    • setPacketID

      public void setPacketID(int nID)
      sets MQTT Packet ID.
      Parameters:
      nID - - Packet ID.
    • getPacketID

      public int getPacketID()
      gets MQTT Packet ID.
      Overrides:
      getPacketID in class CMMqttEvent
      Returns:
      Packet ID.
    • 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
    • setReturnCodeList

      public void setReturnCodeList(CMList<Byte> returnCodeList)
      Sets the list of return codes.
      Parameters:
      returnCodeList - - the list of return codes
    • getReturnCodeList

      public CMList<Byte> getReturnCodeList()
      Returns the list of return codes.
      Returns:
      the list of return codes.
    • addReturnCode

      public boolean addReturnCode(byte returnCode)
      Adds the return code to the list.
      Parameters:
      returnCode - - the return code
      Returns:
      true if the return code is successfully added; false otherwise.
    • removeReturnCode

      public boolean removeReturnCode(byte returnCode)
      Removes the return code from the list.
      Parameters:
      returnCode - - the return code
      Returns:
      true if the return code is successfully removed; false otherwise.
    • removeAllReturnCode

      public void removeAllReturnCode()
      Removes all return codes from the list.
    • 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.