com.rapplogic.xbee.api
Class XBeeResponse

java.lang.Object
  extended by com.rapplogic.xbee.api.XBeeResponse
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ErrorResponse, GenericResponse, ModemStatusResponse, RxBaseResponse, XBeeFrameIdResponse, ZNetNodeIdentificationResponse, ZNetRxBaseResponse

public abstract class XBeeResponse
extends java.lang.Object
implements java.io.Serializable

The super class of all XBee Receive packets

Author:
andrew
See Also:
Serialized Form

Constructor Summary
XBeeResponse()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 void finish()
          For internal use only.
 ApiId getApiId()
           
 int getChecksum()
           
 XBeePacketLength getLength()
           
 int[] getPacketBytes()
          Deprecated. Use getRawPacketBytes instead
 int[] getProcessedPacketBytes()
          Returns an array of all bytes (after being un-escaped) in the packet except the start byte.
 int[] getRawPacketBytes()
          Returns an array all bytes (as received off radio, including escape bytes) in packet except the start byte.
 int hashCode()
           
 boolean isError()
          Indicates an error occurred during the parsing of the packet.
 void setApiId(ApiId apiId)
           
 void setChecksum(int checksum)
           
 void setError(boolean error)
           
 void setLength(XBeePacketLength length)
           
 void setRawPacketBytes(int[] packetBytes)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XBeeResponse

public XBeeResponse()
Method Detail

getLength

public XBeePacketLength getLength()

setLength

public void setLength(XBeePacketLength length)

getApiId

public ApiId getApiId()

setApiId

public void setApiId(ApiId apiId)

getChecksum

public int getChecksum()

setChecksum

public void setChecksum(int checksum)

isError

public boolean isError()
Indicates an error occurred during the parsing of the packet. This may indicate a bug in this software or in the XBee firmware. Absence of an error does not indicate the request was successful; you will need to inspect the status byte of the response object (if available) to determine success.

Returns:

setError

public void setError(boolean error)

getPacketBytes

public int[] getPacketBytes()
Deprecated. Use getRawPacketBytes instead

Returns:

getRawPacketBytes

public int[] getRawPacketBytes()
Returns an array all bytes (as received off radio, including escape bytes) in packet except the start byte.

Returns:

getProcessedPacketBytes

public int[] getProcessedPacketBytes()
Returns an array of all bytes (after being un-escaped) in the packet except the start byte.

Returns:

setRawPacketBytes

public void setRawPacketBytes(int[] packetBytes)

finish

public void finish()
For internal use only. Called after successful parsing to allow subclass to do any final processing before delivery


hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object