Enum ecu_diagnostics::kwp2000::KWP2000Command
source · [−]#[repr(u8)]
pub enum KWP2000Command {
Show 28 variants
StartDiagnosticSession,
ECUReset,
ClearDiagnosticInformation,
ReadStatusOfDiagnosticTroubleCodes,
ReadDiagnosticTroubleCodesByStatus,
ReadECUIdentification,
ReadDataByLocalIdentifier,
ReadDataByIdentifier,
ReadMemoryByAddress,
SecurityAccess,
DisableNormalMessageTransmission,
EnableNormalMessageTransmission,
DynamicallyDefineLocalIdentifier,
WriteDataByIdentifier,
InputOutputControlByLocalIdentifier,
StartRoutineByLocalIdentifier,
StopRoutineByLocalIdentifier,
RequestRoutineResultsByLocalIdentifier,
RequestDownload,
RequestUpload,
TransferData,
RequestTransferExit,
WriteDataByLocalIdentifier,
WriteMemoryByAddress,
TesterPresent,
ControlDTCSettings,
ResponseOnEvent,
CustomSid(u8),
}
Expand description
KWP Command Service IDs.
Note. This does not cover both the ‘Reserved’ range (0x87-0xB9) and ‘System supplier specific’ range (0xBA-0xBF)
Variants
StartDiagnosticSession
Start or change ECU diagnostic session mode.
ECUReset
Reset the ECU.
ClearDiagnosticInformation
Clears diagnostic information stored on the ECU.
ReadStatusOfDiagnosticTroubleCodes
Reads snapshot data of DTCs stored on the ECU.
ReadDiagnosticTroubleCodesByStatus
Reads DTCs stored on the ECU.
ReadECUIdentification
Reads ECU identification data.
ReadDataByLocalIdentifier
Reads data from the ECU using a local identifier.
ReadDataByIdentifier
Reads data from the ECU using a unique identifier.
ReadMemoryByAddress
Reads memory from the ECU by address.
SecurityAccess
Security access functions.
DisableNormalMessageTransmission
Disables normal CAN message transmission from an ECU.
EnableNormalMessageTransmission
Enables normal CAN message transmission from an ECU.
DynamicallyDefineLocalIdentifier
WriteDataByIdentifier
InputOutputControlByLocalIdentifier
StartRoutineByLocalIdentifier
Starts a ECU routine given a local identifier.
StopRoutineByLocalIdentifier
Stops a ECU routine given a local identifier.
RequestRoutineResultsByLocalIdentifier
requests results of an executed routine given a local identifier.
RequestDownload
RequestUpload
TransferData
RequestTransferExit
WriteDataByLocalIdentifier
WriteMemoryByAddress
TesterPresent
Tester present message. Kwp2000DiagnosticServer will automatically send this, so no need to manually create a message with this SID
ControlDTCSettings
ResponseOnEvent
CustomSid(u8)
Custom KWP2000 SID not part of the official specification
Trait Implementations
sourceimpl Clone for KWP2000Command
impl Clone for KWP2000Command
sourcefn clone(&self) -> KWP2000Command
fn clone(&self) -> KWP2000Command
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for KWP2000Command
impl Debug for KWP2000Command
sourceimpl DiagnosticServer<KWP2000Command> for Kwp2000DiagnosticServer
impl DiagnosticServer<KWP2000Command> for Kwp2000DiagnosticServer
sourcefn 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
sourcefn execute_command(
&mut self,
sid: KWP2000Command,
args: &[u8]
) -> DiagServerResult<()>
fn execute_command(
&mut self,
sid: KWP2000Command,
args: &[u8]
) -> DiagServerResult<()>
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
sourcefn send_byte_array(&mut self, arr: &[u8]) -> DiagServerResult<()>
fn send_byte_array(&mut self, arr: &[u8]) -> DiagServerResult<()>
Sends an arbitrary byte array to the ECU, and does not query response from the ECU
sourcefn send_byte_array_with_response(
&mut self,
arr: &[u8]
) -> DiagServerResult<Vec<u8>>
fn send_byte_array_with_response(
&mut self,
arr: &[u8]
) -> DiagServerResult<Vec<u8>>
Sends an arbitrary byte array to the ECU, and polls for the ECU’s response
sourcefn set_repeat_count(&mut self, count: u32)
fn set_repeat_count(&mut self, count: u32)
Sets the command retry counter
sourcefn set_repeat_interval_count(&mut self, interval_ms: u32)
fn set_repeat_interval_count(&mut self, interval_ms: u32)
Sets the command retry interval
sourcefn is_server_running(&self) -> bool
fn is_server_running(&self) -> bool
Returns true if the internal KWP2000 Server is running
sourceimpl From<KWP2000Command> for u8
impl From<KWP2000Command> for u8
sourcefn from(cmd: KWP2000Command) -> Self
fn from(cmd: KWP2000Command) -> Self
Converts to this type from the input type.
sourceimpl From<u8> for KWP2000Command
impl From<u8> for KWP2000Command
sourceimpl Ord for KWP2000Command
impl Ord for KWP2000Command
sourceimpl PartialEq<KWP2000Command> for KWP2000Command
impl PartialEq<KWP2000Command> for KWP2000Command
sourcefn eq(&self, other: &KWP2000Command) -> bool
fn eq(&self, other: &KWP2000Command) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &KWP2000Command) -> bool
fn ne(&self, other: &KWP2000Command) -> bool
This method tests for !=
.
sourceimpl PartialOrd<KWP2000Command> for KWP2000Command
impl PartialOrd<KWP2000Command> for KWP2000Command
sourcefn partial_cmp(&self, other: &KWP2000Command) -> Option<Ordering>
fn partial_cmp(&self, other: &KWP2000Command) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for KWP2000Command
impl Eq for KWP2000Command
impl StructuralEq for KWP2000Command
impl StructuralPartialEq for KWP2000Command
Auto Trait Implementations
impl RefUnwindSafe for KWP2000Command
impl Send for KWP2000Command
impl Sync for KWP2000Command
impl Unpin for KWP2000Command
impl UnwindSafe for KWP2000Command
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more