pylessard / python-can-isotp

A Python package that provides support for ISO-TP (ISO-15765) protocol
MIT License
262 stars 81 forks source link

How do I fill in padding byte in Flow Control messages? #98

Closed dhje0ng closed 1 year ago

dhje0ng commented 1 year ago
flowcontrol.write() got an unexpected keyword argument 'txpad'

It says that the txpad param is not available.

The CAN devices I test always use a DLC length of 8 bytes with the CAN messages with a DLC length of 8 bytes, so the Flow control must also contain a padding byte where XX is 30 00 05 XX XX XX XX XX XX to get a positive response.

Otherwise, it will send a flow control message and not response.

How can you help me?

pylessard commented 1 year ago

I understand that you are configuring a socket. txpad is a general option and should apply to all messages that goes out of that socket. Is that an issue?

dhje0ng commented 1 year ago

No, this was a mistake on my part and

s = isotp.socket(3)
s.set_opts(txpad=8)
s.set_fc_opts(stmin=5, bs=30)

This can be solved as follows Thanks for your answer I will close the issue.