Trait ecu_diagnostics::DiagnosticServer
source · [−]pub trait DiagnosticServer<CommandType> {
fn execute_command(
&mut self,
cmd: CommandType,
args: &[u8]
) -> DiagServerResult<()>;
fn execute_command_with_response(
&mut self,
cmd: CommandType,
args: &[u8]
) -> DiagServerResult<Vec<u8>>;
fn send_byte_array(&mut self, bytes: &[u8]) -> DiagServerResult<()>;
fn send_byte_array_with_response(
&mut self,
bytes: &[u8]
) -> DiagServerResult<Vec<u8>>;
fn is_server_running(&self) -> bool;
fn set_repeat_count(&mut self, count: u32);
fn set_repeat_interval_count(&mut self, interval_ms: u32);
}
Expand description
Base trait for diagnostic servers
Required methods
fn execute_command(
&mut self,
cmd: CommandType,
args: &[u8]
) -> DiagServerResult<()>
fn execute_command(
&mut self,
cmd: CommandType,
args: &[u8]
) -> DiagServerResult<()>
Sends a command to the ECU, and doesn’t poll for its response
fn execute_command_with_response(
&mut self,
cmd: CommandType,
args: &[u8]
) -> DiagServerResult<Vec<u8>>
fn execute_command_with_response(
&mut self,
cmd: CommandType,
args: &[u8]
) -> DiagServerResult<Vec<u8>>
Sends a command to the ECU, and polls for its response
fn send_byte_array(&mut self, bytes: &[u8]) -> DiagServerResult<()>
fn send_byte_array(&mut self, bytes: &[u8]) -> DiagServerResult<()>
Sends an arbitrary byte array to the ECU, and doesn’t poll for its response
fn send_byte_array_with_response(
&mut self,
bytes: &[u8]
) -> DiagServerResult<Vec<u8>>
fn send_byte_array_with_response(
&mut self,
bytes: &[u8]
) -> DiagServerResult<Vec<u8>>
Sends an arbitrary byte array to the ECU, and polls for its response
fn is_server_running(&self) -> bool
fn is_server_running(&self) -> bool
Returns if the diagnostic server is running or not
fn set_repeat_count(&mut self, count: u32)
fn set_repeat_count(&mut self, count: u32)
Sets the maximum number of retries to send a command to the ECU if a failure occurs during transmission of the command to the ECU
fn set_repeat_interval_count(&mut self, interval_ms: u32)
fn set_repeat_interval_count(&mut self, interval_ms: u32)
Sets the minimum interval in milliseconds between a command failure and an attempted repeat transmission