Create qbluetoothlocaldevice_winrt
In preparation for the followup patches. Change-Id: I9b1f6c181adb847f6aafdaf60fcef7139a12b638 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
This commit is contained in:
parent
b5ec1e15f3
commit
576164fef3
|
|
@ -224,7 +224,7 @@ qtConfig(bluez) {
|
|||
|
||||
SOURCES += \
|
||||
qbluetoothdevicediscoveryagent_winrt.cpp \
|
||||
qbluetoothlocaldevice_p.cpp \
|
||||
qbluetoothlocaldevice_winrt.cpp \
|
||||
qbluetoothserver_winrt.cpp \
|
||||
qbluetoothservicediscoveryagent_winrt.cpp \
|
||||
qbluetoothserviceinfo_winrt.cpp \
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ QBluetoothLocalDevice::QBluetoothLocalDevice(QObject *parent) :
|
|||
QObject(parent),
|
||||
d_ptr(new QBluetoothLocalDevicePrivate(this, QBluetoothAddress()))
|
||||
{
|
||||
#if !defined(QT_IOS_BLUETOOTH) && !defined(QT_WINRT_BLUETOOTH)
|
||||
#if !defined(QT_IOS_BLUETOOTH)
|
||||
printDummyWarning();
|
||||
#endif
|
||||
registerQBluetoothLocalDeviceMetaType();
|
||||
|
|
@ -85,11 +85,7 @@ void QBluetoothLocalDevice::setHostMode(QBluetoothLocalDevice::HostMode mode)
|
|||
|
||||
QBluetoothLocalDevice::HostMode QBluetoothLocalDevice::hostMode() const
|
||||
{
|
||||
#ifdef QT_WINRT_BLUETOOTH
|
||||
return HostConnectable;
|
||||
#else
|
||||
return HostPoweredOff;
|
||||
#endif
|
||||
}
|
||||
|
||||
QList<QBluetoothAddress> QBluetoothLocalDevice::connectedDevices() const
|
||||
|
|
@ -116,11 +112,7 @@ QBluetoothLocalDevice::Pairing QBluetoothLocalDevice::pairingStatus(
|
|||
const QBluetoothAddress &address) const
|
||||
{
|
||||
Q_UNUSED(address);
|
||||
#ifdef QT_WINRT_BLUETOOTH
|
||||
return Paired;
|
||||
#else
|
||||
return Unpaired;
|
||||
#endif
|
||||
}
|
||||
|
||||
void QBluetoothLocalDevice::pairingConfirmation(bool confirmation)
|
||||
|
|
|
|||
|
|
@ -208,7 +208,20 @@ private:
|
|||
void initializeAdapter();
|
||||
void initializeAdapterBluez5();
|
||||
};
|
||||
#elif !defined(QT_OSX_BLUETOOTH) // winrt and dummy backend
|
||||
#elif defined(QT_WINRT_BLUETOOTH)
|
||||
class QBluetoothLocalDevicePrivate : public QObject
|
||||
{
|
||||
Q_DECLARE_PUBLIC(QBluetoothLocalDevice)
|
||||
public:
|
||||
QBluetoothLocalDevicePrivate(QBluetoothLocalDevice *q,
|
||||
QBluetoothAddress = QBluetoothAddress());
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
private:
|
||||
QBluetoothLocalDevice *q_ptr;
|
||||
};
|
||||
#elif !defined(QT_OSX_BLUETOOTH) // dummy backend
|
||||
class QBluetoothLocalDevicePrivate : public QObject
|
||||
{
|
||||
public:
|
||||
|
|
@ -219,11 +232,7 @@ public:
|
|||
|
||||
bool isValid() const
|
||||
{
|
||||
#ifndef QT_WINRT_BLUETOOTH
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -0,0 +1,127 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 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 "qbluetoothlocaldevice.h"
|
||||
#include "qbluetoothaddress.h"
|
||||
|
||||
#include "qbluetoothlocaldevice_p.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QBluetoothLocalDevice::QBluetoothLocalDevice(QObject *parent) :
|
||||
QObject(parent),
|
||||
d_ptr(new QBluetoothLocalDevicePrivate(this, QBluetoothAddress()))
|
||||
{
|
||||
registerQBluetoothLocalDeviceMetaType();
|
||||
}
|
||||
|
||||
QBluetoothLocalDevice::QBluetoothLocalDevice(const QBluetoothAddress &address, QObject *parent) :
|
||||
QObject(parent),
|
||||
d_ptr(new QBluetoothLocalDevicePrivate(this, address))
|
||||
{
|
||||
registerQBluetoothLocalDeviceMetaType();
|
||||
}
|
||||
|
||||
QBluetoothLocalDevicePrivate::QBluetoothLocalDevicePrivate(QBluetoothLocalDevice *q, QBluetoothAddress)
|
||||
: q_ptr(q)
|
||||
{
|
||||
}
|
||||
|
||||
bool QBluetoothLocalDevicePrivate::isValid() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void QBluetoothLocalDevice::requestPairing(const QBluetoothAddress &address, Pairing pairing)
|
||||
{
|
||||
Q_UNUSED(address);
|
||||
Q_UNUSED(pairing);
|
||||
QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection,
|
||||
Q_ARG(QBluetoothLocalDevice::Error,
|
||||
QBluetoothLocalDevice::PairingError));
|
||||
}
|
||||
|
||||
QBluetoothLocalDevice::Pairing QBluetoothLocalDevice::pairingStatus(
|
||||
const QBluetoothAddress &address) const
|
||||
{
|
||||
Q_UNUSED(address);
|
||||
return QBluetoothLocalDevice::Unpaired;
|
||||
}
|
||||
|
||||
void QBluetoothLocalDevice::pairingConfirmation(bool confirmation)
|
||||
{
|
||||
Q_UNUSED(confirmation);
|
||||
}
|
||||
|
||||
void QBluetoothLocalDevice::setHostMode(QBluetoothLocalDevice::HostMode mode)
|
||||
{
|
||||
Q_UNUSED(mode);
|
||||
}
|
||||
|
||||
QBluetoothLocalDevice::HostMode QBluetoothLocalDevice::hostMode() const
|
||||
{
|
||||
return HostConnectable;
|
||||
}
|
||||
|
||||
QList<QBluetoothAddress> QBluetoothLocalDevice::connectedDevices() const
|
||||
{
|
||||
return QList<QBluetoothAddress>();
|
||||
}
|
||||
|
||||
void QBluetoothLocalDevice::powerOn()
|
||||
{
|
||||
}
|
||||
|
||||
QString QBluetoothLocalDevice::name() const
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
|
||||
QBluetoothAddress QBluetoothLocalDevice::address() const
|
||||
{
|
||||
return QBluetoothAddress();
|
||||
}
|
||||
|
||||
QList<QBluetoothHostInfo> QBluetoothLocalDevice::allDevices()
|
||||
{
|
||||
QList<QBluetoothHostInfo> localDevices;
|
||||
return localDevices;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
Loading…
Reference in New Issue