pub mod encode;
pub mod parse;
mod types;
pub use encode::{
encode_adc_response, encode_authorize_response, encode_device_descriptor_response,
encode_device_descriptor_unsupported, encode_function_property_state_response,
encode_group_value_read, encode_group_value_response, encode_group_value_write,
encode_individual_address_response, encode_individual_address_serial_number_response,
encode_key_response, encode_memory_ext_read_response, encode_memory_ext_write_response,
encode_memory_response, encode_property_description_response,
encode_property_ext_description_response, encode_property_response,
encode_property_value_ext_response, encode_raw_apdu, encode_restart_response,
encode_system_network_parameter_response,
};
pub use parse::{parse_indication, parse_raw_apdu};
pub use types::{AppIndication, AppLayerError};
use knx_rs_core::message::ApduType;
#[expect(
clippy::cast_possible_truncation,
reason = "APCI is 10-bit, both halves fit in u8"
)]
pub(crate) const fn apci_bytes(t: ApduType) -> [u8; 2] {
let v = t as u16;
[(v >> 8) as u8, v as u8]
}
pub(crate) const MASK_6BIT: u8 = 0x3F;
pub(crate) const MASK_4BIT: u8 = 0x0F;
pub(crate) const MASK_12BIT: u16 = 0x0FFF;
pub(crate) const WRITE_ENABLE_FLAG: u8 = 0x80;
pub(crate) const DESCRIPTOR_TYPE_UNSUPPORTED: u8 = 0x3F;