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
qbluetoothsocket_ohos_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 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_OHOS_P_H
5#define QBLUETOOTHSOCKET_OHOS_P_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#include <QtBluetooth/qbluetoothsocket.h>
18#include <QtBluetooth/private/qbluetoothsocketbase_p.h>
19#include <QtBluetooth/private/qohosbluetoothsocket_p.h>
20
21#include <QtCore/qtconfigmacros.h>
22#include <QtCore/qtypes.h>
23
24QT_BEGIN_NAMESPACE
25
26class QBluetoothSocketPrivateOhos final : public QBluetoothSocketBasePrivate
27{
28public:
29 QBluetoothSocketPrivateOhos();
30 ~QBluetoothSocketPrivateOhos() override;
31
32 void connectToServiceHelper(
33 const QBluetoothAddress &address, const QBluetoothUuid &uuid,
34 QIODevice::OpenMode openMode) override;
35
36 void connectToService(const QBluetoothServiceInfo &service, QIODevice::OpenMode openMode) override;
37 void connectToService(
38 const QBluetoothAddress &address, const QBluetoothUuid &uuid,
39 QIODevice::OpenMode openMode) override;
40 void connectToService(
41 const QBluetoothAddress &address, quint16 port, QIODevice::OpenMode openMode) override;
42
43 bool ensureNativeSocket(QBluetoothServiceInfo::Protocol type) override;
44
45 QString localName() const override;
46 QBluetoothAddress localAddress() const override;
47 quint16 localPort() const override;
48
49 QString peerName() const override;
50 QBluetoothAddress peerAddress() const override;
51 quint16 peerPort() const override;
52
53 void abort() override;
54 void close() override;
55
56 qint64 writeData(const char *data, qint64 maxSize) override;
57 qint64 readData(char *data, qint64 maxSize) override;
58
59 bool setSocketDescriptor(
60 int socketDescriptor, QBluetoothServiceInfo::Protocol type,
61 QBluetoothSocket::SocketState socketState = QBluetoothSocket::SocketState::ConnectedState,
62 QBluetoothSocket::OpenMode openMode = QBluetoothSocket::ReadWrite) override;
63
64 qint64 bytesAvailable() const override;
65 bool canReadLine() const override;
66 qint64 bytesToWrite() const override;
67
68private:
69 void onProxyError(QtOhosBluetooth::QOhosBluetoothErrorCode errorCode);
70 void onProxyDisconnected();
71
72 QtOhosBluetooth::QOhosBluetoothSocketProxy m_bluetoothSocketProxy;
73};
74
75QT_END_NAMESPACE
76
77#endif // QBLUETOOTHSOCKET_OHOS_P_H