Hi Denis,

I've already have a prototype parsing the sysfs. It has no dependencies, consists of less than 100 lines code and determines the SocketCAN interfaces, checks if an interface is virtual and if the interface is CAN FD capable.

You will be able to review it soon :)

Best regards,
Andre

Am 12.08.2016 um 07:39 schrieb Denis Shienkov:
Hi Andre,

We can try to use libudev (or to parse the sysfs entries) to find out
additional information too.
At first, we just need to check what we can take from it.

BR,
Denis

11.08.2016 16:28, André Hartmann пишет:
Hi all,

[Re-sent as I think something went wrong the first time,
the mail did not appear in the archive.]

I'm working on a new feature for QCanBus to enumerate all available
CAN interfaces and query more information about them [0].

As it turns out, the Linux SocketCAN API allows a lot, but exactly
this task is a bit complicated, see mailing list thread [1].

In this thread, Kurt Van Dijck proposed his network interface
enumeration library [2], licensed under LGPL V3, which perfectly
allows to query all SocketCAN devices.
QNetworkInterface::allInterfaces() lists them too, but there is for
now no way to find out which of them are SocketCAN interfaces.

Now I really don't know how to proceed. I already saw some libs like
pcre included in the Qt source tree, but I don't know if this is
possible with libenumif too, and which technical and legal
requirements are needed.

The same problem may occur with libsocketcan [3] which provides more
low-level function like CAN controller hardware reset. But this
library is more widely used and really stable, so dynamically loading
with QLibrary may be enough here.

Thanks for any pointers!

Best regards,
Andre

[0] https://codereview.qt-project.org/#/c/166460
[1] https://marc.info/?l=linux-can&m=147074084303882&w=2
[2] https://github.com/kurt-vd/enumif
[3] http://git.pengutronix.de/?p=tools/libsocketcan.git
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to