Skip to content

support loading files that specify SUB-COMPONENT-PARAM-CONNECTORs referencing SINGLE-ECU-JOBs#452

Merged
andlaus merged 4 commits intomercedes-benz:mainfrom
andlaus:sub-component-param-connectors_with_single-ecu-jobs
Mar 6, 2026
Merged

support loading files that specify SUB-COMPONENT-PARAM-CONNECTORs referencing SINGLE-ECU-JOBs#452
andlaus merged 4 commits intomercedes-benz:mainfrom
andlaus:sub-component-param-connectors_with_single-ecu-jobs

Conversation

@andlaus
Copy link
Member

@andlaus andlaus commented Mar 6, 2026

When I originally wrote this code, I thought only DIAG-SERVICES would make sense, but I recently stumbled over a file which references a SINGLE-ECU-JOB...

…eferencing `SINGLE-ECU-JOB`s

When I originally wrote this, I thought only DIAG-SERVICES would make
sense, but I recently stumbled over a file which references a
SINGLE-ECU-JOB...

Signed-off-by: Andreas Lauser <andreas.lauser@mercedes-benz.com>
Approved-by: Christian Hackenbeck <christian.hackenbeck@mercedes-benz.com>
@andlaus andlaus requested a review from kayoub5 March 6, 2026 11:50
andlaus added 2 commits March 6, 2026 12:56
the category for untyped decorators went from [misc] to [untyped-decorators]...

Signed-off-by: Andreas Lauser <andreas.lauser@mercedes-benz.com>
…ed finding

Signed-off-by: Andreas Lauser <andreas.lauser@mercedes-benz.com>

def _resolve_snrefs(self, context: SnRefContext) -> None:
service = resolve_snref(
diagComm = resolve_snref(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
diagComm = resolve_snref(
diag_comm = resolve_snref(

Copy link
Member Author

Choose a reason for hiding this comment

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

oops. right, I must have been sleepwalking. fixed, thanks: c4072de

self._diagComm = diagComm

if isinstance(diagComm, DiagService):
if not diagComm.positive_responses:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not possible to have negative response?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure, IIRC the spec is pretty vague here (it seems to expect that there is the response). I suppose we should burn that bridge when someone comes to it...

# associated with it and each of these has its own set of
# parameters. In the meantime, we simply use the first
# positive response specified.
response = diagComm.positive_responses[0]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why only the first response ?

Copy link
Member Author

Choose a reason for hiding this comment

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

see above (IIRC the spec just says "response", so any possible response ought to do?)

Copy link
Member Author

Choose a reason for hiding this comment

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

(actually, it does not even say "response" or "request", but only "input and output parameter IFs". since for DIAG-SERVICEs input parameters are attached to requests (I assume) and output parameters to responses, I guess that the current solution is as compliant as any other incompatible interpretation ;))

Copy link
Collaborator

Choose a reason for hiding this comment

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

if it does not says "response", then all responses shall be checked, not only the first one.

Copy link
Member Author

Choose a reason for hiding this comment

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

section 7.9.5 can also be interpreted that mixing parameters from multiple response objects is possible, but it does not make much sense IMO: I am pretty sure that approximately 100% (rounded to the closest percent) of all people who use/have specified that feature expect the parameters of the first (only?) positive response. As said: once we get a bug report about this, I'm willing to put in the work to fix it, but before I cannot really come up with a way of verifying that it works...

snake_case, not camelCase.

thanks to [at]kayoub5 for the catch!

Signed-off-by: Andreas Lauser <andreas.lauser@mercedes-benz.com>
@andlaus
Copy link
Member Author

andlaus commented Mar 6, 2026

BTW: the reason why I originally assumed that only services can be referenced here is that the spec says "A SUB-COMPONENT-PARAM-CONNECTOR allows referring to a service and optionally to one or more IN- and OUT-PARAM-IFs." (section 7.9.5)

@andlaus andlaus merged commit 79e8261 into mercedes-benz:main Mar 6, 2026
7 checks passed
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