rcxport
Class RCXResult

java.lang.Object
  |
  +--rcxport.RCXResult

class RCXResult
extends Object

Holds result information in response to a an RCXPacket. This class gets the raw bytes from the InputStream provided in the constructor, reads them in and checks them as dictated by the RCX Internals web page.

Author:
Scott B. Lewis, slewis@teleport.com

Field Summary
static int BUFFSIZE
           
 
Constructor Summary
protected RCXResult(InputStream ins, RCXPacket aPacket)
          Protected constructor so instances can only be made by RCXPort class.
 
Method Summary
 byte[] getFullPacket()
          Gets the entire packet received from the RCX.
 byte[] getResult()
          Gets the actual result from packet received from RCX.
 String toString()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BUFFSIZE

public static final int BUFFSIZE
Constructor Detail

RCXResult

protected RCXResult(InputStream ins,
                    RCXPacket aPacket)
             throws IOException
Protected constructor so instances can only be made by RCXPort class.
Parameters:
ins - the InputStream to read the result data from
aPacket - the RCXPacket sent (so validity checks can be performed on the response data.
Method Detail

getFullPacket

public byte[] getFullPacket()
Gets the entire packet received from the RCX. This includes all of the original packet sent, checksums, and all the other stuff as described in the RCX Internals web page.
Returns:
byte[] bytes representing full packet from RCX

getResult

public byte[] getResult()
Gets the actual result from packet received from RCX. These are just the important bytes in the result (after removing shadowing, checksums, etc.).
Returns:
byte[] bytes representing just the result from RCX

toString

public String toString()
Overrides:
toString in class Object