public class SerialConnectionBuilder extends ConnectionBuilder<SerialConnectionBuilder>
Modifier and Type | Class and Description |
---|---|
class |
SerialConnectionBuilder.HdlcSettingsImpl |
ConnectionBuilder.SettingsImpl
Constructor and Description |
---|
SerialConnectionBuilder(java.lang.String serialPortName)
Constructs a SerialConnectionBuilder.
|
Modifier and Type | Method and Description |
---|---|
DlmsConnection |
build()
Builds a new DLMS/COSEM Connection, which is connected to the remote meter.
|
SerialConnectionBuilder |
disableHandshake()
Disables a IEC 62056-21 mode E handshake with the meter.
|
SerialConnectionBuilder |
enableHandshake()
Enables a IEC 62056-21 mode E handshake with
the meter.
|
SerialConnectionBuilder |
setBaudRate(int baudrate)
Sets the baudrate.
|
SerialConnectionBuilder |
setBaudRateChangeTime(long baudrateChangeTime)
Sets the baud rate change delay in ms in the handshake process.
|
SerialConnectionBuilder |
setIec21Address(java.lang.String iec21Address)
Specifies the optional field in the IEC 62056-21 request message.
|
SerialConnectionBuilder |
setSerialPortName(java.lang.String serialPortName)
Sets the serial port name.
|
buildConnection, setChallengeLength, setClientId, setHdlcMaxInformationLength, setLogicalDeviceId, setPhysicalDeviceAddress, setRawMessageListener, setReferencingMethod, setResponseTimeout, setSecuritySuite, setSnObjectMapping, setSystemTitle
public SerialConnectionBuilder(java.lang.String serialPortName)
serialPortName
- the serial port name.public SerialConnectionBuilder setSerialPortName(java.lang.String serialPortName)
serialPortName
- the serial port name.SerialConnectionBuilder
reference.public SerialConnectionBuilder setIec21Address(java.lang.String iec21Address)
0-9
, A-Z
or a-z
. Leading zeros in the tariff device address are ignored (i.e.
10203 == 010203 == 00000010203
)
This method call enables the handshake.
iec21Address
- the optional IEC 62056-21 address.SerialConnectionBuilder
reference.java.lang.IllegalArgumentException
- if the specified address does not match the address character requirements or is null
.public SerialConnectionBuilder disableHandshake()
SerialConnectionBuilder
reference.public SerialConnectionBuilder enableHandshake()
SerialConnectionBuilder
reference.public SerialConnectionBuilder setBaudRate(int baudrate)
This method call disables the handshake.
NOTE: this option can't be used with setBaudRateChangeTime(long)
or
setIec21Address(String)
.
baudrate
- a positive integer. E.g. 9600.SerialConnectionBuilder
reference.disableHandshake()
public SerialConnectionBuilder setBaudRateChangeTime(long baudrateChangeTime)
150
.
This method call enables the handshake.
NOTE: this option can't be used with setBaudRate(int)
.
baudrateChangeTime
- sets the baud rate change time in the IEC 62056-21 handshake sequence.SerialConnectionBuilder
reference.enableHandshake()
public DlmsConnection build() throws java.io.IOException
ConnectionBuilder
build
in class ConnectionBuilder<SerialConnectionBuilder>
DlmsConnection
with the given settings.java.io.IOException
- if an error occurs, while connecting to the meter.