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_winrt_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_WINRT_P_H
5#define QBLUETOOTHSOCKET_WINRT_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
18#include "qbluetoothsocket.h"
20#include <QtGlobal>
21
23
24namespace ABI {
25 namespace Windows {
26 namespace Networking {
27 struct IHostName;
28 }
29 }
30}
31
32namespace Microsoft {
33 namespace WRL {
34 template <typename T> class ComPtr;
35 }
36}
38
40{
43
44public:
47
50 QIODevice::OpenMode openMode) override;
51
52 void connectToService(const QBluetoothServiceInfo &service,
53 QIODevice::OpenMode openMode) override;
55 QIODevice::OpenMode openMode) override;
57 QIODevice::OpenMode openMode) override;
58
60
61 QString localName() const override;
62 QBluetoothAddress localAddress() const override;
63 quint16 localPort() const override;
64
65 QString peerName() const override;
66 QBluetoothAddress peerAddress() const override;
67 quint16 peerPort() const override;
68
69 void abort() override;
70 void close() override;
71
72 qint64 writeData(const char *data, qint64 maxSize) override;
73 qint64 readData(char *data, qint64 maxSize) override;
74
78 QBluetoothSocket::OpenMode openMode = QBluetoothSocket::ReadWrite) override;
79
82 QBluetoothSocket::OpenMode openMode = QBluetoothSocket::ReadWrite) override;
83
84 qint64 bytesAvailable() const override;
85 bool canReadLine() const override;
86 qint64 bytesToWrite() const override;
87
89
92
94
95 // Protected by m_readMutex. Written in addToPendingData (native callback)
96 QList<QByteArray> m_pendingData;
97
98 Q_INVOKABLE void addToPendingData(const QList<QByteArray> &data);
99
100private slots:
101 void handleNewData(const QList<QByteArray> &data);
102 void handleError(QBluetoothSocket::SocketError error);
103
104private:
106 const QString &serviceName, QIODevice::OpenMode openMode);
107 HRESULT handleConnectOpFinished(ABI::Windows::Foundation::IAsyncAction *action,
108 ABI::Windows::Foundation::AsyncStatus status);
109
110 QIODevice::OpenMode requestedOpenMode = QIODevice::NotOpen;
111};
112
114
115#endif
\inmodule QtBluetooth
\inmodule QtBluetooth
Protocol
This enum describes the socket protocol used by the service.
QBluetoothSocket::OpenMode openMode
QBluetoothServiceInfo::Protocol socketType
void connectToServiceHelper(const QBluetoothAddress &address, quint16 port, QIODevice::OpenMode openMode) override
qint64 writeData(const char *data, qint64 maxSize) override
Q_INVOKABLE void addToPendingData(const QList< QByteArray > &data)
QBluetoothAddress peerAddress() const override
Microsoft::WRL::ComPtr< ABI::Windows::Foundation::IAsyncAction > m_connectOp
bool ensureNativeSocket(QBluetoothServiceInfo::Protocol type) override
bool setSocketDescriptor(Microsoft::WRL::ComPtr< ABI::Windows::Networking::Sockets::IStreamSocket > socket, QBluetoothServiceInfo::Protocol socketType, QBluetoothSocket::SocketState socketState=QBluetoothSocket::SocketState::ConnectedState, QBluetoothSocket::OpenMode openMode=QBluetoothSocket::ReadWrite) override
Microsoft::WRL::ComPtr< ABI::Windows::Networking::Sockets::IStreamSocket > m_socketObject
QBluetoothAddress localAddress() const override
void connectToService(const QBluetoothServiceInfo &service, QIODevice::OpenMode openMode) override
SocketState
This enum describes the state of the Bluetooth socket.
SocketError
This enum describes Bluetooth socket error types.
\inmodule QtBluetooth
\inmodule QtCore
Definition qmutex.h:281
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
QT_FORWARD_DECLARE_CLASS(QCocoaMenuItem)
DBusConnection const char DBusError * error
EGLOutputPortEXT port
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum type
GLuint GLuint64EXT address
#define Q_OBJECT
#define Q_INVOKABLE
#define slots
unsigned short quint16
Definition qtypes.h:48
long long qint64
Definition qtypes.h:60
long HRESULT
QByteArray readData()