Ensure RawCard size matches flash alignment requirements, add debug logs
This commit is contained in:
@@ -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(),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user