#![allow(clippy::all)] #![allow(unused)] #![allow(missing_docs)] pub mod l2cap { include!(concat!(env!("OUT_DIR"), "/l2cap_packets.rs")); } pub mod hci { include!(concat!(env!("OUT_DIR"), "/hci_packets.rs")); pub const EMPTY_ADDRESS: Address = Address(0x000000000000); impl fmt::Display for Address { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let bytes = u64::to_le_bytes(self.0); write!( f, "{:02X}:{:02X}:{:02X}:{:02X}:{:02X}:{:02X}", bytes[5], bytes[4], bytes[3], bytes[2], bytes[1], bytes[0], ) } } impl From<&[u8; 6]> for Address { fn from(bytes: &[u8; 6]) -> Self { Self(u64::from_le_bytes([ bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], bytes[5], 0, 0, ])) } } impl From
for [u8; 6] { fn from(Address(addr): Address) -> Self { let bytes = u64::to_le_bytes(addr); bytes[0..6].try_into().unwrap() } } }