QCanBus Class
The QCanBus class handles registration and creation of bus backends. More...
Header: | #include <QCanBus> |
qmake: | QT += serialbus |
Since: | Qt 5.6 |
Public Functions
QCanBusDevice * | createDevice(const QByteArray &plugin, const QString &interfaceName) const |
QList<QByteArray> | plugins() const |
Static Public Members
QCanBus * | instance() |
Detailed Description
The QCanBus class handles registration and creation of bus backends.
QCanBus loads Qt CAN Bus plugins at runtime. The ownership of serial bus backends is transferred to the loader.
Member Function Documentation
QCanBusDevice *QCanBus::createDevice(const QByteArray &plugin, const QString &interfaceName) const
Creates a CAN bus device. plugin is the name of the plugin as returned by the plugins() method. interfaceName is the CAN bus interface name.
Ownership of the returned backend is transferred to the caller. Returns null
if no suitable device can be found.
[static]
QCanBus *QCanBus::instance()
Returns a pointer to the QCanBus class. The object is loaded if necessary. QCanBus uses the singleton design pattern.
QList<QByteArray> QCanBus::plugins() const
Returns a list of identifiers for all loaded plugins.