~aleteoryx/muditaos

a3aa441b0fbb94956cdafaebd92b15b5c93da59f — Bartosz Cichocki 4 years ago 4c694e5
[EGD-6682] Fix BT name change bug

To update the BT name there is a need to restart the BT stack.
Sending proper command during working stack wasn't working
1 files changed, 2 insertions(+), 0 deletions(-)

M module-services/service-bluetooth/ServiceBluetooth.cpp
M module-services/service-bluetooth/ServiceBluetooth.cpp => module-services/service-bluetooth/ServiceBluetooth.cpp +2 -0
@@ 212,6 212,8 @@ auto ServiceBluetooth::handle(message::bluetooth::SetDeviceName *msg) -> std::sh
    auto newName = msg->getName();
    bluetooth::set_name(newName);
    settingsHolder->setValue(bluetooth::Settings::DeviceName, newName);
    sendWorkerCommand(bluetooth::Command(bluetooth::Command::Type::PowerOff));
    sendWorkerCommand(bluetooth::Command(bluetooth::Command::Type::PowerOn));
    return sys::MessageNone{};
}