Struct ecu_diagnostics::kwp2000::Kwp2000DiagnosticServer [−][src]
pub struct Kwp2000DiagnosticServer { /* fields omitted */ }
Expand description
Kwp2000 Diagnostic server
Implementations
pub fn new_over_iso_tp<'a, C, E>(
settings: Kwp2000ServerOptions,
server_channel: C,
channel_cfg: IsoTPSettings,
event_handler: E
) -> DiagServerResult<Self> where
C: IsoTPChannel + 'static,
E: ServerEventHandler<SessionType, Kwp2000Cmd> + 'static,
pub fn new_over_iso_tp<'a, C, E>(
settings: Kwp2000ServerOptions,
server_channel: C,
channel_cfg: IsoTPSettings,
event_handler: E
) -> DiagServerResult<Self> where
C: IsoTPChannel + 'static,
E: ServerEventHandler<SessionType, Kwp2000Cmd> + 'static,
Creates a new KWP2000 over an ISO-TP connection with the ECU
On startup, this server will configure the channel with the necessary settings provided in both settings and channel_cfg
Parameters
- settings - KWP2000 Server settings
- channel - ISO-TP communication channel with the ECU
- channel_cfg - The settings to use for the ISO-TP channel
- event_handler - Handler for logging events happening within the server. If you don’t want to create your own handler, use Kwp2000VoidHandler
Returns the current settings used by the KWP2000 Server
Trait Implementations
fn execute_command_with_response(
&mut self,
sid: KWP2000Command,
args: &[u8]
) -> DiagServerResult<Vec<u8>>
fn execute_command_with_response(
&mut self,
sid: KWP2000Command,
args: &[u8]
) -> DiagServerResult<Vec<u8>>
Send a command to the ECU, and receive its response
Parameters
- sid - The Service ID of the command
- args - The arguments for the service
Returns
If the function is successful, and the ECU responds with an OK response (Containing data), then the full ECU response is returned. The response will begin with the sid + 0x40
Send a command to the ECU, but don’t receive a response
Parameters
- sid - The Service ID of the command
- args - The arguments for the service
Sends an arbitrary byte array to the ECU, and does not query response from the ECU
Sends an arbitrary byte array to the ECU, and polls for the ECU’s response
Sets the command retry counter
Sets the command retry interval
Returns true if the internal KWP2000 Server is running