What is the correct function commands to open a socket , enable canfd frames and bind to the interface .The socket should receive bit rate switchcing frames. ip link set can0 up type can bitrate 500000 dbitrate 2000000 fd on //This is the command i use to enable can interface
Currently i am using :
socket(PF_CAN, SOCK_RAW ,CAN_RAW);
setsockopt(sock,SOL_CAN_RAW,CAN_RAW_FD_FRAMES,&enable_canfd,sizeof(enable_canfd)); setsockopt is giving me error code 22 (EINVAL).
what are the correct arguements for : socket(); setsockopt();