Index: sources/bluetooth/BLEScanner.h =================================================================== diff -u -rd9c602dc1f1e5ba34bc665264d739ce6509e0198 -rac16fe2e6ab8e5a7513ebea4959f5a7664238901 --- sources/bluetooth/BLEScanner.h (.../BLEScanner.h) (revision d9c602dc1f1e5ba34bc665264d739ce6509e0198) +++ sources/bluetooth/BLEScanner.h (.../BLEScanner.h) (revision ac16fe2e6ab8e5a7513ebea4959f5a7664238901) @@ -38,6 +38,10 @@ QThread *_thread = nullptr; bool _init = false; + const int _timerInterval = 1000; // SRSUI 6 + int _timerID = -1; + bool _timerIsActive = false; + bool _retryConnection = false; // Singleton SINGLETON(BLEScanner) @@ -59,7 +63,6 @@ uint16_t pulse_rate; // 2 bytes uint8_t user_id; // 1 byte uint16_t measurement_status; // 2 bytes - }; private: @@ -79,7 +82,6 @@ QLowEnergyDescriptor notificationDesc; QLowEnergyDescriptor readDesc; - QTimer *timer; const QString omronCurrentTimeServiceName = QString("{00002a2b-0000-1000-8000-00805f9b34fb}"); const QString omronBatteryLevelServiceName = QString("{0000180f-0000-1000-8000-00805f9b34fb}"); @@ -97,7 +99,12 @@ void updateBLECuffCheckinType(bool retryConnection); void makeServiceConnections(QLowEnergyService *service); QLowEnergyService* setupService(const QBluetoothUuid &uuid); + void timerEvent(QTimerEvent* event); + // timer + int startBLETimer(int interval); + void killBLETimer(int id); + signals: void didReceiveBPMeasurement(BLEMeasurementData); void didReceiveScanForDevicesError(QBluetoothDeviceDiscoveryAgent::Error error);