Skip to content

Commit

Permalink
Handle real CAN devices in the Linux driver
Browse files Browse the repository at this point in the history
  • Loading branch information
hshakula committed Oct 6, 2024
1 parent 6f74bc6 commit d87b7b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/linux/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ int16_t LinuxCANInit(LinuxCANInstance* out_ins, const char* can_iface_name)
{
out_ins->socketcan = NULL;
out_ins->mcast = NULL;
if (strncmp(can_iface_name, "vcan", 4) == 0) {
if (strncmp(can_iface_name, "vcan", 4) == 0 ||
strncmp(can_iface_name, "can", 3) == 0) {
out_ins->socketcan = (SocketCANInstance *)calloc(1, sizeof(SocketCANInstance));
if (out_ins->socketcan == NULL) {
return -ENOMEM;
Expand Down

0 comments on commit d87b7b4

Please sign in to comment.