mirror of
https://github.com/trussed-dev/usbd-ccid.git
synced 2026-06-20 04:16:20 -07:00
Rename packet_len to data_len
This makes the distinction clearer between the length of the USB packet and the length of the data its CCID header references
This commit is contained in:
+1
-1
@@ -152,7 +152,7 @@ where
|
||||
// TODO check
|
||||
self.ext_packet.extend_from_slice(&packet).unwrap();
|
||||
|
||||
let pl = packet.packet_len();
|
||||
let pl = packet.data_len();
|
||||
if pl > PACKET_SIZE - CCID_HEADER_LEN {
|
||||
self.receiving_long = true;
|
||||
self.in_chain = 1;
|
||||
|
||||
+2
-2
@@ -6,11 +6,11 @@ pub type RawPacket = heapless::Vec<u8, PACKET_SIZE>;
|
||||
pub type ExtPacket = heapless::Vec<u8, MAX_MSG_LENGTH>;
|
||||
|
||||
pub trait RawPacketExt {
|
||||
fn packet_len(&self) -> usize;
|
||||
fn data_len(&self) -> usize;
|
||||
}
|
||||
|
||||
impl RawPacketExt for RawPacket {
|
||||
fn packet_len(&self) -> usize {
|
||||
fn data_len(&self) -> usize {
|
||||
u32::from_le_bytes(self[1..5].try_into().unwrap()) as usize
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user