Trait ecu_diagnostics::dynamic_diag::DiagProtocol
source · pub trait DiagProtocol<NRC>: Send + Syncwhere
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§
sourcefn get_basic_session_mode(&self) -> Option<DiagSessionMode>
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)
sourcefn get_protocol_name(&self) -> &'static str
fn get_protocol_name(&self) -> &'static str
Name of the diagnostic protocol
sourcefn process_req_payload(&self, payload: &[u8]) -> DiagAction
fn process_req_payload(&self, payload: &[u8]) -> DiagAction
Process a byte array into a command
sourcefn make_session_control_msg(&self, mode: &DiagSessionMode) -> Vec<u8>
fn make_session_control_msg(&self, mode: &DiagSessionMode) -> Vec<u8>
Creates a session mod req message
sourcefn create_tp_msg(response_required: bool) -> DiagPayload
fn create_tp_msg(response_required: bool) -> DiagPayload
Generate the tester present message (If required)
sourcefn process_ecu_response(r: &[u8]) -> Result<Vec<u8>, (u8, NRC)>
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
sourcefn get_diagnostic_session_list(&self) -> HashMap<u8, DiagSessionMode>
fn get_diagnostic_session_list(&self) -> HashMap<u8, DiagSessionMode>
Gets a hashmap of available diagnostic session modes
sourcefn register_session_type(&mut self, session: DiagSessionMode)
fn register_session_type(&mut self, session: DiagSessionMode)
Registers a new custom diagnostic session mode
Object Safety§
This trait is not object safe.