-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bind() must be called before using the socket #156
Comments
you can also do with IsoTPSocketConnection('canfd0', rxid=0x12, txid=0x23) as conn:
conn.send(bytes([1,2,3])) |
@pylessard Thanks for the answer, but getting nearly the same error with your exampe:
|
You are right. The connection can'T be used in a with statement. My bad. |
Juhuuuu... calling open() works! One more question:
How can I switch to 29Bit Identifiers? |
It's possible. There's a small caveat. IsotpSocketConnection is the first conenction I wrote and the codebase has evolved and now I don't want to break previous interfaces.. The actual constructor won't let you do this cleanly.
For something cleaner, you can create the socket yourself and use a SocketConnection form udsoncan.connections import SocketConnection
import isotp
address = isotp.Address(isotp.AddressingMode.Normal_29bits, rxid=0x123456, txid=0x789ABC)
sock = isotp.socket()
sock.bind(address)
conn = SocketConnection(sock) |
Thank you very much. Your example works with Ext-IDs! |
Hi,
I am trying a very simple example:
but I get the following error:
Can someone help. What am I doing wrong?
The text was updated successfully, but these errors were encountered: