org.reprap.comms.messages
Class VersionResponseMessage

java.lang.Object
  extended by org.reprap.comms.IncomingMessage
      extended by org.reprap.comms.messages.VersionResponseMessage

public class VersionResponseMessage
extends IncomingMessage


Nested Class Summary
 
Nested classes/interfaces inherited from class org.reprap.comms.IncomingMessage
IncomingMessage.InvalidPayloadException
 
Constructor Summary
VersionResponseMessage(IncomingContext incomingContext)
           
 
Method Summary
 int getVersion()
           
protected  boolean isExpectedPacketType(byte packetType)
          Implemented by subclasses to allow them to indicate if they understand or expect a given packetType.
 
Methods inherited from class org.reprap.comms.IncomingMessage
getPayload, receiveData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersionResponseMessage

public VersionResponseMessage(IncomingContext incomingContext)
                       throws java.io.IOException
Parameters:
incomingContext -
Throws:
java.io.IOException
Method Detail

getVersion

public int getVersion()
               throws IncomingMessage.InvalidPayloadException
Returns:
version number
Throws:
InvalidPayloadException
IncomingMessage.InvalidPayloadException

isExpectedPacketType

protected boolean isExpectedPacketType(byte packetType)
Description copied from class: IncomingMessage
Implemented by subclasses to allow them to indicate if they understand or expect a given packetType. This is used to decide if a received packet should be accepted or possibly discarded.

Specified by:
isExpectedPacketType in class IncomingMessage
Parameters:
packetType - the type of packet to receive
Returns:
true if the packetType matches what is expected