Closed prasadghole closed 1 year ago
Yes I tried and it work. But I am still using python-can
as I am not able to use functional address. Hence for tester present I am sending my own message instead of using TesterPresent API.
Functional addressing is handled by the transport layer, not the UDS module. What are you using as the transport layer?
I am using PythonIsoTpConnection
as a transport layer.
I see. PythonIsoTpConnection
is the glue code for the python-can-isotp
package TransportLayer
object.
You can achieve what you want to do, maybe not the cleanest solution, but will work. See this parameter :
https://can-isotp.readthedocs.io/en/latest/isotp/implementation.html#default_target_address_type
isotp_layer = isotp.TransportLayer(...)
conn = PythonIsoTpConnection(isotp_layer)
with Client(conn) as client:
with client.suppress_positive_response:
isotp_layer.params.set('default_target_address_type', isotp.address.TargetAddressType.Functional)
client.tester_present()
isotp_layer.params.set('default_target_address_type', isotp.address.TargetAddressType.Physical)
Current source code always expect response for Tester Present. In most of cases for saving bandwidth of CAN bus by default it should suppress the response. I suggest adding parameters to Tester Present API so that we should able to suppress the Tester Present response.