All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mobius.software.mqttsn.parser.packet.impl.Regack Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
package com.mobius.software.mqttsn.parser.packet.impl;

import com.mobius.software.mqttsn.parser.avps.ReturnCode;
import com.mobius.software.mqttsn.parser.avps.SNType;
import com.mobius.software.mqttsn.parser.packet.api.CountableMessage;
import com.mobius.software.mqttsn.parser.packet.api.SNDevice;

public class Regack extends CountableMessage
{
	private int topicID;
	private ReturnCode code;

	public Regack()
	{
		super();
	}

	public Regack(int topicID, int messageID, ReturnCode code)
	{
		super(messageID);
		this.topicID = topicID;
		this.code = code;
	}

	public Regack reInit(int topicID, int messageID, ReturnCode code)
	{
		this.topicID = topicID;
		setMessageID(messageID);
		this.code = code;
		return this;
	}

	@Override
	public int getLength()
	{
		return 7;
	}

	@Override
	public SNType getType()
	{
		return SNType.REGACK;
	}

	public int getTopicID()
	{
		return topicID;
	}

	public void setTopicID(int topicID)
	{
		this.topicID = topicID;
	}

	public ReturnCode getCode()
	{
		return code;
	}

	public void setCode(ReturnCode code)
	{
		this.code = code;
	}

	@Override
	public void processBy(SNDevice device)
	{
		device.processRegack(messageID, topicID, code);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy