refactor MAC auth

This commit is contained in:
2026-08-29 21:41:07 +08:00
parent 494f4b92eb
commit 8f65670a8f
23 changed files with 557 additions and 356 deletions
+2 -7
View File
@@ -8,6 +8,7 @@ use core::time::Duration;
/// A card UID read by [`Pn532::read_passive_target_id`].
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct Uid {
pub bytes: heapless::Vec<u8, 7>,
}
@@ -25,15 +26,9 @@ impl core::fmt::Display for Uid {
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Uid {
fn format(&self, fmt: defmt::Formatter) {
defmt::write!(fmt, "{}", defmt::Display2Format(self));
}
}
/// Outcome of [`Pn532::tg_init_as_target`] / [`Pn532::tg_init_as_target_default`].
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum TargetInitStatus {
/// The PN532 entered target mode.
Success,