79 void readDescriptor(
const QSharedPointer<QLowEnergyServicePrivate> service,
87 void writeDescriptor(
const QSharedPointer<QLowEnergyServicePrivate> service,
95 int mtu()
const override;
106 void handleConnectionError(
const char *logMessage);
111 EventRegistrationToken mStatusChangedToken;
112 EventRegistrationToken mMtuChangedToken;
113 struct ValueChangedEntry {
114 ValueChangedEntry() {}
116 EventRegistrationToken
t)
123 EventRegistrationToken token;
125 QList<ValueChangedEntry> mValueChangedTokens;
128 QMap<QBluetoothUuid, GattDeviceServiceComPtr> m_openedServices;
129 QSet<QBluetoothUuid> m_requestDetailsServiceUuids;
131 using NativeServiceCallback = std::function<
void(GattDeviceServiceComPtr)>;
135 using NativeCharacteristicCallback = std::function<
void(GattCharacteristicComPtr)>;
138 NativeCharacteristicCallback callback);
141 void unregisterFromValueChanges();
142 HRESULT onValueChange(ABI::Windows::Devices::Bluetooth::GenericAttributeProfile::IGattCharacteristic *characteristic,
143 ABI::Windows::Devices::Bluetooth::GenericAttributeProfile::IGattValueChangedEventArgs *
args);
144 HRESULT onMtuChange(ABI::Windows::Devices::Bluetooth::GenericAttributeProfile::IGattSession *session,
146 bool registerForMtuChanges();
147 void unregisterFromMtuChanges();
149 bool registerForStatusChanges();
150 void unregisterFromStatusChanges();
151 HRESULT onStatusChange(ABI::Windows::Devices::Bluetooth::IBluetoothLEDevice *dev, IInspectable *);
153 void obtainIncludedServices(QSharedPointer<QLowEnergyServicePrivate> servicePointer,
156 ABI::Windows::Foundation::AsyncStatus status);
158 void readCharacteristicHelper(
const QSharedPointer<QLowEnergyServicePrivate> service,
160 GattCharacteristicComPtr characteristic);
161 void readDescriptorHelper(
const QSharedPointer<QLowEnergyServicePrivate> service,
164 GattCharacteristicComPtr characteristic);
165 void writeCharacteristicHelper(
const QSharedPointer<QLowEnergyServicePrivate> service,
167 bool writeWithResponse,
168 GattCharacteristicComPtr characteristic);
169 void writeDescriptorHelper(
const QSharedPointer<QLowEnergyServicePrivate> service,
173 GattCharacteristicComPtr characteristic);
176 GattDeviceServiceComPtr deviceService);
178 void clearAllServices();