Skip to content

Positive response suppression is not fully checked #247

@raul-klg

Description

@raul-klg

Hi!

First of all thanks for this great piece of software.

I think I have found an incorrect behavior, but maybe I'm wrong.

Consider the following code snippet:

    with uds_client.suppress_positive_response(wait_nrc=True):
        response = uds_client.tester_present()
        assert response is None

If the ECU is correctly implemented there should not be positive response to the tester_present request. For example, this is the expected candump output:

(064.801721)  can0  0CDA1619   [3]  02 3E 80

For the above, the current udsoncan implementation is correct.

Now I am testing an incorrectly implemented ECU, and it incorrectly replies to the tester present request when positive response suppression is requested:

(104.301011)  can0  0CDA1619   [3]  02 3E 80
(000.006008)  can0  0CDA1916   [8]  02 7E 80 CC CC CC CC CC

I think udsoncan should check that when request is in suppress_positive_response context, there is no reply and should fail somehow. Currently, udsoncan tester_present call returns an empty response object but it internally does not check that the positive response is actually suppressed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions