Skip to content

Look up extended frames by PGN and source address - #10

Merged
ip332 merged 1 commit into
mainfrom
issue-4
Nov 19, 2026
Merged

ip332 merged 1 commit into
mainfrom
issue-4

Conversation

@ip332

@ip332 ip332 commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extended-frame identity is the PGN, plus the source address only when that PGN has two layouts. Priority is ignored, and DLC is not the tie-break for the generic row.
  • removeDuplicates stores one generic row at j1939PgnKey when the layout is shared. BA_ "J1939Default" chooses the generic row when layouts differ. Other layouts stay under j1939SaKey. @0 and @1 no longer compare equal.
  • J1939Parser::getPgn finds an 11-bit id with can_id & 0x7FF. A map that has not been deduplicated is still found by the DBC CAN id, so the plain-C round-trip and the existing standard-id tests keep working.

Closes #4.

Test plan

  • Hand-built parser gtests on macOS (152 tests), including the j1939.dbc round-trip against the C database
  • CI all_tests and coverage (needs Linux; linux/can.h is not available on this Mac)

An extended message is the PGN, plus the source address only when that
PGN has two layouts. removeDuplicates stores one generic row when the
layout is shared. BA_ "J1939Default" chooses the generic row when
layouts differ. Priority is not part of the key, and DLC is not the
tie-break. Signal equality includes byte order, so @0 and @1 stay
apart. An 11-bit id is found with can_id & 0x7FF.

J1939Parser still reads the std::map. A map that has not been
deduplicated is still found by the DBC CAN id.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Message lookup mixes full CAN ID and PGN, so frames miss when priority or source address differ

1 participant