From 28eeb7afc27e99deeb52eefe10cdd458c7621698 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Wed, 18 Jul 2018 11:03:53 +0200 Subject: Add runtime polymorphism for QBluetoothSocketPrivate This patch introduces a generic interface towards QBluetoothSocketPrivate. Later on, the QBluetoothSocketPrivate class will be split into platform specific overloads/interfaces. Ultimately, this will be needed to support runtime selection of the QBluetootSocket d-pointer on Linux. The Linux Bluez5 implementation is significantly different from the Bluez4 (raw socket) implementation. Since recent Bluez5 releases the raw socket implementation is no longer functional and/or the user has to have root permission and enable bluetooth --compat mode. Therefore a second QBluetoothSocket for the dbus socket API is needed. QBLuetoothSocket has to choose at runtime (during its instanciation) which implementation to use. Task-number: QTBUG-68550 Change-Id: I5d0b8e24b8acd1b149b897f52f0d82eade7f3823 Reviewed-by: Oliver Wolff Reviewed-by: Timur Pocheptsov Reviewed-by: Lubomir I. Ivanov --- src/bluetooth/qbluetoothsocketbase.cpp | 54 ++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/bluetooth/qbluetoothsocketbase.cpp (limited to 'src/bluetooth/qbluetoothsocketbase.cpp') diff --git a/src/bluetooth/qbluetoothsocketbase.cpp b/src/bluetooth/qbluetoothsocketbase.cpp new file mode 100644 index 00000000..8401a1c3 --- /dev/null +++ b/src/bluetooth/qbluetoothsocketbase.cpp @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtBluetooth module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qbluetoothsocketbase_p.h" + +QT_BEGIN_NAMESPACE + +QBluetoothSocketBasePrivate::QBluetoothSocketBasePrivate(QObject *parent) : QObject(parent) +{ + +} + +QBluetoothSocketBasePrivate::~QBluetoothSocketBasePrivate() +{ + +} + +QT_END_NAMESPACE -- cgit v1.2.1