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.
- Wrapper
Header - The 8-octet wrapper header.
Enums§
- Wrapper
Error - 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 fromtransport, looping over short reads.