Skip to main content

Crate knx_core

Crate knx_core 

Source
Expand description

KNX primitives for the public KNXyz Rust crates.

This crate exposes address types, shared error types, selected KNXnet/IP header primitives, and std-gated protocol helper surfaces. It is not a commissioning tool and does not perform device programming, application download, Secure commissioning, or project-file write-back.

The types here are validated primitives - sealed fields, checked constructors, invariants enforced at the boundary - as opposed to the catalogue tier’s open data records, which state declarations with public fields and enforce nothing.

§Feature boundaries

  • Default features enable std.
  • std gates the cEMI types, the APCI type, the encode methods on the KNXnet/IP primitives, and std::error::Error for KnxError. Everything this crate allocates sits behind that gate, and it allocates through std::vec::Vec.
  • --no-default-features leaves the address types, KnxError and Result, and the KNXnet/IP primitives less their encode methods - their constructors, accessors, and decode are the no_std surface. That surface is compile-checked without default features on a hosted target; it is not exercised on bare-metal hardware.
  • alloc is not a feature of this crate. The allocating APIs are reached through std.

Structs§

CemiFrame
A cEMI L_Data frame around 1 group telegram: what the frame is, the 2 control field octets, the telegram itself, and any additional-info block.
ConnectionHeader
The header a frame on an established connection carries ahead of its payload: which channel it belongs to, and where it sits in that channel’s sequence.
GroupAddress
Where a telegram is addressed: 16 bits naming a group, not a device.
GroupTelegram
A single group service, addressed and carrying its data: the device it came from, the group it is addressed to, the service, and the payload in the form it travels in.
Hpai
A Host Protocol Address Information block: the endpoint a peer is asked to send to, as the sender states it.
IndividualAddress
A device’s own address: 4 bits of area, 4 bits of line, and 8 bits of device, held as the 2 octets a frame carries.
KnxNetIpHeader
The header every KNXnet/IP frame opens with: its own length, the protocol version, the service the frame is, and the length of the whole frame.
TunnellingCrd
The Connection Response Data a tunnelling CONNECT_RESPONSE carries.
TwoLevelGroupAddressDisplay
A GroupAddress written as main/sub, for installations that address in 2 levels.

Enums§

Apci
Only group-value services are modeled; all other APCI codes decode as InvalidFrame (intentional scope limit).
CemiMessageCode
What a cEMI frame is, as its first octet states.
ConfirmStatus
What a server reports about a frame it confirmed.
GroupPayload
The transmitted form of a group telegram’s data.
HostProtocol
The transport an endpoint speaks, as the host protocol octet of an HPAI names it.
KnxError
Why this crate refused.
ServiceType
The KNXnet/IP services this crate speaks: a chosen subset of the registry, not the complete set.

Constants§

HEADER_LENGTH
The length of the KNXnet/IP header itself, in octets. The header states this in its own first octet, so a frame that opens with anything else is not a header this crate reads.
PROTOCOL_VERSION_1_0
The protocol version octet for KNXnet/IP 1.0, the only version this crate speaks: the major version in the high nibble, the minor in the low one.

Type Aliases§

Result
The result every fallible entry point in this crate answers with: KnxError is the only error any of them raises.