org.universAAL.lddi.fs20.connect
Class FHZ1000PC.FHZ1000SerialDevice

Package class diagram package FHZ1000PC.FHZ1000SerialDevice
java.lang.Object
  extended by org.universAAL.lddi.fs20.connect.FHZ1000PC.FHZ1000SerialDevice
All Implemented Interfaces:
gnu.io.SerialPortEventListener, EventListener, FHZ1000PC.FHZ1000Device
Enclosing class:
FHZ1000PC

public class FHZ1000PC.FHZ1000SerialDevice
extends Object
implements FHZ1000PC.FHZ1000Device, gnu.io.SerialPortEventListener

When running on Linux, we access the USB-device via generic serial drivers for FTDI-chips. This is done via this class.

Author:
Stefan Strömberg

Field Summary
protected  InputStream inputStream
           
protected  boolean m_CallbackActive
           
protected  int MAX_WAIT_TIME_MS
           
protected  OutputStream outputStream
           
protected  gnu.io.CommPortIdentifier portId
           
protected  Enumeration<gnu.io.CommPortIdentifier> portList
           
protected  gnu.io.SerialPort serialPort
           
 
Constructor Summary
FHZ1000PC.FHZ1000SerialDevice(String m_ComPort)
           
 
Method Summary
 void activate()
           
 void deactivate()
           
 byte[] read(int length)
           
 void serialEvent(gnu.io.SerialPortEvent event)
           
 int write(byte[] data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_WAIT_TIME_MS

protected final int MAX_WAIT_TIME_MS
See Also:
Constant Field Values

portList

protected Enumeration<gnu.io.CommPortIdentifier> portList

inputStream

protected InputStream inputStream

outputStream

protected OutputStream outputStream

serialPort

protected gnu.io.SerialPort serialPort

portId

protected gnu.io.CommPortIdentifier portId

m_CallbackActive

protected boolean m_CallbackActive
Constructor Detail

FHZ1000PC.FHZ1000SerialDevice

public FHZ1000PC.FHZ1000SerialDevice(String m_ComPort)
                              throws IOException
Throws:
IOException
Method Detail

activate

public void activate()
              throws IOException
Specified by:
activate in interface FHZ1000PC.FHZ1000Device
Throws:
IOException

serialEvent

public void serialEvent(gnu.io.SerialPortEvent event)
Specified by:
serialEvent in interface gnu.io.SerialPortEventListener

write

public int write(byte[] data)
          throws IOException
Specified by:
write in interface FHZ1000PC.FHZ1000Device
Throws:
IOException

read

public byte[] read(int length)
            throws IOException
Specified by:
read in interface FHZ1000PC.FHZ1000Device
Throws:
IOException

deactivate

public void deactivate()
                throws IOException
Specified by:
deactivate in interface FHZ1000PC.FHZ1000Device
Throws:
IOException


Copyright © 2014 universAAL Consortium. All Rights Reserved.