pub struct SomeipHeader {
pub message_id: u32,
pub length: u32,
pub request_id: u32,
pub interface_version: u8,
pub message_type: MessageType,
pub return_code: u8,
pub tp_header: Option<TpHeader>,
}Expand description
SOMEIP header (including tp header if present).
Fields§
§message_id: u32§length: u32§request_id: u32§interface_version: u8§message_type: MessageTypeMessage type (does not contain the tp flag, this is determined if something is present in the tp_header field).
return_code: u8§tp_header: Option<TpHeader>Contains a tp header (Transporting large SOME/IP messages of UDP [SOME/IP-TP]).
If there is a tp header a someip payload is split over multiple messages and the tp header contains the start offset of the payload of this message relative to the completly assembled payload.
Implementations§
Source§impl SomeipHeader
impl SomeipHeader
Sourcepub fn new_sd_header(
length: u32,
session_id: u16,
tp_header: Option<TpHeader>,
) -> Self
pub fn new_sd_header( length: u32, session_id: u16, tp_header: Option<TpHeader>, ) -> Self
Create a service discovery message header.
Sourcepub fn service_id(&self) -> u16
pub fn service_id(&self) -> u16
Returns the service id (first 16 bits of the message id)
Sourcepub fn set_service_id(&mut self, service_id: u16)
pub fn set_service_id(&mut self, service_id: u16)
Set the servide id (first 16 bits of the message id)
Sourcepub fn set_event_id(&mut self, event_id: u16)
pub fn set_event_id(&mut self, event_id: u16)
Set the event id + the event bit.
Sourcepub fn set_method_id(&mut self, method_id: u16)
pub fn set_method_id(&mut self, method_id: u16)
Set the event id + the event bit to 0. Asserting method_id <= 0x7FFF (otherwise the )
Sourcepub fn set_method_or_event_id(&mut self, method_id: u16)
pub fn set_method_or_event_id(&mut self, method_id: u16)
Sets the event id or method id. This number mjust include the “event bit”.
Sourcepub fn is_someip_sd(&self) -> bool
pub fn is_someip_sd(&self) -> bool
Returns true if the message has the message id of a some ip service discovery message.
Sourcepub fn is_event(&self) -> bool
pub fn is_event(&self) -> bool
Returns true if the event or notification bit in the message id is set
Sourcepub fn event_or_method_id(&self) -> u16
pub fn event_or_method_id(&self) -> u16
Return the event id or method id. This number includes the “event bit”.
Sourcepub fn base_to_bytes(&self) -> [u8; 16]
pub fn base_to_bytes(&self) -> [u8; 16]
Returns the encoded SOMEIP header (without the TP header).
Sourcepub fn read<T: Read>(
reader: &mut T,
) -> Result<SomeipHeader, SomeipHeaderReadError>
pub fn read<T: Read>( reader: &mut T, ) -> Result<SomeipHeader, SomeipHeaderReadError>
Read a header from a byte stream.
Trait Implementations§
Source§impl Clone for SomeipHeader
impl Clone for SomeipHeader
Source§fn clone(&self) -> SomeipHeader
fn clone(&self) -> SomeipHeader
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SomeipHeader
impl Debug for SomeipHeader
Source§impl Default for SomeipHeader
impl Default for SomeipHeader
Source§fn default() -> SomeipHeader
fn default() -> SomeipHeader
Source§impl PartialEq for SomeipHeader
impl PartialEq for SomeipHeader
impl Eq for SomeipHeader
impl StructuralPartialEq for SomeipHeader
Auto Trait Implementations§
impl Freeze for SomeipHeader
impl RefUnwindSafe for SomeipHeader
impl Send for SomeipHeader
impl Sync for SomeipHeader
impl Unpin for SomeipHeader
impl UnwindSafe for SomeipHeader
Blanket Implementations§
§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
§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)
clone_to_uninit)