Userspace USB driver for CAN to USB adaptors - based on the Kvaser canlib API
This project is maintained by aph-le
Version 0.0.1
User-space driver for OSX using IOKitLib and IOUSBLib CAN to USB Adapters using the Kvaser canlib API. Based on Kvaser canlib linux driver.
Please refer to the Kvaser canlib documentation.
void simpleSend(void)
{
CanHandle hdl;
int channel = 0;
int bitrate = canBITRATE_125K;
canInitializeLibrary();
hdl = canOpenChannel(channel, canOPEN_EXCLUSIVE | canOPEN_REQUIRE_EXTENDED);
canBusOff(hdl);
canSetBusParams(hdl, bitrate, 10, 5, 1, 1, 0);
canBusOn(hdl);
canWrite(hdl, 0x123, "can4osx", 8, 0);
canBusOff(hdl);
}