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
qlowenergyserviceprivate_p.h
Go to the documentation of this file.
1
// Copyright (C) 2021 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
QLOWENERGYSERVICEPRIVATE_P_H
5
#
define
QLOWENERGYSERVICEPRIVATE_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
<
QtCore
/
QObject
>
19
#
include
<
QtCore
/
QPointer
>
20
#
include
<
QtBluetooth
/
qbluetooth
.
h
>
21
#
include
<
QtBluetooth
/
QLowEnergyService
>
22
#
include
<
QtBluetooth
/
QLowEnergyCharacteristic
>
23
#
include
<
QtCore
/
private
/
qglobal_p
.
h
>
24
25
#
if
defined
(
QT_ANDROID_BLUETOOTH
)
26
#
include
<
QtCore
/
QJniObject
>
27
#
endif
28
29
QT_BEGIN_NAMESPACE
30
31
class
QLowEnergyControllerPrivate;
32
33
class
QLowEnergyServicePrivate
:
public
QObject
34
{
35
Q_OBJECT
36
public
:
37
explicit
QLowEnergyServicePrivate
(
QObject
*
parent
=
nullptr
);
38
~
QLowEnergyServicePrivate
();
39
40
struct
DescData
{
41
QByteArray
value
;
42
QBluetoothUuid
uuid
;
43
};
44
45
struct
CharData
{
46
QLowEnergyHandle
valueHandle
;
47
QBluetoothUuid
uuid
;
48
QLowEnergyCharacteristic
::
PropertyTypes
properties
;
49
QByteArray
value
;
50
QHash
<
QLowEnergyHandle
,
DescData
>
descriptorList
;
51
};
52
53
enum
GattAttributeTypes
{
54
PrimaryService
= 0x2800,
55
SecondaryService
= 0x2801,
56
IncludeAttribute
= 0x2802,
57
Characteristic
= 0x2803
58
};
59
60
void
setController
(
QLowEnergyControllerPrivate
* control);
61
void
setError
(QLowEnergyService::ServiceError newError);
62
void
setState
(QLowEnergyService::ServiceState newState);
63
64
signals
:
65
void
stateChanged
(
QLowEnergyService
::
ServiceState
newState
);
66
void
errorOccurred
(QLowEnergyService::ServiceError error);
67
void
characteristicChanged
(
const
QLowEnergyCharacteristic &characteristic,
68
const
QByteArray &newValue);
69
void
characteristicRead
(
const
QLowEnergyCharacteristic &info,
70
const
QByteArray &value);
71
void
characteristicWritten
(
const
QLowEnergyCharacteristic &characteristic,
72
const
QByteArray &newValue);
73
void
descriptorRead
(
const
QLowEnergyDescriptor &info,
74
const
QByteArray &value);
75
void
descriptorWritten
(
const
QLowEnergyDescriptor &descriptor,
76
const
QByteArray &newValue);
77
78
public
:
79
QLowEnergyHandle
startHandle
= 0;
80
QLowEnergyHandle
endHandle
= 0;
81
82
QBluetoothUuid
uuid
;
83
QList
<
QBluetoothUuid
>
includedServices
;
84
QLowEnergyService
::
ServiceTypes
type
=
QLowEnergyService
::
PrimaryService
;
85
QLowEnergyService
::
ServiceState
state
=
QLowEnergyService
::
InvalidService
;
86
QLowEnergyService
::
ServiceError
lastError
=
QLowEnergyService
::
NoError
;
87
QLowEnergyService
::
DiscoveryMode
mode
=
QLowEnergyService
::
FullDiscovery
;
88
89
QHash
<
QLowEnergyHandle
,
CharData
>
characteristicList
;
90
91
QPointer
<
QLowEnergyControllerPrivate
>
controller
;
92
93
#
if
defined
(
QT_ANDROID_BLUETOOTH
)
94
// reference to the BluetoothGattService object
95
QJniObject
androidService
;
96
#
endif
97
98
};
99
100
typedef
QHash
<
QLowEnergyHandle
,
QLowEnergyServicePrivate
::
CharData
>
CharacteristicDataMap
;
101
typedef
QHash
<
QLowEnergyHandle
,
QLowEnergyServicePrivate
::
DescData
>
DescriptorDataMap
;
102
103
QT_END_NAMESPACE
104
105
QT_DECL_METATYPE_EXTERN_TAGGED(QSharedPointer<QLowEnergyServicePrivate>,
106
QSharedPointer_QLowEnergyServicePrivate,
107
/* not exported */
)
108
109
#
endif
// QLOWENERGYSERVICEPRIVATE_P_H
QT_BT_MAC_AUTORELEASEPOOL
#define QT_BT_MAC_AUTORELEASEPOOL
Definition
btutility_p.h:78
QLowEnergyControllerPrivate
\inmodule QtBluetooth
Definition
qlowenergycontrollerbase_p.h:30
QLowEnergyServicePrivate
Definition
qlowenergyserviceprivate_p.h:34
QLowEnergyServicePrivate::characteristicWritten
void characteristicWritten(const QLowEnergyCharacteristic &characteristic, const QByteArray &newValue)
QLowEnergyServicePrivate::includedServices
QList< QBluetoothUuid > includedServices
Definition
qlowenergyserviceprivate_p.h:83
QLowEnergyServicePrivate::~QLowEnergyServicePrivate
~QLowEnergyServicePrivate()
Definition
qlowenergyserviceprivate.cpp:15
QLowEnergyServicePrivate::setController
void setController(QLowEnergyControllerPrivate *control)
Definition
qlowenergyserviceprivate.cpp:19
QLowEnergyServicePrivate::characteristicChanged
void characteristicChanged(const QLowEnergyCharacteristic &characteristic, const QByteArray &newValue)
QLowEnergyServicePrivate::characteristicRead
void characteristicRead(const QLowEnergyCharacteristic &info, const QByteArray &value)
QLowEnergyServicePrivate::mode
QLowEnergyService::DiscoveryMode mode
Definition
qlowenergyserviceprivate_p.h:87
QLowEnergyServicePrivate::descriptorWritten
void descriptorWritten(const QLowEnergyDescriptor &descriptor, const QByteArray &newValue)
QLowEnergyServicePrivate::startHandle
QLowEnergyHandle startHandle
Definition
qlowenergyserviceprivate_p.h:79
QLowEnergyServicePrivate::descriptorRead
void descriptorRead(const QLowEnergyDescriptor &info, const QByteArray &value)
QLowEnergyServicePrivate::uuid
QBluetoothUuid uuid
Definition
qlowenergyserviceprivate_p.h:82
QLowEnergyServicePrivate::lastError
QLowEnergyService::ServiceError lastError
Definition
qlowenergyserviceprivate_p.h:86
QLowEnergyServicePrivate::setError
void setError(QLowEnergyService::ServiceError newError)
Definition
qlowenergyserviceprivate.cpp:29
QLowEnergyServicePrivate::endHandle
QLowEnergyHandle endHandle
Definition
qlowenergyserviceprivate_p.h:80
QLowEnergyServicePrivate::type
QLowEnergyService::ServiceTypes type
Definition
qlowenergyserviceprivate_p.h:84
QLowEnergyServicePrivate::controller
QPointer< QLowEnergyControllerPrivate > controller
Definition
qlowenergyserviceprivate_p.h:91
QLowEnergyServicePrivate::errorOccurred
void errorOccurred(QLowEnergyService::ServiceError error)
QLowEnergyServicePrivate::setState
void setState(QLowEnergyService::ServiceState newState)
Definition
qlowenergyserviceprivate.cpp:35
QLowEnergyServicePrivate::GattAttributeTypes
GattAttributeTypes
Definition
qlowenergyserviceprivate_p.h:53
QLowEnergyServicePrivate::IncludeAttribute
@ IncludeAttribute
Definition
qlowenergyserviceprivate_p.h:56
QLowEnergyServicePrivate::PrimaryService
@ PrimaryService
Definition
qlowenergyserviceprivate_p.h:54
QLowEnergyServicePrivate::Characteristic
@ Characteristic
Definition
qlowenergyserviceprivate_p.h:57
QLowEnergyServicePrivate::SecondaryService
@ SecondaryService
Definition
qlowenergyserviceprivate_p.h:55
QLowEnergyServicePrivate::state
QLowEnergyService::ServiceState state
Definition
qlowenergyserviceprivate_p.h:85
QLowEnergyServicePrivate::characteristicList
QHash< QLowEnergyHandle, CharData > characteristicList
Definition
qlowenergyserviceprivate_p.h:89
DarwinBluetooth
Definition
btcentralmanager.mm:22
DarwinBluetooth::qt_timeoutNSError
ObjCStrongReference< NSError > qt_timeoutNSError(OperationTimeout type)
Definition
btcentralmanager.mm:49
DarwinBluetooth::qt_find_watchdog
auto qt_find_watchdog(const std::vector< GCDTimer > &watchdogs, id object, OperationTimeout type)
Definition
btcentralmanager.mm:62
DarwinBluetooth::OperationTimeout
OperationTimeout
Definition
btgcdtimer_p.h:31
DarwinBluetooth::OperationTimeout::none
@ none
Definition
btgcdtimer_p.h:32
DarwinBluetooth::qt_countGATTEntries
NSUInteger qt_countGATTEntries(CBService *service)
Definition
btcentralmanager.mm:24
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
CharacteristicDataMap
QHash< QLowEnergyHandle, QLowEnergyServicePrivate::CharData > CharacteristicDataMap
Definition
qlowenergyserviceprivate_p.h:100
DescriptorDataMap
QHash< QLowEnergyHandle, QLowEnergyServicePrivate::DescData > DescriptorDataMap
Definition
qlowenergyserviceprivate_p.h:101
QLowEnergyServicePrivate::CharData
Definition
qlowenergyserviceprivate_p.h:45
QLowEnergyServicePrivate::CharData::descriptorList
QHash< QLowEnergyHandle, DescData > descriptorList
Definition
qlowenergyserviceprivate_p.h:50
QLowEnergyServicePrivate::CharData::uuid
QBluetoothUuid uuid
Definition
qlowenergyserviceprivate_p.h:47
QLowEnergyServicePrivate::CharData::valueHandle
QLowEnergyHandle valueHandle
Definition
qlowenergyserviceprivate_p.h:46
QLowEnergyServicePrivate::CharData::properties
QLowEnergyCharacteristic::PropertyTypes properties
Definition
qlowenergyserviceprivate_p.h:48
QLowEnergyServicePrivate::CharData::value
QByteArray value
Definition
qlowenergyserviceprivate_p.h:49
QLowEnergyServicePrivate::DescData
Definition
qlowenergyserviceprivate_p.h:40
QLowEnergyServicePrivate::DescData::uuid
QBluetoothUuid uuid
Definition
qlowenergyserviceprivate_p.h:42
QLowEnergyServicePrivate::DescData::value
QByteArray value
Definition
qlowenergyserviceprivate_p.h:41
QmlIR::Object::id
int id
Definition
qqmlirbuilder_p.h:312
qtconnectivity
src
bluetooth
qlowenergyserviceprivate_p.h
Generated on
for Qt by
1.18.0