Skip to main content

Module wrapper

Module wrapper 

Source
Expand description

The DLMS/COSEM wrapper sub-layer (IEC 62056-47).

The wrapper carries an xDLMS APDU over a connection-oriented (TCP) or connectionless (UDP) transport by prefixing it with an 8-octet header:

+---------+-------------+------------------+--------+
| version | source wPort| destination wPort| length |
|  2 oct  |    2 oct    |      2 oct       | 2 oct  |
+---------+-------------+------------------+--------+

All fields are big-endian; length is the size of the APDU that follows. The wrapper is defined only over TCP/UDP, so Wrapper is bounded on crate::transport::NetworkTransport.

Structs§

Wrapper
The wrapper data-link sub-layer over a network (TCP/UDP) transport.
WrapperHeader
The 8-octet wrapper header.

Enums§

WrapperError
Errors that can occur while decoding a wrapper PDU.

Constants§

WRAPPER_VERSION
The only defined wrapper protocol version.

Functions§

decode
Parses a complete wrapper PDU, returning the header and the APDU.
encode
Builds a complete wrapper PDU (header + APDU).
read_exact 🔒
Reads exactly buf.len() bytes from transport, looping over short reads.