Skip to content

Conversation

tainnok
Copy link
Contributor

@tainnok tainnok commented Sep 2, 2025

!! DRAFT !!
this is part of an bigger change which i tried to split into several pull-requests.
But as the changes depends on each other the splited pull-requests will generate merge-conflicts.
So see this seperated pull-requests as some kind of documentation.
The "big" pull-request which contains everything in a single pull-request which do NOT generate merge-conflicts is: #873

WARNING: most likley #864 is merged before this PR.
You will get an merge-conflict at the call of get_signals() in get_frame_from_container_ipdu().
The version of this PR need to be choosen:
get_signals(pdu_sig_mapping, target_pdu, ea, None, float_factory, bit_offset=0, generated_update_bits_init_to_1=generated_update_bits_init_to_1)

there are two kinds of container-pdus.

  • dynamic, where each sub-pdu has an header (id and length). not all sub-pdus are transmitted each time, position of sub-pdu in container-pdu is dynamic
  • static, where each sub-pdu has a fixed position (offset) in the container-pdu. there is NO header for the sub-pdus!

there was some kind of support for static container-pdus, but in that case each signal of a static sub-pdu got modified start_bit (increased by the pdu-offset).
That result in a situation where the start_bit was incorrect in relation to the sub-pdu itself.
As the sub-pdu offset was not stored, the user of canmatrix has no possiblity to get the correct signal-startbit positions.

Solution:

  • store the sub-pdu offset at the sub-pdu itself
  • set the startbit of the sub-pdu signals to the correct value
  • add support for no-header container-pdus to the unpack() method

…ner-pdu). signals of such sub-pdus now get the correct start_bit
@tainnok tainnok marked this pull request as draft September 2, 2025 17:24
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.

1 participant