diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-11-20 13:49:33 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-11-20 13:49:33 +0100 |
commit | fbfc5d7877fa22365484c6e951e60f37b9aaa2a5 (patch) | |
tree | 1018a5e53ae1decc64fda181a9ed714198adf07a | |
parent | 17ecdc048f33289b28777efe93f18a2e48667696 (diff) | |
parent | 50e4edb4b23947f9fcdb99ea0101660f0752cc1f (diff) |
Merge 5.10 into 5.10.0
Change-Id: I39fdb7d6cb58785adabd993c78e8c1f7e46e26cf
-rw-r--r-- | examples/serialbus/can/sendframebox.cpp | 14 | ||||
-rw-r--r-- | examples/serialbus/can/sendframebox.h | 14 | ||||
-rw-r--r-- | src/serialbus/qcanbus.cpp | 19 |
3 files changed, 41 insertions, 6 deletions
diff --git a/examples/serialbus/can/sendframebox.cpp b/examples/serialbus/can/sendframebox.cpp index d7a25ba..117ff10 100644 --- a/examples/serialbus/can/sendframebox.cpp +++ b/examples/serialbus/can/sendframebox.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** ** Copyright (C) 2017 Andre Hartmann <aha_1980@gmx.de> -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the QtSerialBus module. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/serialbus/can/sendframebox.h b/examples/serialbus/can/sendframebox.h index 465ba02..e8459c5 100644 --- a/examples/serialbus/can/sendframebox.h +++ b/examples/serialbus/can/sendframebox.h @@ -1,12 +1,22 @@ /**************************************************************************** ** ** Copyright (C) 2017 Andre Hartmann <aha_1980@gmx.de> -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the QtSerialBus module. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/serialbus/qcanbus.cpp b/src/serialbus/qcanbus.cpp index 6b74bd7..5c1ddc8 100644 --- a/src/serialbus/qcanbus.cpp +++ b/src/serialbus/qcanbus.cpp @@ -147,6 +147,17 @@ static QObject *canBusFactory(const QString &plugin, QString *errorMessage) \note Some plugins might not or only partially support this function. + For example, the following call returns a list of all available SocketCAN + interfaces (which can be used for \l createDevice()): + + \code + QString errorString; + const QList<QCanBusDeviceInfo> devices = QCanBus::instance()->availableDevices( + QStringLiteral("socketcan"), &errorString); + if (!errorString.isEmpty()) + qDebug() << errorString; + \endcode + \sa createDevice() */ QList<QCanBusDeviceInfo> QCanBus::availableDevices(const QString &plugin, QString *errorMessage) const @@ -180,9 +191,13 @@ QList<QCanBusDeviceInfo> QCanBus::availableDevices(const QString &plugin, QStrin For example, the following call would connect to the SocketCAN interface vcan0: \code + QString errorString; QCanBusDevice *device = QCanBus::instance()->createDevice( - QStringLiteral("socketcan"), QStringLiteral("vcan0")); - device->connectDevice(); + QStringLiteral("socketcan"), QStringLiteral("vcan0"), &errorString); + if (!device) + qDebug() << errorString; + else + device->connectDevice(); \endcode \note The \a interfaceName is plugin-dependent. See the corresponding plugin documentation |