Skip to content

[50 bounty] Move CAN ignition hooks and add test#3182

Open
benksih-code wants to merge 4 commits intocommaai:masterfrom
benksih-code:move-can-ignition-hooks
Open

[50 bounty] Move CAN ignition hooks and add test#3182
benksih-code wants to merge 4 commits intocommaai:masterfrom
benksih-code:move-can-ignition-hooks

Conversation

@benksih-code
Copy link
Copy Markdown

@benksih-code benksih-code commented Mar 10, 2026

Resolves #1834

Changes:

  • Move ignition_can/ignition_can_cnt global variables from panda repo to opendbc safety layer
  • Port full ignition_can_hook() implementation, 100% compatible with original panda code, no logic changes
  • Automatically call ignition_can_hook() from safety_rx_hook() on all incoming CAN messages, same as panda behavior
  • Add complete test coverage:
    • GM ignition signal (0x1F1) test
    • Rivian R1S/T GEN1 ignition signal (0x152 + counter validation) test
    • Tesla Model 3/Y ignition signal (0x221 + counter validation) test
    • Mazda ignition signal (0x9E) test
    • Negative test: ensure non-matching messages / non-bus 0 messages do not trigger false positives

All functionality matches existing panda implementation exactly, no breaking changes to any existing features or safety logic.

@github-actions github-actions Bot added the car safety vehicle-specific safety code label Mar 10, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing to opendbc! In order for us to review your PR as quickly as possible, check the following:

  • Convert your PR to a draft unless it's ready to review
  • Read the contributing docs
  • Before marking as "ready for review", ensure:
    • the goal is clearly stated in the description
    • all the tests are passing
    • include a route or your device' dongle ID if relevant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

car safety vehicle-specific safety code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[$250 bounty] Move CAN ignition hooks and add test

1 participant