pylessard / python-udsoncan

Python implementation of UDS (ISO-14229) standard.
MIT License
586 stars 201 forks source link

[CANFD, IsoTPSocketConnection] How to set the link layer options to CANFD #122

Closed ziyangfu closed 2 years ago

ziyangfu commented 2 years ago

Hi We use IsoTPSocketConnection to connect underlying protocol. as we all known, the default values about link layer is CAN2.0, if we need change link layer to CANFD,whether we need add some codes in connection->IsoTPSocketConnection->open() like this: self.tpsock.set_ll_opts(CAN_FD, 64) if not necessary, we don't want to modifiy your code. Thanks.

the python_isotp manual socket.set_ll_opts(mtu=None, tx_dl=None, tx_flags=None)

pylessard commented 2 years ago

Hi, you can pass your own socket to the connection object. Make the socket by yourself and give it to the connection through the tpsock param

See https://github.com/pylessard/python-udsoncan/blob/beabbf2c1e0d5e0d0627650f02410bc0487cc2a2/udsoncan/connections.py#L250

ziyangfu commented 2 years ago

Hi, pylessard thanks for your answer,I got it.