mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-07-04 21:27:30 -04:00
* [EGD-2566] refactored cellular notification recogniton * [EGD-2566] add new conversion to dBm * [EGD-2566] added dBm to bar calculations some minor fixes connected to signal strength put static data in event store * [EGD-2566] removed magic number * [EGD-2566] PR fixes * [EGD-2566] PR fixes * [EGD-2566] missing rebase fix * [EGD-2566] moved Signal Strength to separate file. * [EGD-2566] missing return * [EGD-2566] update signalstrength without message sending * [EGD-2566] reverted USE_DAEFAULT_BAUDRATE to 1 * [EGD-2566][fix] missing change for closing end call window * [EGD-2566] fix for proper checking for CSQ. Verbose setting of singla strength in Store * [EGD-2566] fixed inlude in ScopeDTime. * [EGD-2566] added mutex in GSM store * [EGD-2566] missing change * [EGD-2566] reverted USE_DAEFAULT_BAUDRATE * [EGD-2566] PR fixy
82 lines
1.9 KiB
C++
82 lines
1.9 KiB
C++
#pragma once
|
|
|
|
// static lifetime read only cache for (hw) states to not poll
|
|
// right now it serves data from:
|
|
// - battery
|
|
// - gsm SIM tray
|
|
// it's not meant to serve as polling interface - rather to serve data
|
|
|
|
#include <cstddef>
|
|
namespace Store
|
|
{
|
|
struct Battery
|
|
{
|
|
enum class State
|
|
{
|
|
Discharging,
|
|
Charging,
|
|
} state = State::Discharging;
|
|
unsigned int level = 0;
|
|
|
|
static const Battery &get();
|
|
static Battery &modify();
|
|
};
|
|
|
|
enum class RssiBar : size_t
|
|
{
|
|
zero = 0,
|
|
one = 1,
|
|
two = 2,
|
|
three = 3,
|
|
four = 4,
|
|
five = 5,
|
|
noOfSupprtedBars
|
|
};
|
|
|
|
struct SignalStrength
|
|
{
|
|
int rssi = 0;
|
|
int rssidBm = 0;
|
|
RssiBar rssiBar = RssiBar::zero;
|
|
};
|
|
|
|
struct GSM
|
|
{
|
|
private:
|
|
GSM() = default;
|
|
SignalStrength signalStrength;
|
|
|
|
public:
|
|
enum class Tray
|
|
{
|
|
OUT,
|
|
IN
|
|
} tray = Tray::IN;
|
|
/// tray - tray actual status which is visible right now on screen
|
|
/// selected - tray selection settings settable sim tray
|
|
enum class SIM
|
|
{
|
|
SIM1,
|
|
SIM2,
|
|
SIM_FAIL,
|
|
SIM_UNKNOWN,
|
|
NONE,
|
|
} sim = SIM::SIM_UNKNOWN,
|
|
selected = SIM::SIM1;
|
|
|
|
/// state of modem
|
|
enum class Modem
|
|
{
|
|
OFF, /// modem is off - it's not working
|
|
ON_INITIALIZING, /// modem is set to on, just started - initialization not done yet
|
|
ON_NEED_SIMFLOW, /// modem is on, initialized, no SIM initialization yet
|
|
ON_INITIALIZED, /// modem is on, and it's fully initialized
|
|
} modem = Modem::OFF;
|
|
|
|
void setSignalStrength(const SignalStrength &signalStrength);
|
|
SignalStrength getSignalStrength();
|
|
|
|
static GSM *get();
|
|
};
|
|
}; // namespace Store
|