57 QLowEnergyService::DiscoveryMode mode)
override;
60 const QSharedPointer<QLowEnergyServicePrivate> service,
61 const QLowEnergyHandle charHandle)
override;
63 const QSharedPointer<QLowEnergyServicePrivate> service,
64 const QLowEnergyHandle charHandle,
65 const QLowEnergyHandle descriptorHandle)
override;
68 const QSharedPointer<QLowEnergyServicePrivate> service,
69 const QLowEnergyHandle charHandle,
70 const QByteArray &newValue,
71 QLowEnergyService::WriteMode writeMode)
override;
73 const QSharedPointer<QLowEnergyServicePrivate> service,
74 const QLowEnergyHandle charHandle,
75 const QLowEnergyHandle descriptorHandle,
76 const QByteArray &newValue)
override;
79 const QLowEnergyAdvertisingParameters ¶ms,
80 const QLowEnergyAdvertisingData &advertisingData,
81 const QLowEnergyAdvertisingData &scanResponseData)
override;
85 const QLowEnergyConnectionParameters & params)
override;
87 const QLowEnergyServiceData &service,
88 QLowEnergyHandle startHandle)
override;
90 int mtu()
const override;
93 void connectToDeviceHelper();
94 void resetController();
96 void scheduleNextJob();
101 void characteristicPropertiesChanged(QLowEnergyHandle charHandle,
const QString &interface,
102 const QVariantMap &changedProperties,
103 const QStringList &invalidatedProperties);
104 void interfacesRemoved(
const QDBusObjectPath &objectPath,
const QStringList &interfaces);
106 void onCharReadFinished(QDBusPendingCallWatcher *call);
107 void onDescReadFinished(QDBusPendingCallWatcher *call);
108 void onCharWriteFinished(QDBusPendingCallWatcher *call);
109 void onDescWriteFinished(QDBusPendingCallWatcher *call);
116 QString adapterPathWithPeripheralSupport;
121 QLeDBusAdvertiser *advertiser{};
122 void handleAdvertisingError();
123 void handlePeripheralApplicationError();
124 void handlePeripheralApplicationRegistered();
125 void handlePeripheralConnectivityChanged(
bool connected);
126 void handlePeripheralCharacteristicValueUpdate(QLowEnergyHandle handle,
127 const QByteArray& value);
128 void handlePeripheralDescriptorValueUpdate(QLowEnergyHandle characteristicHandle,
129 QLowEnergyHandle descriptorHandle,
130 const QByteArray& value);
131 void handlePeripheralRemoteDeviceChanged(
const QBluetoothAddress& address,
134 bool pendingConnect =
false;
135 bool disconnectSignalRequired =
false;
137 struct GattCharacteristic
139 QSharedPointer<QtBluetoothPrivate::OrgBluezGattCharacteristic1Interface> characteristic;
140 QSharedPointer<QtBluetoothPrivate::OrgFreedesktopDBusPropertiesInterface> charMonitor;
141 QList<QSharedPointer<QtBluetoothPrivate::OrgBluezGattDescriptor1Interface>> descriptors;
147 QList<GattCharacteristic> characteristics;
149 bool hasBatteryService =
false;
150 QSharedPointer<QtBluetoothPrivate::OrgBluezBattery1Interface> batteryInterface;
153 QHash<QBluetoothUuid, GattService> dbusServices;
154 QLowEnergyHandle runningHandle = 1;
163 ServiceDiscovery = 0x10,
164 LastServiceDiscovery = 0x20
166 Q_DECLARE_FLAGS(JobFlags, JobFlag)
168 JobFlags flags = GattJob::Unset;
169 QLowEnergyHandle handle;
171 QLowEnergyService::WriteMode writeMode = QLowEnergyService::WriteWithResponse;
172 QSharedPointer<QLowEnergyServicePrivate> service;
176 bool jobPending =
false;
178 void prepareNextJob();
179 void discoverBatteryServiceDetails(GattService &dbusData,
180 QSharedPointer<QLowEnergyServicePrivate> serviceData);
181 void executeClose(QLowEnergyController::Error newError);