Skip navigation links

icube.ch DLMS/COSEM libraries

The DLMS/COSEM Java implementation consists of 4 packages.

See: Description

Packages 
Package Description
icube.demo
Provides a 'basic' demo framework.
icube.demo.io  
icube.ezhdlc
The icube.ezhdlc package implements the HDLC layer of the 3-layers, connection oriented, HDLC-based communication profile defined by the COSEM/DLMS standard.
icube.wrapper
The icube.wrapper package implements the WRAPPER layer of the TCP/IP based communication profile.
icube.xmlpdu
The icube.xmlpdu package implements package implements classes to Encode/Decode Xml-elements to/from PDU (Protocol Data Unit).

The DLMS/COSEM Java implementation consists of 4 packages.

icube.xmlpdu provides methods that translate the COSEM/DLMS services, from a XML format to a binary (PDU) and vice versa.

icube.ezhdlc, implements the HDLC layer, connection oriented, HDLC-based communication defined by the COSEM/DLMS standard.

icube.wrapper implements the WRAPPER layer of the TCP/IP based communication profile.

icube.GCM implements the GCM (Gallois Counter Mode) cryptographic operations.

The icube.ezhdlc and icube.wrapper packages rely on a pair of java.io.InputStream and java.io.OutputStream provided by the client application to "send the bytes" to the peer layer, respectively to "receive the bytes" from the peer layer.

The package icube.demo provides some basic test examples.

The PDUs that icube.xmlpdu processes are defined by this symplified ASN.1 syntax.

Packages usage.

The steps needed to establish a COSEM/DLMS connection are:

  1. Create the communication layer to the Meter (using serial port, TCP/IP, UDP or any other mechanism which implements a pair of InputStream and OutputStream).

  2. Connect the supporting layer. For example, if the supporting layed is TCP (or UDP), then connect it. In the HDLC case, the supporting layed can be a serial port, the open the port and set its parameters.

  3. Set the parameters of the required layer (HDLC or WRAPPER), and create an instance of icube.ezhdlc.HDLCProtocol(...) with the requiered HDLCParameters, InputStream and OuputStream ( hdlc = HDLCProtocol(...) ).

  4. If needed (HDLC), call the hdlc.connect() method.

  5. Translate the required AssociationRequest XML to PDU using icube.xmlpdu.XmlPduInterface.XmlToPdu().

  6. Send the resulting PDU to the meter device and read the corresponding response with a call to hdlc.sendReceive() method.

  7. Translate the received PDU to XML using icube.xmlpdu.XmlPduInterface.PduToXml().

  8. Process the received XML.

  9. Repeat as needed, with COSEM services like ReadRequest, GetRequest, ...

  10. When finished, and if needed, close the connection using hdlc.disconnect().

  11. Disconnect the supporting channel, TCP (or UDP), or close the serial port.

Release notes.

Release 2.0.2

Version 2. Initial published release.

Release 2.0.3

Version 2. XML Syntax minor corrections.

Release 2.1.5

ezhdlc Improved error recovery in communication.

Release 3.01

This version adds the ability to process Consumer Information Interface (CII) data provided by a compliant meter. Refer to this page for a description of this interface.

ezhdlc Added processing capabilities for CII.

xmlpdu Added new definitions the be able to process CII.

Wrapper No change.

GCM Added this new library to allow deciphering the encrypted pushed data.

New sample in the libraries-demo project.

Skip navigation links