pub struct RfcommFrame {
pub address: u8,
pub control: u8,
pub length: u16,
pub data: Vec<u8>,
pub fcs: u8,
pub credits: Option<u8>,
}Expand description
An RFCOMM frame
Fields§
§address: u8Address byte (DLCI + C/R + EA)
control: u8Control byte (frame type)
length: u16Length of the information field
data: Vec<u8>Information field (data payload)
fcs: u8Frame Check Sequence
credits: Option<u8>Credit byte (present in UIH frames when P/F bit set in credit-based flow)
Implementations§
Source§impl RfcommFrame
impl RfcommFrame
Sourcepub fn uih(dlci: u8, data: &[u8], credits: Option<u8>) -> Self
pub fn uih(dlci: u8, data: &[u8], credits: Option<u8>) -> Self
Create a UIH (data) frame with optional credits
Sourcepub fn verify_fcs(&self) -> bool
pub fn verify_fcs(&self) -> bool
Verify the FCS of this frame
Sourcepub fn serialize(&self, buf: &mut [u8]) -> Result<usize, KernelError>
pub fn serialize(&self, buf: &mut [u8]) -> Result<usize, KernelError>
Serialize frame to buffer, returns bytes written
Trait Implementations§
Source§impl Clone for RfcommFrame
impl Clone for RfcommFrame
Source§fn clone(&self) -> RfcommFrame
fn clone(&self) -> RfcommFrame
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RfcommFrame
impl RefUnwindSafe for RfcommFrame
impl Send for RfcommFrame
impl Sync for RfcommFrame
impl Unpin for RfcommFrame
impl UnwindSafe for RfcommFrame
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)