Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qohosbluetoothdevicediscovery_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
QOHOSBLUETOOTHDEVICEDISCOVERY_P_H
5
#
define
QOHOSBLUETOOTHDEVICEDISCOVERY_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
<
QtBluetooth
/
private
/
qohosbluetoothaccess_p
.
h
>
19
#
include
<
QtBluetooth
/
private
/
qohosbluetoothcommon_p
.
h
>
20
21
#
include
<
QtCore
/
qobject
.
h
>
22
#
include
<
QtCore
/
qtconfigmacros
.
h
>
23
#
include
<
QtCore
/
qtimer
.
h
>
24
#
include
<
QtCore
/
qtypes
.
h
>
25
#
include
<
QtCore
/
private
/
qcore_ohos_p
.
h
>
26
27
#
include
<
memory
>
28
#
include
<
optional
>
29
#
include
<
string
>
30
#
include
<
vector
>
31
32
QT_BEGIN_NAMESPACE
33
34
namespace
QtOhosBluetooth
{
35
36
struct
DiscoveryResult
37
{
38
std
::string
deviceId
;
39
std
::string
deviceName
;
40
quint32
classOfDevice
= 0;
41
qint16
rssi
= 0;
42
43
static
DiscoveryResult
makeFromOhosDiscoveryResultObject
(
44
QOhosJsState &jsState, QNapi::Object discoveryResultObject);
45
};
46
47
class
QOhosBluetoothDeviceDiscoveryAgentProxy
:
public
QObject
48
{
49
Q_OBJECT
50
public
:
51
static
std
::
shared_ptr
<
QOhosBluetoothDeviceDiscoveryAgentProxy
>
instance
();
52
53
bool
isForeignDiscoveryOngoing
();
54
std
::
vector
<
DiscoveryResult
>
getPairedDevices
();
55
56
void
startBluetoothDiscovery
();
57
void
stopBluetoothDiscovery
();
58
59
Q_SIGNALS
:
60
void
discoveryStopped
();
61
void
bluetoothDevicesFound
(
const
std::vector<DiscoveryResult> &discoveredDevices);
62
63
void
missingPermission
();
64
void
discoveryStartFailed
();
65
void
discoveryStopFailed
();
66
void
bluetoothPoweredOff
();
67
68
protected
:
69
QOhosBluetoothDeviceDiscoveryAgentProxy
();
70
71
private
:
72
bool
ensureDiscoveredDevicesConsumerRegistered();
73
std
::optional<
bool
> tryCheckBluetoothDiscovering();
74
void
resetDiscoveryTracking();
75
76
std::shared_ptr<QOhosBluetoothAccessProxy> m_accessProxy;
77
std
::shared_ptr<
void
> m_discoveredDevicesConsumerHandle;
78
bool
m_discoveryStartedByProxy =
false
;
79
QTimer m_discoveryStoppedPollTimer;
80
QTimer m_discoveryStoppedTimeoutTimer;
81
};
82
83
}
84
85
QT_END_NAMESPACE
86
87
#
endif
// QOHOSBLUETOOTHDEVICEDISCOVERY_P_H
QtOhosBluetooth::QOhosBluetoothDeviceDiscoveryAgentProxy
Definition
qohosbluetoothdevicediscovery_p.h:48
QtOhosBluetooth::QOhosBluetoothDeviceDiscoveryAgentProxy::getPairedDevices
std::vector< DiscoveryResult > getPairedDevices()
Definition
qohosbluetoothdevicediscovery.cpp:325
QtOhosBluetooth::QOhosBluetoothDeviceDiscoveryAgentProxy::isForeignDiscoveryOngoing
bool isForeignDiscoveryOngoing()
Definition
qohosbluetoothdevicediscovery.cpp:257
QtOhosBluetooth::QOhosBluetoothDeviceDiscoveryAgentProxy::bluetoothPoweredOff
void bluetoothPoweredOff()
QtOhosBluetooth::QOhosBluetoothDeviceDiscoveryAgentProxy::QOhosBluetoothDeviceDiscoveryAgentProxy
QOhosBluetoothDeviceDiscoveryAgentProxy()
Definition
qohosbluetoothdevicediscovery.cpp:133
QtOhosBluetooth::QOhosBluetoothDeviceDiscoveryAgentProxy::bluetoothDevicesFound
void bluetoothDevicesFound(const std::vector< DiscoveryResult > &discoveredDevices)
QtOhosBluetooth::QOhosBluetoothDeviceDiscoveryAgentProxy::discoveryStopFailed
void discoveryStopFailed()
QtOhosBluetooth::QOhosBluetoothDeviceDiscoveryAgentProxy::missingPermission
void missingPermission()
QtOhosBluetooth::QOhosBluetoothDeviceDiscoveryAgentProxy::discoveryStartFailed
void discoveryStartFailed()
QtOhosBluetooth::QOhosBluetoothDeviceDiscoveryAgentProxy::startBluetoothDiscovery
void startBluetoothDiscovery()
Definition
qohosbluetoothdevicediscovery.cpp:262
QtOhosBluetooth::QOhosBluetoothDeviceDiscoveryAgentProxy::stopBluetoothDiscovery
void stopBluetoothDiscovery()
Definition
qohosbluetoothdevicediscovery.cpp:309
QtOhosBluetooth
Definition
qohosbluetoothaccess.cpp:21
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
Q_DECLARE_LOGGING_CATEGORY
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQIORing)
QtOhosBluetooth::DiscoveryResult
Definition
qohosbluetoothdevicediscovery_p.h:37
QtOhosBluetooth::DiscoveryResult::classOfDevice
quint32 classOfDevice
Definition
qohosbluetoothdevicediscovery_p.h:40
QtOhosBluetooth::DiscoveryResult::deviceName
std::string deviceName
Definition
qohosbluetoothdevicediscovery_p.h:39
QtOhosBluetooth::DiscoveryResult::rssi
qint16 rssi
Definition
qohosbluetoothdevicediscovery_p.h:41
QtOhosBluetooth::DiscoveryResult::deviceId
std::string deviceId
Definition
qohosbluetoothdevicediscovery_p.h:38
QtOhosBluetooth::DiscoveryResult::makeFromOhosDiscoveryResultObject
static DiscoveryResult makeFromOhosDiscoveryResultObject(QOhosJsState &jsState, QNapi::Object discoveryResultObject)
Definition
qohosbluetoothdevicediscovery.cpp:114
qtconnectivity
src
bluetooth
ohos
qohosbluetoothdevicediscovery_p.h
Generated on
for Qt by
1.18.0