pub trait DiagProtocol<NRC>: Send + Sync
where NRC: EcuNRC,
{ // Required methods fn get_basic_session_mode(&self) -> Option<DiagSessionMode>; fn get_protocol_name(&self) -> &'static str; fn process_req_payload(&self, payload: &[u8]) -> DiagAction; fn make_session_control_msg(&self, mode: &DiagSessionMode) -> Vec<u8>; fn create_tp_msg(response_required: bool) -> DiagPayload; fn process_ecu_response(r: &[u8]) -> Result<Vec<u8>, (u8, NRC)>; fn get_diagnostic_session_list(&self) -> HashMap<u8, DiagSessionMode>; fn register_session_type(&mut self, session: DiagSessionMode); }
Expand description

Diagnostic protocol description trait

Required Methods§

source

fn get_basic_session_mode(&self) -> Option<DiagSessionMode>

Returns the alias to the ECU ‘default’ diagnostic session mode Returns None if there is no session type control in the protocol (For example basic OBD2)

source

fn get_protocol_name(&self) -> &'static str

Name of the diagnostic protocol

source

fn process_req_payload(&self, payload: &[u8]) -> DiagAction

Process a byte array into a command

source

fn make_session_control_msg(&self, mode: &DiagSessionMode) -> Vec<u8>

Creates a session mod req message

source

fn create_tp_msg(response_required: bool) -> DiagPayload

Generate the tester present message (If required)

source

fn process_ecu_response(r: &[u8]) -> Result<Vec<u8>, (u8, NRC)>

Processes the ECU response, and checks to see if it is a positive or negative response, this includes checking to see if the ECU is in a waiting state

source

fn get_diagnostic_session_list(&self) -> HashMap<u8, DiagSessionMode>

Gets a hashmap of available diagnostic session modes

source

fn register_session_type(&mut self, session: DiagSessionMode)

Registers a new custom diagnostic session mode

Object Safety§

This trait is not object safe.

Implementors§