Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-75204

Please add a possibility to specify the socket family used by the socketcan plugin for QCanBus

    XMLWordPrintable

Details

    • Linux/Wayland, Linux/X11, Linux/Other display system
    • 9f5b8ba590d424f82498fca5f2cc8594b1757ff0 (qt/qtserialbus/dev)

    Description

      The socketcanbackend.cpp opens the socket hardcoded:

      if (Q_UNLIKELY((canSocket = socket(PF_CAN, SOCK_RAW | SOCK_NONBLOCK, CAN_RAW)) < 0)) {
        setError(qt_error_string(errno), QCanBusDevice::CanBusError::ConnectionError);
        return false;
      }
      

      Now what if you have a device that does not use CAN_RAW as the family. But instead uses a different implementation defined by the hardware vendor?

      In my case, I have to pass "7" instead of whatever value CAN_RAW has, to get socketcan working on my device.

      Probably the socketcan plugin can get made configurable so that you can pass an arbitrary value here?
       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            aha_1980 André Hartmann
            darkmattercoder Jochen Bauer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes