Struct ecu_diagnostics::kwp2000::KwpRoutineManager
source · [−]pub struct KwpRoutineManager<'a> { /* private fields */ }
Expand description
KWP2000 Routine execution wrapper
Implementations
sourceimpl<'a> KwpRoutineManager<'a>
impl<'a> KwpRoutineManager<'a>
sourcepub fn new(
rid: RoutineID,
server: &'a mut Kwp2000DiagnosticServer
) -> DiagServerResult<Self>
pub fn new(
rid: RoutineID,
server: &'a mut Kwp2000DiagnosticServer
) -> DiagServerResult<Self>
Creates a new routine manager. Upon creation, the KWP2000 diagnostic server will automatically attempt to enter extended diagnostic session mode, which is required for routine execution and management.
Parameters
- rid - The routine ID
- server - Reference to running KWP2000 diagnostic server
Returns
If an error of DiagError::ParameterInvalid is returned, then it means that the value of rid
is invalid
and violates the KWP2000 specification. Other DiagError’s will come from the attempt to set the ECU
into extended diagnostic session mode.
sourcepub fn start_routine(&mut self, entry_options: &[u8]) -> DiagServerResult<()>
pub fn start_routine(&mut self, entry_options: &[u8]) -> DiagServerResult<()>
Attempts to start the routine
sourcepub fn stop_routine(
&mut self,
exit_options: &[u8]
) -> DiagServerResult<RoutineExitStatus>
pub fn stop_routine(
&mut self,
exit_options: &[u8]
) -> DiagServerResult<RoutineExitStatus>
Attempts to stop the routine. Note that some routines automatically exit themselves and do NOT need to be manually stopped
sourcepub fn request_routine_results(&mut self) -> DiagServerResult<Vec<u8>>
pub fn request_routine_results(&mut self) -> DiagServerResult<Vec<u8>>
Requests the results of the routine. If the routine was manually stopped prior to running this, it is best practice to check the RoutineExitStatus to see if the routine exited with RoutineExitStatus::NormalExitWithResults first.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for KwpRoutineManager<'a>
impl<'a> Send for KwpRoutineManager<'a>
impl<'a> !Sync for KwpRoutineManager<'a>
impl<'a> Unpin for KwpRoutineManager<'a>
impl<'a> !UnwindSafe for KwpRoutineManager<'a>
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