|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.wagner_ibw.iow.AbstractIowDevice
This class provides default implementation for the IO-Warrior devices.
Field Summary | |
static int |
IOW24_SMF_REPORT_LENGTH
Constant for IO-Warrior 24 device special mode funtions's record length: '8'. |
static long |
IOW24ID
Constant for IO-Warrior 24 device id: '0x1501'. |
static java.lang.String |
IOW24NAME
Constant for IO-Warrior 24 device name: 'IOW24'. |
static int |
IOW40_SMF_REPORT_LENGTH
Constant for IO-Warrior 40 device special mode funtions's record length: '8'. |
static long |
IOW40ID
Constant for IO-Warrior 40 device id: '0x1500'. |
static java.lang.String |
IOW40NAME
Constant for IO-Warrior 40 device name: 'IOW40'. |
static int |
IOW56_SMF_REPORT_LENGTH
Constant for IO-Warrior 56 device special mode funtions's record length: '64'. |
static long |
IOW56ID
Constant for IO-Warrior 56 device id: '0x1503'. |
static java.lang.String |
IOW56NAME
Constant for IO-Warrior 56 device name: 'IOW56'. |
Constructor Summary | |
AbstractIowDevice()
Constructor, called from sub class only. |
Method Summary | |
void |
addIowChangeListener(IowChangeListener icl)
Adds an IowChangeListener to the internal list. |
void |
addSpecialModeFunctionImpl(SpecialModeFunction impl)
Adds given special mode function implementation to this IO-Warrior device. |
void |
autonomous(boolean status)
Sets the autonomous mode either on or off. |
void |
clearBit(int port,
int bit)
Clear the given bit from a the given port. |
void |
close()
Close this IO-Warrior device. |
abstract boolean |
equals(java.lang.Object o)
Indicates whether some other IO-Warrior 24, IO-Warrior 40 or IO-Warrior 65 object is "equal to" this object.
|
long |
getHandle()
Returns the handle of this IO-Warrior device. |
int |
getId()
Returns the device id of this IO-Warrior device. |
Monitor |
getMonitor()
Returns the Monitor reference (for internal I2C control purpose only). |
abstract java.lang.String |
getName()
Returns the name of this IO-Warrior device. |
IowPort |
getPort(int port)
Returns the desired port of this IO-Warrior device. |
int |
getPortCount()
Returns the number of ports of this IO-Warrior device. |
int |
getRev()
Returns the revision of this IO-Warrior device. |
java.lang.String |
getSerial()
Returns the serial of this IO-Warrior device. |
int |
getSmfReportLength()
Returns the length of the special mode function report of this IO-Warrior device. |
SpecialModeFunction |
getSpecialModeFunctionImpl(java.lang.String smfName)
Returns the desired special mode function implementation. |
int |
hashCode()
Returns a hash code value for this Iow object. |
long |
readIOPorts()
Reads the iow ports and store them in the internal port array. |
abstract long |
readIOPortsImmediate()
Reads the iow ports and store them in the internal port array (none blocking). |
long |
readIOPortsNonBlocking()
Reads the iow ports non blocking and store them in the internal port array. |
void |
removeIowChangeListener(IowChangeListener icl)
Removes given IowChangeListener from the internal list. |
void |
removeSpecialModeFunctionImpl(SpecialModeFunction impl)
Removes given special mode function implementation from this IO-Warrior device. |
abstract long |
scanPorts()
Gets the current pin status. |
void |
setBit(int port,
int bit)
Set the given bit from the given port. |
void |
setDirection(int port,
int direction)
Set the direction mask to the given port. |
void |
setPort(int port,
int in)
Set the pattern to the given port. |
void |
setTimeout(long timeout)
Set timeout for read operations. |
void |
setWriteTimeout(long timeout)
Set timeout for write operations. |
abstract java.lang.String |
toString()
Returns a String object representing this Iow object.
|
abstract void |
writeIOPorts()
Writes the presetted ports to this IO-Warrior device. |
abstract void |
writeIOPorts(long value)
Writes the value to this IO-Warrior device's ports. |
long |
writeReport(int pipe,
int[] wbuf)
Writes a report to this IO-Warrior device. |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final long IOW40ID
public static final long IOW24ID
public static final long IOW56ID
public static final java.lang.String IOW40NAME
public static final java.lang.String IOW24NAME
public static final java.lang.String IOW56NAME
public static final int IOW24_SMF_REPORT_LENGTH
public static final int IOW40_SMF_REPORT_LENGTH
public static final int IOW56_SMF_REPORT_LENGTH
Constructor Detail |
public AbstractIowDevice()
Method Detail |
public void addSpecialModeFunctionImpl(SpecialModeFunction impl) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
impl
- Special mode function implementation to add.
java.lang.UnsupportedOperationException
- if this IO-Warrior device does not support the given
special mode function
java.lang.IllegalArgumentException
- if the special mode function implementation is already addedpublic void removeSpecialModeFunctionImpl(SpecialModeFunction impl)
impl
- Special mode function implementation to remove.public SpecialModeFunction getSpecialModeFunctionImpl(java.lang.String smfName) throws java.util.NoSuchElementException
smfName
- Name of the desired function.
java.util.NoSuchElementException
- if the desired function was not added.public long getHandle()
public java.lang.String getSerial()
public int getId()
public int getSmfReportLength()
public int getRev()
public int getPortCount()
public void close()
public void setTimeout(long timeout)
timeout
- Timeout value in ms.public void setWriteTimeout(long timeout)
timeout
- Timeout value in ms.public long writeReport(int pipe, int[] wbuf)
pipe
- number of pipe.wbuf
- Write buffer.
public long readIOPorts()
public long readIOPortsNonBlocking()
public abstract long readIOPortsImmediate()
public abstract long scanPorts() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
- if this IO-Warrior device does not support the
get curent pin status special mode function.public abstract void writeIOPorts()
public abstract void writeIOPorts(long value)
value
- output patternpublic void autonomous(boolean status)
status
- true switches the mode on, false switches the mode off.public void addIowChangeListener(IowChangeListener icl)
IowChangeListener
to the internal list.
public void removeIowChangeListener(IowChangeListener icl)
IowChangeListener
from the internal list.
public abstract java.lang.String getName()
public IowPort getPort(int port) throws java.lang.IllegalArgumentException
port
- desired port number.
IowPort
instance of the desired port.
java.lang.IllegalArgumentException
- if the port number is out of range.public void setBit(int port, int bit) throws java.lang.IllegalArgumentException
port
- Port number (0...1 or 0...3).bit
- Bit number (0...7).
java.lang.IllegalArgumentException
- if the port number is out of range.public void clearBit(int port, int bit) throws java.lang.IllegalArgumentException
port
- Port number (0...1 or 0...3).bit
- Bit number (0...7).
java.lang.IllegalArgumentException
- if the port number is out of range.public void setPort(int port, int in) throws java.lang.IllegalArgumentException
port
- Port number (0...3).
java.lang.IllegalArgumentException
- if the port number is out of range.public void setDirection(int port, int direction) throws java.lang.IllegalArgumentException
port
- Port number (0...3 or 0...1).direction
- 0-output, 1-input
java.lang.IllegalArgumentException
- if the port number is out of range.public Monitor getMonitor()
Monitor
reference (for internal I2C control purpose only).
Monitor
referencepublic int hashCode()
hashCode
in class java.lang.Object
public abstract java.lang.String toString()
String
object representing this Iow object.
It contains information about device handle, id , revision,
serial number and the status of ports.
toString
in class java.lang.Object
public abstract boolean equals(java.lang.Object o)
IO-Warrior 24, IO-Warrior 40 or IO-Warrior 65
object is "equal to" this object.
Criteria is the serial number.
equals
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |