pub struct UdsFirstFrame {
pub size: u16,
pub sid: u8,
pub did: Option<u16>,
pub payload: Vec<u8>,
}Expand description
Represents a UDS First Frame. This frame is sent when the payload is too large for a single frame. It contains the total size of the payload and the initial data.
Fields§
§size: u16Total size of the payload (only 12 bits are used).
sid: u8Service Identifier (SID) for the request or response.
did: Option<u16>Optional Diagnostic Identifier (DID), used in certain services.
payload: Vec<u8>The first portion of the payload.
Implementations§
Source§impl UdsFirstFrame
impl UdsFirstFrame
Sourcepub fn new(
sid: u8,
size: u16,
did: Option<u16>,
payload: Vec<u8>,
) -> Result<Self, FrameError>
pub fn new( sid: u8, size: u16, did: Option<u16>, payload: Vec<u8>, ) -> Result<Self, FrameError>
Creates a new UDS First Frame for multi-frame communication.
§Parameters:
sid: Service Identifier.size: Total payload size.did: Optional Diagnostic Identifier.payload: Initial chunk of the payload (max 6 bytes).
§Returns:
Ok(UdsFirstFrame): If the payload size is valid.Err(FrameError): If the payload exceeds 6 bytes.
Trait Implementations§
Source§impl Clone for UdsFirstFrame
impl Clone for UdsFirstFrame
Source§fn clone(&self) -> UdsFirstFrame
fn clone(&self) -> UdsFirstFrame
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UdsFirstFrame
impl Debug for UdsFirstFrame
Source§impl PartialEq for UdsFirstFrame
impl PartialEq for UdsFirstFrame
impl StructuralPartialEq for UdsFirstFrame
Auto Trait Implementations§
impl Freeze for UdsFirstFrame
impl RefUnwindSafe for UdsFirstFrame
impl Send for UdsFirstFrame
impl Sync for UdsFirstFrame
impl Unpin for UdsFirstFrame
impl UnwindSafe for UdsFirstFrame
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more