/* Initializes the CAN interface. Note that this module assumes that the CAN device was already properly configured and brought online on the Linux system. Terminal command "ip addr" can be used to verify this.  */
static void SocketCanInit(tCanSettings const *settings)
/* Initializes the CAN interface. Note that this module assumes that the CAN device was already properly configured and brought online on the Linux system. Terminal command "ip addr" can be used to verify this.  */
static void SocketCanInit(tCanSettings const *settings)
{
  char * canDeviceName;
  socketCanEventsList = NULL;
  socketCanEventsEntries = 0;
  socketCanErrorDetected = false;
  socketCanSettings.devicename = "";
  socketCanSettings.channel = 0;
  socketCanSettings.baudrate = CAN_BR500K;
  socketCanSettings.code = 0x00000000u;
  socketCanSettings.mask = 0x00000000u;
  UtilCriticalSectionInit();
  assert(settings != NULL);
  if (settings != NULL)
  {
    socketCanSettings = *settings;
    assert(settings->devicename != NULL);
    if (settings->devicename != NULL)
    {
      canDeviceName = malloc(strlen(settings->devicename) + 1);
      assert(canDeviceName != NULL);
      if (canDeviceName != NULL)
      {
        strcpy(canDeviceName, settings->devicename);
        socketCanSettings.devicename = canDeviceName;
      }
    }
  }
}