endrov.hardwareNative
Class EvSerialTCP

java.lang.Object
  extended by endrov.hardwareNative.EvSerialTCP
All Implemented Interfaces:
EvDevice, HWSerial

public class EvSerialTCP
extends java.lang.Object
implements HWSerial

Serial communication over TCP/IP TODO this code has not been tested


Field Summary
 EvDeviceObserver event
           
 
Constructor Summary
EvSerialTCP(java.net.Socket s)
           
 
Method Summary
 void addDeviceListener(EvDeviceObserver.DeviceListener listener)
          Add a listener for updates.
 java.lang.String getDescName()
          Descriptive name of hardware
 java.util.SortedMap<java.lang.String,java.lang.String> getPropertyMap()
           
 java.util.SortedMap<java.lang.String,DevicePropertyType> getPropertyTypes()
           
 java.lang.String getPropertyValue(java.lang.String prop)
           
 java.lang.Boolean getPropertyValueBoolean(java.lang.String prop)
           
 boolean hasConfigureDialog()
           
 java.lang.String nonblockingRead()
          Read whatever input is available at the moment
 void openConfigureDialog()
           
 java.lang.String readUntilTerminal(java.lang.String term)
          Read until string occurs.
 void removeDeviceListener(EvDeviceObserver.DeviceListener listener)
           
 void setPropertyValue(java.lang.String prop, boolean value)
           
 void setPropertyValue(java.lang.String prop, java.lang.String value)
           
 void writePort(java.lang.String s)
          Write string to serial port
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

event

public EvDeviceObserver event
Constructor Detail

EvSerialTCP

public EvSerialTCP(java.net.Socket s)
            throws java.io.IOException
Throws:
java.io.IOException
Method Detail

nonblockingRead

public java.lang.String nonblockingRead()
Description copied from interface: HWSerial
Read whatever input is available at the moment

Specified by:
nonblockingRead in interface HWSerial

readUntilTerminal

public java.lang.String readUntilTerminal(java.lang.String term)
Description copied from interface: HWSerial
Read until string occurs. Returns up to and including this string

Specified by:
readUntilTerminal in interface HWSerial

writePort

public void writePort(java.lang.String s)
Description copied from interface: HWSerial
Write string to serial port

Specified by:
writePort in interface HWSerial

getDescName

public java.lang.String getDescName()
Description copied from interface: EvDevice
Descriptive name of hardware

Specified by:
getDescName in interface EvDevice

getPropertyMap

public java.util.SortedMap<java.lang.String,java.lang.String> getPropertyMap()
Specified by:
getPropertyMap in interface EvDevice

getPropertyTypes

public java.util.SortedMap<java.lang.String,DevicePropertyType> getPropertyTypes()
Specified by:
getPropertyTypes in interface EvDevice

getPropertyValue

public java.lang.String getPropertyValue(java.lang.String prop)
Specified by:
getPropertyValue in interface EvDevice

getPropertyValueBoolean

public java.lang.Boolean getPropertyValueBoolean(java.lang.String prop)
Specified by:
getPropertyValueBoolean in interface EvDevice

setPropertyValue

public void setPropertyValue(java.lang.String prop,
                             java.lang.String value)
Specified by:
setPropertyValue in interface EvDevice

setPropertyValue

public void setPropertyValue(java.lang.String prop,
                             boolean value)
Specified by:
setPropertyValue in interface EvDevice

hasConfigureDialog

public boolean hasConfigureDialog()
Specified by:
hasConfigureDialog in interface EvDevice

openConfigureDialog

public void openConfigureDialog()
Specified by:
openConfigureDialog in interface EvDevice

addDeviceListener

public void addDeviceListener(EvDeviceObserver.DeviceListener listener)
Description copied from interface: EvDevice
Add a listener for updates. The pointer to the listener is weak

Specified by:
addDeviceListener in interface EvDevice

removeDeviceListener

public void removeDeviceListener(EvDeviceObserver.DeviceListener listener)
Specified by:
removeDeviceListener in interface EvDevice