Skip to main content

knx_core/
lib.rs

1#![cfg_attr(not(feature = "std"), no_std)]
2#![forbid(unsafe_code)]
3//! KNX primitives for the public KNXyz Rust crates.
4//!
5//! This crate currently exposes address types, shared error types, selected
6//! KNXnet/IP header primitives, and `std`-gated protocol helper surfaces. It is
7//! not a commissioning tool and does not perform device programming,
8//! application download, Secure commissioning, or project-file write-back.
9//!
10//! # Feature boundaries
11//!
12//! - Default features enable `std`.
13//! - `--no-default-features` keeps a limited `no_std` surface for addresses,
14//!   errors, and selected KNXnet/IP decode primitives.
15//! - `serde` adds optional derives for exported types without enabling `std`.
16//! - `std` currently enables allocation-backed convenience APIs, cEMI/APCI
17//!   helpers, encode helpers, and `std::error::Error` for `KnxError`.
18//!
19//! There is no public `alloc` feature yet. Allocation-backed APIs may move from
20//! `std` to a future `alloc` feature after a separate API review and test
21//! matrix update.
22
23mod address;
24#[cfg(feature = "std")]
25mod apci;
26#[cfg(feature = "std")]
27mod cemi;
28mod error;
29mod knxnetip;
30
31pub use address::{GroupAddress, IndividualAddress, TwoLevelGroupAddressDisplay};
32#[cfg(feature = "std")]
33pub use apci::Apci;
34#[cfg(feature = "std")]
35pub use cemi::{CemiFrame, CemiMessageCode, GroupTelegram};
36pub use error::{KnxError, Result};
37pub use knxnetip::{
38    ConnectionHeader, HostProtocol, Hpai, KnxNetIpHeader, ServiceType, HEADER_LENGTH,
39    PROTOCOL_VERSION_1_0,
40};