~aleteoryx/muditaos

83524c42e46ad7fd4ba1c9c42f7f446d797aba3b — SP2FET 4 years ago 7ccc68c
[EGD-5986] Fix re-enabling BT scan

Due to incorrect stopping the BT scan, re-enabling it caused
failure to HCI state machine, which was indirect cause of failing
connections. Now it works
M module-apps/application-settings-new/windows/AllDevicesWindow.cpp => module-apps/application-settings-new/windows/AllDevicesWindow.cpp +4 -1
@@ 38,8 38,11 @@ namespace gui
                                    "cross");
    }

    void AllDevicesWindow::onBeforeShow(ShowMode /*mode*/, SwitchData *data)
    void AllDevicesWindow::onBeforeShow(ShowMode mode, SwitchData *data)
    {
        if (mode == ShowMode::GUI_SHOW_RETURN) {
            bluetoothSettingsModel->stopScan();
        }
        const auto newData = dynamic_cast<BondedDevicesData *>(data);
        if (newData != nullptr) {
            devices                  = newData->getDevices();

M module-bluetooth/Bluetooth/CommandHandler.cpp => module-bluetooth/Bluetooth/CommandHandler.cpp +1 -0
@@ 90,6 90,7 @@ namespace bluetooth

    Error::Code CommandHandler::stopScan()
    {
        LOG_INFO("Stopping scan!");
        driver->stopScan();
        static_cast<ServiceBluetooth *>(service)->scanStoppedCallback();
        return Error::Success;

M module-bluetooth/lib/btstack => module-bluetooth/lib/btstack +1 -1
@@ 1,1 1,1 @@
Subproject commit 50e2ffe2ac7968e178cd0bc183b48c12c9d06834
Subproject commit 45e9304c0b9f764e195c54b23136a948071fd4e5