dlms-cosem-kit
DLMS/COSEM (IEC 62056) in one Rust crate: sans-I/O, no_std, client and server.
Read meters, host COSEM objects, or receive push notifications. The protocol core works with caller-provided buffers. The blocking client drives TCP wrapper and HDLC connections.
[]
= "0.4"
Read a profile
Pass an associated client and the capture-column count for the selection. The returned
value borrows storage. Use Some(selector) to read a clock range or entry range;
DateTime::from_unix_seconds builds the range ends.
use ;
use ProfileBuffer;
use Obis;
use CryptoProvider;
use AttributeDescriptor;
The client accepts up to 64 KiB of encoded result data by default. Set the client limit
with with_response_capacity. A smaller output slice sets the limit for that GET.
ResponseTooLarge indicates whether to reconnect. For owned values use get or
get_selected.
release succeeds only when the meter confirms the release, so commit staged readings on
it. WrapperTransport checks reply ports and lengths on the header, and set_deadline
bounds a whole association.
Features
default = ["std", "client", "server", "hdlc", "wrapper", "p1", "suite0", "obis-names"]
| Feature | What it switches on |
|---|---|
client / server |
The two engines. With std, client adds the blocking Client and its transports. |
hdlc / wrapper / p1 |
The HDLC data link, the TCP/UDP wrapper, the P1 customer interface. |
sn |
Short-name referencing, for pre-logical-name meters. Off by default. |
suite0 |
The AES-GCM provider: ciphering under suites 0, 1 and 2. Implies crypto. |
crypto |
Zeroised key storage and constant-time comparison, without a cipher. |
obis-names |
Names for the well-known OBIS codes. |
std / alloc / heapless |
Environment. std implies alloc and brings OsRandom. |
Protocol support
The crate implements A-XDR and BER codecs, ACSE associations, logical-name services, optional short-name referencing, service blocks and general block transfer. Security includes symmetric ciphering for suites 0–2, HLS-GMAC and replay protection. Persist the next invocation counter before reusing a key across restarts.
For embedded or async applications, drive the sans-I/O ClientSession or Server
with your transport. See the support matrix
for supported security mechanisms and interoperability limits.
Run the TCP examples
In separate terminals, start the simulator and read its profile.
Add -- --ciphered to both commands for HLS-GMAC and authenticated encryption.
Cookbook · API reference · Changelog
License
MIT OR Apache-2.0, at your option.