1
votes

I know that if there is an error in a CAN transmission, the system will generate a particular error frame. But I can't figure how to make this working.

I set up my CAN socket, and then I write data:

write(s, (struct sockaddr *)&addr, sizeof(addr))

There is nothing connected on the bus, so I would expect a CAN_ERR_ACK, but nothing arrive.

PS: error receiving is enabled.

What's wrong?

1

1 Answers

0
votes

You might have to enable error receiving

can_err_mask_t err_mask = CAN_ERR_ACK ;
setsockopt(skt, SOL_CAN_RAW, CAN_RAW_ERR_FILTER,&err_mask, sizeof(err_mask));