sophware.home.io
Class USBAccess

java.lang.Object
  extended by sophware.home.io.USBAccess
All Implemented Interfaces:
HomeAccess

public class USBAccess
extends java.lang.Object
implements HomeAccess

USBAccess provides communications access to USB Devices.

Version:
1.0, 02/17/06
Author:
Russell Soph

Constructor Summary
USBAccess(short vendor, short product)
          Creates an instance of USBAccess
 
Method Summary
 void close()
          Closes the USB Port
 java.io.InputStream getInputStream()
          Gets the input stream associate with the USB Port
 java.io.OutputStream getOutputStream()
          Gets the output stream associate with the USB Port
 boolean isOpen()
          State of the connection
 void open()
          Opens and initializes the USB Port
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

USBAccess

public USBAccess(short vendor,
                 short product)
Creates an instance of USBAccess

Parameters:
vendor - the USB device vendor ID
product - the USB device product ID
Method Detail

open

public void open()
          throws java.io.IOException
Opens and initializes the USB Port

Specified by:
open in interface HomeAccess
Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()
Gets the input stream associate with the USB Port

Specified by:
getInputStream in interface HomeAccess
Returns:
the input stream

getOutputStream

public java.io.OutputStream getOutputStream()
Gets the output stream associate with the USB Port

Specified by:
getOutputStream in interface HomeAccess
Returns:
the output stream

close

public void close()
Closes the USB Port

Specified by:
close in interface HomeAccess

isOpen

public boolean isOpen()
State of the connection

Specified by:
isOpen in interface HomeAccess
Returns:
true if connection is open