@@ -202,7 +202,7 @@ impl fmt::Display for Packet {
202
202
}
203
203
204
204
/// shows packet/message contents as pretty string for debug
205
- pub async fn pkt_debug ( pkt : & Packet ) -> Result < ( ) > {
205
+ pub async fn pkt_debug ( proxy_type : ProxyType , pkt : & Packet ) -> Result < ( ) > {
206
206
// don't run further if we are not in Debug mode
207
207
if !log_enabled ! ( Level :: Debug ) {
208
208
return Ok ( ( ) ) ;
@@ -479,7 +479,7 @@ pub async fn proxy<A: Endpoint<A> + 'static>(
479
479
if proxy_type == ProxyType :: HeadUnit {
480
480
// waiting for initial version frame (HU is starting transmission)
481
481
let pkt = rxr. recv ( ) . await . ok_or ( "reader channel hung up" ) ?;
482
- let _ = pkt_debug ( & pkt) . await ;
482
+ let _ = pkt_debug ( proxy_type , & pkt) . await ;
483
483
// sending to the MD
484
484
tx. send ( pkt) . await ?;
485
485
// waiting for MD reply
@@ -509,7 +509,7 @@ pub async fn proxy<A: Endpoint<A> + 'static>(
509
509
pkt. transmit ( & mut device) . await ?;
510
510
// waiting for MD reply
511
511
let pkt = rxr. recv ( ) . await . ok_or ( "reader channel hung up" ) ?;
512
- let _ = pkt_debug ( & pkt) . await ;
512
+ let _ = pkt_debug ( proxy_type , & pkt) . await ;
513
513
// sending reply back to the HU
514
514
tx. send ( pkt) . await ?;
515
515
@@ -559,7 +559,7 @@ pub async fn proxy<A: Endpoint<A> + 'static>(
559
559
if let Ok ( mut pkt) = rxr. try_recv ( ) {
560
560
match pkt. decrypt_payload ( & mut mem_buf, & mut server) . await {
561
561
Ok ( _) => {
562
- let _ = pkt_debug ( & pkt) . await ;
562
+ let _ = pkt_debug ( proxy_type , & pkt) . await ;
563
563
tx. send ( pkt) . await ?;
564
564
}
565
565
Err ( e) => error ! ( "decrypt_payload: {:?}" , e) ,
0 commit comments