Package org.openmuc.jdlms
Interface DlmsSnConnection
-
- All Superinterfaces:
java.lang.AutoCloseable
public interface DlmsSnConnection
DLMS connection class providing methods to directly access SN services READ and WRITE.SN meters can also be accessed using the DlmsConnection. In this case LN to SN service mapping is applied.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
changeClientGlobalAuthenticationKey(byte[] key)
Change the global authentication key used by the client.void
changeClientGlobalEncryptionKey(byte[] key)
Change the global encryption used by the client.void
close()
Closes the connection.void
disconnect()
Disconnects gracefully from the server.java.util.List<ReadResult>
read(java.util.List<SnAddressSpec> varAddressSpecs)
Read multiple values from a COSEM IC object attribute or invoke multiple IC method (only when a return value is expected).ReadResult
read(SnAddressSpec varAddressSpec)
Read a value from a COSEM IC object attribute or invoke a IC method (only when a return value is expected).java.util.List<AccessResultCode>
write(java.util.List<SnWriteParameter> writeParameters)
Write multiple COSEM IC object attributes or invoke multiple IC method .AccessResultCode
write(SnWriteParameter writeParameter)
Write a value to a COSEM IC object attribute or invoke a IC method .
-
-
-
Method Detail
-
read
ReadResult read(SnAddressSpec varAddressSpec) throws java.io.IOException
Read a value from a COSEM IC object attribute or invoke a IC method (only when a return value is expected).- Parameters:
varAddressSpec
- the "Variable Access Specification" of the COSEM attribute or method.- Returns:
- the read result. If the service invocation failed, or the IC method did not return any value, the result won't contain data.
- Throws:
java.io.IOException
- if an IO exception occurred on invocation of the read service.
-
read
java.util.List<ReadResult> read(java.util.List<SnAddressSpec> varAddressSpecs) throws java.io.IOException
Read multiple values from a COSEM IC object attribute or invoke multiple IC method (only when a return value is expected).- Parameters:
varAddressSpecs
- a list of "Variable Access Specification" of the COSEM attribute or method.- Returns:
- the read result. If the service invocation failed, or the IC method did not return any value, the result won't contain data.
- Throws:
java.io.IOException
- if an IO exception occurred on invocation of the read service.
-
write
AccessResultCode write(SnWriteParameter writeParameter) throws java.io.IOException
Write a value to a COSEM IC object attribute or invoke a IC method .- Parameters:
writeParameter
- method/attribute address and data.- Returns:
- the result code resulting the write service invocation.
- Throws:
java.io.IOException
- if an IO exception occurred on invocation of the read service.
-
write
java.util.List<AccessResultCode> write(java.util.List<SnWriteParameter> writeParameters) throws java.io.IOException
Write multiple COSEM IC object attributes or invoke multiple IC method .- Parameters:
writeParameters
- set of method/attribute address and data.- Returns:
- list of result code resulting the write service invocation.
- Throws:
java.io.IOException
- if an IO exception occurred on invocation of the read service.
-
changeClientGlobalAuthenticationKey
void changeClientGlobalAuthenticationKey(byte[] key)
Change the global authentication key used by the client.- Parameters:
key
- the new key
-
changeClientGlobalEncryptionKey
void changeClientGlobalEncryptionKey(byte[] key)
Change the global encryption used by the client.- Parameters:
key
- the new key
-
disconnect
void disconnect() throws java.io.IOException
Disconnects gracefully from the server.- Throws:
java.io.IOException
- if an I/O Exception occurs while closing
-
close
void close() throws java.io.IOException
Closes the connection.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.io.IOException
- if an I/O Exception occurs while closing
-
-