Skip to main content

zigbee_core/
lib.rs

1//! Implements the Zigbee protocol stack in `no-std` based on the [Zigbee
2//! Specification R23]
3//!
4//! [Zigbee Specification R23]: https://csa-iot.org/wp-content/uploads/2024/07/docs-05-3474-23-csg-zigbee-specificationR23.1.pdf
5//!
6//! This crate contains the core network layer and security features.
7//! It deals with addressing, keys, trust center, formation and discovery
8//! mechanisms.
9#![no_std]
10#![deny(clippy::panic, unused_must_use)]
11#![warn(
12    clippy::missing_safety_doc,
13    clippy::pedantic,
14    clippy::nursery,
15    clippy::tests_outside_test_module,
16    unused_crate_dependencies,
17    unused_qualifications,
18    single_use_lifetimes,
19    non_ascii_idents
20)]
21#![allow(
22    clippy::missing_errors_doc,
23    clippy::missing_panics_doc,
24    clippy::module_name_repetitions,
25    clippy::must_use_candidate,
26    clippy::needless_raw_string_hashes,
27    clippy::blocks_in_conditions,
28    clippy::missing_const_for_fn,
29    clippy::future_not_send,
30    clippy::ignored_unit_patterns,
31    clippy::trivially_copy_pass_by_ref,
32    clippy::struct_excessive_bools,
33    dead_code,
34    unused_imports,
35    unused_macros,
36    clippy::doc_markdown,
37    clippy::cast_lossless,
38    private_interfaces,
39    clippy::cognitive_complexity,
40    clippy::new_without_default,
41    clippy::non_std_lazy_statics,
42    static_mut_refs,
43    clippy::needless_range_loop,
44    clippy::redundant_pub_crate,
45    clippy::too_many_arguments,
46    clippy::derive_partial_eq_without_eq,
47    clippy::too_long_first_doc_paragraph,
48    clippy::derivable_impls,
49    clippy::unused_self,
50    async_fn_in_trait
51)]
52#![feature(macro_metavar_expr_concat)]
53
54#[cfg(test)]
55extern crate std;
56
57/// Serializes tests that touch the NIB or AIB.
58///
59/// Both are process-wide singletons shared by every test in this binary, so a
60/// per-module lock does not serialize against a sibling module holding its own.
61/// Every test that reads or writes them must hold *this* one.
62#[cfg(test)]
63pub(crate) static TEST_MUTEX: std::sync::Mutex<()> = std::sync::Mutex::new(());
64
65// dev-dependency only used by the storage tests
66#[cfg(all(test, not(feature = "storage")))]
67use sequential_storage as _;
68
69#[cfg(feature = "alloc")]
70extern crate alloc;
71
72#[cfg(feature = "alloc")]
73use alloc as _;
74
75pub mod apl;
76pub mod aps;
77pub mod nwk;
78pub mod security;
79pub mod storage;
80/// Zigbee Device Profile (2.4).
81pub mod zdp;
82
83// ZDO is not directly called by the application — it is controlled by BDB or
84// used internally by the stack.
85#[doc(hidden)]
86pub mod zdo;
87
88pub use apl::descriptors::node_descriptor::LogicalType;
89pub use apl::descriptors::node_power_descriptor::CurrentPowerMode;
90pub use apl::descriptors::node_power_descriptor::CurrentPowerSourceLevel;
91pub use apl::descriptors::node_power_descriptor::PowerSource;
92pub use zdo::config::Config;