pub struct PapPacket {
pub connection_id: u8,
pub function: PapFunction,
pub sequence_num: u16,
pub data: Vec<u8>,
}Expand description
PAP packet structure
PAP packets are sent over ATP and have the following format:
- Byte 0: Connection ID
- Byte 1: Function code
- Bytes 2-3: Sequence number (for some functions)
- Remaining bytes: Function-specific data
Fields§
§connection_id: u8§function: PapFunction§sequence_num: u16§data: Vec<u8>Implementations§
Source§impl PapPacket
impl PapPacket
Sourcepub const MIN_HEADER_LEN: usize = 2
pub const MIN_HEADER_LEN: usize = 2
Minimum header length (connection_id + function)
Sourcepub fn to_atp_parts(&self) -> ([u8; 4], &[u8])
pub fn to_atp_parts(&self) -> ([u8; 4], &[u8])
Convert to ATP user bytes and data payload
PAP transmits its header in the ATP user bytes.
- Byte 0: Connection ID
- Byte 1: Function code
- Bytes 2-3: Sequence number (or unused/zero)
Trait Implementations§
impl Eq for PapPacket
impl StructuralPartialEq for PapPacket
Auto Trait Implementations§
impl Freeze for PapPacket
impl RefUnwindSafe for PapPacket
impl Send for PapPacket
impl Sync for PapPacket
impl Unpin for PapPacket
impl UnsafeUnpin for PapPacket
impl UnwindSafe for PapPacket
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more