lejos.pc.comm
Class NXTCommFantom

java.lang.Object
  extended by lejos.pc.comm.NXTCommUSB
      extended by lejos.pc.comm.NXTCommFantom
All Implemented Interfaces:
NXTCommRequest, NXTComm

public class NXTCommFantom
extends NXTCommUSB

Implementation of NXTComm using the the LEGO Fantom API. Currently only supports USB access. The Fantom read function when using Bluetooth seems to be broken, it does not work if the amount of data available to be read does not match the amount of data requested. So for now we only support USB. Notes The Fantom read and write functions have a built in timeout period of 20 seconds. This module assumes that this timeout exists and uses it to timeout some requests. Should not be used directly - use NXTCommFactory to create an appropriate NXTComm object for your system and the protocol you are using.


Field Summary
 
Fields inherited from interface lejos.pc.comm.NXTComm
LCP, PACKET, RAW
 
Constructor Summary
NXTCommFantom()
           
 
Method Summary
 void jfantom_close(long nxt)
           
 java.lang.String[] jfantom_find()
           
 long jfantom_open(java.lang.String nxt)
           
 int jfantom_read_data(long nxt, byte[] data, int offset, int len)
           
 int jfantom_send_data(long nxt, byte[] message, int offset, int len)
           
 
Methods inherited from class lejos.pc.comm.NXTCommUSB
available, close, getInputStream, getOutputStream, open, open, read, search, sendRequest, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NXTCommFantom

public NXTCommFantom()
Method Detail

jfantom_find

public java.lang.String[] jfantom_find()

jfantom_open

public long jfantom_open(java.lang.String nxt)

jfantom_close

public void jfantom_close(long nxt)

jfantom_send_data

public int jfantom_send_data(long nxt,
                             byte[] message,
                             int offset,
                             int len)

jfantom_read_data

public int jfantom_read_data(long nxt,
                             byte[] data,
                             int offset,
                             int len)