Files
MuditaOS/module-gui/gui/widgets/status-bar/BT.cpp
Maciej Gibowicz e5114922d3 [MOS-138] Correction of URC poll mode parameters
In poll mode, the CSQ will be requested every 15 minutes
and another attempt to switch the mode will be after 1 hour.
If the keyboard is unlocked or the USB cable is connected
or the BT car kit is connected, the URCs will be operated
in the reporting mode.
2022-04-28 09:19:39 +02:00

36 lines
1.2 KiB
C++

// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "BT.hpp"
#include "Style.hpp"
namespace gui::status_bar
{
constexpr auto bt_status = "bt_status";
constexpr auto bt_connected_status = "bt_connected_status";
BT::BT(Item *parent, uint32_t x, uint32_t y) : StatusBarWidgetBase(parent, x, y, 0, 0)
{
set(bt_status, style::status_bar::imageTypeSpecifier);
}
void BT::setBluetoothMode(sys::bluetooth::BluetoothMode mode)
{
switch (mode) {
case sys::bluetooth::BluetoothMode::Disabled:
setVisible(false);
break;
case sys::bluetooth::BluetoothMode::Enabled:
set(bt_status, style::status_bar::imageTypeSpecifier);
break;
case sys::bluetooth::BluetoothMode::ConnectedVoice:
[[fallthrough]];
case sys::bluetooth::BluetoothMode::ConnectedAudio:
[[fallthrough]];
case sys::bluetooth::BluetoothMode::ConnectedBoth:
set(bt_connected_status, style::status_bar::imageTypeSpecifier);
break;
}
}
}; // namespace gui::status_bar