org.openmuc.jmbus
Class MBusSap
java.lang.Object
org.openmuc.jmbus.MBusSap
public class MBusSap
- extends java.lang.Object
M-Bus Application Layer Service Access Point
Constructor Summary |
MBusSap(java.lang.String serialPort,
java.lang.String serialConfig,
int defaultReadTimeout)
Creates an M-Bus Service Access Point that is used to read meters. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
APL_RESET_ALL
public static final byte APL_RESET_ALL
- See Also:
- Constant Field Values
APL_RESET_USER_DATA
public static final byte APL_RESET_USER_DATA
- See Also:
- Constant Field Values
APL_RESET_SIMPLE_BILLING
public static final byte APL_RESET_SIMPLE_BILLING
- See Also:
- Constant Field Values
APL_RESET_ENHANCED_BILLING
public static final byte APL_RESET_ENHANCED_BILLING
- See Also:
- Constant Field Values
APL_RESET_MULTI_TARIF_BILLING
public static final byte APL_RESET_MULTI_TARIF_BILLING
- See Also:
- Constant Field Values
APL_RESET_INST_VALUES
public static final byte APL_RESET_INST_VALUES
- See Also:
- Constant Field Values
APL_RESET_LOAD_MANAGEMENT
public static final byte APL_RESET_LOAD_MANAGEMENT
- See Also:
- Constant Field Values
APL_RESET_INSTALLATION
public static final byte APL_RESET_INSTALLATION
- See Also:
- Constant Field Values
APL_RESET_TESTING
public static final byte APL_RESET_TESTING
- See Also:
- Constant Field Values
APL_RESET_CALIBRATION
public static final byte APL_RESET_CALIBRATION
- See Also:
- Constant Field Values
APL_RESET_MANUFACTURING
public static final byte APL_RESET_MANUFACTURING
- See Also:
- Constant Field Values
APL_RESET_DEVELOPMENT
public static final byte APL_RESET_DEVELOPMENT
- See Also:
- Constant Field Values
APL_RESET_SELFTEST
public static final byte APL_RESET_SELFTEST
- See Also:
- Constant Field Values
MBusSap
public MBusSap(java.lang.String serialPort,
java.lang.String serialConfig,
int defaultReadTimeout)
throws java.io.IOException
- Creates an M-Bus Service Access Point that is used to read meters. Attempts to initialize the given serial port
and throws an IOException if this fails. If the serialConfig syntax is not understood an IllegalArgumentException
is thrown.
- Parameters:
serialPort
- examples for serial port identifiers on Linux are "/dev/ttyS0" or "/dev/ttyUSB0".serialConfig
- the serial configuration, format is /. The empty string
indicates the default configuration. The default config is "2400/8E1".defaultReadTimeout
- the default timeout for reading meters in ms
- Throws:
java.io.IOException
readMeter
public VariableDataResponse readMeter(java.lang.String meterAddr)
throws java.io.IOException,
java.util.concurrent.TimeoutException
- Throws:
java.io.IOException
java.util.concurrent.TimeoutException
readMeter
public VariableDataResponse readMeter(java.lang.String meterAddr,
int timeout)
throws java.io.IOException,
java.util.concurrent.TimeoutException
- Parameters:
meterAddr
- e.g. p1 or s...
- Throws:
java.io.IOException
java.util.concurrent.TimeoutException
applicationReset
public void applicationReset(java.lang.String meterAddr)
throws java.io.IOException,
java.util.concurrent.TimeoutException
- Throws:
java.io.IOException
java.util.concurrent.TimeoutException
applicationReset
public void applicationReset(java.lang.String meterAddr,
byte subCode)
throws java.io.IOException,
java.util.concurrent.TimeoutException
- Throws:
java.io.IOException
java.util.concurrent.TimeoutException
closeSerialPort
public void closeSerialPort()