File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -429,7 +429,12 @@ static int honda_bosch_fwd_hook(int bus_num, int addr) {
429
429
int bus_fwd = -1 ;
430
430
431
431
if (bus_num == 0 ) {
432
- bus_fwd = 2 ;
432
+ // Radarless: Block buttons when engaged
433
+ int is_button_msg = (addr == 0x296 );
434
+ bool block_msg = is_button_msg && controls_allowed && honda_bosch_radarless && !honda_bosch_long ;
435
+ if (!block_msg ) {
436
+ bus_fwd = 2 ;
437
+ }
433
438
}
434
439
if (bus_num == 2 ) {
435
440
int is_lkas_msg = (addr == 0xE4 ) || (addr == 0xE5 ) || (addr == 0x33D ) || (addr == 0x33DA ) || (addr == 0x33DB );
Original file line number Diff line number Diff line change @@ -565,6 +565,21 @@ def setUp(self):
565
565
self .safety .set_safety_hooks (Panda .SAFETY_HONDA_BOSCH , Panda .FLAG_HONDA_RADARLESS )
566
566
self .safety .init_tests ()
567
567
568
+ # Test forwarding buttons when disengaged
569
+ def test_fwd_hook (self ):
570
+ for controls_allowed in [False , True ]:
571
+ self .safety .set_controls_allowed (controls_allowed )
572
+ if controls_allowed :
573
+ self .FWD_BLACKLISTED_ADDRS [0 ] = [0x296 ]
574
+ super ().test_fwd_hook ()
575
+
576
+ # OP sends buttons when engaged, so allow all. Only allow cancel when disengaged.
577
+ def test_buttons_radarless (self ):
578
+ for controls_allowed in [False , True ]:
579
+ self .safety .set_controls_allowed (controls_allowed )
580
+ self .assertTrue (self ._tx (self ._button_msg (Btn .CANCEL , bus = self .BUTTONS_BUS )))
581
+ for button in (Btn .MAIN , Btn .RESUME , Btn .SET , Btn .NONE ):
582
+ self .assertEqual (controls_allowed , self ._tx (self ._button_msg (button , bus = self .BUTTONS_BUS )))
568
583
569
584
class TestHondaBoschRadarlessAltBrakeSafety (HondaPcmEnableBase , TestHondaBoschRadarlessSafetyBase , TestHondaBoschAltBrakeSafetyBase ):
570
585
"""
You can’t perform that action at this time.
0 commit comments