The sk.ipesoft.sgcom.udp module is used to create the impression of connection-oriented communication over UDP in order to use the existing implementation of IEC62056-47 and DLMS/COSEM protocol in the jDLMS library to communicate with ADDAX NP73E power meters in dynamic IP address mode and over UDP communication with the serial server devices.
The DatagramWrapperServerImpl class controls the entire subsystem. It opens UDP ports that can receive notifications from electricity meters announcing their current IP address and their unique identifier. Each of these ports is served by an instance of the DatagramSocketWrapper class, which creates an object of StreamedDatagramSocket type by calling createStreamedDatagramSocket. It already represents a "connection-oriented channel" between SGCom and the electricity meter and provides an InputStream and an OutputStream as well as the possibility to set a timeout for reading.
Each incoming UDP datagram is processed by an instance of the DatagramSocketWrapper class. If it's a datagram from a "connected" peer – that is, there is an instance of the StreamedDatagramSocket class for it – it's redirected to the appropriate StreamedDatagramSocket. Otherwise, it's redirected to the DatagramWrapperServer.
When communicating with a serial server device, the connection is simplified to one instance of DatagramSocketWrapper and one instance of StreamedDatagramSocket.
The DatagramTransportLayer class wraps the DatagramSocketWrapper class in the interface org.openmuc.jdlms.transportlayer.client.TransportLayer so that it can be used as a plugin to the jDLMS library.



Napíšte komentár