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
btperipheralmanager_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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 BTPERIPHERALMANAGER_P_H
5#define BTPERIPHERALMANAGER_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 for the convenience
12// of internal files. This header file may change from version to version
13// without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "btutility_p.h"
19
21#include "qbluetooth.h"
22
23#include <QtCore/qsharedpointer.h>
24#include <QtCore/qbytearray.h>
25#include <QtCore/qglobal.h>
26#include <QtCore/qpair.h>
27#include <QtCore/qmap.h>
28
29#include <QtCore/private/qcore_mac_p.h>
30
31#include <vector>
32#include <deque>
33#include <map>
34
35#include <Foundation/Foundation.h>
36
37#include <CoreBluetooth/CoreBluetooth.h>
38
40
44
45namespace DarwinBluetooth
46{
47
49
50} // namespace DarwinBluetooth
51
53
54
55// Exposing names in a header is ugly, but constant QT_PREPEND_NAMESPACE is even worse ...
56// After all, this header is to be included only in its own and controller's *.mm files.
57
59
60using namespace DarwinBluetooth;
61
62
63template<class Type>
64using GenericLEMap = QMap<QLowEnergyHandle, Type>;
65
67{
68 idle,
72};
73
75{
76 UpdateRequest() = default;
77 UpdateRequest(QLowEnergyHandle handle, const ObjCStrongReference<NSData> &val)
79 value(val)
80 {
81 }
82
84 ObjCStrongReference<NSData> value;
85};
86
87using ValueRange = QPair<NSUInteger, NSUInteger>;
88
89@interface QT_MANGLE_NAMESPACE(DarwinBTPeripheralManager) : NSObject<CBPeripheralManagerDelegate>
90
91- (id)initWith:(LECBManagerNotifier *)notifier;
92- (void)dealloc;
93
95- (void) setParameters:(const QLowEnergyAdvertisingParameters &)parameters
96 data:(const QLowEnergyAdvertisingData &)data
97 scanResponse:(const QLowEnergyAdvertisingData &)scanResponse;
98
99// To be executed on the Qt's special BTLE dispatch queue.
102- (void)detach;
103
104- (void)write:(const QByteArray &)value
105 charHandle:(QLowEnergyHandle)charHandle;
106
107
108// CBPeripheralManagerDelegate's callbacks (BTLE queue).
109- (void)peripheralManagerDidUpdateState:(CBPeripheralManager *)peripheral;
110- (void)peripheralManagerDidStartAdvertising:(CBPeripheralManager *)peripheral
111 error:(NSError *)error;
112- (void)peripheralManager:(CBPeripheralManager *)peripheral
113 didAddService:(CBService *)service error:(NSError *)error;
114- (void)peripheralManager:(CBPeripheralManager *)peripheral central:(CBCentral *)central
115 didSubscribeToCharacteristic:(CBCharacteristic *)characteristic;
116- (void)peripheralManager:(CBPeripheralManager *)peripheral central:(CBCentral *)central
117 didUnsubscribeFromCharacteristic:(CBCharacteristic *)characteristic;
118- (void)peripheralManager:(CBPeripheralManager *)peripheral
119 didReceiveReadRequest:(CBATTRequest *)request;
120- (void)peripheralManager:(CBPeripheralManager *)peripheral
121 didReceiveWriteRequests:(NSArray *)requests;
122- (void)peripheralManagerIsReadyToUpdateSubscribers:(CBPeripheralManager *)peripheral;
123
124@end
125
127
128#endif
QMap< QLowEnergyHandle, Type > GenericLEMap
QPair< NSUInteger, NSUInteger > ValueRange
\inmodule QtCore
Definition qbytearray.h:57
The QLowEnergyAdvertisingData class represents the data to be broadcast during Bluetooth Low Energy a...
The QLowEnergyAdvertisingParameters class represents the parameters used for Bluetooth Low Energy adv...
The QLowEnergyServiceData class is used to set up GATT service data. \inmodule QtBluetooth.
\inmodule QtCore
Combined button and popup list for selecting options.
quint16 QLowEnergyHandle
Definition qbluetooth.h:42
#define QT_NAMESPACE_ALIAS_OBJC_CLASS(__KLASS__)
Definition qcore_mac_p.h:58
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLuint64 GLenum void * handle
GLenum GLuint id
[7]
gzip write("uncompressed data")
UpdateRequest()=default
QLowEnergyHandle charHandle
UpdateRequest(QLowEnergyHandle handle, const ObjCStrongReference< NSData > &val)
ObjCStrongReference< NSData > value