Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qbluetoothserver_p.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
7#ifndef QT_IOS_BLUETOOTH
8#include "dummy/dummy_helper_p.h"
9#endif
10
12
13QBluetoothServerPrivate::QBluetoothServerPrivate(QBluetoothServiceInfo::Protocol sType,
14 QBluetoothServer *parent)
15 : serverType(sType),
16 q_ptr(parent)
17{
18#ifndef QT_IOS_BLUETOOTH
19 printDummyWarning();
20#endif
21 if (sType == QBluetoothServiceInfo::RfcommProtocol)
22 socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol);
23 else
24 socket = new QBluetoothSocket(QBluetoothServiceInfo::L2capProtocol);
25}
26
28{
29 delete socket;
30}
31
32void QBluetoothServer::close()
33{
34}
35
36bool QBluetoothServer::listen(const QBluetoothAddress &address, quint16 port)
37{
38 Q_UNUSED(address);
39 Q_UNUSED(port);
40 Q_D(QBluetoothServer);
41 d->m_lastError = UnsupportedProtocolError;
42 emit errorOccurred(d->m_lastError);
43 return false;
44}
45
46void QBluetoothServer::setMaxPendingConnections(int numConnections)
47{
48 Q_UNUSED(numConnections);
49}
50
51bool QBluetoothServer::hasPendingConnections() const
52{
53 return false;
54}
55
56QBluetoothSocket *QBluetoothServer::nextPendingConnection()
57{
58 return nullptr;
59}
60
61QBluetoothAddress QBluetoothServer::serverAddress() const
62{
63 return QBluetoothAddress();
64}
65
66quint16 QBluetoothServer::serverPort() const
67{
68 return 0;
69}
70
71void QBluetoothServer::setSecurityFlags(QBluetooth::SecurityFlags security)
72{
73 Q_UNUSED(security);
74}
75
76QBluetooth::SecurityFlags QBluetoothServer::securityFlags() const
77{
78 return QBluetooth::Security::NoSecurity;
79}
80
81QT_END_NAMESPACE
QBluetoothSocket * socket