support loading files that specify SUB-COMPONENT-PARAM-CONNECTORs referencing SINGLE-ECU-JOBs#452
Conversation
…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>
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( |
There was a problem hiding this comment.
| diagComm = resolve_snref( | |
| diag_comm = resolve_snref( |
There was a problem hiding this comment.
oops. right, I must have been sleepwalking. fixed, thanks: c4072de
| self._diagComm = diagComm | ||
|
|
||
| if isinstance(diagComm, DiagService): | ||
| if not diagComm.positive_responses: |
There was a problem hiding this comment.
Not possible to have negative response?
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
Why only the first response ?
There was a problem hiding this comment.
see above (IIRC the spec just says "response", so any possible response ought to do?)
There was a problem hiding this comment.
(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 ;))
There was a problem hiding this comment.
if it does not says "response", then all responses shall be checked, not only the first one.
There was a problem hiding this comment.
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>
|
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) |
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...