|
jSyncManager | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jSyncManager.API.Protocol.USB_Packet
USB_Packet class. This class holds a USB packet.
Field Summary | |
---|---|
static byte |
ABORT
A value to denote that this packet is an abort packet. |
static byte |
ACK
A value to denote that this packet is an ACKnowledgement packet. |
byte[] |
data
A byte array to hold this packets data portion. |
static byte |
DATA
A value to denote that this packet is a data packet. |
static byte |
NACK
A value to denote that this packet is a Negative ACKnowledgement packet. |
int |
packetSize
The size of this packet, in bytes. |
byte |
packetType
The packet type of the USB packet. |
boolean |
sent
A flag to denote wether or not this packet has been sent to the remote end. |
static byte |
TICKLE
A value to denote that this packet is a tickle packet. |
byte |
transactionID
This packets transaction ID. |
Constructor Summary | |
---|---|
USB_Packet(byte type,
byte transID,
byte[] data)
Create a new USB_Packet instance with the specified packet type, transaction ID, and data. |
Method Summary | |
---|---|
static USB_Packet |
bytes2Packet(byte[] pkt)
Convert an array of bytes representing a USB packet to a USB_Packet instance. |
static USB_Packet |
bytes2Packet(byte[] headerPkt,
byte[] dataPkt)
Convert two arrays of bytess representing a USB packet header and data to a USB_Packet instance. |
byte[] |
packet2Bytes()
Converts this USB_Packet instance into a byte array suitable for transmission to a handheld device. |
Methods inherited from class java.lang.Object |
---|
|
Field Detail |
public byte packetType
DATA
,
ACK
,
NACK
,
TICKLE
,
ABORT
public byte transactionID
public int packetSize
public static final byte DATA
public static final byte ACK
public static final byte NACK
public static final byte TICKLE
public static final byte ABORT
public byte[] data
public boolean sent
Constructor Detail |
public USB_Packet(byte type, byte transID, byte[] data)
type
- the packet type.transID
- the transaction ID for this packet.data
- the data to be encapsulated within this packet.Method Detail |
public static USB_Packet bytes2Packet(byte[] pkt)
pkt
- an array of bytes representing a USB packet.public static USB_Packet bytes2Packet(byte[] headerPkt, byte[] dataPkt)
headerPkt
- the byte array containing the packet header.dataPkt
- the data that is encapsulated inside this packet.public byte[] packet2Bytes()
|
jSyncManager | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |