pub struct FastPacket {
pub frame_count: u8,
pub sequence_count: u8,
pub total_number_of_frames: u8,
pub data: Vec<u8, 128>,
}Expand description
- In fast packet framing, the first packet contains two protocol bytes and six data bytes.
- Following packets contain one protocol byte and seven data bytes.
- The first byte in all frames contains a sequence counter in the high 3 bits and a frame counter in the lower 5 bits.
- The second byte in the first frame contains the total number of frames that will be sent.
Fields§
§frame_count: u8§sequence_count: u8§total_number_of_frames: u8§data: Vec<u8, 128>Implementations§
Source§impl FastPacket
impl FastPacket
pub fn is_first_frame(data: &[u8]) -> bool
pub fn parse_frame_count(b: u8) -> u8
pub fn parse_sequence_count(b: u8) -> u8
pub fn add_frame(&mut self, data: &[u8]) -> AddFrame
pub fn is_complete(&self) -> bool
pub fn new(data: &[u8]) -> Option<FastPacket>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FastPacket
impl RefUnwindSafe for FastPacket
impl Send for FastPacket
impl Sync for FastPacket
impl Unpin for FastPacket
impl UnwindSafe for FastPacket
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