ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
lonworks.h File Reference

LonWorks / LON-IP (ISO/IEC 14908) network-variable codec (PROTOCORE_ENABLE_LONWORKS). More...

#include "protocore_config.h"

Go to the source code of this file.

Detailed Description

LonWorks / LON-IP (ISO/IEC 14908) network-variable codec (PROTOCORE_ENABLE_LONWORKS).

LonWorks is the ISO/IEC 14908 building-automation network. Devices exchange network variables (SNVTs - Standard Network Variable Types) as LonTalk application PDUs. LON/IP (14908-4) tunnels those PDUs over UDP so a device speaks LON without a Neuron chip. This codec builds/parses the LonTalk application-layer message a network-variable update carries:

[1 d sel13..8 : 1][sel7..0 : 1][value...]

where bit 7 marks the APDU a network variable message, d is the direction (1 outgoing, 0 incoming), and the remaining six bits join the second octet to form the 14-bit selector that addresses the bound network variable. The value is the SNVT-encoded data. It also provides the two most-common SNVT scalar encodings from the LONMARK SNVT master list: SNVT_temp (index 39, tenths of a degree Celsius above -274) and SNVT_switch (index 95, a level 0..100 % in 0.5 % steps + a state), so an app reads/writes those without a full SNVT table. Pure, zero heap, no stdlib, host-testable; the LON/IP UDP transport is the shipped UDP layer.

Definition in file lonworks.h.