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

com.mobius.software.mqttsn.parser.packet.impl.SNPingreq 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.SNType;
import com.mobius.software.mqttsn.parser.packet.api.SNDevice;
import com.mobius.software.mqttsn.parser.packet.api.SNMessage;

public class SNPingreq extends SNMessage
{
	private String clientID;

	public SNPingreq()
	{
		super();
	}

	public SNPingreq(String clientID)
	{
		this.clientID = clientID;
	}

	public SNPingreq reInit(String clientID)
	{
		this.clientID = clientID;
		return this;
	}

	@Override
	public int getLength()
	{
		int length = 2;
		if (clientID != null)
			length += clientID.length();
		return length;
	}

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

	public String getClientID()
	{
		return clientID;
	}

	public void setClientID(String clientID)
	{
		this.clientID = clientID;
	}

	@Override
	public void processBy(SNDevice device)
	{
		device.processPingreq();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy