lejos.rcxcomm
Class LLC

java.lang.Object
  extended by lejos.rcxcomm.LLC

public class LLC
extends Object

Emulates RCX LLC class using the RCXLink class.


Method Summary
static RCXLink getLink()
          Return the RCXLink object associated with LLC
static void init()
          Initialize LLC an
static void init(SensorPort port)
          Initialize LLC and set port
static boolean isSendError()
          Return the error status of the last send
static boolean isSending()
          Indicate whether the last send is still active
static int read()
          read a single byte, if available
static int receive()
          wait a little while for a byte to become available
static boolean sendBytes(byte[] buf, int len)
          Send a number of bytes and wait for completion of transmission
static void setPort(SensorPort port)
          Set sensor port
static void setRangeLong()
          Sets long range transmision.
static void setRangeShort()
          Sets short range transmision.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Method Detail

init

public static void init(SensorPort port)
Initialize LLC and set port


init

public static void init()
Initialize LLC an


setPort

public static void setPort(SensorPort port)
Set sensor port


read

public static int read()
read a single byte, if available

Returns:
the byte read, or -1 if no byte is available

isSending

public static boolean isSending()
Indicate whether the last send is still active

Returns:
true if still sending, else false

isSendError

public static boolean isSendError()
Return the error status of the last send

Returns:
true if still sending, else false

sendBytes

public static boolean sendBytes(byte[] buf,
                                int len)
Send a number of bytes and wait for completion of transmission

Parameters:
buf - the array of bytes to send
len - the number of bytes to send
Returns:
true if the send is successful, else false

receive

public static int receive()
wait a little while for a byte to become available

Returns:
the byte received, or -1 if no byte available

setRangeLong

public static void setRangeLong()
Sets long range transmision.


setRangeShort

public static void setRangeShort()
Sets short range transmision.


getLink

public static RCXLink getLink()
Return the RCXLink object associated with LLC

Returns:
the RCXLink used