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
serveracceptancethread_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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
4#ifndef SERVERACCEPTANCETHREAD_H
5#define SERVERACCEPTANCETHREAD_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/QMutex>
19#include <QtCore/QJniObject>
20#include <QtBluetooth/QBluetoothServer>
21#include <QtBluetooth/QBluetoothUuid>
22#include "qbluetooth.h"
23#include "private/qglobal_p.h"
24
26
28{
30public:
31 explicit ServerAcceptanceThread(QObject *parent = nullptr);
33 void setServiceDetails(const QBluetoothUuid &uuid, const QString &serviceName,
34 QBluetooth::SecurityFlags securityFlags);
35
36
37 bool hasPendingConnections() const;
39 void setMaxPendingConnections(int maximumCount);
40
41 void javaThreadErrorOccurred(int errorCode);
42 void javaNewSocket(jobject socket);
43
44 void run();
45 void stop();
46 bool isRunning() const;
47
51
52private:
53 bool validSetup() const;
54 void shutdownPendingConnections();
55
56 QList<QJniObject> pendingSockets;
57 mutable QMutex m_mutex;
58 QString m_serviceName;
59 QBluetoothUuid m_uuid;
60 int maxPendingConnections;
61 QBluetooth::SecurityFlags secFlags;
62
63 QJniObject javaThread;
64
65};
66
68
69#endif // SERVERACCEPTANCETHREAD_H
Error
This enum describes Bluetooth server error types.
\inmodule QtBluetooth
\inmodule QtCore
\inmodule QtCore
Definition qmutex.h:281
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
ServerAcceptanceThread(QObject *parent=nullptr)
void setServiceDetails(const QBluetoothUuid &uuid, const QString &serviceName, QBluetooth::SecurityFlags securityFlags)
void errorOccurred(QBluetoothServer::Error)
void javaNewSocket(jobject socket)
void javaThreadErrorOccurred(int errorCode)
void setMaxPendingConnections(int maximumCount)
Combined button and popup list for selecting options.
#define Q_OBJECT
#define signals
QTcpSocket * socket
[1]