Porovnávané verzie

Kľúč

  • Tento riadok sa pridal
  • Riadok je odstránený.
  • Formátovanie sa zmenilo.

Modul The sk.ipesoft.sgcom.udp slúži na vytvorenie dojmu spojovo orientovanej komunikácie cez UDP, aby bolo možné použiť existujúcu implementáciu IEC62056-47 a DLMS/COSEM protokolu v knižnici jDLMS na komunikáciu s elektromermi ADDAX NP73E v režime s dynamickou IP adresou a na UDP komunikáciu s MOXA zariadením.
Trieda DatagramWrapperServerImpl riadi celý subsystém. Otvára UDP porty, na ktoré môžu prichádzať notifikácie z elektromerov, v ktorých oznamujú svoju aktuálny IP adresu a svoj unikátny identifikátor. Každý z týchto portov je obsluhovaný inštanciou triedy DatagramSocketWrapper, ktorý volaním createStreamedDatagramSocket vytvára objekt typu StreamedDatagramSocket. Ten už reprezentuje „spojovo orientovaný kanál" medzi SGCom-om a elektromerom a poskytuje InputStreamOutputStream ako aj možnosť nastaviť timeout na čítanie.
Každý prichádzajúci UDP datagram je spracovaný inštanciou triedy DatagramSocketWrapper. Ak je to datagram od „pripojeného" partnera – tzn. existuje preň inštancia triedy StreamedDatagramSocket – je presmerovaný do príslušného StreamedDatagramSocket-u. V opačnom prípade je presmerovaný do DatagramWrapperServer-a.
V prípade komunikácie s MOXA zariadením je spojenie zjednodušené na jednu inštanciu DatagramSocketWrapper-a a jednu inštanciu StreamedDatagramSocket-u.
Trieda DatagramTransportLayer obaľuje triedu DatagramSocketWrapper do rozhrania 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, aby ju bolo možné použiť ako zásuvný modul do knižnice jDLMS so that it can be used as a plugin to the jDLMS library.