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

## josx.rcxcomm
Class F7Handler

    java.lang.Object
      josx.rcxcomm.PacketHandler
          josx.rcxcomm.F7Handler

    public class F7Handler

extends PacketHandler

Packet handler that uses the Lego Firmware F7 (set Message) opcodes.

Field Summary

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

Method Summary
`void` | `close()` Close the Tower.
`int` | `getError()` Get the last error on the Tower
`boolean` | `isPacketAvailable()` Check if a packet is available
`int` | `receivePacket(byte[] packet)` 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
`isAckAvailable, open, receiveAck, reset`

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

Method Detail

### getError

    public int getError()

  Get the last error on the Tower

  Overrides:
    `getError` in class `PacketHandler`
  Returns:
    the error number, or zero for success

### setListen

    public void setListen(boolean listen)

  Set or unset the listen flag to keep a PC serial tower alive

  Overrides:
    `setListen` in class `PacketHandler`
  Parameters:
    `listen` - true to set listen mode, else false

### 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 the send was successful, else false

### receivePacket

    public int receivePacket(byte[] packet)

  Receive a packet.

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

### 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

### close

    public void close()

  Close the Tower.

  Overrides:
    `close` in class `PacketHandler`

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