@@ -199,6 +199,18 @@ pub enum DiagSession {
199199 ExtendedDiag = 0x92 ,
200200}
201201
202+ impl ToString for DiagSession {
203+ fn to_string ( & self ) -> String {
204+ match & self {
205+ DiagSession :: Normal => "Normal" ,
206+ DiagSession :: ECUFlash => "Flash" ,
207+ DiagSession :: StandBy => "Standby" ,
208+ DiagSession :: ECUPassive => "Passive" ,
209+ DiagSession :: ExtendedDiag => "Extended diagnostics"
210+ } . into ( )
211+ }
212+ }
213+
202214impl DiagSession {
203215 pub ( crate ) fn send_tester_present ( & self ) -> bool {
204216 self != & DiagSession :: Normal
@@ -418,14 +430,14 @@ impl ProtocolServer for KWP2000ECU {
418430 let mut timer = Instant :: now ( ) ;
419431 while should_run_t. load ( Relaxed ) {
420432 if let Ok ( data) = channel_tx_receiver. try_recv ( ) {
421- let res = Self :: run_command_isotp ( comm_server. as_ref ( ) , s_id, data. 0 , & data. 1 , data. 2 ) ;
433+ let res = Self :: run_command_iso_tp ( comm_server. as_ref ( ) , s_id, data. 0 , & data. 1 , data. 2 ) ;
422434 if channel_rx_sender. send ( res) . is_err ( ) {
423435 * last_error_t. write ( ) . unwrap ( ) = Some ( ProtocolError :: CustomError ( "Sender channel died" . into ( ) ) ) ;
424436 break
425437 }
426438 }
427439 if timer. elapsed ( ) . as_millis ( ) >= 2000 && session_type_t. read ( ) . unwrap ( ) . send_tester_present ( ) {
428- if let Ok ( res) = Self :: run_command_isotp ( comm_server. as_ref ( ) , s_id, Service :: TesterPresent . into ( ) , & [ 0x01 ] , true ) {
440+ if let Ok ( res) = Self :: run_command_iso_tp ( comm_server. as_ref ( ) , s_id, Service :: TesterPresent . into ( ) , & [ 0x01 ] , true ) {
429441 println ! ( "Tester present resp: {:02X?}" , res) ;
430442 }
431443 timer = Instant :: now ( ) ;
0 commit comments