Ensure RawCard size matches flash alignment requirements, add debug logs

This commit is contained in:
2026-08-29 15:01:48 +00:00
committed by rhetenor
parent ed86e88980
commit 704682b0ae
6 changed files with 18 additions and 10 deletions
+1
View File
@@ -17,6 +17,7 @@ pub fn split_nfc_hex(payload: &[u8]) -> Option<RawCard> {
packed_card_text: payload[0x2DB..0x311].try_into().ok()?,
secret: payload[0x311..0x329].try_into().ok()?,
_opaque_trailer: payload[0x329..0x35A].try_into().ok()?,
_padding: Default::default(),
})
}
+3
View File
@@ -19,8 +19,11 @@ pub struct RawCard {
pub packed_card_text: [u8; 54],
pub secret: [u8; 24],
pub _opaque_trailer: [u8; 49],
pub _padding: [u8; 2],
}
static_assertions::const_assert!(RawCard::SERIALIZED_SIZE.is_multiple_of(4));
#[derive(Debug, Clone, Eq, PartialEq, FromPrimitive)]
#[repr(u8)]
pub enum CardType {