Skip to content

Instantly share code, notes, and snippets.

@andre-hartmann
Created September 29, 2018 10:35
Show Gist options
  • Save andre-hartmann/069f682d5bd78a28adddcd545007856a to your computer and use it in GitHub Desktop.
Save andre-hartmann/069f682d5bd78a28adddcd545007856a to your computer and use it in GitHub Desktop.
#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