Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## lejos.rcxcomm
Class LLCReliableHandler

    java.lang.Object
      lejos.rcxcomm.PacketHandler
          lejos.rcxcomm.LLCReliableHandler

    public class LLCReliableHandler

extends PacketHandler

A Packet handler that guarantees reliable delivery using checksums, acks, and a single bit sequence number.

Field Summary

Fields inherited from class lejos.rcxcomm.PacketHandler
`lowerHandler`

Constructor Summary
`LLCReliableHandler(PacketHandler handler)`

Method Summary
`boolean` | `isPacketAvailable()` Check if a packet is available.
`int` | `receivePacket(byte[] buffer)` Receive a packet.
`void` | `reset()` Reset sequence numbers.
`boolean` | `sendPacket(byte[] packet, int len)` Send a packet.

Methods inherited from class lejos.rcxcomm.PacketHandler
`close, getError, isAckAvailable, open, receiveAck, setListen`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait`

Constructor Detail

### LLCReliableHandler

    public LLCReliableHandler(PacketHandler handler)

Method Detail

### reset

    public void reset()

  Reset sequence numbers.

  Overrides:
    `reset` in class `PacketHandler`

### sendPacket

    public boolean sendPacket(byte[] packet,
                              int len)

  Send a packet.

  Specified by:
    `sendPacket` in class `PacketHandler`
  Parameters:
    `packet` - the bytes to send
    `len` - the number of bytes to send
  Returns:
    true if send successful, else false

### receivePacket

    public int receivePacket(byte[] buffer)

  Receive a packet.

  Specified by:
    `receivePacket` in class `PacketHandler`
  Parameters:
    `buffer` - the buffer to receive the packet into
  Returns:
    the number of bytes received

### isPacketAvailable

    public boolean isPacketAvailable()

  Check if a packet is available.

  Specified by:
    `isPacketAvailable` in class `PacketHandler`
  Returns:
    true if a packet is available, else false

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD