rcx.comm
Class MacUSBPort

java.lang.Object
  extended by rcx.comm.MacUSBPort
All Implemented Interfaces:
USBPort

public class MacUSBPort
extends java.lang.Object
implements USBPort

MacUSBPort - uses JNI to interface to the macusb.shlib shared library (see macusb source code)

Author:
Dario Laverde Copyright 2002 Dario Laverde, under terms of GNU LGPL

Constructor Summary
MacUSBPort()
           
 
Method Summary
 int available()
           
 void close()
           
 void disableReceiveFraming()
           
 void disableReceiveThreshold()
           
 void disableReceiveTimeout()
           
 void enableReceiveFraming(int i)
           
 void enableReceiveThreshold(int i)
           
 void enableReceiveTimeout(int timeout)
           
 int getInputBufferSize()
           
 java.io.InputStream getInputStream()
           
 java.lang.String getName()
           
 int getOutputBufferSize()
           
 java.io.OutputStream getOutputStream()
           
 int getReceiveFramingByte()
           
 int getReceiveThreshold()
           
 int getReceiveTimeout()
           
 boolean isReceiveFramingEnabled()
           
 boolean isReceiveThresholdEnabled()
           
 boolean isReceiveTimeoutEnabled()
           
 int open(java.lang.String portname)
           
 int read()
           
 int read(byte[] byteArray)
           
 int read(byte[] byteArray, int offset, int len)
           
 void setInputBufferSize(int i)
           
 void setOutputBufferSize(int i)
           
 java.lang.String toString()
           
 void write(byte[] byteArray)
           
 void write(byte[] byteArray, int offset, int len)
           
 void write(int b)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MacUSBPort

public MacUSBPort()
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface USBPort

toString

public java.lang.String toString()
Specified by:
toString in interface USBPort
Overrides:
toString in class java.lang.Object

open

public int open(java.lang.String portname)
         throws java.io.IOException
Specified by:
open in interface USBPort
Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Specified by:
read in interface USBPort
Throws:
java.io.IOException

write

public void write(int b)
           throws java.io.IOException
Specified by:
write in interface USBPort
Throws:
java.io.IOException

close

public void close()
Specified by:
close in interface USBPort

available

public int available()
              throws java.io.IOException
Specified by:
available in interface USBPort
Throws:
java.io.IOException

read

public int read(byte[] byteArray)
         throws java.io.IOException
Specified by:
read in interface USBPort
Throws:
java.io.IOException

read

public int read(byte[] byteArray,
                int offset,
                int len)
         throws java.io.IOException
Specified by:
read in interface USBPort
Throws:
java.io.IOException

write

public void write(byte[] byteArray)
           throws java.io.IOException
Specified by:
write in interface USBPort
Throws:
java.io.IOException

write

public void write(byte[] byteArray,
                  int offset,
                  int len)
           throws java.io.IOException
Specified by:
write in interface USBPort
Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Specified by:
getInputStream in interface USBPort
Throws:
java.io.IOException

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Specified by:
getOutputStream in interface USBPort
Throws:
java.io.IOException

enableReceiveThreshold

public void enableReceiveThreshold(int i)
Specified by:
enableReceiveThreshold in interface USBPort

disableReceiveThreshold

public void disableReceiveThreshold()
Specified by:
disableReceiveThreshold in interface USBPort

isReceiveThresholdEnabled

public boolean isReceiveThresholdEnabled()
Specified by:
isReceiveThresholdEnabled in interface USBPort

getReceiveThreshold

public int getReceiveThreshold()
Specified by:
getReceiveThreshold in interface USBPort

enableReceiveTimeout

public void enableReceiveTimeout(int timeout)
Specified by:
enableReceiveTimeout in interface USBPort

disableReceiveTimeout

public void disableReceiveTimeout()
Specified by:
disableReceiveTimeout in interface USBPort

isReceiveTimeoutEnabled

public boolean isReceiveTimeoutEnabled()
Specified by:
isReceiveTimeoutEnabled in interface USBPort

getReceiveTimeout

public int getReceiveTimeout()
Specified by:
getReceiveTimeout in interface USBPort

enableReceiveFraming

public void enableReceiveFraming(int i)
Specified by:
enableReceiveFraming in interface USBPort

disableReceiveFraming

public void disableReceiveFraming()
Specified by:
disableReceiveFraming in interface USBPort

isReceiveFramingEnabled

public boolean isReceiveFramingEnabled()
Specified by:
isReceiveFramingEnabled in interface USBPort

getReceiveFramingByte

public int getReceiveFramingByte()
Specified by:
getReceiveFramingByte in interface USBPort

setInputBufferSize

public void setInputBufferSize(int i)
Specified by:
setInputBufferSize in interface USBPort

getInputBufferSize

public int getInputBufferSize()
Specified by:
getInputBufferSize in interface USBPort

setOutputBufferSize

public void setOutputBufferSize(int i)
Specified by:
setOutputBufferSize in interface USBPort

getOutputBufferSize

public int getOutputBufferSize()
Specified by:
getOutputBufferSize in interface USBPort