CAN communication using C code

I have successfully used CAN to control my motor controller using cansend and candump in the terminal. For my application I need to use C to control the motor driver with CAN and was wondering how to do that seeing as there is not much resources out there doing this with a jetson. I am trying to use socketCAN but that doesn’t seem to work.

hello bottomsjeremy,

please refer to developer guide, CAN (Controller Area Network) for setting-up.
please also refer to kernel documentation for the details of using socketCAN.
for example, $L4T_Sources/r32.5/Linux_for_Tegra/source/public/kernel/kernel-4.9/Documentation/networking/can.txt
thanks

Thank you, socketCAN is the solution, I just had an error in my code was the problem. This link is something that helped me: https://www.beyondlogic.org/example-c-socketcan-code/

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.