com.ibutton.jib
Class JibReturnPacket

java.lang.Object
  |
  +--com.ibutton.jib.JibReturnPacket

public class JibReturnPacket
extends java.lang.Object

JibReturnPacket is used for storing the return packet generated by the iButton with Java.


Field Summary
static int CMD_OK
           
static int CSB_OK
           
 
Constructor Summary
JibReturnPacket(int[] rawData)
          Create a JibReturnPacket with an integer array as its value.
JibReturnPacket(int csb, int groupID, int[] data)
          Create a JibReturnPacket with a command status byte, group ID and a body.
 
Method Summary
 int getCSB()
          Get the command status byte of this return packet.
 int getGroupID()
          Get the group ID of this return packet.
 byte[] getReturnBytes()
          Get the body of the return packet.
 char[] getReturnChars()
          Get the body of the return packet.
 char[] getReturnChars(int start, int count)
          Get count number of bytes of the return packet starting at start.
 int getReturnInteger()
          Get the zero byte of the return packet in integer form.
 int getReturnInteger(int index)
          Get a specific byte of the return packet in integer notation.
 int[] getReturnInts()
          Get the body of the return packet as an integer array.
 int getReturnShort()
          Get the zero byte of the return packet in short notation.
 int getReturnShort(int index)
          Get a specific byte of the return packet in short notation.
 java.lang.String getReturnString()
          Get the body of the return packet as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CSB_OK

public static final int CSB_OK

CMD_OK

public static final int CMD_OK
Constructor Detail

JibReturnPacket

public JibReturnPacket(int[] rawData)
Create a JibReturnPacket with an integer array as its value.
Parameters:
rawData - to be used as the body of the return packet.

JibReturnPacket

public JibReturnPacket(int csb,
                       int groupID,
                       int[] data)
Create a JibReturnPacket with a command status byte, group ID and a body.
Parameters:
csb - command status byte.
groupID - the groupID of the command performed.
data - the data for the return value.
Method Detail

getCSB

public int getCSB()
Get the command status byte of this return packet.
Returns:
the command status byte.

getGroupID

public int getGroupID()
Get the group ID of this return packet.
Returns:
the group ID

getReturnString

public java.lang.String getReturnString()
Get the body of the return packet as a String.
Returns:
the body of the return packet.

getReturnInteger

public int getReturnInteger(int index)
Get a specific byte of the return packet in integer notation.
Parameters:
index - the index of the byte to get.
Returns:
the integer requested.

getReturnInteger

public int getReturnInteger()
Get the zero byte of the return packet in integer form.
Returns:
the zero byte of the return packet.

getReturnShort

public int getReturnShort(int index)
Get a specific byte of the return packet in short notation.
Parameters:
index - the index of the byte to get.
Returns:
short requested.

getReturnShort

public int getReturnShort()
Get the zero byte of the return packet in short notation.
Returns:
the short requested.

getReturnBytes

public byte[] getReturnBytes()
Get the body of the return packet.
Returns:
the body of the return packet.

getReturnChars

public char[] getReturnChars()
Get the body of the return packet.
Returns:
the body of the return packet.

getReturnChars

public char[] getReturnChars(int start,
                             int count)
Get count number of bytes of the return packet starting at start.
Parameters:
start - the offset into the body of the return packet.
count - the number of bytes requested.
Returns:
the section of the return packet requested.

getReturnInts

public int[] getReturnInts()
Get the body of the return packet as an integer array.
Returns:
the body of the return packet.