rcx.comm
Class Win32USBPort
java.lang.Object
rcx.comm.Win32USBPort
- All Implemented Interfaces:
- USBPort
public class Win32USBPort
- extends java.lang.Object
- implements USBPort
Win32USBPort - uses JNI to interface to win32usb.dll (see win32usb source)
- Author:
- Dario Laverde
Copyright 2002 Dario Laverde, under terms of GNU LGPL
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Win32USBPort
public Win32USBPort()
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
- note: available() currently not supported by win32 driver
- 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
main
public static void main(java.lang.String[] args)
throws java.io.IOException
- Throws:
java.io.IOException