#[repr(C)]pub struct TMiniHeader {
pub header: u16,
pub ct: u8,
pub lsn: u8,
pub fsa: u16,
pub lsa: u16,
pub cs: u16,
}Expand description
Data packet header for T-mini Plus.
§Fields
header: Start marker (0x55AA)ct: Control byte containing scan frequency and package typelsn: Sample count in this packetfsa: First sample angle (raw value)lsa: Last sample angle (raw value)cs: Checksum for data integrity
Fields§
§header: u16Start marker (0x55AA).
ct: u8Control byte: scan frequency and package type.
lsn: u8Sample count in this packet.
fsa: u16First sample angle (raw value).
lsa: u16Last sample angle (raw value).
cs: u16Checksum for data integrity.
Implementations§
Source§impl TMiniHeader
impl TMiniHeader
Sourcepub fn from_bytes(data: &[u8]) -> Option<Self>
pub fn from_bytes(data: &[u8]) -> Option<Self>
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Check if the header is valid.
Verifies that the start marker is correct (0x55AA).
Sourcepub fn scan_frequency(&self) -> f32
pub fn scan_frequency(&self) -> f32
Trait Implementations§
Source§impl Clone for TMiniHeader
impl Clone for TMiniHeader
Source§fn clone(&self) -> TMiniHeader
fn clone(&self) -> TMiniHeader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TMiniHeader
Auto Trait Implementations§
impl Freeze for TMiniHeader
impl RefUnwindSafe for TMiniHeader
impl Send for TMiniHeader
impl Sync for TMiniHeader
impl Unpin for TMiniHeader
impl UnsafeUnpin for TMiniHeader
impl UnwindSafe for TMiniHeader
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