de.wagner_ibw.iow.spi
Class AbstractSPIDevice

java.lang.Object
  |
  +--de.wagner_ibw.iow.spi.AbstractSPIDevice
All Implemented Interfaces:
SPIDevice
Direct Known Subclasses:
GenericSPIDevice, M95020

public abstract class AbstractSPIDevice
extends java.lang.Object
implements SPIDevice

This is the abtract implementation of the SPIDevice.java interface

Since:
0.9.4.
Author:
Thomas Wagner

Field Summary
private  int flags
          SPI data transfer flag.
protected  AbstractIowDevcie iow
          Reference to the underlying IOW device.
private  java.lang.String name
          Device name.
protected  sun.misc.Queue readQueue
           
 
Constructor Summary
AbstractSPIDevice(java.lang.String name, int flags)
           
 
Method Summary
 java.lang.String getName()
          Returns the name of the spi device.
private  void printReport(java.lang.String dir, int[] rep)
          Only for debug purposes.
 void reportReceived(int[] readBuffer)
          Callback method is called when a matching report was received.
 void setIowDevice(AbstractIowDevcie iow)
          Sets the reference to an iow device for write report operations.
 java.lang.String toString()
          Returns the name of the spi device as String.
protected  int[] transmit(int[] in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

iow

protected AbstractIowDevcie iow
Reference to the underlying IOW device.


name

private java.lang.String name
Device name.


flags

private int flags
SPI data transfer flag.


readQueue

protected sun.misc.Queue readQueue
Constructor Detail

AbstractSPIDevice

public AbstractSPIDevice(java.lang.String name,
                         int flags)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: SPIDevice
Returns the name of the spi device.

Specified by:
getName in interface SPIDevice
Returns:
Name of the spi device.

reportReceived

public void reportReceived(int[] readBuffer)
Description copied from interface: SPIDevice
Callback method is called when a matching report was received.

Specified by:
reportReceived in interface SPIDevice
Parameters:
readBuffer - Read buffer from a received report.

setIowDevice

public void setIowDevice(AbstractIowDevcie iow)
Description copied from interface: SPIDevice
Sets the reference to an iow device for write report operations.

Specified by:
setIowDevice in interface SPIDevice
Parameters:
iow - Instance of an iow device.

transmit

protected int[] transmit(int[] in)
                  throws java.lang.Exception
java.lang.Exception

printReport

private void printReport(java.lang.String dir,
                         int[] rep)
Only for debug purposes.

Parameters:
dir -
rep -

toString

public java.lang.String toString()
Returns the name of the spi device as String.

Overrides:
toString in class java.lang.Object
Returns:
String representation of information about this spi device.