Files
MuditaOS/module-sys/Service/Common.hpp
kkleczkowski e46d2a2829 Egd 3244 antenna manager (#490)
* [EGD-3244] Service antenna + utils State.

* [EGD-3244] CellularAPI + at::response.

* [EGD-3244-antenna-manager] Changes in application Antenna.

* [EGD-3244-antenna-manager] Changes in antenna app ( antenna switch multicast ).

* [EGD-3244-antenna-manager] Changed Antenna app GUI.

* [EGD-3244-antenna-manager] Basic algorithm.

* [EGD-3244-antenna-manager] Fixes in algorithm.

* [EGD-3244-antenna-manager] Small fixes + service blocking.

* [EGD-3244-antenna-manager] Little cleanup.

* [EGD-3244-antenna-manager] Restored Cellular call in Application Antenna.

* [EGD-3244-antenna-manager] Style fix.

* [EGD-3244-antenna-manager] Sewrvice antenna disabled.

* [EGD-3244-antenna-manager] PR suggestions + linux buil fixed.

* [EGD-3244-antenna-manager] Updated changelog

* [EGD-3244-antenna-manager] Style fix.

* [EGD-3244-antenna-manager] Fixed submodule.

* [EGD-3244-antenna-manager] PR suggestions + toNumeric UT.

* [EGD-3244-antenna-manager] PR suggstions again.

Co-authored-by: Kuba Kleczkowski <dd>
2020-07-07 10:54:47 +02:00

107 lines
2.8 KiB
C++

#pragma once
#include "FreeRTOSConfig.h"
namespace sys
{
enum class BusChannels
{
System,
SystemManagerRequests,
PowerManagerRequests
#ifndef MODULE_CORE_CUSTOM_BUS
#else
,
#include "BusChannelsCustom.hpp"
#endif
};
enum class ServicePriority
{
Idle = 0, ///< priority: idle (lowest)
Low = 1, ///< priority: low
Normal = 2, ///< priority: normal
High = 3, ///< priority: high
Realtime = 4, ///< priority: realtime (highest)
};
enum class ServicePowerMode
{
Active,
SuspendToRAM,
SuspendToNVM
};
enum class ReturnCodes
{
Success,
Failure,
Timeout,
ServiceDoesntExist,
// This is used in application's template in base class messages handler. The meaning is that
// message that was processed by base class implementation of the DataReceivedHandler was not processed
// and it should be handled by the class next in hierarchy.
Unresolved
};
} // namespace sys
inline const char *c_str(sys::ReturnCodes code)
{
switch (code) {
case sys::ReturnCodes::Success:
return "Success";
case sys::ReturnCodes::Failure:
return "Failure";
case sys::ReturnCodes::Timeout:
return "Timeout";
case sys::ReturnCodes::ServiceDoesntExist:
return "ServiceDoesntExist";
case sys::ReturnCodes::Unresolved:
return "Unresolved";
}
return "Undefined";
}
inline const char *c_str(sys::ServicePowerMode code)
{
switch (code) {
case sys::ServicePowerMode::Active:
return "Active";
case sys::ServicePowerMode::SuspendToRAM:
return "SuspendToRAM";
case sys::ServicePowerMode::SuspendToNVM:
return "SuspendToNVM";
}
return "";
}
inline const char *c_str(sys::BusChannels channel)
{
switch (channel) {
case sys::BusChannels::System:
return "System";
case sys::BusChannels::SystemManagerRequests:
return "SystemManagerRequests";
case sys::BusChannels::PowerManagerRequests:
return "PowerManagerRequests";
case sys::BusChannels::ServiceCellularNotifications:
return "ServiceCellularNotifications,";
case sys::BusChannels::Test2CustomBusChannel:
return "Test2CustomBusChannel,";
case sys::BusChannels::ServiceDBNotifications:
return "ServiceDBNotifications,";
case sys::BusChannels::ServiceAudioNotifications:
return "ServiceAudioNotifications";
case sys::BusChannels::AppManagerNotifications:
return "AppManagerNotifications,";
case sys::BusChannels::ServiceFotaNotifications:
return "ServiceFotaNotifications";
case sys::BusChannels::AntennaNotifications:
return "AntennaNotifications";
}
return "";
}