org.openmuc.sunnywebbox
Class SunnyWebboxDriverImpl
java.lang.Object
org.openmuc.sunnywebbox.SunnyWebboxDriverImpl
- All Implemented Interfaces:
- DeviceDriverInterface
public class SunnyWebboxDriverImpl
- extends java.lang.Object
- implements DeviceDriverInterface
Field Summary |
boolean |
debug
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
debug
public boolean debug
SunnyWebboxDriverImpl
public SunnyWebboxDriverImpl()
configureInterface
public void configureInterface(java.lang.String iface,
java.lang.String configStr)
throws NoSuchInterfaceException,
MethodNotImplementedException,
java.io.IOException
- Description copied from interface:
DeviceDriverInterface
- Configure the interface.
- Specified by:
configureInterface
in interface DeviceDriverInterface
- Parameters:
iface
- Interface descriptor. E.g. com1 for "/dev/ttyS0" usb1 for
"/dev/ttyUSB0"configStr
- Configuration data for interface e.g. "setting=2400-7N1"
mbus:com1:p1?setting=2400-7N1
- Throws:
NoSuchInterfaceException
- if the interface is not present
MethodNotImplementedException
- if method is not implemented by driver
java.io.IOException
getDeviceList
public java.util.List<DeviceURI> getDeviceList(BusURI url)
throws MethodNotImplementedException,
java.io.IOException
- Description copied from interface:
DeviceDriverInterface
- Scan the bus for connected meters
This operation is optional and my not be supported by specific drivers
- Specified by:
getDeviceList
in interface DeviceDriverInterface
- Returns:
- List of URLs of connected meters or null if this operation is not
supported by the driver.
- Throws:
MethodNotImplementedException
- if method is not implemented by driver
java.io.IOException
getDriverID
public java.lang.String getDriverID()
- Specified by:
getDriverID
in interface DeviceDriverInterface
getSupportedOperations
public java.util.List<java.lang.String> getSupportedOperations()
- Description copied from interface:
DeviceDriverInterface
- Get a list of supported operations by the driver. This list does not
contain the mandatory operations.
- Specified by:
getSupportedOperations
in interface DeviceDriverInterface
- Returns:
- List of the supported optional operation names
readDeviceAsync
public void readDeviceAsync(DeviceURI url,
java.util.List<ChannelIdentifier> channels,
DataReceivedListener callback,
java.lang.Object handle)
throws MethodNotImplementedException
- Specified by:
readDeviceAsync
in interface DeviceDriverInterface
- Parameters:
url
- URL of the devicechannels
- List of channels to readout. If channels == null all channels
will be read.callback
- Callback object if task finished or error/timeout occured.
- Throws:
MethodNotImplementedException
- if method is not implemented by driver
readDeviceSync
public java.util.List<Measurement> readDeviceSync(DeviceURI url,
java.util.List<ChannelIdentifier> channels)
throws MethodNotImplementedException,
java.io.IOException
- Specified by:
readDeviceSync
in interface DeviceDriverInterface
- Throws:
MethodNotImplementedException
- if method is not implemented by driver
java.io.IOException
writeChannel
public void writeChannel(DeviceURI url,
ChannelIdentifier channel,
double value)
throws MethodNotImplementedException,
java.io.IOException
- Description copied from interface:
DeviceDriverInterface
- Write a channel/register on connected meter / device / i/o
- Specified by:
writeChannel
in interface DeviceDriverInterface
- Parameters:
url
- - URL of the device in a driver specific formatchannel
- - channel to write tovalue
- - value to write to register
- Throws:
MethodNotImplementedException
- if method is not implemented by driver
java.io.IOException
getDeviceChannels
public java.util.List<ChannelInformation> getDeviceChannels(DeviceURI url)
throws MethodNotImplementedException,
java.io.IOException
- Description copied from interface:
DeviceDriverInterface
- Scan a device for available channels
This operation is optional and my not be supported by specific drivers
- Specified by:
getDeviceChannels
in interface DeviceDriverInterface
- Returns:
- List of Strings of assigned channels for a meters or null if this
operation is not supported by the driver.
- Throws:
MethodNotImplementedException
- if method is not implemented by driver
java.io.IOException
disconnect
public void disconnect()