| 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_BLUEZ_H |
| 5 | #define QBLUETOOTHSOCKET_BLUEZ_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 "qbluetoothsocketbase_p.h" |
| 19 | |
| 20 | QT_BEGIN_NAMESPACE |
| 21 | |
| 22 | class QBluetoothSocketPrivateBluez final: public QBluetoothSocketBasePrivate |
| 23 | { |
| 24 | Q_OBJECT |
| 25 | |
| 26 | public: |
| 27 | QBluetoothSocketPrivateBluez(); |
| 28 | ~QBluetoothSocketPrivateBluez() override; |
| 29 | |
| 30 | void connectToServiceHelper(const QBluetoothAddress &address, |
| 31 | quint16 port, |
| 32 | QIODevice::OpenMode openMode) override; |
| 33 | |
| 34 | void connectToService(const QBluetoothServiceInfo &service, |
| 35 | QIODevice::OpenMode openMode) override; |
| 36 | void connectToService(const QBluetoothAddress &address, const QBluetoothUuid &uuid, |
| 37 | QIODevice::OpenMode openMode) override; |
| 38 | void connectToService(const QBluetoothAddress &address, quint16 port, |
| 39 | QIODevice::OpenMode openMode) override; |
| 40 | |
| 41 | bool ensureNativeSocket(QBluetoothServiceInfo::Protocol type) override; |
| 42 | |
| 43 | QString localName() const override; |
| 44 | QBluetoothAddress localAddress() const override; |
| 45 | quint16 localPort() const override; |
| 46 | |
| 47 | QString peerName() const override; |
| 48 | QBluetoothAddress peerAddress() const override; |
| 49 | quint16 peerPort() const override; |
| 50 | |
| 51 | void abort() override; |
| 52 | void close() override; |
| 53 | |
| 54 | qint64 writeData(const char *data, qint64 maxSize) override; |
| 55 | qint64 readData(char *data, qint64 maxSize) override; |
| 56 | |
| 57 | bool setSocketDescriptor(int socketDescriptor, QBluetoothServiceInfo::Protocol socketType, |
| 58 | QBluetoothSocket::SocketState socketState = QBluetoothSocket::SocketState::ConnectedState, |
| 59 | QBluetoothSocket::OpenMode openMode = QBluetoothSocket::ReadWrite) override; |
| 60 | |
| 61 | qint64 bytesAvailable() const override; |
| 62 | bool canReadLine() const override; |
| 63 | qint64 bytesToWrite() const override; |
| 64 | |
| 65 | private slots: |
| 66 | void _q_readNotify(); |
| 67 | void _q_writeNotify(); |
| 68 | }; |
| 69 | |
| 70 | QT_END_NAMESPACE |
| 71 | |
| 72 | #endif // QBLUETOOTHSOCKET_BLUEZ_H |
| 73 | |