> > I was going to propose another global CAN change, removing the 1000 > > factor from bitrate thus making bitrate calls use units in Hz instead > > of kHz, so we can discuss that and (if agreed) I make the change on > > the same PR to avoid creating so a tiny one.
> What's the unit used on Linux? we need to align the interface with Linux. Units in linux are Hz, according to https://docs.kernel.org/networking/can.html#the-can-network-device-driver-interface One problem with using kHz is Single Wire Can (SAE J2411) uses bitrates of 33333 bps (83333 bps in high speed mode) so representing this in kbps causes a timing error which can be significant in some cases. The change would require modifying arbi_bitrate and data_bitrate fields on struct can_ioctl_data_s from uint16_t to uint32_t, otherwise usual bitrates cannot be represented. Carlos