IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Qt Serial Bus

Provides an API to access various serial bus devices.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Qt Serial Bus

The Qt Serial Bus API provides classes and functions to access the various industrial serial buses and protocols, such as CAN, ModBus, and others.

Getting Started

To include the definitions of the module's classes and functions, use the following directive:

 
Sélectionnez
#include <QtSerialBus>

To link against the module, add this line to your qmake .pro file:

 
Sélectionnez
QT += serialbus

Supported Buses and Protocols

API Reference

These are links to the API reference materials.

Logging Categories

The QtSerialBus module exports the following logging categories:

Logging Category

Description

qt.canbus

Enables standard logging inside the Qt CAN Bus classes

qt.canbus.plugins

Enables low level logging inside the Qt CAN Bus plugin classes. To set logging for a specific plugin, use "qt.canbus.plugins.pluginname". e.g. "qt.canbus.plugins.socketcan". "qt.canbus.plugins*" affects all plugins.

qt.modbus

Enables standard logging inside the Qt Modbus classes

qt.modbus.lowlevel

Enables low level logging including individual packet content inside the Qt Modbus classes

Logging categories can be used to enable additional warning and debug output for QtSerialBus. More detailed information about logging can be found in QLoggingCategory.

A quick way to enable all Qt Modbus logging is to add the following line to the main() function:

 
Sélectionnez
QLoggingCategory::setFilterRules(QStringLiteral("qt.modbus* = true"));

Examples

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+