|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjosx.rcxcomm.PacketHandler
josx.rcxcomm.LLCHandler
Packet handler than implement the LLC packet protocol. Deals with packets and acks. Supports independent streams of data in both directions.
Field Summary |
Fields inherited from class josx.rcxcomm.PacketHandler |
lowerHandler |
Constructor Summary | |
LLCHandler()
|
Method Summary | |
void |
close()
Close the Tower. |
int |
getError()
Get the last error on the Tower |
boolean |
isAckAvailable()
Check if an Ack is available |
boolean |
isPacketAvailable()
Check if a packet is available |
int |
receiveAck(byte[] buffer)
Receive a ack. |
int |
receivePacket(byte[] buffer)
Receive a packet. |
boolean |
sendPacket(byte[] packet,
int len)
Send a packet. |
void |
setListen(boolean listen)
Set or unset the listen flag to keep a PC serial tower alive |
Methods inherited from class josx.rcxcomm.PacketHandler |
open, reset |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait |
Constructor Detail |
public LLCHandler()
Method Detail |
public int getError()
getError
in class PacketHandler
public void setListen(boolean listen)
setListen
in class PacketHandler
listen
- true to set listen mode, else falsepublic boolean sendPacket(byte[] packet, int len)
sendPacket
in class PacketHandler
packet
- the bytes to sendlen
- the number of bytes to send
public int receivePacket(byte[] buffer)
receivePacket
in class PacketHandler
buffer
- the buffer to receive the packet into
public int receiveAck(byte[] buffer)
receiveAck
in class PacketHandler
buffer
- the buffer to receive the ack into
public boolean isPacketAvailable()
isPacketAvailable
in class PacketHandler
public boolean isAckAvailable()
isAckAvailable
in class PacketHandler
public void close()
close
in class PacketHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |