The module sk.ipesoft.sgcom.hdlc contains the implementation of the IEC62056-46 HDLC protocol. HDLC primarily provides connection-oriented communication over a serial bus, similar to TCP/IP over Ethernet or WiFi, although it does not include as many sophisticated extensions. The use of this implementation of the HDLC protocol instead of the built-in support in the jDLMS library is due to the fact that it allows sending even long messages that do not fit into one HDLC Information Frame. It is also possible to debug it better, thanks to the configurable and detailed output to the LOG.
The main class of the module is HdlcLayer, which maintains the state of communication and controls the reception and transmission of frames. It is implemented in such a way that it can operate over any physical layer whose interfaces are InputStream, OutputStream and setTimeout, i.e. over TCP/IP socket, serial line, and DatagramSocketWrapper.
Unlike other communication layers, HdlcLayer does not have a read program loop executed in a separate thread, as is the case for example in the Serial or Udp module. This is due to the fact that the communication is strictly half-duplex - at every moment of the communication it is clearly obvious which of the partners is waiting and which can send the frame.



0 komentárov

Nie ste prihlásený. Akékoľvek zmeny, ktoré vykonáte, sa označia ako anonymné. Ak už máte svoj účet, pravdepodobne sa budete chcieť prihlásiť .