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
qohosbluetoothremotedevice_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
QOHOSBLUETOOTHREMOTEDEVICE_P_H
5
#
define
QOHOSBLUETOOTHREMOTEDEVICE_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
/
qohosbluetoothcommon_p
.
h
>
19
#
include
<
QtBluetooth
/
private
/
qohosbluetoothenums_p
.
h
>
20
21
#
include
<
QtCore
/
qobject
.
h
>
22
#
include
<
QtCore
/
qstring
.
h
>
23
#
include
<
QtCore
/
qstringlist
.
h
>
24
#
include
<
QtCore
/
qtconfigmacros
.
h
>
25
26
#
include
<
memory
>
27
#
include
<
optional
>
28
#
include
<
string
>
29
#
include
<
vector
>
30
31
QT_BEGIN_NAMESPACE
32
33
namespace
QtOhosBluetooth
{
34
35
struct
RemoteDeviceServices
36
{
37
std
::string
deviceId
;
38
std
::optional<
std
::string>
optDeviceName
;
39
std
::
optional
<
quint32
>
optClassOfDevice
;
40
bool
lowEnergyOnly
=
false
;
41
std
::
optional
<
std
::
vector
<
std
::
string
>>
optProfileUuids
;
42
};
43
44
class
QOhosBluetoothRemoteDeviceProxy
:
public
QObject
45
{
46
Q_OBJECT
47
public
:
48
using
BluetoothTransport
=
49
QtOhosBluetooth
::
enums
::
ohos
::
bluetooth
::
connection
::
BluetoothTransport
;
50
using
BondState
=
QtOhosBluetooth
::
enums
::
ohos
::
bluetooth
::
connection
::
BondState
;
51
using
UnbondCause
=
QtOhosBluetooth
::
enums
::
ohos
::
bluetooth
::
connection
::
UnbondCause
;
52
53
static
std
::shared_ptr<
QOhosBluetoothRemoteDeviceProxy
>
instance
();
54
55
std
::
optional
<
QString
>
tryGetRemoteDeviceName
(
const
QString &deviceId);
56
std
::
optional
<
BondState
>
tryGetPairState
(
const
QString &deviceId);
57
58
bool
pairDevice
(
const
QString &deviceId);
59
std
::
optional
<
QOhosBluetoothErrorCode
>
requestRemoteDeviceServices
(
const
QString &deviceId);
60
61
Q_SIGNALS
:
62
void
bondStateChanged
(
QString
deviceId
,
BondState
bondState
,
std
::
optional
<
UnbondCause
>
unbondCause
);
63
void
pairDeviceFailed
(QString deviceId);
64
void
remoteDeviceServicesRead
(
RemoteDeviceServices
remoteDeviceServices);
65
void
missingPermission
();
66
67
protected
:
68
QOhosBluetoothRemoteDeviceProxy
();
69
70
private
:
71
bool
ensureBondStateChangeConsumerRegistered();
72
73
std
::shared_ptr<
void
> m_bondStateChangeConsumerHandle;
74
};
75
76
std
::optional<
std
::string>
readRemoteDeviceName
(QOhosJsState &jsState,
const
std
::string &deviceId);
77
std
::
optional
<
quint32
>
readRemoteDeviceClass
(QOhosJsState &jsState,
const
std
::string &deviceId);
78
std
::
optional
<
QOhosBluetoothRemoteDeviceProxy
::
BluetoothTransport
>
readRemoteDeviceTransport
(
79
QOhosJsState &jsState,
const
std
::string &deviceId);
80
bool
isRemoteDeviceLowEnergyOnly
(QOhosJsState &jsState,
const
std
::string &deviceId);
81
82
}
83
84
QT_END_NAMESPACE
85
86
#
endif
// QOHOSBLUETOOTHREMOTEDEVICE_P_H
QtOhosBluetooth::QOhosBluetoothRemoteDeviceProxy
Definition
qohosbluetoothremotedevice_p.h:45
QtOhosBluetooth::QOhosBluetoothRemoteDeviceProxy::missingPermission
void missingPermission()
QtOhosBluetooth::QOhosBluetoothRemoteDeviceProxy::tryGetRemoteDeviceName
std::optional< QString > tryGetRemoteDeviceName(const QString &deviceId)
Definition
qohosbluetoothremotedevice.cpp:186
QtOhosBluetooth::QOhosBluetoothRemoteDeviceProxy::pairDeviceFailed
void pairDeviceFailed(QString deviceId)
QtOhosBluetooth::QOhosBluetoothRemoteDeviceProxy::requestRemoteDeviceServices
std::optional< QOhosBluetoothErrorCode > requestRemoteDeviceServices(const QString &deviceId)
Definition
qohosbluetoothremotedevice.cpp:218
QtOhosBluetooth::QOhosBluetoothRemoteDeviceProxy::tryGetPairState
std::optional< BondState > tryGetPairState(const QString &deviceId)
Definition
qohosbluetoothremotedevice.cpp:205
QtOhosBluetooth::QOhosBluetoothRemoteDeviceProxy::QOhosBluetoothRemoteDeviceProxy
QOhosBluetoothRemoteDeviceProxy()
Definition
qohosbluetoothremotedevice.cpp:134
QtOhosBluetooth::QOhosBluetoothRemoteDeviceProxy::instance
static std::shared_ptr< QOhosBluetoothRemoteDeviceProxy > instance()
Definition
qohosbluetoothremotedevice.cpp:172
QtOhosBluetooth::QOhosBluetoothRemoteDeviceProxy::remoteDeviceServicesRead
void remoteDeviceServicesRead(RemoteDeviceServices remoteDeviceServices)
QtOhosBluetooth::QOhosBluetoothRemoteDeviceProxy::pairDevice
bool pairDevice(const QString &deviceId)
Definition
qohosbluetoothremotedevice.cpp:282
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QtOhosBluetooth
Definition
qohosbluetoothaccess.cpp:21
QtOhosBluetooth::isRemoteDeviceLowEnergyOnly
bool isRemoteDeviceLowEnergyOnly(QOhosJsState &jsState, const std::string &deviceId)
Definition
qohosbluetoothremotedevice.cpp:128
QtOhosBluetooth::readRemoteDeviceClass
std::optional< quint32 > readRemoteDeviceClass(QOhosJsState &jsState, const std::string &deviceId)
Definition
qohosbluetoothremotedevice.cpp:95
QtOhosBluetooth::readRemoteDeviceTransport
std::optional< QOhosBluetoothRemoteDeviceProxy::BluetoothTransport > readRemoteDeviceTransport(QOhosJsState &jsState, const std::string &deviceId)
Definition
qohosbluetoothremotedevice.cpp:111
QtOhosBluetooth::readRemoteDeviceName
std::optional< std::string > readRemoteDeviceName(QOhosJsState &jsState, const std::string &deviceId)
Definition
qohosbluetoothremotedevice.cpp:80
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
QtOhosBluetooth::RemoteDeviceServices
Definition
qohosbluetoothremotedevice_p.h:36
QtOhosBluetooth::RemoteDeviceServices::optProfileUuids
std::optional< std::vector< std::string > > optProfileUuids
Definition
qohosbluetoothremotedevice_p.h:41
QtOhosBluetooth::RemoteDeviceServices::lowEnergyOnly
bool lowEnergyOnly
Definition
qohosbluetoothremotedevice_p.h:40
QtOhosBluetooth::RemoteDeviceServices::optDeviceName
std::optional< std::string > optDeviceName
Definition
qohosbluetoothremotedevice_p.h:38
QtOhosBluetooth::RemoteDeviceServices::optClassOfDevice
std::optional< quint32 > optClassOfDevice
Definition
qohosbluetoothremotedevice_p.h:39
QtOhosBluetooth::RemoteDeviceServices::deviceId
std::string deviceId
Definition
qohosbluetoothremotedevice_p.h:37
qtconnectivity
src
bluetooth
ohos
qohosbluetoothremotedevice_p.h
Generated on
for Qt by
1.18.0