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
qbluetoothsocket_bluezdbus_p.h
Go to the documentation of this file.
1// Copyright (C) 2018 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 QBLUETOOTHSOCKET_BLUEZDBUS_H
5#define QBLUETOOTHSOCKET_BLUEZDBUS_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
19
20#include <QtDBus/qdbusunixfiledescriptor.h>
21
22#include <QtNetwork/qlocalsocket.h>
23#include <QDBusPendingCallWatcher>
24
26
28
29class QLocalSocket;
31
33{
35
36public:
39
42 QIODevice::OpenMode openMode) override;
44 const QBluetoothUuid &uuid,
45 QIODevice::OpenMode openMode);
46
47 void connectToService(const QBluetoothServiceInfo &service,
48 QIODevice::OpenMode openMode) override;
50 QIODevice::OpenMode openMode) override;
52 QIODevice::OpenMode openMode) override;
53
55
56 QString localName() const override;
57 QBluetoothAddress localAddress() const override;
58 quint16 localPort() const override;
59
60 QString peerName() const override;
61 QBluetoothAddress peerAddress() const override;
62 quint16 peerPort() const override;
63
64 void abort() override;
65 void close() override;
66
67 qint64 writeData(const char *data, qint64 maxSize) override;
68 qint64 readData(char *data, qint64 maxSize) override;
69
72 QBluetoothSocket::OpenMode openMode = QBluetoothSocket::ReadWrite) override;
73
74 qint64 bytesAvailable() const override;
75 bool canReadLine() const override;
76 qint64 bytesToWrite() const override;
77
78public slots:
80
81private:
82 void remoteConnected(const QDBusUnixFileDescriptor &fd);
83 void socketStateChanged(QLocalSocket::LocalSocketState newState);
84
85 void clearSocket();
86
87private:
88 OrgBluezProfileManager1Interface *profileManager = nullptr;
89 OrgBluezProfile1ContextInterface *profileContext = nullptr;
90 QString remoteDevicePath;
91 QString profileUuid;
92 QString profilePath;
93 QLocalSocket *localSocket = nullptr;
94};
95
97
98#endif // QBLUETOOTHSOCKET_BLUEZDBUS_H
\inmodule QtBluetooth
\inmodule QtBluetooth
Protocol
This enum describes the socket protocol used by the service.
QBluetoothSocket::OpenMode openMode
QBluetoothServiceInfo::Protocol socketType
void connectToService(const QBluetoothServiceInfo &service, QIODevice::OpenMode openMode) override
void connectToServiceHelper(const QBluetoothAddress &address, quint16 port, QIODevice::OpenMode openMode) override
QBluetoothAddress peerAddress() const override
QBluetoothAddress localAddress() const override
qint64 writeData(const char *data, qint64 maxSize) override
bool setSocketDescriptor(int socketDescriptor, QBluetoothServiceInfo::Protocol socketType, QBluetoothSocket::SocketState socketState=QBluetoothSocket::SocketState::ConnectedState, QBluetoothSocket::OpenMode openMode=QBluetoothSocket::ReadWrite) override
void connectToServiceReplyHandler(QDBusPendingCallWatcher *)
bool ensureNativeSocket(QBluetoothServiceInfo::Protocol type) override
SocketState
This enum describes the state of the Bluetooth socket.
\inmodule QtBluetooth
The QLocalSocket class provides a local socket.
LocalSocketState
This enum describes the different states in which a socket can be.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
void newState(QList< State > &states, const char *token, const char *lexem, bool pre)
Combined button and popup list for selecting options.
EGLOutputPortEXT port
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum type
GLuint64 GLenum GLint fd
GLuint GLuint64EXT address
#define Q_OBJECT
#define slots
unsigned short quint16
Definition qtypes.h:48
long long qint64
Definition qtypes.h:60
QByteArray readData()