Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qbluetoothserver.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// Copyright (C) 2016 BlackBerry Limited. All rights reserved.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QBLUETOOTHSERVER_H
6#define QBLUETOOTHSERVER_H
7
8#include <QtBluetooth/qtbluetoothglobal.h>
9
10#include <QtCore/QObject>
11
12#include <QtBluetooth/QBluetoothAddress>
13#include <QtBluetooth/qbluetooth.h>
14#include <QtBluetooth/QBluetoothSocket>
15#include <QtBluetooth/QBluetoothServiceInfo>
16
18
21
22class Q_BLUETOOTH_EXPORT QBluetoothServer : public QObject
23{
25
26public:
37
38 explicit QBluetoothServer(QBluetoothServiceInfo::Protocol serverType, QObject *parent = nullptr);
40
41 void close();
42
44 [[nodiscard]] QBluetoothServiceInfo listen(const QBluetoothUuid &uuid,
45 const QString &serviceName = QString());
46 bool isListening() const;
47
48 void setMaxPendingConnections(int numConnections);
49 int maxPendingConnections() const;
50
51 bool hasPendingConnections() const;
52 QBluetoothSocket *nextPendingConnection();
53
54 QBluetoothAddress serverAddress() const;
55 quint16 serverPort() const;
56
57 void setSecurityFlags(QBluetooth::SecurityFlags security);
58 QBluetooth::SecurityFlags securityFlags() const;
59
60 QBluetoothServiceInfo::Protocol serverType() const;
61
62 Error error() const;
63
67
68protected:
70
71private:
72 Q_DECLARE_PRIVATE(QBluetoothServer)
73};
74
76
77#endif
\inmodule QtBluetooth
\inmodule QtBluetooth
Error
This enum describes Bluetooth server error types.
QBluetoothServerPrivate * d_ptr
void errorOccurred(QBluetoothServer::Error error)
This signal is emitted when an error occurs.
void newConnection()
This signal is emitted when a new connection is available.
\inmodule QtBluetooth
Protocol
This enum describes the socket protocol used by the service.
\inmodule QtBluetooth
\inmodule QtBluetooth
\inmodule QtCore
Definition qobject.h:103
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
EGLOutputPortEXT port
GLuint GLuint64EXT address
#define Q_ENUM(x)
#define Q_OBJECT
#define Q_SIGNALS
unsigned short quint16
Definition qtypes.h:48
socketLayer listen()