Skip to main content

Module wired

Module wired 

Source
Expand description

Wired M-Bus link layer (EN 13757-2, the FT1.2 format of IEC 60870-5-2).

E5                                      single character (ACK)
10 C A CS 16                            short frame
68 L L 68 C A CI [data…] CS 16          control (L = 3) and long frame

L counts the bytes from C to the last data byte. CS is their arithmetic sum modulo 256 (for a short frame, C + A).

Modules§

control
C-field values a master sends.

Enums§

Frame
A wired M-Bus frame.
Scan
What scan found in a receive buffer.

Constants§

ACK
The single-character acknowledgement.
BROADCAST
The primary address that addresses every slave (no reply expected).
NETWORK_LAYER
The primary address that addresses the selected slave (secondary addressing).

Functions§

req_ud2
REQ_UD2 to a primary address: ask for the meter reading. Toggle fcb between successive requests to the same slave.
scan
Find the first valid frame in a receive buffer that may begin with noise, an echo or the tail of a broken frame (what a level converter delivers on a real bus).
scan_ended
scan for a reply that is over (no more bytes will come): an incomplete frame is noise too, so a frame behind a stray start byte (68 E5, 10 E5) is still found. Scan::NeedMore means there is no valid frame.
snd_nke
SND_NKE to a primary address: reset the slave’s link layer.