Package org.deepjava.runtime.util
Class SLIP
- java.lang.Object
-
- org.deepjava.runtime.util.SLIP
-
public class SLIP extends Object
Interface for the RN131 driver to send and receive packets with the SLIP protocol.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intread(byte[] packet, int offset, int length)Reads a packet from the receive buffer.booleanwrite(byte[] packet, int offset, int length)Writes a packet to the transmit buffer.
-
-
-
Method Detail
-
write
public boolean write(byte[] packet, int offset, int length)Writes a packet to the transmit buffer.- Parameters:
packet- byte array with the packetoffset- start offset of the packet datalength- length of the packet- Returns:
- false if buffer is full, true otherwise
-
read
public int read(byte[] packet, int offset, int length)Reads a packet from the receive buffer.- Parameters:
packet- buffer where to put the packetoffset- offset in the bufferlength- length of the buffer- Returns:
return values >= 0 number of received bytes -1 end of packet received -2 buffer overflow
-
-