Created
September 29, 2018 10:35
-
-
Save andre-hartmann/069f682d5bd78a28adddcd545007856a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QCanBus> | |
#include <QCoreApplication> | |
#include <QDebug> | |
int main(int argc, char *argv[]) | |
{ | |
const QStringList plugins = QCanBus::instance()->plugins(); | |
for (auto plugin : plugins) { | |
QString errorString; | |
const QList<QCanBusDeviceInfo> devices = QCanBus::instance()->availableDevices( | |
plugin, &errorString); | |
if (!errorString.isEmpty()) | |
qDebug() << plugin << errorString; | |
for (auto device : devices) | |
qDebug() << plugin << device.name(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment