Index: sources/view/VBluetooth.h =================================================================== diff -u -r5220c64dd3a0fc9c322a68884e73503bb7893d12 -r2fde0cfeb28b3fab9437e9bd15c1ec775785f103 --- sources/view/VBluetooth.h (.../VBluetooth.h) (revision 5220c64dd3a0fc9c322a68884e73503bb7893d12) +++ sources/view/VBluetooth.h (.../VBluetooth.h) (revision 2fde0cfeb28b3fab9437e9bd15c1ec775785f103) @@ -43,13 +43,16 @@ void didRequestScanForDevices(); void didPairedDevicesChanged(); void didRequestConcurrentSave(QString, QString, bool); + void didRequestReconnectToDevice(QBluetoothDeviceInfo); private: - QList bleDevices; - QList pairedDevices; - QString status; + QList _unpairedDevices; + QList _pairedDevices; + QString _status; + const QString _lastSelectedDeviceAddrKey = "LastSelectedDevice"; + VBluetoothDeviceInfo *_lastSelectedDevice = nullptr; - QString getStatus() { return status; } + QString getStatus() { return _status; } QString controllerErrorToString(QLowEnergyController::Error error); bool isDeviceAlreadyPaired(const QBluetoothDeviceInfo &deviceInfo); void removeFromDevices(const VBluetoothDeviceInfo *info); @@ -65,6 +68,8 @@ void onConnectedToDevice(const QBluetoothDeviceInfo &deviceInfo); void onDisconnectedFromDevice(const QBluetoothDeviceInfo &deviceInfo); void onLoadMyDevices(const QString &path = Bluetooth_Saved_Devices_Path_JSON); + void onReconnectToDevice(const VBluetoothDeviceInfo *deviceInfo); + void onLoadAndConnectToLastSelectedDevice(const QJsonObject &obj); }; } #endif // VBLUETOOTH_H