Skip to content

xcp_registry: make default event list optional - #54

Open
pamirmundt wants to merge 2 commits into
vectorgrp:masterfrom
pamirmundt:feature/optional-default-event-list
Open

xcp_registry: make default event list optional#54
pamirmundt wants to merge 2 commits into
vectorgrp:masterfrom
pamirmundt:feature/optional-default-event-list

Conversation

@pamirmundt

Copy link
Copy Markdown

Summary

Add Registry::set_write_default_event_list(bool) to control whether event 0 is emitted in DEFAULT_EVENT_LIST.

When disabled, event 0 changes from:

/begin DAQ_EVENT VARIABLE
  /begin DEFAULT_EVENT_LIST EVENT 0 /end DEFAULT_EVENT_LIST
/end DAQ_EVENT

to:

/begin DAQ_EVENT VARIABLE
/end DAQ_EVENT

Nonzero FIXED_EVENT_LIST associations are unaffected.

Motivation

The A2L writer currently always emits event 0 as DEFAULT_EVENT_LIST. Some registry producers use event 0 as a fallback when they cannot reliably determine a fixed event.

In that case, presenting event 0 as the default may incorrectly suggest that it is the appropriate measurement raster. Emitting a bare VARIABLE association allows the calibration-tool user to choose the event explicitly.

The existing behavior remains the default; this option only allows callers to suppress that recommendation when the event is unknown.

Compatibility

The option defaults to true, preserving the existing A2L output.

As a writer-only setting, it is excluded from registry JSON serialization and restores the enabled default after deserialization.

Validation

  • Tested with Rust 1.90
  • cargo test -p xcp_registry --all-features
  • Test result: 8 passed, 0 failed, 1 pre-existing test ignored

@RainerZ

RainerZ commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Sorry, I just changed this as well at the moment, because it was very strange behaviour.
I removed the special treatment of event 0 completely, for now.
As a quick fix, it mc_registry writes default event instead of fixed event depending on absolute addressing mode.
As Rust xcp-lite does not use absolute addressing mode, is has no impact here. All events in Rust applications are emitted as fixed events now, as it should be.
Let me consider first, what options xcp_client offline A2L generation has, before we decide which features mc_registry might need.
Your changes are now in conflict.
Is that ok for now ?

@pamirmundt

Copy link
Copy Markdown
Author

Yes, that’s absolutely fine. Thanks for letting me know. I’ll leave the PR as it is for now while you consider it. I’ll be happy to rebase and adapt the implementation or close the PR if it’s no longer needed. Thanks again!

Sorry, I just changed this as well at the moment, because it was very strange behaviour. I removed the special treatment of event 0 completely, for now. As a quick fix, it mc_registry writes default event instead of fixed event depending on absolute addressing mode. As Rust xcp-lite does not use absolute addressing mode, is has no impact here. All events in Rust applications are emitted as fixed events now, as it should be. Let me consider first, what options xcp_client offline A2L generation has, before we decide which features mc_registry might need. Your changes are now in conflict. Is that ok for now ?

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.

2 participants