~aleteoryx/muditaos

d5de12f7cea071555de4058ebf62b160a86a36af — Radosław Wicik 5 years ago 140cce4
[EGD-3852] clean include in service (#928)

145 files changed, 1738 insertions(+), 732 deletions(-)

M module-services/service-antenna/ServiceAntenna.cpp
M module-services/service-antenna/ServiceAntenna.hpp
M module-services/service-antenna/api/AntennaServiceAPI.cpp
M module-services/service-antenna/api/AntennaServiceAPI.hpp
M module-services/service-appmgr/ApplicationManager.cpp
M module-services/service-appmgr/ApplicationManager.hpp
M module-services/service-appmgr/Controller.cpp
M module-services/service-appmgr/Controller.hpp
M module-services/service-audio/api/AudioServiceAPI.cpp
M module-services/service-audio/api/AudioServiceAPI.hpp
M module-services/service-bluetooth/ServiceBluetooth.cpp
M module-services/service-bluetooth/ServiceBluetooth.hpp
M module-services/service-cellular/CellularCall.cpp
M module-services/service-cellular/CellularCall.hpp
M module-services/service-cellular/ServiceCellular.cpp
M module-services/service-cellular/ServiceCellular.hpp
M module-services/service-cellular/SignalStrength.hpp
M module-services/service-cellular/api/CellularServiceAPI.cpp
M module-services/service-cellular/api/CellularServiceAPI.hpp
M module-services/service-db/ServiceDB.cpp
M module-services/service-db/ServiceDB.hpp
M module-services/service-db/agents/DatabaseAgent.cpp
M module-services/service-db/agents/DatabaseAgent.hpp
M module-services/service-db/agents/settings/Settings.cpp
M module-services/service-db/agents/settings/Settings.hpp
M module-services/service-db/agents/settings/SettingsAgent.cpp
M module-services/service-db/agents/settings/SettingsAgent.hpp
M module-services/service-db/api/DBServiceAPI.cpp
M module-services/service-db/api/DBServiceAPI.hpp
M module-services/service-db/api/DBServiceAPI_GetByQuery.cpp
M module-services/service-db/messages/DBAlarmMessage.cpp
M module-services/service-db/messages/DBAlarmMessage.hpp
M module-services/service-db/messages/DBCalllogMessage.cpp
M module-services/service-db/messages/DBCalllogMessage.hpp
M module-services/service-db/messages/DBContactMessage.cpp
M module-services/service-db/messages/DBContactMessage.hpp
M module-services/service-db/messages/DBCountryCodeMessage.cpp
M module-services/service-db/messages/DBCountryCodeMessage.hpp
M module-services/service-db/messages/DBNotesMessage.cpp
M module-services/service-db/messages/DBNotesMessage.hpp
M module-services/service-db/messages/DBNotificationMessage.cpp
M module-services/service-db/messages/DBNotificationMessage.hpp
M module-services/service-db/messages/DBSMSMessage.cpp
M module-services/service-db/messages/DBSMSMessage.hpp
M module-services/service-db/messages/DBSMSTemplateMessage.cpp
M module-services/service-db/messages/DBSMSTemplateMessage.hpp
M module-services/service-db/messages/DBServiceMessage.cpp
M module-services/service-db/messages/DBServiceMessage.hpp
M module-services/service-db/messages/DBSettingsMessage.cpp
M module-services/service-db/messages/DBSettingsMessage.hpp
M module-services/service-db/messages/DBThreadMessage.cpp
M module-services/service-db/messages/DBThreadMessage.hpp
M module-services/service-db/messages/QueryMessage.cpp
M module-services/service-db/test/test-service-db-api.cpp
M module-services/service-db/test/test-service-db-settings-api.cpp
M module-services/service-db/test/test-service-db-settings-messages.cpp
M module-services/service-desktop/ServiceDesktop.cpp
M module-services/service-desktop/ServiceDesktop.hpp
M module-services/service-desktop/WorkerDesktop.cpp
M module-services/service-desktop/WorkerDesktop.hpp
M module-services/service-desktop/endpoints/backup/BackupEndpoint.cpp
M module-services/service-desktop/endpoints/backup/BackupEndpoint.hpp
M module-services/service-desktop/endpoints/backup/BackupRestore.cpp
M module-services/service-desktop/endpoints/backup/BackupRestore.hpp
M module-services/service-desktop/endpoints/calllog/CalllogEndpoint.cpp
M module-services/service-desktop/endpoints/calllog/CalllogEndpoint.hpp
M module-services/service-desktop/endpoints/calllog/CalllogHelper.cpp
M module-services/service-desktop/endpoints/calllog/CalllogHelper.hpp
M module-services/service-desktop/endpoints/contacts/ContactHelper.cpp
M module-services/service-desktop/endpoints/contacts/ContactHelper.hpp
M module-services/service-desktop/endpoints/contacts/ContactsEndpoint.cpp
M module-services/service-desktop/endpoints/contacts/ContactsEndpoint.hpp
M module-services/service-desktop/endpoints/developerMode/DeveloperModeEndpoint.cpp
M module-services/service-desktop/endpoints/developerMode/DeveloperModeEndpoint.hpp
M module-services/service-desktop/endpoints/developerMode/DeveloperModeHelper.cpp
M module-services/service-desktop/endpoints/developerMode/DeveloperModeHelper.hpp
M module-services/service-desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp
M module-services/service-desktop/endpoints/deviceInfo/DeviceInfoEndpoint.hpp
M module-services/service-desktop/endpoints/factoryReset/FactoryReset.cpp
M module-services/service-desktop/endpoints/factoryReset/FactoryReset.hpp
M module-services/service-desktop/endpoints/factoryReset/FactoryResetEndpoint.cpp
M module-services/service-desktop/endpoints/factoryReset/FactoryResetEndpoint.hpp
M module-services/service-desktop/endpoints/messages/MessageHelper.cpp
M module-services/service-desktop/endpoints/messages/MessageHelper.hpp
M module-services/service-desktop/endpoints/messages/MessagesEndpoint.cpp
M module-services/service-desktop/endpoints/messages/MessagesEndpoint.hpp
M module-services/service-desktop/endpoints/restore/RestoreEndpoint.cpp
M module-services/service-desktop/endpoints/restore/RestoreEndpoint.hpp
M module-services/service-desktop/endpoints/update/UpdateEndpoint.cpp
M module-services/service-desktop/endpoints/update/UpdateEndpoint.hpp
M module-services/service-desktop/endpoints/update/UpdateMuditaOS.cpp
M module-services/service-desktop/endpoints/update/UpdateMuditaOS.hpp
M module-services/service-desktop/parser/MessageHandler.cpp
M module-services/service-desktop/parser/MessageHandler.hpp
M module-services/service-desktop/parser/ParserFSM.cpp
M module-services/service-desktop/parser/ParserFSM.hpp
M module-services/service-desktop/parser/ParserUtils.cpp
M module-services/service-desktop/parser/ParserUtils.hpp
M module-services/service-desktop/tests/unittest.cpp
M module-services/service-eink/ServiceEink.cpp
M module-services/service-eink/ServiceEink.hpp
M module-services/service-eink/board/linux/renderer/src/RArea.cpp
M module-services/service-eink/board/linux/renderer/src/RArea.hpp
M module-services/service-eink/board/linux/renderer/src/RWindow.cpp
M module-services/service-eink/board/linux/renderer/src/RWindow.hpp
M module-services/service-eink/board/linux/renderer/src/gui_renderer.cpp
M module-services/service-evtmgr/EventManager.cpp
M module-services/service-evtmgr/EventManager.hpp
M module-services/service-evtmgr/WorkerEvent.cpp
M module-services/service-evtmgr/WorkerEvent.hpp
M module-services/service-evtmgr/alarm/EventManagerAlarm.cpp
M module-services/service-evtmgr/api/EventManagerServiceAPI.cpp
M module-services/service-evtmgr/api/EventManagerServiceAPI.hpp
M module-services/service-evtmgr/harness/Parser.cpp
M module-services/service-evtmgr/harness/Parser.hpp
M module-services/service-evtmgr/harness/actions/CellularCMD.cpp
M module-services/service-evtmgr/harness/actions/CellularCMD.hpp
M module-services/service-evtmgr/harness/events/AtResponse.cpp
M module-services/service-evtmgr/harness/events/FocusApp.cpp
M module-services/service-evtmgr/harness/events/FocusApp.hpp
M module-services/service-evtmgr/harness/events/GPIO.cpp
M module-services/service-evtmgr/harness/events/GPIO.hpp
M module-services/service-evtmgr/harness/events/KeyPress.cpp
M module-services/service-evtmgr/harness/events/KeyPress.hpp
M module-services/service-evtmgr/harness/events/SysStart.cpp
M module-services/service-evtmgr/harness/events/SysStart.hpp
M module-services/service-evtmgr/messages/Message.cpp
M module-services/service-fota/ServiceFota.cpp
M module-services/service-fota/ServiceFota.hpp
M module-services/service-fota/api/FotaServiceAPI.cpp
M module-services/service-fota/api/FotaServiceAPI.hpp
M module-services/service-gui/ServiceGUI.cpp
M module-services/service-gui/ServiceGUI.hpp
M module-services/service-gui/WorkerGUI.cpp
M module-services/service-gui/WorkerGUI.hpp
M module-services/service-gui/messages/DrawMessage.cpp
M module-services/service-gui/messages/DrawMessage.hpp
M module-services/service-lwip/ServiceLwIP.cpp
M module-services/service-lwip/ServiceLwIP.hpp
M module-services/service-time/ServiceTime.cpp
M module-services/service-time/ServiceTime.hpp
M module-services/service-time/timeEvents/CalendarTimeEvents.cpp
M module-services/service-time/timeEvents/CalendarTimeEvents.hpp
M module-services/service-time/timeEvents/TimeEvents.cpp
M module-services/service-time/timeEvents/TimeEvents.hpp
M module-services/service-antenna/ServiceAntenna.cpp => module-services/service-antenna/ServiceAntenna.cpp +18 -15
@@ 2,21 2,24 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "ServiceAntenna.hpp"
#include "Service/Timer.hpp"
#include "api/AntennaServiceAPI.hpp"
#include "log/log.hpp"
#include "messages/AntennaMessage.hpp"
#include "service-appmgr/ApplicationManager.hpp"
#include <at/response.hpp>
#include <memory>
#include <module-utils/state/ServiceState.hpp>
#include <service-cellular/messages/CellularMessage.hpp>

#include "service-cellular/api/CellularServiceAPI.hpp"
#include "time/time_conversion.hpp"
#include <ticks.hpp>

#include <cassert>

#include <at/response.hpp> // for parseCSQ, isRegistered, parseCREG, parseNetworkFrequency, parseQNWINFO
#include <module-utils/state/ServiceState.hpp>           // for State
#include <service-cellular/messages/CellularMessage.hpp> // for CellularNotificationMessage, StateChange, CellularCallMessage, CellularNotificationMessage::Type, CellularNotificationMessage::Type::CallAborted
#include <ticks.hpp>                                     // for Ticks
#include <memory>                                        // for make_shared, unique_ptr, allocator, make_unique
#include <algorithm>                                     // for max
#include <string>                                        // for string
#include <vector>                                        // for vector

#include "Service/Timer.hpp"                           // for Timer
#include "api/AntennaServiceAPI.hpp"                   // for LockRequest
#include "log/log.hpp"                                 // for LOG_INFO, LOG_WARN, LOG_FATAL
#include "messages/AntennaMessage.hpp"                 // for AntennaLockRequestResponse, AntennaLockRequestMessage
#include "service-cellular/api/CellularServiceAPI.hpp" // for GetCSQ, GetAntenna, SelectAntenna, GetCREG, GetQNWINFO
#include "MessageType.hpp" // for MessageType, MessageType::AntennaCSQChange, MessageType::AntennaChanged, MessageType::AntennaGetLockState, MessageType::AntennaLockService, MessageType::CellularCall, MessageType::CellularNotification, MessageType::CellularStateRequest, MessageType::StateChange
#include "projdefs.h"      // for pdMS_TO_TICKS
#include "service-cellular/State.hpp" // for State, State::ST, State::ST::Ready

const char *ServiceAntenna::serviceName = "ServiceAntenna";


M module-services/service-antenna/ServiceAntenna.hpp => module-services/service-antenna/ServiceAntenna.hpp +18 -5
@@ 3,17 3,30 @@

#pragma once

#include <module-utils/state/ServiceState.hpp>
#include <stdint.h> // for uint32_t
#include <algorithm>
#include <cassert>
#include <memory> // for unique_ptr

#include "Service/Service.hpp"
#include "Service/Message.hpp"
#include "Service/Service.hpp" // for Service
#include "Service/Message.hpp" // for Message_t, DataMessage (ptr only), ResponseMessage (ptr only)
#include "Service/Worker.hpp"
#include "MessageType.hpp"
#include "bsp/cellular/bsp_cellular.hpp" // for antenna
#include "Service/Common.hpp"            // for ReturnCodes, ServicePowerMode

#include <module-utils/state/ServiceState.hpp>

#include "bsp/cellular/bsp_cellular.hpp"
namespace sys
{
    class Timer;
} // namespace sys
namespace utils
{
    namespace state
    {
        template <typename T> class State;
    } // namespace state
} // namespace utils

namespace antenna
{

M module-services/service-antenna/api/AntennaServiceAPI.cpp => module-services/service-antenna/api/AntennaServiceAPI.cpp +16 -1
@@ 2,7 2,22 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "AntennaServiceAPI.hpp"
#include "../messages/AntennaMessage.hpp"

#include <memory>  // for make_shared, allocator, shared_ptr, __shared_ptr<>::element_type
#include <utility> // for pair

#include "../messages/AntennaMessage.hpp" // for AntennaLockRequestMessage, AntennaLockRequestResponse
#include "MessageType.hpp" // for MessageType, MessageType::AntennaCSQChange, MessageType::AntennaGetLockState, MessageType::AntennaLockService
#include "Service/Bus.hpp"     // for Bus
#include "Service/Common.hpp"  // for ReturnCodes, ReturnCodes::Success, BusChannels, BusChannels::AntennaNotifications
#include "Service/Message.hpp" // for DataMessage
#include "service-antenna/ServiceAntenna.hpp" // for ServiceAntenna, ServiceAntenna::serviceName, lockState

namespace sys
{
    class Service;
} // namespace sys

namespace AntennaServiceAPI
{


M module-services/service-antenna/api/AntennaServiceAPI.hpp => module-services/service-antenna/api/AntennaServiceAPI.hpp +6 -1
@@ 6,7 6,12 @@
#include <MessageType.hpp>
#include <Service/Message.hpp>

#include "../ServiceAntenna.hpp"
#include "../ServiceAntenna.hpp" // for lockState

namespace sys
{
    class Service;
} // namespace sys

namespace AntennaServiceAPI
{

M module-services/service-appmgr/ApplicationManager.cpp => module-services/service-appmgr/ApplicationManager.cpp +21 -17
@@ 2,24 2,28 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "service-appmgr/ApplicationManager.hpp"
#include "service-appmgr/Controller.hpp"

#include <utility>
#include <module-apps/application-desktop/data/LockPhoneData.hpp>

#include "application-call/ApplicationCall.hpp"
#include "application-special-input/ApplicationSpecialInput.hpp"

#include "Service/Message.hpp"
#include "AppMessage.hpp"

#include "Service/Timer.hpp"
#include "service-db/api/DBServiceAPI.hpp"
#include "service-evtmgr/EventManager.hpp"
#include "service-eink/ServiceEink.hpp"
#include "service-gui/ServiceGUI.hpp"

#include "log/log.hpp"
#include <utility>   // for move
#include <algorithm> // for find_if
#include <limits>    // for numeric_limits

#include "service-appmgr/Controller.hpp"                         // for Controller
#include "application-call/ApplicationCall.hpp"                  // for name_call
#include "application-special-input/ApplicationSpecialInput.hpp" // for special_input
#include "Service/Message.hpp"             // for ResponseMessage, DataMessage (ptr only), Message_t
#include "AppMessage.hpp"                  // for AppSwitchWindowMessage
#include "Service/Timer.hpp"               // for Timer, Timer::Type, Timer::Type::SingleShot, ms
#include "service-db/api/DBServiceAPI.hpp" // for DBServiceAPI
#include "service-evtmgr/EventManager.hpp" // for EventManager
#include "service-eink/ServiceEink.hpp"    // for ServiceEink
#include "service-gui/ServiceGUI.hpp"      // for ServiceGUI
#include "log/log.hpp"                     // for LOG_INFO, LOG_ERROR, LOG_WARN, LOG_DEBUG, LOG_FATAL
#include "Common.hpp"                      // for ShowMode, ShowMode::GUI_SHOW_INIT
#include "Common/Common.hpp" // for SettingsLanguage, SettingsLanguage::ENGLISH, SettingsLanguage::GERMAN, SettingsLanguage::POLISH, SettingsLanguage::SPANISH
#include "Service/Bus.hpp"   // for Bus
#include "SystemManager/SystemManager.hpp"        // for SystemManager
#include "i18/i18.hpp"                            // for Lang, Lang::En, Lang::De, Lang::Pl, Lang::Sp, i18, localize
#include "service-appmgr/messages/APMMessage.hpp" // for APMCheckApp, APMSwitch, APMRegister, APMConfirmClose, APMConfirmSwitch, Action, APMAction, APMChangeLanguage, APMSwitchPrevApp, APMDelayedClose, APMClose, APMInitPowerSaveMode, APMPreventBlocking

// Auto phone lock disabled for now till the times when it's debugged
// #define AUTO_PHONE_LOCK_ENABLED

M module-services/service-appmgr/ApplicationManager.hpp => module-services/service-appmgr/ApplicationManager.hpp +24 -5
@@ 3,16 3,35 @@

#pragma once

#include <memory>
#include <string>

#include "Application.hpp"
#include "ApplicationLauncher.hpp"
#include <memory>      // for unique_ptr, allocator
#include <string>      // for string
#include <deque>       // for deque
#include <string_view> // for string_view
#include <vector>      // for vector

#include "Application.hpp"         // for Application, Application::State
#include "ApplicationLauncher.hpp" // for ApplicationLauncher
#include "messages/APMMessage.hpp"
#include "Service/Common.hpp"  // for ReturnCodes, ServicePowerMode
#include "Service/Message.hpp" // for Message_t, DataMessage (ptr only), ResponseMessage (ptr only)
#include "Service/Service.hpp" // for Service
#include "Service/Timer.hpp"   // for Timer
#include "SettingsRecord.hpp"  // for SettingsRecord
#include "SwitchData.hpp"      // for SwitchData

namespace app
{
    class ApplicationLauncher;
    namespace manager
    {
        class APMAction;
        class APMChangeLanguage;
        class APMConfirmClose;
        class APMConfirmSwitch;
        class APMRegister;
        class APMSwitch;
        class APMSwitchPrevApp;
    } // namespace manager
}

namespace app::manager

M module-services/service-appmgr/Controller.cpp => module-services/service-appmgr/Controller.cpp +5 -1
@@ 3,7 3,11 @@

#include "Controller.hpp"

#include "module-sys/Service/Bus.hpp"
#include <utility> // for move

#include "module-sys/Service/Bus.hpp" // for Bus
#include "Service/Service.hpp"        // for Service
#include "service-appmgr/ApplicationManager.hpp" // for ApplicationManager, ApplicationManager::ServiceName, ApplicationHandle, ApplicationHandle::Name

namespace app::manager
{

M module-services/service-appmgr/Controller.hpp => module-services/service-appmgr/Controller.hpp +11 -1
@@ 3,9 3,19 @@

#pragma once

#include "ApplicationManager.hpp"
#include <memory> // for unique_ptr
#include <string> // for string

#include "ApplicationManager.hpp" // for ApplicationHandle, ApplicationHandle::Name
#include "module-sys/Service/Service.hpp"
#include "SwitchData.hpp"                         // for SwitchData
#include "i18/i18.hpp"                            // for Lang
#include "service-appmgr/messages/APMMessage.hpp" // for APMSwitchPrevApp, Action (ptr only)

namespace sys
{
    class Service;
} // namespace sys

namespace app::manager
{

M module-services/service-audio/api/AudioServiceAPI.cpp => module-services/service-audio/api/AudioServiceAPI.cpp +14 -2
@@ 2,8 2,20 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "AudioServiceAPI.hpp"
#include "Service/Bus.hpp"
#include "../ServiceAudio.hpp"

#include <utility> // for move, pair

#include "Service/Bus.hpp"                         // for Bus, defaultCmdTimeout
#include "../ServiceAudio.hpp"                     // for ServiceAudio, ServiceAudio::serviceName
#include "Audio/decoder/decoder.hpp"               // for Tags
#include "Service/Common.hpp"                      // for ReturnCodes, ReturnCodes::Success
#include "log/log.hpp"                             // for LOG_DEBUG, LOG_ERROR
#include "service-audio/messages/AudioMessage.hpp" // for AudioStopRequest, AudioResponseMessage, AudioEventRequest, AudioGetFileTagsRequest, AudioGetSetting, AudioKeyPressedRequest, AudioPauseRequest, AudioResumeRequest, AudioStartPlaybackRequest, AudioStartRecorderRequest, AudioStartRoutingRequest, AudioMessage, AudioSetSetting (ptr only)

namespace sys
{
    class Service;
} // namespace sys

using namespace audio;
namespace AudioServiceAPI

M module-services/service-audio/api/AudioServiceAPI.hpp => module-services/service-audio/api/AudioServiceAPI.hpp +15 -2
@@ 3,12 3,25 @@

#pragma once

#include <optional> // for optional
#include <memory>   // for shared_ptr
#include <string>   // for string
#include <vector>   // for vector

#include "../messages/AudioMessage.hpp"
#include "Audio/decoder/decoder.hpp"

#include <optional>
#include "Audio/AudioCommon.hpp" // for PlaybackType, PlaybackType::None, Token (ptr only), RetCode, Setting, Event (ptr only), EventType
#include "Audio/Profiles/Profile.hpp" // for Profile, Profile::Type, Profile::Type::Idle

class Service;
namespace audio
{
    struct Tags;
} // namespace audio
namespace sys
{
    class Service;
} // namespace sys

/**
 * Audio service API.

M module-services/service-bluetooth/ServiceBluetooth.cpp => module-services/service-bluetooth/ServiceBluetooth.cpp +13 -8
@@ 2,14 2,19 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "ServiceBluetooth.hpp"
#include "Constants.hpp"
#include "Service/Service.hpp"
#include "Service/Message.hpp"
#include "MessageType.hpp"
#include "messages/BluetoothMessage.hpp"
#include <log/log.hpp>
#include <service-lwip/ServiceLwIP.hpp>
#include <module-sys/Service/Bus.hpp>

#include <log/log.hpp>                // for LOG_INFO, LOG_ERROR
#include <module-sys/Service/Bus.hpp> // for Bus
#include <bits/exception.h>           // for exception
#include <utility>                    // for move

#include "Constants.hpp"       // for bluetooth
#include "Service/Service.hpp" // for Service
#include "Service/Message.hpp" // for ResponseMessage, Message_t, DataMessage
#include "MessageType.hpp" // for MessageType, MessageType::BluetoothAddrResult, MessageType::BluetoothRequest, MessageType::BluetoothRequestStream
#include "messages/BluetoothMessage.hpp" // for BluetoothMessage, BluetoothRequestStreamResultMessage, BluetoothAddrMessage, BluetoothMessage::PAN, BluetoothMessage::Play, BluetoothMessage::Scan, BluetoothMessage::Start, BluetoothMessage::Stop, BluetoothMessage::StopScan, BluetoothMessage::Visible
#include "BluetoothWorker.hpp"           // for BluetoothWorker
#include "interface/profiles/Profile.hpp" // for Profile

ServiceBluetooth::ServiceBluetooth() : sys::Service(service::name::bluetooth)
{

M module-services/service-bluetooth/ServiceBluetooth.hpp => module-services/service-bluetooth/ServiceBluetooth.hpp +7 -2
@@ 3,9 3,14 @@

#pragma once

#include <memory> // for unique_ptr

#include "Bluetooth/BluetoothWorker.hpp"
#include "Service/Service.hpp"
#include <memory>
#include "Service/Service.hpp" // for Service
#include "Service/Common.hpp"  // for ReturnCodes, ServicePowerMode
#include "Service/Message.hpp" // for Message_t, DataMessage (ptr only), ResponseMessage (ptr only)

class BluetoothWorker;

class ServiceBluetooth : public sys::Service
{

M module-services/service-cellular/CellularCall.cpp => module-services/service-cellular/CellularCall.cpp +13 -9
@@ 2,15 2,19 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "CellularCall.hpp"
#include <Modem/ATParser.hpp>
#include <Utils.hpp>
#include <log/log.hpp>
#include <time/time_conversion.hpp>
#include <bsp/rtc/rtc.hpp>

#include <vector>
#include <string>
#include <sstream>

#include <Utils.hpp>                // for enum_cast, split
#include <log/log.hpp>              // for LOG_ERROR
#include <time/time_conversion.hpp> // for Timestamp, operator-, Duration
#include <inttypes.h>               // for PRIu32
#include <vector>                   // for vector
#include <string>    // for allocator, stoul, operator+, string, char_traits, operator<<, basic_string, to_string
#include <sstream>   // for operator<<, basic_ostream, basic_ostream<>::__ostream_type, ostream
#include <optional>  // for optional
#include <stdexcept> // for runtime_error

#include "CalllogRecord.hpp" // for CalllogRecord
#include "PhoneNumber.hpp"   // for PhoneNumber::View, PhoneNumber

namespace ModemCall
{

M module-services/service-cellular/CellularCall.hpp => module-services/service-cellular/CellularCall.hpp +11 -6
@@ 3,12 3,17 @@

#pragma once

#include <PhoneNumber.hpp>
#include <Interface/CalllogRecord.hpp>
#include <time/time_conversion.hpp>

#include <functional>
#include <string>
#include <PhoneNumber.hpp>             // for PhoneNumber::View, PhoneNumber
#include <Interface/CalllogRecord.hpp> // for CalllogRecord
#include <time/time_conversion.hpp>    // for Timestamp
#include <stdint.h>                    // for uint8_t, int8_t
#include <sys/types.h>                 // for time_t
#include <functional>                  // for function
#include <string>                      // for string
#include <iosfwd>                      // for ostream

#include "Tables/CalllogTable.hpp" // for CallType, CallType::CT_NONE
#include "utf8/UTF8.hpp"           // for UTF8

namespace ModemCall
{

M module-services/service-cellular/ServiceCellular.cpp => module-services/service-cellular/ServiceCellular.cpp +64 -56
@@ 1,63 1,71 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <algorithm>
#include <cassert>
#include <iostream>
#include <iterator>
#include <sstream>
#include <string>
#include <vector>

#include <ctime>
#include <functional>
#include <iomanip>

#include "Service/Message.hpp"
#include "Service/Service.hpp"
#include "Service/Timer.hpp"
#include <Utils.hpp>       // for removeNewLines, enumToString, split, to_string
#include <at/URC_QIND.hpp> // for QIND
#include <at/URC_CUSD.hpp> // for CUSD
#include <at/URC_CTZE.hpp> // for CTZE
#include <at/URC_CREG.hpp> // for CREG
#include <at/response.hpp> // for parseQNWINFO
#include <common_data/EventStore.hpp> // for GSM, GSM::SIM, GSM::SIM::SIM1, GSM::SIM::SIM_FAIL, GSM::SIM::SIM2, GSM::Tray, GSM::Tray::IN, Network
#include <service-evtmgr/Constants.hpp>                                    // for evt_manager
#include <country.hpp>                                                     // for Id, Id::UNKNOWN
#include <PhoneNumber.hpp>                                                 // for PhoneNumber::View, PhoneNumber
#include <module-db/queries/notifications/QueryNotificationsIncrement.hpp> // for Increment
#include <module-db/queries/messages/sms/QuerySMSSearchByType.hpp>         // for SMSSearchByType, SMSSearchByTypeResult
#include <log/log.hpp>      // for LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_FATAL, LOG_WARN, LOG_TRACE
#include <bits/exception.h> // for exception
#include <algorithm>        // for remove, max
#include <cassert>          // for assert
#include <iostream>         // for basic_istream, istringstream
#include <string>   // for string, allocator, basic_string, operator+, char_traits, to_string, stoi, getline, operator!=
#include <vector>   // for vector
#include <utility>  // for move
#include <optional> // for optional, nullopt, operator==
#include <map>      // for map

#include "Service/Message.hpp" // for DataMessage, ResponseMessage, Message_t
#include "Service/Service.hpp" // for Service
#include "Service/Timer.hpp"   // for Timer
#include "ServiceCellular.hpp"

#include "MessageType.hpp"

#include "messages/CellularMessage.hpp"

#include "SignalStrength.hpp"
#include "service-appmgr/ApplicationManager.hpp"
#include "service-appmgr/messages/APMMessage.hpp"
#include "service-evtmgr/messages/EVMessages.hpp"
#include "ucs2/UCS2.hpp"

#include "api/CellularServiceAPI.hpp"
#include "service-db/api/DBServiceAPI.hpp"
#include "service-db/messages/DBNotificationMessage.hpp"
#include "service-db/messages/QueryMessage.hpp"

#include "service-evtmgr/api/EventManagerServiceAPI.hpp"
#include "service-antenna/api/AntennaServiceAPI.hpp"
#include "service-antenna/messages/AntennaMessage.hpp"

#include "time/time_conversion.hpp"
#include <Utils.hpp>
#include <at/URC_QIND.hpp>
#include <at/URC_CUSD.hpp>
#include <at/URC_CTZE.hpp>
#include <at/URC_CREG.hpp>
#include <at/response.hpp>
#include <common_data/EventStore.hpp>
#include <service-evtmgr/Constants.hpp>
#include <country.hpp>
#include <PhoneNumber.hpp>
#include <module-db/queries/notifications/QueryNotificationsIncrement.hpp>
#include <module-db/queries/messages/sms/QuerySMSSearchByType.hpp>

#include <log/log.hpp>

#include <vector>
#include <utility>
#include <optional>
#include <string>
#include <ticks.hpp>
#include "MessageType.hpp" // for MessageType, MessageType::CellularGetAntenna, MessageType::CellularListCurrentCalls, MessageType::CellularAnswerIncomingCall, MessageType::CellularCall, MessageType::CellularCallRequest, MessageType::CellularGetCREG, MessageType::CellularGetCSQ, MessageType::CellularGetFirmwareVersion, MessageType::CellularGetIMSI, MessageType::CellularGetNWINFO, MessageType::CellularGetNetworkInfo, MessageType::CellularGetOwnNumber, MessageType::CellularGetScanMode, MessageType::CellularGetScanModeResult, MessageType::CellularHangupCall, MessageType::CellularNetworkInfoResult, MessageType::CellularNotification, MessageType::CellularOperatorsScanResult, MessageType::CellularSelectAntenna, MessageType::CellularSetScanMode, MessageType::CellularSimProcedure, MessageType::CellularStartOperatorsScan, MessageType::CellularStateRequest, MessageType::CellularTransmitDtmfTones, MessageType::CellularUSSDRequest, MessageType::DBServiceNotification, MessageType::EVMModemStatus, MessageType::EVMTimeUpdated
#include "messages/CellularMessage.hpp" // for CellularResponseMessage, CellularNotificationMessage, CellularNotificationMessage::Type, CellularCallMessage, CellularUSSDMessage, RawCommandRespAsync, RawCommandResp, CellularUSSDMessage::RequestType, CellularRequestMessage, StateChange, CellularGetChannelMessage, CellularGetChannelResponseMessage, CellularAntennaResponseMessage, CellularCallMessage::Type, CellularTimeNotificationMessage, CellularUSSDMessage::RequestType::abortSesion, CellularAntennaRequestMessage, CellularCallRequestMessage, CellularNotificationMessage::Type::CallActive, RawCommand, CellularCallMessage::Type::IncomingCall, CellularCallMessage::Type::Ringing, CellularDtmfRequestMessage, CellularNotificationMessage::Type::CallAborted, CellularNotificationMessage::Type::NetworkStatusUpdate, CellularNotificationMessage::Type::NewIncomingSMS, CellularNotificationMessage::Type::NewIncomingUSSD, CellularNotificationMessage::Type::PowerDownDeregistered, CellularNotificationMessage::Type::PowerDownDeregistering, CellularNotificationMessage::Type::SIM, CellularNotificationMessage::Type::SignalStrengthUpdate, CellularUSSDMessage::RequestType::pushSesionRequest, CellularNotificationMessage::Type::PowerUpProcedureComplete, CellularNotificationMessage::Type::RawCommand, CellularUSSDMessage::RequestType::pullSesionRequest
#include "SignalStrength.hpp"           // for SignalStrength
#include "service-evtmgr/messages/EVMessages.hpp"        // for SIMMessage, StatusStateMessage
#include "ucs2/UCS2.hpp"                                 // for UCS2
#include "api/CellularServiceAPI.hpp"                    // for USSDRequest
#include "service-db/api/DBServiceAPI.hpp"               // for DBServiceAPI
#include "service-db/messages/DBNotificationMessage.hpp" // for NotificationMessage
#include "service-db/messages/QueryMessage.hpp"          // for QueryResponse
#include "service-evtmgr/api/EventManagerServiceAPI.hpp" // for GetBoard
#include "service-antenna/api/AntennaServiceAPI.hpp"     // for CSQChange, LockRequest
#include "service-antenna/messages/AntennaMessage.hpp"   // for AntennaChangedMessage
#include "time/time_conversion.hpp"                      // for Timestamp
#include "Audio/AudioCommon.hpp"                         // for PlaybackType, PlaybackType::TextMessageRingtone
#include "AudioServiceAPI.hpp"                           // for PlaybackStart
#include "BaseInterface.hpp" // for Interface, Interface::Name, Interface::Name::Notifications, Interface::Name::SMS
#include "CalllogRecord.hpp" // for CalllogRecord
#include "Commands.hpp" // for AT, factory, Cmd, AT::SMS_GSM, getCommadsSet, AT::CREG, AT::CSQ, AT::QNWINFO, AT::QSIMSTAT, AT::SMS_UCSC2, AT::ATA, AT::ATD, AT::ATH, AT::CEER, AT::CIMI, AT::CLCC, AT::CMGD, AT::CMGS, AT::CNUM, AT::CUSD_CLOSE_SESSION, AT::CUSD_OPEN_SESSION, AT::CUSD_SEND, AT::DISABLE_TIME_ZONE_REPORTING, AT::DISABLE_TIME_ZONE_UPDATE, AT::ENABLE_NETWORK_REGISTRATION_URC, AT::ENABLE_TIME_ZONE_UPDATE, AT::GET_SCANMODE, AT::IPR, AT::QCMGR, AT::QCMGS, AT::QGMR, AT::QLDTMF, AT::SET_SCANMODE, AT::SET_SMS_TEXT_MODE_UCS2, AT::SET_TIME_ZONE_REPORTING, AT::SIMSTAT_ON, AT::SIM_DET, AT::SIM_DET_ON, AT::STORE_SETTINGS_ATW, AT::VTS, commadsSet, commadsSet::simInit
#include "Common/Common.hpp"          // for SMSType, SMSType::QUEUED, SMSType::FAILED, SMSType::INBOX, SMSType::OUTBOX
#include "Common/Query.hpp"           // for Query, Query::Type, Query::Type::Create, Query::Type::Update, QueryResult
#include "Modem/ATCommon.hpp"         // for Chanel, Chanel::BUSY, Chanel::NO_ANSWER, Chanel::NO_CARRIER
#include "Modem/ATParser.hpp"         // for ATParser
#include "Modem/TS0710/DLC_channel.h" // for DLC_channel, DLC_channel::Callback_t
#include "Modem/TS0710/TS0710.h" // for TS0710, TS0710::Channel, TS0710::Channel::Commands, TS0710::ConfState, TS0710::ConfState::Success, TS0710::Channel::Notifications, TS0710::ConfState::Failure, TS0710::Mode, TS0710::Mode::AT
#include "Modem/TS0710/TS0710_START.h" // for TS0710_START::START_SystemParameters_t
#include "NotificationsRecord.hpp" // for NotificationsRecord, NotificationsRecord::Key, NotificationsRecord::Key::Calls, NotificationsRecord::Key::Sms
#include "Result.hpp"              // for Result, Result::Code, Result::Code::OK
#include "Service/Bus.hpp"         // for Bus
#include "Tables/CalllogTable.hpp" // for CallType, CallType::CT_INCOMING, CallType::CT_MISSED, CallType::CT_OUTGOING
#include "Tables/Record.hpp"       // for DB_ID_NONE
#include "bsp/cellular/bsp_cellular.hpp" // for hotswap_trigger, sim_sel, value, Cellular, antenna, antenna::lowBand, status, value::ACTIVE, value::INACTIVE
#include "projdefs.h"                         // for pdMS_TO_TICKS
#include "service-antenna/ServiceAntenna.hpp" // for lockState, lockState::unlocked
#include "service-cellular/CellularCall.hpp" // for CellularCall, ModemCall, operator<<, CallState, CallState::Active, Forced, Forced::True
#include "service-cellular/State.hpp" // for State, State::ST, State::ST::CellularConfProcedure, State::ST::Failed, State::ST::PowerUpInProgress, State::ST::PowerUpProcedure, State::ST::ModemFatalFailure, State::ST::PowerDownWaiting, State::ST::AudioConfigurationProcedure, State::ST::Idle, State::ST::PowerDown, State::ST::SimInit, State::ST::ModemOn, State::ST::PowerDownStarted, State::ST::Ready, State::ST::SanityCheck, State::ST::SimSelect, State::ST::StatusCheck, State::ST::URCReady, cellular
#include "service-cellular/USSD.hpp" // for State, State::pullRequestSent, State::sesionAborted, State::pullResponseReceived, State::pushSesion, noTimeout, State::none, pullResponseTimeout, pullSesionTimeout
#include "task.h"                    // for vTaskDelay
#include "utf8/UTF8.hpp"             // for UTF8

const char *ServiceCellular::serviceName = "ServiceCellular";


M module-services/service-cellular/ServiceCellular.hpp => module-services/service-cellular/ServiceCellular.hpp +29 -11
@@ 4,20 4,38 @@
#ifndef PUREPHONE_SERVICECELLULAR_HPP
#define PUREPHONE_SERVICECELLULAR_HPP

#include "CellularCall.hpp"
#include "USSD.hpp"
#include "SMSRecord.hpp"
#include <Modem/TS0710/DLC_channel.h>
#include <Modem/TS0710/TS0710.h>
#include <Service/Service.hpp>
#include "messages/CellularMessage.hpp"
#include <Modem/TS0710/DLC_channel.h> // for DLC_channel::Callback_t, DLC_channel
#include <Modem/TS0710/TS0710.h>      // for TS0710
#include <Service/Service.hpp>        // for Service
#include <utf8/UTF8.hpp>
#include "State.hpp"
#include "bsp/common.hpp"

#include <optional>
#include <stdint.h> // for uint32_t
#include <optional> // for optional
#include <memory>   // for unique_ptr, allocator, make_unique, shared_ptr
#include <string>   // for string
#include <vector>   // for vector

#include "CellularCall.hpp"             // for CellularCall
#include "USSD.hpp"                     // for State, State::none
#include "SMSRecord.hpp"                // for SMSRecord
#include "messages/CellularMessage.hpp" // for CellularUSSDMessage, CellularUSSDMessage::RequestType
#include "State.hpp"                    // for State
#include "bsp/common.hpp"               // for Board, Board::none
#include "Modem/TS0710/TS0710_types.h"  // for PS460800, PortSpeed_e
#include "Service/Common.hpp"           // for ReturnCodes, ServicePowerMode
#include "Service/Message.hpp"          // for Message_t, DataMessage (ptr only), ResponseMessage (ptr only)

class MuxDaemon;
namespace db
{
    namespace query
    {
        class SMSSearchByTypeResult;
    } // namespace query
} // namespace db
namespace sys
{
    class Timer;
} // namespace sys

class ServiceCellular : public sys::Service
{

M module-services/service-cellular/SignalStrength.hpp => module-services/service-cellular/SignalStrength.hpp +2 -1
@@ 3,9 3,10 @@

#pragma once

#include "common_data/EventStore.hpp"
#include <limits>

#include "common_data/EventStore.hpp" // for SignalStrength, RssiBar

class SignalStrength
{
    // <rssi>   0           -113dBm or less

M module-services/service-cellular/api/CellularServiceAPI.cpp => module-services/service-cellular/api/CellularServiceAPI.cpp +17 -9
@@ 1,17 1,25 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "../ServiceCellular.hpp"
#include <PhoneNumber.hpp> // for PhoneNumber
#include <Service/Bus.hpp> // for Bus
#include <memory> // for make_shared, shared_ptr, allocator, dynamic_pointer_cast, operator!=, __shared_ptr_access, __shared_ptr<>::element_type
#include <string> // for string
#include <utility> // for pair, move

#include "../ServiceCellular.hpp" // for ServiceCellular, ServiceCellular::serviceName
#include "CellularServiceAPI.hpp"

#include <PhoneNumber.hpp>
#include <Service/Bus.hpp>
#include <utf8/UTF8.hpp>

#include <memory>
#include <string>
#include <utility>
#include "MessageType.hpp" // for MessageType, MessageType::CellularAnswerIncomingCall, MessageType::CellularGetAntenna, MessageType::CellularGetCREG, MessageType::CellularGetCSQ, MessageType::CellularGetFirmwareVersion, MessageType::CellularGetIMSI, MessageType::CellularGetNWINFO, MessageType::CellularGetNetworkInfo, MessageType::CellularGetOwnNumber, MessageType::CellularGetScanMode, MessageType::CellularHangupCall, MessageType::CellularSelectAntenna, MessageType::CellularSetScanMode, MessageType::CellularStartOperatorsScan
#include "Modem/TS0710/TS0710.h"                         // for TS0710, TS0710::Channel, TS0710::Channel::Data
#include "Service/Common.hpp"                            // for ReturnCodes, ReturnCodes::Success
#include "bsp/cellular/bsp_cellular.hpp"                 // for antenna
#include "log/log.hpp"                                   // for LOG_ERROR, LOG_DEBUG
#include "service-cellular/messages/CellularMessage.hpp" // for CellularRequestMessage, CellularResponseMessage, CellularAntennaRequestMessage, CellularUSSDMessage, CellularCallRequestMessage, CellularDtmfRequestMessage, CellularGetChannelMessage, CellularAntennaResponseMessage, CellularUSSDMessage::RequestType

namespace sys
{
    class Service;
} // namespace sys

bool CellularServiceAPI::DialNumber(sys::Service *serv, const utils::PhoneNumber &number)
{

M module-services/service-cellular/api/CellularServiceAPI.hpp => module-services/service-cellular/api/CellularServiceAPI.hpp +11 -4
@@ 2,13 2,20 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once
#include "../messages/CellularMessage.hpp"
#include <Modem/TS0710/TS0710.h> // for TS0710, TS0710::Channel
#include <PhoneNumber.hpp>       // for PhoneNumber
#include <stdint.h>              // for uint32_t
#include <string>                // for string, allocator

#include "../messages/CellularMessage.hpp" // for CellularUSSDMessage, CellularUSSDMessage::RequestType
#include "utf8/UTF8.hpp"
#include <Modem/TS0710/TS0710.h>
#include "module-bsp/bsp/cellular/bsp_cellular.hpp" // for antenna

#include <PhoneNumber.hpp>
#include "module-bsp/bsp/cellular/bsp_cellular.hpp"
class Service;
namespace sys
{
    class Service;
} // namespace sys

namespace CellularServiceAPI
{

M module-services/service-db/ServiceDB.cpp => module-services/service-db/ServiceDB.cpp +49 -21
@@ 3,27 3,55 @@

#include "ServiceDB.hpp"

#include "messages/DBSMSMessage.hpp"
#include "messages/DBThreadMessage.hpp"
#include "messages/DBNotificationMessage.hpp"
#include "messages/DBSettingsMessage.hpp"
#include "messages/DBSMSTemplateMessage.hpp"
#include "messages/DBContactMessage.hpp"
#include "messages/DBAlarmMessage.hpp"
#include "messages/DBNotesMessage.hpp"
#include "messages/DBCalllogMessage.hpp"
#include "messages/DBCountryCodeMessage.hpp"
#include <messages/DBServiceMessage.hpp>

#include "Database/Database.hpp"

#include "log/log.hpp"

#include "includes/DBServiceName.hpp"
#include "messages/QueryMessage.hpp"
#include <Service/Bus.hpp>
#include <cassert>
#include <time/ScopedTime.hpp>
#include <messages/DBServiceMessage.hpp> // for DBServiceResponseMessage, DBServiceMessageBackup
#include <Service/Bus.hpp>               // for Bus
#include <time/ScopedTime.hpp>           // for Scoped
#include <inttypes.h>                    // for PRIu32
#include <stdint.h>                      // for uint32_t
#include <cassert>                       // for assert
#include <optional>                      // for optional
#include <utility>                       // for move
#include <vector>                        // for vector

#include "messages/DBSMSMessage.hpp" // for DBSMSResponseMessage, DBSMSMessage
#include "messages/DBThreadMessage.hpp" // for DBThreadResponseMessage, DBThreadMessage, DBThreadGetCountMessage, DBThreadMessageGet
#include "messages/DBNotificationMessage.hpp" // for NotificationMessage
#include "messages/DBSettingsMessage.hpp"     // for DBSettingsResponseMessage, DBSettingsMessage
#include "messages/DBSMSTemplateMessage.hpp"  // for DBSMSTemplateMessage, DBSMSTemplateResponseMessage
#include "messages/DBContactMessage.hpp" // for DBContactMessage, DBContactResponseMessage, DBContactNumberResponseMessage, DBContactSearchMessage, DBContactBlock, DBContactNumberMessage
#include "messages/DBAlarmMessage.hpp"   // for DBAlarmResponseMessage, DBAlarmMessage
#include "messages/DBNotesMessage.hpp"   // for DBNotesResponseMessage, DBNotesMessage
#include "messages/DBCalllogMessage.hpp" // for DBCalllogResponseMessage, DBCalllogMessage, DBCalllogGetCount
#include "messages/DBCountryCodeMessage.hpp" // for DBCountryCodeResponseMessage, DBCountryCodeMessage
#include "Database/Database.hpp"             // for Database
#include "log/log.hpp"                       // for LOG_INFO, LOG_DEBUG, LOG_ERROR, LOG_FATAL
#include "includes/DBServiceName.hpp"        // for db
#include "messages/QueryMessage.hpp"         // for QueryMessage, QueryResponse
#include "AlarmsRecord.hpp"                  // for AlarmsRecordInterface, AlarmsRecord
#include "CalllogRecord.hpp"                 // for CalllogRecordInterface, CalllogRecord
#include "ContactRecord.hpp" // for ContactRecord, ContactRecordInterface, ContactRecordInterface::ContactNumberMatch
#include "CountryCodeRecord.hpp"         // for CountryCodeRecordInterface
#include "Databases/AlarmsDB.hpp"        // for AlarmsDB
#include "Databases/CalllogDB.hpp"       // for CalllogDB
#include "Databases/ContactsDB.hpp"      // for ContactsDB
#include "Databases/CountryCodesDB.hpp"  // for CountryCodesDB
#include "Databases/EventsDB.hpp"        // for EventsDB
#include "Databases/NotesDB.hpp"         // for NotesDB
#include "Databases/NotificationsDB.hpp" // for NotificationsDB
#include "Databases/SettingsDB.hpp"      // for SettingsDB
#include "Databases/SmsDB.hpp"           // for SmsDB
#include "EventsRecord.hpp"              // for EventsRecordInterface
#include "MessageType.hpp" // for MessageType, MessageType::DBContactGetByID, MessageType::DBContactGetByNumber, MessageType::DBContactGetBySpeedDial, MessageType::DBContactGetLimitOffset, MessageType::DBAlarmAdd, MessageType::DBAlarmGetCount, MessageType::DBAlarmGetLimitOffset, MessageType::DBAlarmGetNext, MessageType::DBAlarmRemove, MessageType::DBAlarmUpdate, MessageType::DBCalllogAdd, MessageType::DBCalllogGetCount, MessageType::DBCalllogGetLimitOffset, MessageType::DBCalllogRemove, MessageType::DBCalllogUpdate, MessageType::DBContactAdd, MessageType::DBContactBlock, MessageType::DBContactGetByName, MessageType::DBContactGetCount, MessageType::DBContactMatchByNumber, MessageType::DBContactRemove, MessageType::DBContactSearch, MessageType::DBContactUpdate, MessageType::DBCountryCode, MessageType::DBNotesAdd, MessageType::DBNotesGetCount, MessageType::DBNotesGetLimitOffset, MessageType::DBNotesRemove, MessageType::DBNotesUpdate, MessageType::DBQuery, MessageType::DBSMSAdd, MessageType::DBSMSGetCount, MessageType::DBSMSGetLastRecord, MessageType::DBSMSGetSMSLimitOffset, MessageType::DBSMSGetSMSLimitOffsetByThreadID, MessageType::DBSMSRemove, MessageType::DBSMSTemplateAdd, MessageType::DBSMSTemplateGetCount, MessageType::DBSMSTemplateGetLimitOffset, MessageType::DBSMSTemplateRemove, MessageType::DBSMSTemplateUpdate, MessageType::DBSMSUpdate, MessageType::DBServiceBackup, MessageType::DBSettingsGet, MessageType::DBSettingsUpdate, MessageType::DBThreadGet, MessageType::DBThreadGetCount, MessageType::DBThreadGetForContact, MessageType::DBThreadGetLimitOffset, MessageType::DBThreadRemove, MessageType::DBThreadUpdate
#include "NotesRecord.hpp" // for NotesRecordInterface
#include "NotificationsRecord.hpp"  // for NotificationsRecordInterface
#include "SMSRecord.hpp"            // for SMSRecord, SMSRecordInterface, SMSRecordField, SMSRecordField::ThreadID
#include "SMSTemplateRecord.hpp"    // for SMSTemplateRecordInterface
#include "SettingsRecord.hpp"       // for SettingsRecordInterface, SettingsRecord
#include "SettingsRecord_v2.hpp"    // for SettingsRecordInterface_v2
#include "Tables/Record.hpp"        // for DB_ID_NONE
#include "ThreadRecord.hpp"         // for ThreadRecord, ThreadRecordInterface
#include "agents/DatabaseAgent.hpp" // for DatabaseAgent
#include "agents/settings/SettingsAgent.hpp" // for SettingsAgent

static const auto service_db_stack = 1024 * 24;


M module-services/service-db/ServiceDB.hpp => module-services/service-db/ServiceDB.hpp +32 -2
@@ 3,6 3,10 @@

#pragma once

#include <memory> // for unique_ptr
#include <set>    // for set
#include <string> // for string

#include "Interface/AlarmsRecord.hpp"
#include "Interface/CalllogRecord.hpp"
#include "Interface/ContactRecord.hpp"


@@ 15,11 19,37 @@
#include "Interface/NotificationsRecord.hpp"
#include "Interface/EventsRecord.hpp"
#include "Interface/SettingsRecord_v2.hpp"
#include "Service/Message.hpp"
#include "Service/Service.hpp"
#include "Service/Message.hpp" // for Message_t, DataMessage (ptr only), ResponseMessage (ptr only)
#include "Service/Service.hpp" // for Service
#include "messages/DBNotificationMessage.hpp"
#include "agents/DatabaseAgent.hpp"
#include "agents/settings/SettingsAgent.hpp"
#include "BaseInterface.hpp"  // for Interface, Interface::Name
#include "Common/Query.hpp"   // for Query, Query::Type
#include "Service/Common.hpp" // for ReturnCodes, ServicePowerMode

class AlarmsDB;
class AlarmsRecordInterface;
class CalllogDB;
class CalllogRecordInterface;
class ContactRecordInterface;
class ContactsDB;
class CountryCodeRecordInterface;
class CountryCodesDB;
class DatabaseAgent;
class EventsDB;
class EventsRecordInterface;
class NotesDB;
class NotesRecordInterface;
class NotificationsDB;
class NotificationsRecordInterface;
class SMSRecordInterface;
class SMSTemplateRecordInterface;
class SettingsDB;
class SettingsRecordInterface;
class SettingsRecordInterface_v2;
class SmsDB;
class ThreadRecordInterface;

class ServiceDB : public sys::Service
{

M module-services/service-db/agents/DatabaseAgent.cpp => module-services/service-db/agents/DatabaseAgent.cpp +5 -0
@@ 3,5 3,10 @@

#include "DatabaseAgent.hpp"

namespace sys
{
    class Service;
} // namespace sys

DatabaseAgent::DatabaseAgent(sys::Service *parentService) : parentService(parentService)
{}

M module-services/service-db/agents/DatabaseAgent.hpp => module-services/service-db/agents/DatabaseAgent.hpp +7 -3
@@ 3,12 3,16 @@

#pragma once

#include <Database/Database.hpp>
#include <Database/Database.hpp> // for Database
#include <Service/Service.hpp>

#include <string>
#include <string> // for string
#include <memory> // for unique_ptr

class Database;
namespace sys
{
    class Service;
} // namespace sys

class DatabaseAgent
{

M module-services/service-db/agents/settings/Settings.cpp => module-services/service-db/agents/settings/Settings.cpp +10 -3
@@ 2,9 2,16 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "Settings.hpp"
#include "messages/SettingsMessages.hpp"
#include <Service/Service.hpp>
#include <Service/Bus.hpp>

#include <Service/Service.hpp> // for Service
#include <Service/Bus.hpp>     // for Bus
#include <utility>             // for move, pair
#include <vector>              // for vector

#include "messages/SettingsMessages.hpp" // for EntryPath, VariableChanged, CurrentModeChanged, CurrentProfileChanged, AddProfile, GetCurrentMode, GetCurrentProfile, GetVariable, ListModes, ListProfiles, RegisterOnModeChange, RegisterOnProfileChange, RegisterOnVariableChange, SetCurrentMode, SetCurrentProfile, SetVariable, UnregisterOnModeChange, UnregisterOnProfileChange, UnregisterOnVariableChange, VariableResponse, ModeListResponse, ModeResponse, ProfileListResponse, ProfileResponse, SettingsMessage (ptr only)
#include "Service/Common.hpp" // for BusChannels, BusChannels::ServiceDBNotifications, ReturnCodes, ReturnCodes::Success
#include "Service/Message.hpp" // for ResponseMessage, DataMessage, Message_t
#include "log/log.hpp"         // for LOG_DEBUG, LOG_INFO, LOG_ERROR

namespace Settings
{

M module-services/service-db/agents/settings/Settings.hpp => module-services/service-db/agents/settings/Settings.hpp +9 -7
@@ 3,18 3,20 @@

#pragma once

#include <list>
#include <functional>
#include <map>
#include <memory>
#include <string>

#include <includes/DBServiceName.hpp>
#include <includes/DBServiceName.hpp> // for db
#include <stdint.h>                   // for int16_t
#include <list>                       // for list
#include <functional>                 // for function
#include <map>                        // for map
#include <memory>                     // for shared_ptr, allocator
#include <string>                     // for string
#include <optional>                   // for optional

namespace sys
{
    class Service;
    class Message;

    using Message_t = std::shared_ptr<Message>;
}; // namespace sys


M module-services/service-db/agents/settings/SettingsAgent.cpp => module-services/service-db/agents/settings/SettingsAgent.cpp +9 -6
@@ 1,14 1,17 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "SettingsAgent.hpp"

#include <module-sys/Service/Bus.hpp>
#include <module-vfs/vfs.hpp>
#include <module-sys/Service/Bus.hpp> // for Bus
#include <module-vfs/vfs.hpp>         // for USER_PATH
#include <memory>                     // for make_shared, allocator, shared_ptr, make_unique, unique_ptr
#include <functional>                 // for _Bind_helper<>::type, _Placeholder, bind, _1, _2
#include <utility>                    // for move

#include <log/log.hpp>

#include <memory>
#include "Database/Database.hpp"         // for Database
#include "Service/Service.hpp"           // for Service
#include "messages/SettingsMessages.hpp" // for SetVariable, GetVariable, VariableChanged, VariableResponse, EntryPath

SettingsAgent::SettingsAgent(sys::Service *parentService) : DatabaseAgent(parentService)
{

M module-services/service-db/agents/settings/SettingsAgent.hpp => module-services/service-db/agents/settings/SettingsAgent.hpp +14 -1
@@ 3,8 3,21 @@

#pragma once

#include <optional> // for optional
#include <string>   // for string

#include "messages/SettingsMessages.hpp"
#include "agents/DatabaseAgent.hpp"
#include "agents/DatabaseAgent.hpp" // for DatabaseAgent
#include "Service/Message.hpp"      // for DataMessage (ptr only), Message_t, ResponseMessage (ptr only)

namespace Settings
{
    struct EntryPath;
} // namespace Settings
namespace sys
{
    class Service;
} // namespace sys

class SettingsAgent : public DatabaseAgent
{

M module-services/service-db/api/DBServiceAPI.cpp => module-services/service-db/api/DBServiceAPI.cpp +40 -22
@@ 3,28 3,46 @@

#include "DBServiceAPI.hpp"

#include <messages/DBThreadMessage.hpp>
#include <messages/DBSettingsMessage.hpp>
#include <messages/DBSMSMessage.hpp>
#include <messages/DBSMSTemplateMessage.hpp>
#include <messages/DBContactMessage.hpp>
#include <messages/DBAlarmMessage.hpp>
#include <messages/DBNotesMessage.hpp>
#include <messages/DBCalllogMessage.hpp>
#include <messages/DBCountryCodeMessage.hpp>
#include <messages/DBServiceMessage.hpp>
#include <messages/QueryMessage.hpp>

#include <Common/Query.hpp>
#include <queries/phonebook/QueryNumberGetByID.hpp>
#include <queries/messages/threads/QueryThreadGetByNumber.hpp>

#include <ServiceDB.hpp>
#include <includes/DBServiceName.hpp>

#include <Utils.hpp>

#include <cassert>
#include <messages/DBThreadMessage.hpp> // for DBThreadMessage, DBThreadResponseMessage, DBThreadGetCountMessage, DBThreadMessageGet
#include <messages/DBSettingsMessage.hpp> // for DBSettingsMessage, DBSettingsResponseMessage
#include <messages/DBSMSMessage.hpp>      // for DBSMSMessage, DBSMSResponseMessage, DBSMSGetCount
#include <messages/DBSMSTemplateMessage.hpp> // for DBSMSTemplateMessage, DBSMSTemplateResponseMessage, DBSMSTemplateGetCount
#include <messages/DBContactMessage.hpp> // for DBContactMessage, DBContactResponseMessage, DBContactBlock, DBContactNumberMessage, DBContactSearchMessage, DBContactNumberResponseMessage
#include <messages/DBAlarmMessage.hpp>   // for DBAlarmMessage, DBAlarmResponseMessage
#include <messages/DBNotesMessage.hpp>   // for DBNotesMessage, DBNotesResponseMessage
#include <messages/DBCalllogMessage.hpp> // for DBCalllogMessage, DBCalllogResponseMessage, DBCalllogGetCount
#include <messages/DBCountryCodeMessage.hpp>                   // for DBCountryCodeMessage, DBCountryCodeResponseMessage
#include <messages/DBServiceMessage.hpp>                       // for DBServiceMessageBackup
#include <messages/QueryMessage.hpp>                           // for QueryResponse
#include <Common/Query.hpp>                                    // for Query, QueryResult
#include <queries/phonebook/QueryNumberGetByID.hpp>            // for NumberGetByID, NumberGetByIDResult
#include <queries/messages/threads/QueryThreadGetByNumber.hpp> // for ThreadGetByNumber, ThreadGetByNumberResult
#include <includes/DBServiceName.hpp>                          // for db
#include <Utils.hpp>                                           // for to_string
#include <ext/alloc_traits.h>                                  // for __alloc_traits<>::value_type
#include <cassert>                                             // for assert
#include <utility>                                             // for pair, move, tuple_element<>::type

#include "AlarmsRecord.hpp"  // for AlarmsRecord
#include "CalllogRecord.hpp" // for CalllogRecord, operator<<
#include "ContactRecord.hpp" // for ContactRecord, ContactRecord::Number
#include "MessageType.hpp" // for MessageType, MessageType::DBContactGetByID, MessageType::DBAlarmAdd, MessageType::DBAlarmGetCount, MessageType::DBAlarmGetLimitOffset, MessageType::DBAlarmGetNext, MessageType::DBAlarmRemove, MessageType::DBAlarmUpdate, MessageType::DBCalllogAdd, MessageType::DBCalllogGetLimitOffset, MessageType::DBCalllogRemove, MessageType::DBCalllogUpdate, MessageType::DBContactAdd, MessageType::DBContactBlock, MessageType::DBContactGetByName, MessageType::DBContactGetByNumber, MessageType::DBContactGetBySpeedDial, MessageType::DBContactGetCount, MessageType::DBContactGetLimitOffset, MessageType::DBContactRemove, MessageType::DBContactSearch, MessageType::DBContactUpdate, MessageType::DBCountryCode, MessageType::DBNotesAdd, MessageType::DBNotesGetCount, MessageType::DBNotesGetLimitOffset, MessageType::DBNotesRemove, MessageType::DBNotesUpdate, MessageType::DBSMSAdd, MessageType::DBSMSGetLastRecord, MessageType::DBSMSGetSMSLimitOffset, MessageType::DBSMSGetSMSLimitOffsetByThreadID, MessageType::DBSMSRemove, MessageType::DBSMSTemplateAdd, MessageType::DBSMSTemplateGetLimitOffset, MessageType::DBSMSTemplateRemove, MessageType::DBSMSTemplateUpdate, MessageType::DBSMSUpdate, MessageType::DBServiceBackup, MessageType::DBSettingsGet, MessageType::DBSettingsUpdate, MessageType::DBThreadGet, MessageType::DBThreadGetForContact, MessageType::DBThreadGetLimitOffset, MessageType::DBThreadRemove, MessageType::DBThreadUpdate
#include "PhoneNumber.hpp" // for PhoneNumber::View, PhoneNumber
#include "SMSRecord.hpp"   // for SMSRecord
#include "SMSTemplateRecord.hpp"        // for SMSTemplateRecord
#include "Service/Bus.hpp"              // for Bus
#include "Service/Common.hpp"           // for ReturnCodes, ReturnCodes::Success, c_str
#include "SettingsRecord.hpp"           // for SettingsRecord
#include "Tables/CountryCodesTable.hpp" // for CodesTableRow
#include "Tables/Record.hpp"            // for DB_ID_NONE
#include "ThreadRecord.hpp"             // for ThreadRecord
#include "log/log.hpp"                  // for LOG_DEBUG, LOG_ERROR, LOG_INFO

namespace sys
{
    class Service;
} // namespace sys
struct NotesRecord;

SettingsRecord DBServiceAPI::SettingsGet(sys::Service *serv)
{

M module-services/service-db/api/DBServiceAPI.hpp => module-services/service-db/api/DBServiceAPI.hpp +28 -11
@@ 3,23 3,40 @@

#pragma once

#include "Interface/AlarmsRecord.hpp"
#include "Interface/CalllogRecord.hpp"
#include <Common/Query.hpp>
#include <PhoneNumber.hpp>     // for PhoneNumber
#include <Service/Message.hpp> // for MessageRet_t
#include <stdint.h>            // for uint32_t
#include <sys/types.h>         // for time_t
#include <memory>              // for unique_ptr, shared_ptr
#include <string>              // for string
#include <vector>              // for vector

#include "Interface/AlarmsRecord.hpp"  // for AlarmsRecord
#include "Interface/CalllogRecord.hpp" // for CalllogRecord
#include "Interface/ContactRecord.hpp"
#include "Interface/NotesRecord.hpp"
#include "Interface/SMSRecord.hpp"
#include "Interface/SettingsRecord.hpp"
#include "Interface/ThreadRecord.hpp"
#include "Interface/SMSTemplateRecord.hpp"
#include "Interface/SMSRecord.hpp"         // for SMSRecord
#include "Interface/SettingsRecord.hpp"    // for SettingsRecord
#include "Interface/ThreadRecord.hpp"      // for ThreadRecord
#include "Interface/SMSTemplateRecord.hpp" // for SMSTemplateRecord
#include "Service/Bus.hpp"
#include "Interface/SettingsRecord_v2.hpp"

#include <Common/Query.hpp>
#include <PhoneNumber.hpp>

#include <Service/Message.hpp>
#include "BaseInterface.hpp" // for Interface, Interface::Name
#include "Common/Common.hpp" // for EntryState, EntryState::ALL
#include "utf8/UTF8.hpp"     // for UTF8

class DBContactMessage;
namespace db
{
    class Query;
} // namespace db
namespace sys
{
    class Service;
} // namespace sys
struct ContactRecord;
struct NotesRecord;

class DBServiceAPI
{

M module-services/service-db/api/DBServiceAPI_GetByQuery.cpp => module-services/service-db/api/DBServiceAPI_GetByQuery.cpp +17 -5
@@ 1,13 1,25 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "DBServiceAPI.hpp"
#include <includes/DBServiceName.hpp> // for db
#include <messages/QueryMessage.hpp>  // for QueryMessage
#include <Service/Message.hpp>        // for MessageRet_t
#include <stdint.h>                   // for uint32_t
#include <utility>                    // for move
#include <memory>                     // for make_shared, allocator, unique_ptr

#include <includes/DBServiceName.hpp>
#include <messages/QueryMessage.hpp>
#include <Service/Message.hpp>
#include "DBServiceAPI.hpp"  // for DBServiceAPI
#include "BaseInterface.hpp" // for Interface, Interface::Name
#include "Service/Bus.hpp"   // for Bus

#include <utility>
namespace db
{
    class Query;
} // namespace db
namespace sys
{
    class Service;
} // namespace sys

bool DBServiceAPI::GetQuery(sys::Service *serv, db::Interface::Name database, std::unique_ptr<db::Query> query)
{

M module-services/service-db/messages/DBAlarmMessage.cpp => module-services/service-db/messages/DBAlarmMessage.cpp +5 -0
@@ 3,6 3,11 @@

#include "DBAlarmMessage.hpp"

#include <utility> // for move

#include "AlarmsRecord.hpp"       // for AlarmsRecord
#include "messages/DBMessage.hpp" // for DBMessage, DBResponseMessage

DBAlarmMessage ::DBAlarmMessage(MessageType messageType, const AlarmsRecord &rec) : DBMessage(messageType), record(rec)
{}


M module-services/service-db/messages/DBAlarmMessage.hpp => module-services/service-db/messages/DBAlarmMessage.hpp +8 -2
@@ 3,8 3,14 @@

#pragma once

#include "DBMessage.hpp"
#include "Interface/AlarmsRecord.hpp"
#include <stdint.h>    // for uint32_t
#include <sys/types.h> // for time_t
#include <memory>      // for unique_ptr
#include <vector>      // for vector

#include "DBMessage.hpp"              // for DBMessage, DBResponseMessage
#include "Interface/AlarmsRecord.hpp" // for AlarmsRecord
#include "MessageType.hpp"            // for MessageType, MessageType::MessageTypeUninitialized

class DBAlarmMessage : public DBMessage
{

M module-services/service-db/messages/DBCalllogMessage.cpp => module-services/service-db/messages/DBCalllogMessage.cpp +5 -0
@@ 3,6 3,11 @@

#include "DBCalllogMessage.hpp"

#include <utility> // for move

#include "CalllogRecord.hpp"      // for CalllogRecord
#include "messages/DBMessage.hpp" // for DBMessage, DBResponseMessage

DBCalllogMessage::DBCalllogMessage(MessageType messageType, const CalllogRecord &rec)
    : DBMessage(messageType), record(rec)
{}

M module-services/service-db/messages/DBCalllogMessage.hpp => module-services/service-db/messages/DBCalllogMessage.hpp +8 -2
@@ 3,8 3,14 @@

#pragma once

#include "DBMessage.hpp"
#include "Interface/CalllogRecord.hpp"
#include <stdint.h> // for uint32_t
#include <memory>   // for unique_ptr
#include <vector>   // for vector

#include "DBMessage.hpp"               // for DBMessage, DBResponseMessage
#include "Interface/CalllogRecord.hpp" // for CalllogRecord
#include "Common/Common.hpp"           // for EntryState
#include "MessageType.hpp"             // for MessageType, MessageType::MessageTypeUninitialized

class DBCalllogMessage : public DBMessage
{

M module-services/service-db/messages/DBContactMessage.cpp => module-services/service-db/messages/DBContactMessage.cpp +7 -3
@@ 2,10 2,14 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "DBContactMessage.hpp"
#include "MessageType.hpp"

#include <memory>
#include <utility>
#include <memory>  // for unique_ptr
#include <utility> // for move

#include "MessageType.hpp"        // for MessageType, MessageType::DBContactMatchByNumber
#include "ContactRecord.hpp"      // for ContactRecord
#include "PhoneNumber.hpp"        // for PhoneNumber
#include "messages/DBMessage.hpp" // for DBMessage, DBResponseMessage

DBContactMessage ::DBContactMessage(MessageType messageType, const ContactRecord &rec, bool favourite)
    : DBMessage(messageType), record(rec), favourite{favourite}

M module-services/service-db/messages/DBContactMessage.hpp => module-services/service-db/messages/DBContactMessage.hpp +10 -9
@@ 3,16 3,17 @@

#pragma once

#include "MessageType.hpp"

#include "DBMessage.hpp"
#include "Interface/ContactRecord.hpp"
#include "Service/Message.hpp"

#include <PhoneNumber.hpp>

#include <memory>
#include <PhoneNumber.hpp> // for PhoneNumber, PhoneNumber::View
#include <stdint.h>        // for uint32_t
#include <memory>          // for unique_ptr
#include <utility>
#include <vector> // for vector

#include "MessageType.hpp"             // for MessageType, MessageType::MessageTypeUninitialized
#include "DBMessage.hpp"               // for DBMessage, DBResponseMessage
#include "Interface/ContactRecord.hpp" // for ContactRecord
#include "Service/Message.hpp"         // for DataMessage, ResponseMessage
#include "Service/Common.hpp"          // for ReturnCodes

class DBContactMessage : public DBMessage
{

M module-services/service-db/messages/DBCountryCodeMessage.cpp => module-services/service-db/messages/DBCountryCodeMessage.cpp +2 -0
@@ 3,6 3,8 @@

#include "DBCountryCodeMessage.hpp"

#include "messages/DBMessage.hpp" // for DBMessage, DBResponseMessage

DBCountryCodeMessage::DBCountryCodeMessage(MessageType messageType, const uint32_t _mcc, const uint32_t _country_code)
    : DBMessage(messageType), mcc(_mcc), country_code(_country_code)
{}

M module-services/service-db/messages/DBCountryCodeMessage.hpp => module-services/service-db/messages/DBCountryCodeMessage.hpp +5 -1
@@ 3,8 3,12 @@

#pragma once

#include "DBMessage.hpp"
#include <stdint.h> // for uint32_t

#include "DBMessage.hpp" // for DBMessage, DBResponseMessage
#include "Interface/CountryCodeRecord.hpp"
#include "MessageType.hpp"              // for MessageType, MessageType::MessageTypeUninitialized
#include "Tables/CountryCodesTable.hpp" // for CodesTableRow

class DBCountryCodeMessage : public DBMessage
{

M module-services/service-db/messages/DBNotesMessage.cpp => module-services/service-db/messages/DBNotesMessage.cpp +5 -0
@@ 3,6 3,11 @@

#include "DBNotesMessage.hpp"

#include <utility> // for move

#include "NotesRecord.hpp"        // for NotesRecord
#include "messages/DBMessage.hpp" // for DBMessage, DBResponseMessage

DBNotesMessage::DBNotesMessage(MessageType messageType, const NotesRecord &rec) : DBMessage(messageType), record(rec)
{}


M module-services/service-db/messages/DBNotesMessage.hpp => module-services/service-db/messages/DBNotesMessage.hpp +7 -2
@@ 3,8 3,13 @@

#pragma once

#include "DBMessage.hpp"
#include "Interface/NotesRecord.hpp"
#include <stdint.h> // for uint32_t
#include <memory>   // for unique_ptr
#include <vector>   // for vector

#include "DBMessage.hpp"             // for DBMessage, DBResponseMessage
#include "Interface/NotesRecord.hpp" // for NotesRecord
#include "MessageType.hpp"           // for MessageType, MessageType::MessageTypeUninitialized

class DBNotesMessage : public DBMessage
{

M module-services/service-db/messages/DBNotificationMessage.cpp => module-services/service-db/messages/DBNotificationMessage.cpp +4 -0
@@ 3,6 3,10 @@

#include "DBNotificationMessage.hpp"

#include "BaseInterface.hpp" // for Interface, Interface::Name
#include "Common/Query.hpp"  // for Query, Query::Type, Query::Type::Create, Query::Type::Delete, Query::Type::Update
#include "MessageType.hpp"   // for MessageType, MessageType::DBServiceNotification

namespace db
{
    NotificationMessage::NotificationMessage(db::Interface::Name interface, Query::Type type)

M module-services/service-db/messages/DBNotificationMessage.hpp => module-services/service-db/messages/DBNotificationMessage.hpp +5 -4
@@ 3,11 3,12 @@

#pragma once

#include "DBMessage.hpp"
#include "Service/Message.hpp"
#include <module-db/Interface/BaseInterface.hpp> // for Interface, Interface::Name
#include <module-db/Common/Query.hpp>            // for Query, Query::Type
#include <memory>
#include <module-db/Interface/BaseInterface.hpp>
#include <module-db/Common/Query.hpp>

#include "DBMessage.hpp"
#include "Service/Message.hpp" // for DataMessage

namespace db
{

M module-services/service-db/messages/DBSMSMessage.cpp => module-services/service-db/messages/DBSMSMessage.cpp +5 -0
@@ 3,6 3,11 @@

#include "DBSMSMessage.hpp"

#include <utility> // for move

#include "SMSRecord.hpp"          // for SMSRecord
#include "messages/DBMessage.hpp" // for DBMessage, DBResponseMessage

DBSMSMessage::DBSMSMessage(MessageType messageType, const SMSRecord &rec) : DBMessage(messageType), record(rec)
{}


M module-services/service-db/messages/DBSMSMessage.hpp => module-services/service-db/messages/DBSMSMessage.hpp +7 -2
@@ 3,8 3,13 @@

#pragma once

#include "DBMessage.hpp"
#include "Interface/SMSRecord.hpp"
#include <stdint.h> // for uint32_t
#include <memory>   // for unique_ptr
#include <vector>   // for vector

#include "DBMessage.hpp"           // for DBMessage, DBResponseMessage
#include "Interface/SMSRecord.hpp" // for SMSRecord
#include "MessageType.hpp"         // for MessageType, MessageType::MessageTypeUninitialized

class DBSMSMessage : public DBMessage
{

M module-services/service-db/messages/DBSMSTemplateMessage.cpp => module-services/service-db/messages/DBSMSTemplateMessage.cpp +5 -0
@@ 3,6 3,11 @@

#include "DBSMSTemplateMessage.hpp"

#include <utility> // for move

#include "SMSTemplateRecord.hpp"  // for SMSTemplateRecord
#include "messages/DBMessage.hpp" // for DBMessage, DBResponseMessage

DBSMSTemplateMessage::DBSMSTemplateMessage(MessageType messageType, const SMSTemplateRecord &rec)
    : DBMessage(messageType), record(rec)
{}

M module-services/service-db/messages/DBSMSTemplateMessage.hpp => module-services/service-db/messages/DBSMSTemplateMessage.hpp +7 -2
@@ 3,8 3,13 @@

#pragma once

#include "DBMessage.hpp"
#include "Interface/SMSTemplateRecord.hpp"
#include <stdint.h> // for uint32_t
#include <memory>   // for unique_ptr
#include <vector>   // for vector

#include "DBMessage.hpp"                   // for DBMessage, DBResponseMessage
#include "Interface/SMSTemplateRecord.hpp" // for SMSTemplateRecord
#include "MessageType.hpp"                 // for MessageType, MessageType::MessageTypeUninitialized

class DBSMSTemplateMessage : public DBMessage
{

M module-services/service-db/messages/DBServiceMessage.cpp => module-services/service-db/messages/DBServiceMessage.cpp +2 -0
@@ 3,6 3,8 @@

#include "DBServiceMessage.hpp"

#include "messages/DBMessage.hpp" // for DBMessage, DBResponseMessage

DBServiceMessageBackup::DBServiceMessageBackup(MessageType messageType, std::string backupPath)
    : DBMessage(messageType), backupPath(backupPath)
{}

M module-services/service-db/messages/DBServiceMessage.hpp => module-services/service-db/messages/DBServiceMessage.hpp +5 -1
@@ 3,7 3,11 @@

#pragma once

#include "DBMessage.hpp"
#include <stdint.h> // for uint32_t
#include <string>   // for string

#include "DBMessage.hpp"   // for DBMessage, DBResponseMessage
#include "MessageType.hpp" // for MessageType, MessageType::MessageTypeUninitialized

class DBServiceMessageBackup : public DBMessage
{

M module-services/service-db/messages/DBSettingsMessage.cpp => module-services/service-db/messages/DBSettingsMessage.cpp +5 -0
@@ 3,6 3,11 @@

#include "DBSettingsMessage.hpp"

#include "SettingsRecord_v2.hpp"  // for SettingsRecord_v2
#include "messages/DBMessage.hpp" // for DBMessage, DBResponseMessage

struct SettingsRecord;

DBSettingsMessage::DBSettingsMessage(MessageType messageType, const SettingsRecord &rec)
    : DBMessage(messageType), record(rec)
{}

M module-services/service-db/messages/DBSettingsMessage.hpp => module-services/service-db/messages/DBSettingsMessage.hpp +7 -3
@@ 3,9 3,13 @@

#pragma once

#include "DBMessage.hpp"
#include "Interface/SettingsRecord.hpp"
#include "Interface/SettingsRecord_v2.hpp"
#include <stdint.h> // for uint32_t
#include <string>   // for string

#include "DBMessage.hpp"                   // for DBMessage, DBResponseMessage
#include "Interface/SettingsRecord.hpp"    // for SettingsRecord
#include "Interface/SettingsRecord_v2.hpp" // for SettingsRecord_v2
#include "MessageType.hpp"                 // for MessageType, MessageType::MessageTypeUninitialized

class DBSettingsMessage : public DBMessage
{

M module-services/service-db/messages/DBThreadMessage.cpp => module-services/service-db/messages/DBThreadMessage.cpp +5 -0
@@ 3,6 3,11 @@

#include "DBThreadMessage.hpp"

#include <utility> // for move

#include "ThreadRecord.hpp"       // for ThreadRecord
#include "messages/DBMessage.hpp" // for DBMessage, DBResponseMessage

DBThreadMessage::DBThreadMessage(MessageType messageType, const ThreadRecord &rec) : DBMessage(messageType), record(rec)
{}


M module-services/service-db/messages/DBThreadMessage.hpp => module-services/service-db/messages/DBThreadMessage.hpp +8 -2
@@ 3,8 3,14 @@

#pragma once

#include "DBMessage.hpp"
#include "Interface/ThreadRecord.hpp"
#include <stdint.h> // for uint32_t
#include <memory>   // for unique_ptr
#include <vector>   // for vector

#include "DBMessage.hpp"              // for DBMessage, DBResponseMessage
#include "Interface/ThreadRecord.hpp" // for ThreadRecord
#include "Common/Common.hpp"          // for EntryState, EntryState::ALL
#include "MessageType.hpp"            // for MessageType, MessageType::MessageTypeUninitialized

class DBThreadMessage : public DBMessage
{

M module-services/service-db/messages/QueryMessage.cpp => module-services/service-db/messages/QueryMessage.cpp +8 -2
@@ 3,8 3,14 @@

#include "QueryMessage.hpp"

#include <memory>
#include <stdexcept>
#include <memory>    // for unique_ptr, operator==
#include <stdexcept> // for runtime_error
#include <utility>   // for move

#include "BaseInterface.hpp"      // for Interface, Interface::Name
#include "Common/Query.hpp"       // for Query, QueryResult
#include "MessageType.hpp"        // for MessageType, MessageType::DBQuery
#include "messages/DBMessage.hpp" // for DBMessage, DBResponseMessage

namespace db
{

M module-services/service-db/test/test-service-db-api.cpp => module-services/service-db/test/test-service-db-api.cpp +6 -3
@@ 1,9 1,12 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <catch2/catch.hpp>
#include <module-db/Interface/ContactRecord.hpp>
#include <module-services/service-db/api/DBServiceAPI.hpp>
#include <catch2/catch.hpp> // for AssertionHandler, operator""_catch_sr, SourceLineInfo, StringRef, REQUIRE, Section, SECTION, SectionInfo, TEST_CASE
#include <module-db/Interface/ContactRecord.hpp> // for ContactRecord
#include <module-services/service-db/api/DBServiceAPI.hpp> // for DBServiceAPI, DBServiceAPI::noError, DBServiceAPI::ContactVerificationError, DBServiceAPI::emptyContactError
#include <memory> // for allocator

#include "utf8/UTF8.hpp" // for UTF8

TEST_CASE("DB_API")
{

M module-services/service-db/test/test-service-db-settings-api.cpp => module-services/service-db/test/test-service-db-settings-api.cpp +13 -5
@@ 1,11 1,19 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <catch2/catch.hpp>
#include "agents/settings/Settings.hpp"
#include "messages/SettingsMessages.hpp"
#include <Service/Service.hpp>
#include <functional>
#include <catch2/catch.hpp> // for AssertionHandler, SourceLineInfo, operator""_catch_sr, Section, StringRef, REQUIRE, SECTION, SectionInfo, TEST_CASE
#include <Service/Service.hpp> // for Service
#include <functional>          // for _Bind_helper<>::type, _Placeholder, bind, _1, _2
#include <map>                 // for operator!=, _Rb_tree_iterator, map<>::iterator, map<>::mapped_type, map
#include <memory>              // for shared_ptr, allocator, make_shared, operator==, __shared_ptr_access
#include <optional>            // for optional
#include <string>              // for string, operator==, basic_string

#include "agents/settings/Settings.hpp"  // for Settings
#include "messages/SettingsMessages.hpp" // for SetVariable, VariableResponse, GetVariable, EntryPath, VariableChanged
#include "Service/Common.hpp"            // for ReturnCodes, ReturnCodes::Success, ServicePowerMode
#include "Service/Mailbox.hpp"           // for Mailbox
#include "Service/Message.hpp"           // for Message_t, ResponseMessage, DataMessage, Message

namespace Settings
{

M module-services/service-db/test/test-service-db-settings-messages.cpp => module-services/service-db/test/test-service-db-settings-messages.cpp +13 -8
@@ 1,14 1,19 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <catch2/catch.hpp>
#include "messages/SettingsMessages.hpp"

#include <Service/Service.hpp>
#include <Service/Message.hpp>

#include <functional>
#include <module-sys/Service/Bus.hpp>
#include <catch2/catch.hpp>           // for Section, SourceLineInfo, SECTION, SectionInfo, StringRef, TEST_CASE
#include <Service/Service.hpp>        // for Service
#include <Service/Message.hpp>        // for Message_t, ResponseMessage, DataMessage
#include <module-sys/Service/Bus.hpp> // for Bus
#include <functional>                 // for _Bind_helper<>::type, _Placeholder, bind, _1, _2
#include <list>                       // for list
#include <memory>                     // for make_shared, allocator, shared_ptr
#include <optional>                   // for optional
#include <string>                     // for string
#include <utility>                    // for move

#include "messages/SettingsMessages.hpp" // for SetVariable, ListProfiles, GetVariable, AddMode, AddProfile, CurrentModeChanged, CurrentProfileChanged, EntryPath, GetCurrentMode, GetCurrentProfile, ListModes, ModeListResponse, ProfileListResponse, RegisterOnVariableChange, UnregisterOnVariableChange, VariableChanged, VariableResponse
#include "Service/Common.hpp"            // for ReturnCodes, ReturnCodes::Success, ServicePowerMode

namespace Settings
{

M module-services/service-desktop/ServiceDesktop.cpp => module-services/service-desktop/ServiceDesktop.cpp +19 -7
@@ 1,13 1,25 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <messages/QueryMessage.hpp>
#include <module-apps/application-desktop/ApplicationDesktop.hpp>
#include "ServiceDesktop.hpp"
#include "BackupRestore.hpp"
#include "DesktopMessages.hpp"
#include "module-services/service-desktop/endpoints/factoryReset/FactoryReset.hpp"
#include "log/log.hpp"
#include <messages/QueryMessage.hpp>                              // for QueryResponse
#include <module-apps/application-desktop/ApplicationDesktop.hpp> // for name_desktop
#include <module-services/service-desktop/ServiceDesktop.hpp>
#include <inttypes.h> // for PRIu32
#include <filesystem> // for path

#include "ServiceDesktop.hpp" // for ServiceDesktop, cdc_queue_len, cdc_queue_object_size, service_desktop, service_stack
#include "BackupRestore.hpp"  // for BackupRestore
#include "DesktopMessages.hpp" // for UpdateOsMessage, BackupMessage, FactoryMessage, RestoreMessage
#include "module-services/service-desktop/endpoints/factoryReset/FactoryReset.hpp" // for Run
#include "log/log.hpp"                                                             // for LOG_DEBUG, LOG_INFO, LOG_ERROR
#include "Common/Query.hpp"                                                        // for QueryResult
#include "MessageType.hpp"    // for MessageType, MessageType::DBQuery
#include "Service/Bus.hpp"    // for Bus
#include "Service/Worker.hpp" // for WorkerQueueInfo
#include "UpdateMuditaOS.hpp" // for UpdateMuditaOS, UpdateStats, UpdateMessageType, UpdateError, UpdateError::NoError, UpdateMessageType::UpdateCheckForUpdateOnce, UpdateMessageType::UpdateFoundOnBoot, UpdateMessageType::UpdateNow
#include "WorkerDesktop.hpp"  // for WorkerDesktop
#include "json/json11.hpp"    // for Json
#include "vfs.hpp"            // for vfs

ServiceDesktop::ServiceDesktop() : sys::Service(service::name::service_desktop, "", sdesktop::service_stack)
{

M module-services/service-desktop/ServiceDesktop.hpp => module-services/service-desktop/ServiceDesktop.hpp +9 -0
@@ 3,8 3,17 @@

#pragma once

#include <memory> // for allocator, unique_ptr
#include <string> // for string

#include "WorkerDesktop.hpp"
#include "module-services/service-desktop/endpoints/update/UpdateMuditaOS.hpp"
#include "Service/Common.hpp"  // for ReturnCodes, ServicePowerMode
#include "Service/Message.hpp" // for Message_t, DataMessage (ptr only), ResponseMessage (ptr only)
#include "Service/Service.hpp" // for Service

class UpdateMuditaOS;
class WorkerDesktop;

namespace service::name
{

M module-services/service-desktop/WorkerDesktop.cpp => module-services/service-desktop/WorkerDesktop.cpp +10 -1
@@ 2,7 2,16 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "WorkerDesktop.hpp"
#include "MessageHandler.hpp"

#include <map>    // for map
#include <vector> // for vector

#include "MessageHandler.hpp"      // for MessageHandler, MessageHandler::sendQueue
#include "ParserFSM.hpp"           // for StateMachine
#include "bsp/usb_cdc/usb_cdc.hpp" // for usbCDCInit, usbCDCSend
#include "log/log.hpp"             // for LOG_ERROR, LOG_INFO
#include "projdefs.h"              // for pdTRUE
#include "queue.h"                 // for xQueueReceive, QueueDefinition, QueueHandle_t

bool WorkerDesktop::handleMessage(uint32_t queueID)
{

M module-services/service-desktop/WorkerDesktop.hpp => module-services/service-desktop/WorkerDesktop.hpp +10 -3
@@ 4,6 4,9 @@
#pragma once

#include <string.h>
#include <stdint.h> // for uint32_t
#include <list>     // for list
#include <string>   // for allocator, string

extern "C"
{


@@ 13,11 16,15 @@ extern "C"

#include "Service/Message.hpp"
#include "Service/Service.hpp"
#include "Service/Worker.hpp"
#include "parser/ParserFSM.hpp"

#include "Service/Worker.hpp"   // for Worker, WorkerQueueInfo (ptr only)
#include "parser/ParserFSM.hpp" // for StateMachine
#include "bsp/usb_cdc/usb_cdc.hpp"

namespace sys
{
    class Service;
} // namespace sys

class WorkerDesktop : public sys::Worker
{
  private:

M module-services/service-desktop/endpoints/backup/BackupEndpoint.cpp => module-services/service-desktop/endpoints/backup/BackupEndpoint.cpp +12 -4
@@ 2,10 2,18 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "BackupEndpoint.hpp"
#include "DesktopMessages.hpp"
#include "ParserUtils.hpp"
#include "ServiceDesktop.hpp"
#include <Service/Bus.hpp>

#include <Service/Bus.hpp> // for Bus
#include <filesystem>      // for path
#include <memory>          // for make_shared

#include "DesktopMessages.hpp" // for BackupMessage
#include "ParserUtils.hpp" // for Method, backupReady, backupRequest, backupUpload, Code, Code::BadRequest, Method::del, Method::get, Method::post, Method::put
#include "ServiceDesktop.hpp" // for service_desktop
#include "Context.hpp"        // for Context
#include "MessageHandler.hpp" // for MessageHandler
#include "json/json11.hpp"    // for Json, Json::object
#include "vfs.hpp"            // for vfs, os_backup

static bool backupReady = false;


M module-services/service-desktop/endpoints/backup/BackupEndpoint.hpp => module-services/service-desktop/endpoints/backup/BackupEndpoint.hpp +14 -2
@@ 1,9 1,21 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "Endpoint.hpp"
#include "ParserUtils.hpp"
#include <string> // for string

#include "Endpoint.hpp"    // for Endpoint
#include "ParserUtils.hpp" // for parserFSM
#include "ServiceDesktop.hpp"
#include "Service/Common.hpp" // for ReturnCodes

namespace parserFSM
{
    class Context;
} // namespace parserFSM
namespace sys
{
    class Service;
} // namespace sys

using namespace parserFSM;


M module-services/service-desktop/endpoints/backup/BackupRestore.cpp => module-services/service-desktop/endpoints/backup/BackupRestore.cpp +19 -5
@@ 2,11 2,25 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "BackupRestore.hpp"
#include "vfs.hpp"
#include "microtar/src/microtar.hpp"
#include "api/DBServiceAPI.hpp"
#include "service-db/includes/DBServiceName.hpp"
#include "SystemManager/SystemManager.hpp"

#include <assert.h>   // for assert
#include <stdint.h>   // for uint32_t
#include <filesystem> // for path
#include <memory>     // for allocator, unique_ptr
#include <string>     // for string, operator+, basic_string, char_traits
#include <vector>     // for vector

#include "vfs.hpp" // for vfs, vfs::DirectoryEntry, os_backup, tar_buf, PATH_BACKUP, vfs::FILE, user_disk
#include "microtar/src/microtar.hpp" // for mtar_close, mtar_header_t, MTAR_ESUCCESS, mtar_strerror, mtar_open, mtar_finalize, mtar_next, mtar_read_data, mtar_read_header, mtar_write_data, mtar_write_file_header, mtar_t, MTAR_TREG
#include "api/DBServiceAPI.hpp"      // for DBServiceAPI
#include "service-db/includes/DBServiceName.hpp" // for db
#include "SystemManager/SystemManager.hpp"       // for SystemManager
#include "log/log.hpp"                           // for LOG_INFO, LOG_ERROR

namespace sys
{
    class Service;
} // namespace sys

static const long unsigned int empty_dirlist_size = 2;
static const auto backup_file_name                = "backup.tar";

M module-services/service-desktop/endpoints/backup/BackupRestore.hpp => module-services/service-desktop/endpoints/backup/BackupRestore.hpp +5 -0
@@ 5,6 5,11 @@

#include "Service/Service.hpp"

namespace sys
{
    class Service;
} // namespace sys

class BackupRestore
{
  public:

M module-services/service-desktop/endpoints/calllog/CalllogEndpoint.cpp => module-services/service-desktop/endpoints/calllog/CalllogEndpoint.cpp +2 -0
@@ 3,6 3,8 @@

#include "CalllogEndpoint.hpp"

#include "Context.hpp" // for Context

using namespace parserFSM;

auto CalllogEndpoint::handle(Context &context) -> void

M module-services/service-desktop/endpoints/calllog/CalllogEndpoint.hpp => module-services/service-desktop/endpoints/calllog/CalllogEndpoint.hpp +15 -2
@@ 3,9 3,22 @@

#pragma once

#include "Endpoint.hpp"
#include <memory> // for make_unique, unique_ptr
#include <string> // for string

#include "Endpoint.hpp" // for Endpoint
#include "Service/Service.hpp"
#include "CalllogHelper.hpp"
#include "CalllogHelper.hpp" // for CalllogHelper
#include "ParserUtils.hpp"   // for parserFSM

namespace parserFSM
{
    class Context;
} // namespace parserFSM
namespace sys
{
    class Service;
} // namespace sys

using namespace parserFSM;


M module-services/service-desktop/endpoints/calllog/CalllogHelper.cpp => module-services/service-desktop/endpoints/calllog/CalllogHelper.cpp +16 -5
@@ 1,13 1,24 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <module-db/queries/calllog/QueryCalllogGet.hpp>
#include <module-db/queries/calllog/QueryCalllogGetCount.hpp>
#include <module-db/queries/calllog/QueryCalllogRemove.hpp>
#include <module-db/queries/calllog/QueryCalllogGetByContactID.hpp>
#include <module-db/queries/calllog/QueryCalllogGet.hpp>            // for CalllogGet, CalllogGetResult
#include <module-db/queries/calllog/QueryCalllogGetCount.hpp>       // for CalllogGetCount, CalllogGetCountResult
#include <module-db/queries/calllog/QueryCalllogRemove.hpp>         // for CalllogRemove, CalllogRemoveResult
#include <module-db/queries/calllog/QueryCalllogGetByContactID.hpp> // for CalllogGetByContactID, CalllogGetByContactIDResult
#include <memory>                                                   // for make_unique, unique_ptr
#include <ostream>                                                  // for stringstream, basic_ostream, basic_ios::clear
#include <utility>                                                  // for move
#include <vector>                                                   // for vector

#include "CalllogEndpoint.hpp"
#include "CalllogHelper.hpp"
#include "BaseInterface.hpp"    // for Interface, Interface::Name, Interface::Name::Calllog
#include "Common/Query.hpp"     // for EndpointListener, Query, QueryListener, QueryResult
#include "Context.hpp"          // for Context
#include "MessageHandler.hpp"   // for MessageHandler
#include "ParserUtils.hpp"      // for Code, Code::InternalServerError, Code::OK, parserFSM
#include "PhoneNumber.hpp"      // for PhoneNumber::View
#include "api/DBServiceAPI.hpp" // for DBServiceAPI
#include "utf8/UTF8.hpp"        // for UTF8

using namespace parserFSM;


M module-services/service-desktop/endpoints/calllog/CalllogHelper.hpp => module-services/service-desktop/endpoints/calllog/CalllogHelper.hpp +14 -5
@@ 3,17 3,26 @@

#pragma once

#include <application-phonebook/models/PhonebookModel.hpp>
#include <service-db/api/DBServiceAPI.hpp>
#include <string> // for string, allocator

#include "Common/Query.hpp"
#include "Context.hpp"
#include "Service/Service.hpp"
#include "Service/Common.hpp"
#include "DBHelper.hpp"
#include <application-phonebook/models/PhonebookModel.hpp>
#include <service-db/api/DBServiceAPI.hpp>
#include "CalllogRecord.hpp"
#include "Service/Common.hpp" // for ReturnCodes
#include "DBHelper.hpp"       // for DBHelper
#include "CalllogRecord.hpp"  // for CalllogRecord
#include "json/json11.hpp"    // for Json

namespace sys
{
    class Service;
} // namespace sys

namespace parserFSM
{
    class Context;

    class CalllogHelper : public DBHelper
    {

M module-services/service-desktop/endpoints/contacts/ContactHelper.cpp => module-services/service-desktop/endpoints/contacts/ContactHelper.cpp +23 -12
@@ 1,19 1,30 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "ContactRecord.hpp"
#include <queries/phonebook/QueryContactGet.hpp>    // for ContactGet, ContactGetSize, ContactGetResult
#include <queries/phonebook/QueryContactAdd.hpp>    // for ContactAdd, ContactAddResult
#include <queries/phonebook/QueryContactRemove.hpp> // for ContactRemove, ContactRemoveResult
#include <memory>                                   // for make_unique, unique_ptr
#include <utility>                                  // for move
#include <vector>                                   // for vector

#include "ContactRecord.hpp" // for ContactRecord, ContactRecord::Number
#include "ContactHelper.hpp"
#include "Common/Query.hpp"
#include "ParserUtils.hpp"
#include "Service/Common.hpp"
#include "api/DBServiceAPI.hpp"
#include "log/log.hpp"
#include "queries/phonebook/QueryContactGetByID.hpp"
#include "queries/phonebook/QueryContactUpdate.hpp"
#include "json/json11.hpp"
#include <queries/phonebook/QueryContactGet.hpp>
#include <queries/phonebook/QueryContactAdd.hpp>
#include <queries/phonebook/QueryContactRemove.hpp>
#include "Common/Query.hpp"                          // for EndpointListener, Query, QueryListener, QueryResult
#include "ParserUtils.hpp"                           // for Code, Code::InternalServerError, Code::OK, parserFSM
#include "Service/Common.hpp"                        // for ReturnCodes, ReturnCodes::Success, ReturnCodes::Failure
#include "api/DBServiceAPI.hpp"                      // for DBServiceAPI
#include "log/log.hpp"                               // for LOG_ERROR
#include "queries/phonebook/QueryContactGetByID.hpp" // for ContactGetByID, ContactGetByIDResult
#include "queries/phonebook/QueryContactUpdate.hpp"  // for ContactUpdate, ContactUpdateResult
#include "json/json11.hpp"                           // for Json, Json::array, Json::object
#include "BaseInterface.hpp"                         // for Interface, Interface::Name, Interface::Name::Contact
#include "Common/Common.hpp"                         // for ContactNumberType, ContactNumberType::CELL
#include "Context.hpp"                               // for Context
#include "MessageHandler.hpp"                        // for MessageHandler
#include "PhoneNumber.hpp"                           // for PhoneNumber, PhoneNumber::View
#include "queries/RecordQuery.hpp"                   // for RecordsSizeQueryResult
#include "utf8/UTF8.hpp"                             // for UTF8

using namespace parserFSM;


M module-services/service-desktop/endpoints/contacts/ContactHelper.hpp => module-services/service-desktop/endpoints/contacts/ContactHelper.hpp +14 -5
@@ 3,17 3,26 @@

#pragma once

#include <application-phonebook/models/PhonebookModel.hpp>
#include <service-db/api/DBServiceAPI.hpp>
#include <string> // for string, allocator

#include "Common/Query.hpp"
#include "Context.hpp"
#include "Service/Service.hpp"
#include "Service/Common.hpp"
#include "DBHelper.hpp"
#include <application-phonebook/models/PhonebookModel.hpp>
#include <service-db/api/DBServiceAPI.hpp>
#include "ContactRecord.hpp"
#include "Service/Common.hpp" // for ReturnCodes
#include "DBHelper.hpp"       // for DBHelper
#include "ContactRecord.hpp"  // for ContactRecord
#include "json/json11.hpp"    // for Json

namespace sys
{
    class Service;
} // namespace sys

namespace parserFSM
{
    class Context;

    class ContactHelper : public DBHelper
    {

M module-services/service-desktop/endpoints/contacts/ContactsEndpoint.cpp => module-services/service-desktop/endpoints/contacts/ContactsEndpoint.cpp +5 -3
@@ 2,9 2,11 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "ContactsEndpoint.hpp"
#include "queries/phonebook/QueryContactGet.hpp"
#include <memory>
#include <string>

#include <memory> // for unique_ptr

#include "Context.hpp"                // for Context
#include "contacts/ContactHelper.hpp" // for ContactHelper

using namespace parserFSM;


M module-services/service-desktop/endpoints/contacts/ContactsEndpoint.hpp => module-services/service-desktop/endpoints/contacts/ContactsEndpoint.hpp +15 -2
@@ 3,9 3,22 @@

#pragma once

#include "Endpoint.hpp"
#include <memory> // for make_unique, unique_ptr
#include <string> // for string

#include "Endpoint.hpp" // for Endpoint
#include "Service/Service.hpp"
#include "ContactHelper.hpp"
#include "ContactHelper.hpp" // for ContactHelper
#include "ParserUtils.hpp"   // for parserFSM

namespace parserFSM
{
    class Context;
} // namespace parserFSM
namespace sys
{
    class Service;
} // namespace sys

using namespace parserFSM;


M module-services/service-desktop/endpoints/developerMode/DeveloperModeEndpoint.cpp => module-services/service-desktop/endpoints/developerMode/DeveloperModeEndpoint.cpp +2 -0
@@ 3,6 3,8 @@

#include "DeveloperModeEndpoint.hpp"

#include "Context.hpp" // for Context

using namespace parserFSM;

auto DeveloperModeEndpoint::handle(Context &context) -> void

M module-services/service-desktop/endpoints/developerMode/DeveloperModeEndpoint.hpp => module-services/service-desktop/endpoints/developerMode/DeveloperModeEndpoint.hpp +15 -2
@@ 3,9 3,22 @@

#pragma once

#include "Endpoint.hpp"
#include <memory> // for make_unique, unique_ptr
#include <string> // for string

#include "Endpoint.hpp" // for Endpoint
#include "Service/Service.hpp"
#include "DeveloperModeHelper.hpp"
#include "DeveloperModeHelper.hpp" // for DeveloperModeHelper
#include "ParserUtils.hpp"         // for parserFSM

namespace parserFSM
{
    class Context;
} // namespace parserFSM
namespace sys
{
    class Service;
} // namespace sys

using namespace parserFSM;


M module-services/service-desktop/endpoints/developerMode/DeveloperModeHelper.cpp => module-services/service-desktop/endpoints/developerMode/DeveloperModeHelper.cpp +6 -1
@@ 1,8 1,13 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "DeveloperModeEndpoint.hpp"
#include "DeveloperModeHelper.hpp"
#include "ParserUtils.hpp" // for parserFSM

namespace parserFSM
{
    class Context;
} // namespace parserFSM

using namespace parserFSM;
auto DeveloperModeHelper::processGetRequest(Context &context) -> sys::ReturnCodes

M module-services/service-desktop/endpoints/developerMode/DeveloperModeHelper.hpp => module-services/service-desktop/endpoints/developerMode/DeveloperModeHelper.hpp +9 -1
@@ 3,13 3,21 @@

#pragma once

#include <string> // for allocator, string

#include "Common/Query.hpp"
#include "Context.hpp"
#include "Service/Service.hpp"
#include "Service/Common.hpp"
#include "Service/Common.hpp" // for ReturnCodes

namespace sys
{
    class Service;
} // namespace sys

namespace parserFSM
{
    class Context;

    class DeveloperModeHelper
    {

M module-services/service-desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp => module-services/service-desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp +11 -6
@@ 2,12 2,17 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "DeviceInfoEndpoint.hpp"
#include <source/version.hpp>
#include <vfs.hpp>
#include <common_data/EventStore.hpp>
#include <time/time_conversion.hpp>
#include <service-desktop/ServiceDesktop.hpp>
#include <string>

#include <source/version.hpp>         // for GIT_BRANCH, GIT_REV, GIT_TAG
#include <vfs.hpp>                    // for vfs::FilesystemStats, vfs
#include <common_data/EventStore.hpp> // for GSM, Battery, SignalStrength
#include <time/time_conversion.hpp>   // for Time
#include <stdint.h>                   // for uint32_t
#include <string>                     // for to_string, allocator, string

#include "Context.hpp"        // for Context
#include "MessageHandler.hpp" // for MessageHandler
#include "json/json11.hpp"    // for Json, Json::object

auto DeviceInfoEndpoint::handle(Context &context) -> void
{

M module-services/service-desktop/endpoints/deviceInfo/DeviceInfoEndpoint.hpp => module-services/service-desktop/endpoints/deviceInfo/DeviceInfoEndpoint.hpp +13 -1
@@ 3,8 3,20 @@

#pragma once

#include "Endpoint.hpp"
#include <string> // for string

#include "Endpoint.hpp" // for Endpoint
#include "Service/Service.hpp"
#include "ParserUtils.hpp" // for parserFSM

namespace parserFSM
{
    class Context;
} // namespace parserFSM
namespace sys
{
    class Service;
} // namespace sys

using namespace parserFSM;


M module-services/service-desktop/endpoints/factoryReset/FactoryReset.cpp => module-services/service-desktop/endpoints/factoryReset/FactoryReset.cpp +15 -3
@@ 2,9 2,21 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "FactoryReset.hpp"
#include "vfs.hpp"
#include "service-db/includes/DBServiceName.hpp"
#include "SystemManager/SystemManager.hpp"

#include <stdint.h>   // for uint32_t
#include <filesystem> // for path
#include <memory>     // for unique_ptr, allocator
#include <vector>     // for vector

#include "vfs.hpp" // for vfs, vfs::DirectoryEntry, copy_buf, os_factory, vfs::FILE, eMMC_disk, vfs::FileAttributes, vfs::FileAttributes::Directory, PATH_FACTORY
#include "service-db/includes/DBServiceName.hpp" // for db
#include "SystemManager/SystemManager.hpp"       // for SystemManager
#include "log/log.hpp"                           // for LOG_ERROR, LOG_INFO

namespace sys
{
    class Service;
} // namespace sys

namespace FactoryReset
{

M module-services/service-desktop/endpoints/factoryReset/FactoryReset.hpp => module-services/service-desktop/endpoints/factoryReset/FactoryReset.hpp +7 -0
@@ 3,8 3,15 @@

#pragma once

#include <string> // for string

#include "Service/Service.hpp"

namespace sys
{
    class Service;
} // namespace sys

namespace FactoryReset
{
    bool Run(sys::Service *ownerService);

M module-services/service-desktop/endpoints/factoryReset/FactoryResetEndpoint.cpp => module-services/service-desktop/endpoints/factoryReset/FactoryResetEndpoint.cpp +9 -3
@@ 2,9 2,15 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "FactoryResetEndpoint.hpp"
#include "DesktopMessages.hpp"
#include "ServiceDesktop.hpp"
#include <Service/Bus.hpp>

#include <Service/Bus.hpp> // for Bus
#include <memory>          // for make_shared

#include "DesktopMessages.hpp" // for FactoryMessage
#include "ServiceDesktop.hpp"  // for service_desktop
#include "Context.hpp"         // for Context
#include "MessageHandler.hpp"  // for MessageHandler
#include "json/json11.hpp"     // for Json, Json::object

auto FactoryResetEndpoint::handle(Context &context) -> void
{

M module-services/service-desktop/endpoints/factoryReset/FactoryResetEndpoint.hpp => module-services/service-desktop/endpoints/factoryReset/FactoryResetEndpoint.hpp +13 -1
@@ 3,8 3,20 @@

#pragma once

#include "Endpoint.hpp"
#include <string> // for string

#include "Endpoint.hpp" // for Endpoint
#include "Service/Service.hpp"
#include "ParserUtils.hpp" // for parserFSM

namespace parserFSM
{
    class Context;
} // namespace parserFSM
namespace sys
{
    class Service;
} // namespace sys

using namespace parserFSM;


M module-services/service-desktop/endpoints/messages/MessageHelper.cpp => module-services/service-desktop/endpoints/messages/MessageHelper.cpp +33 -27
@@ 2,33 2,39 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "MessageHelper.hpp"
#include "Common/Query.hpp"
#include "ParserUtils.hpp"
#include "PhoneNumber.hpp"
#include "SMSRecord.hpp"
#include "SMSTemplateRecord.hpp"
#include "Service/Common.hpp"
#include "ThreadRecord.hpp"
#include "api/DBServiceAPI.hpp"
#include "queries/messages/sms/QuerySMSGet.hpp"
#include "queries/messages/sms/QuerySMSGetByContactID.hpp"
#include "queries/messages/sms/QuerySMSGetByThreadID.hpp"
#include "queries/messages/sms/QuerySMSGetByID.hpp"
#include "queries/messages/sms/QuerySMSGetByText.hpp"
#include "queries/messages/sms/QuerySMSGetCount.hpp"
#include "queries/messages/threads/QueryThreadsSearchForList.hpp"
#include "queries/messages/sms/QuerySMSRemove.hpp"
#include "queries/messages/templates/QuerySMSTemplateGet.hpp"
#include "queries/messages/templates/QuerySMSTemplateRemove.hpp"
#include "queries/messages/templates/QuerySMSTemplateUpdate.hpp"
#include "queries/messages/templates/QuerySMSTemplateAdd.hpp"
#include "queries/messages/templates/QuerySMSTemplateGetByID.hpp"
#include "queries/messages/templates/QuerySMSTemplateGetCount.hpp"
#include "queries/messages/threads/QueryThreadMarkAsRead.hpp"
#include "utf8/UTF8.hpp"
#include "json/json11.hpp"
#include <memory>
#include <string>

#include <memory>  // for make_unique, unique_ptr
#include <string>  // for string
#include <utility> // for move
#include <vector>  // for vector

#include "Common/Query.hpp" // for EndpointListener, Query, QueryListener, QueryResult
#include "ParserUtils.hpp" // for Code, id, count, Code::InternalServerError, Code::OK, contactID, msgTemplate, threadID, messageBody, templateText, date, isUnread, offset, type, dateSent, msgCount, parserFSM, phoneNumber, snippet, unreadMsgCount
#include "PhoneNumber.hpp" // for PhoneNumber::View
#include "SMSRecord.hpp"   // for SMSRecord
#include "SMSTemplateRecord.hpp"                                   // for SMSTemplateRecord
#include "Service/Common.hpp"                                      // for ReturnCodes, ReturnCodes::Success
#include "ThreadRecord.hpp"                                        // for ThreadRecord
#include "api/DBServiceAPI.hpp"                                    // for DBServiceAPI
#include "queries/messages/sms/QuerySMSGet.hpp"                    // for SMSGet, SMSGetResult
#include "queries/messages/sms/QuerySMSGetByContactID.hpp"         // for SMSGetByContactID, SMSGetByContactIDResult
#include "queries/messages/sms/QuerySMSGetByThreadID.hpp"          // for SMSGetByThreadID, SMSGetByThreadIDResult
#include "queries/messages/sms/QuerySMSGetByID.hpp"                // for SMSGetByID, SMSGetByIDResult
#include "queries/messages/sms/QuerySMSGetByText.hpp"              // for SMSGetByText, SMSGetByTextResult
#include "queries/messages/sms/QuerySMSGetCount.hpp"               // for SMSGetCount, SMSGetCountResult
#include "queries/messages/sms/QuerySMSRemove.hpp"                 // for SMSRemove, SMSRemoveResult
#include "queries/messages/templates/QuerySMSTemplateGet.hpp"      // for SMSTemplateGet, SMSTemplateGetResult
#include "queries/messages/templates/QuerySMSTemplateRemove.hpp"   // for SMSTemplateRemove, SMSTemplateRemoveResult
#include "queries/messages/templates/QuerySMSTemplateUpdate.hpp"   // for SMSTemplateUpdate, SMSTemplateUpdateResult
#include "queries/messages/templates/QuerySMSTemplateAdd.hpp"      // for SMSTemplateAdd, SMSTemplateAddResult
#include "queries/messages/templates/QuerySMSTemplateGetByID.hpp"  // for SMSTemplateGetByID, SMSTemplateGetByIDResult
#include "queries/messages/templates/QuerySMSTemplateGetCount.hpp" // for SMSTemplateGetCount, SMSTemplateGetCountResult
#include "queries/messages/threads/QueryThreadMarkAsRead.hpp" // for MarkAsRead, MarkAsRead::Read, MarkAsReadResult, MarkAsRead::Read::False, MarkAsRead::Read::True, query
#include "utf8/UTF8.hpp"   // for UTF8
#include "json/json11.hpp" // for Json, Json::array, Json::object
#include "BaseInterface.hpp" // for Interface, Interface::Name, Interface::Name::SMS, Interface::Name::SMSTemplate, Interface::Name::SMSThread
#include "Context.hpp"        // for Context
#include "MessageHandler.hpp" // for MessageHandler

using namespace parserFSM;


M module-services/service-desktop/endpoints/messages/MessageHelper.hpp => module-services/service-desktop/endpoints/messages/MessageHelper.hpp +16 -5
@@ 3,17 3,28 @@

#pragma once

#include <service-db/api/DBServiceAPI.hpp>
#include <memory>
#include <string> // for string, allocator

#include "Common/Query.hpp"
#include "SMSTemplateRecord.hpp"
#include "SMSTemplateRecord.hpp" // for SMSTemplateRecord
#include "Service/Service.hpp"
#include "Service/Common.hpp"
#include "DBHelper.hpp"
#include <memory>
#include <service-db/api/DBServiceAPI.hpp>
#include "Service/Common.hpp" // for ReturnCodes
#include "DBHelper.hpp"       // for DBHelper
#include "Endpoint.hpp"
#include "SMSRecord.hpp"    // for SMSRecord
#include "ThreadRecord.hpp" // for ThreadRecord
#include "json/json11.hpp"  // for Json

namespace sys
{
    class Service;
} // namespace sys

namespace parserFSM
{
    class Context;

    class MessageHelper final : public DBHelper
    {

M module-services/service-desktop/endpoints/messages/MessagesEndpoint.cpp => module-services/service-desktop/endpoints/messages/MessagesEndpoint.cpp +2 -1
@@ 2,7 2,8 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "MessagesEndpoint.hpp"
#include "module-db/queries/messages/templates/QuerySMSTemplateGetByID.hpp"

#include "Context.hpp" // for Context

using namespace parserFSM;


M module-services/service-desktop/endpoints/messages/MessagesEndpoint.hpp => module-services/service-desktop/endpoints/messages/MessagesEndpoint.hpp +15 -2
@@ 3,9 3,22 @@

#pragma once

#include "Endpoint.hpp"
#include <memory> // for make_shared, shared_ptr
#include <string> // for string

#include "Endpoint.hpp" // for Endpoint
#include "Service/Service.hpp"
#include "MessageHelper.hpp"
#include "MessageHelper.hpp" // for MessageHelper
#include "ParserUtils.hpp"   // for parserFSM

namespace parserFSM
{
    class Context;
} // namespace parserFSM
namespace sys
{
    class Service;
} // namespace sys

using namespace parserFSM;


M module-services/service-desktop/endpoints/restore/RestoreEndpoint.cpp => module-services/service-desktop/endpoints/restore/RestoreEndpoint.cpp +10 -4
@@ 2,10 2,16 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "RestoreEndpoint.hpp"
#include "DesktopMessages.hpp"
#include "ParserUtils.hpp"
#include "ServiceDesktop.hpp"
#include <Service/Bus.hpp>

#include <Service/Bus.hpp> // for Bus
#include <memory>          // for make_shared

#include "DesktopMessages.hpp" // for RestoreMessage
#include "ParserUtils.hpp"     // for restoreRequest, Method, Method::post
#include "ServiceDesktop.hpp"  // for service_desktop
#include "Context.hpp"         // for Context
#include "MessageHandler.hpp"  // for MessageHandler
#include "json/json11.hpp"     // for Json, Json::object

auto RestoreEndpoint::handle(Context &context) -> void
{

M module-services/service-desktop/endpoints/restore/RestoreEndpoint.hpp => module-services/service-desktop/endpoints/restore/RestoreEndpoint.hpp +13 -2
@@ 1,10 1,21 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "Endpoint.hpp"
#include "ParserUtils.hpp"
#include <string> // for string

#include "Endpoint.hpp"    // for Endpoint
#include "ParserUtils.hpp" // for parserFSM
#include "ServiceDesktop.hpp"

namespace parserFSM
{
    class Context;
} // namespace parserFSM
namespace sys
{
    class Service;
} // namespace sys

using namespace parserFSM;

class RestoreEndpoint : public Endpoint

M module-services/service-desktop/endpoints/update/UpdateEndpoint.cpp => module-services/service-desktop/endpoints/update/UpdateEndpoint.cpp +12 -3
@@ 2,9 2,18 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "UpdateEndpoint.hpp"
#include "DesktopMessages.hpp"
#include "ServiceDesktop.hpp"
#include <Service/Bus.hpp>

#include <Service/Bus.hpp> // for Bus
#include <filesystem>      // for operator/, path
#include <memory>          // for allocator, make_shared

#include "DesktopMessages.hpp" // for UpdateOsMessage
#include "ServiceDesktop.hpp"  // for service_desktop
#include "Context.hpp"         // for Context
#include "MessageHandler.hpp"  // for MessageHandler
#include "UpdateMuditaOS.hpp"  // for update
#include "json/json11.hpp"     // for Json, Json::object
#include "vfs.hpp"             // for vfs, os_updates

auto UpdateEndpoint::handle(Context &context) -> void
{

M module-services/service-desktop/endpoints/update/UpdateEndpoint.hpp => module-services/service-desktop/endpoints/update/UpdateEndpoint.hpp +14 -1
@@ 3,8 3,21 @@

#pragma once

#include "Endpoint.hpp"
#include <string> // for string

#include "Endpoint.hpp" // for Endpoint
#include "Service/Service.hpp"
#include "ParserUtils.hpp"    // for parserFSM
#include "Service/Common.hpp" // for ReturnCodes

namespace parserFSM
{
    class Context;
} // namespace parserFSM
namespace sys
{
    class Service;
} // namespace sys

using namespace parserFSM;


M module-services/service-desktop/endpoints/update/UpdateMuditaOS.cpp => module-services/service-desktop/endpoints/update/UpdateMuditaOS.cpp +16 -4
@@ 5,10 5,22 @@
#if defined(TARGET_RT1051)
#include "board/cross/eMMC/eMMC.hpp"
#endif
#include <service-desktop/ServiceDesktop.hpp>
#include <service-gui/ServiceGUI.hpp>
#include <math.h>
#include <module-apps/application-desktop/ApplicationDesktop.hpp>
#include <service-desktop/ServiceDesktop.hpp>                     // for ServiceDesktop
#include <module-apps/application-desktop/ApplicationDesktop.hpp> // for name_desktop
#include <stdarg.h>                                               // for va_end, va_list, va_start
#include <stdio.h>                                                // for vsnprintf, snprintf, sprintf
#include <stdlib.h>                                               // for strtoull
#include <array>                                                  // for array
#include <memory> // for unique_ptr, make_shared, allocator, __shared_ptr_access, shared_ptr

#include "DesktopMessages.hpp"             // for UpdateOsMessage
#include "Service/Bus.hpp"                 // for Bus
#include "SystemManager/SystemManager.hpp" // for SystemManager
#include "crc32/crc32.h"                   // for Crc32_ComputeBuf
#include "json/json11.hpp"                 // for Json, Json::object
#include "log/log.hpp"                     // for LOG_INFO, LOG_DEBUG, LOG_ERROR
#include "microtar/src/microtar.hpp" // for mtar_header_t, mtar_close, mtar_open, mtar_read_data, MTAR_ESUCCESS, mtar_find, mtar_next, mtar_read_header, mtar_t, MTAR_ENOTFOUND, MTAR_ENULLRECORD, MTAR_EOPENFAIL, MTAR_TDIR
#include "vfs.hpp" // for vfs, tar_buf, os_previous, os_updates, os_current, tmp, vfs::FILE, crc_char_size, vfs::DirectoryEntry, os_version, user_disk, version_string, boot_json, crc32, crc_buf, crc_radix, eMMC_disk

FileInfo::FileInfo(mtar_header_t &h, unsigned long crc32) : fileSize(h.size), fileCRC32(crc32)
{

M module-services/service-desktop/endpoints/update/UpdateMuditaOS.hpp => module-services/service-desktop/endpoints/update/UpdateMuditaOS.hpp +9 -3
@@ 3,11 3,17 @@

#pragma once

#include <module-utils/microtar/src/microtar.hpp>
#include <vfs.hpp>
#include <json/json11.hpp>
#include <module-utils/microtar/src/microtar.hpp> // for mtar_header_t, mtar_t
#include <vfs.hpp>                                // for PATH_SYS, PATH_TMP
#include <json/json11.hpp>                        // for Json
#include <stdint.h>                               // for uint32_t
#include <filesystem>                             // for path, filesystem
#include <iosfwd>                                 // for size_t
#include <string>                                 // for string, allocator
#include <vector>                                 // for vector

class ServiceDesktop;

namespace fs = std::filesystem;
namespace updateos
{

M module-services/service-desktop/parser/MessageHandler.cpp => module-services/service-desktop/parser/MessageHandler.cpp +15 -5
@@ 2,11 2,21 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "MessageHandler.hpp"
#include "Context.hpp"
#include "EndpointFactory.hpp"
#include "log/log.hpp"
#include "ParserUtils.hpp"
#include <memory>

#include <bits/exception.h> // for exception
#include <inttypes.h>       // for PRIu32
#include <memory>           // for operator!=, unique_ptr

#include "Context.hpp"         // for Context
#include "EndpointFactory.hpp" // for EndpointFactory
#include "log/log.hpp"         // for LOG_ERROR, LOG_DEBUG
#include "Endpoint.hpp"        // for Endpoint
#include "FreeRTOS.h"          // for xQueueHandle

namespace sys
{
    class Service;
} // namespace sys

using namespace parserFSM;


M module-services/service-desktop/parser/MessageHandler.hpp => module-services/service-desktop/parser/MessageHandler.hpp +11 -4
@@ 2,13 2,20 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once
#include "Service/Service.hpp"
#include <string>
#include "json/json11.hpp"
#include <log/log.hpp>
#include <string> // for string

#include "Service/Service.hpp"
#include "json/json11.hpp" // for Json

namespace sys
{
    class Service;
} // namespace sys

extern "C"
{
#include <FreeRTOS.h>
#include <FreeRTOS.h> // for xQueueHandle
#include <queue.h>
}


M module-services/service-desktop/parser/ParserFSM.cpp => module-services/service-desktop/parser/ParserFSM.cpp +12 -5
@@ 2,11 2,18 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "ParserFSM.hpp"
#include <service-desktop/ServiceDesktop.hpp>
#include <log/log.hpp>
#include <json/json11.hpp>
#include <memory>
#include <string>

#include <log/log.hpp> // for LOG_DEBUG, LOG_ERROR
#include <memory>      // for unique_ptr, make_unique
#include <string>      // for string

#include "MessageHandler.hpp" // for MessageHandler
#include "ParserUtils.hpp" // for eraseFront, calcPayloadLength, extractPayload, getHeader, removeHeader, size_header, endpointChar, parserFSM

namespace sys
{
    class Service;
} // namespace sys

using namespace parserFSM;


M module-services/service-desktop/parser/ParserFSM.hpp => module-services/service-desktop/parser/ParserFSM.hpp +7 -0
@@ 2,10 2,17 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once
#include <string> // for string

#include "ParserUtils.hpp"
#include "json/json11.hpp"
#include "MessageHandler.hpp"

namespace sys
{
    class Service;
} // namespace sys

namespace parserFSM
{
    enum class State

M module-services/service-desktop/parser/ParserUtils.cpp => module-services/service-desktop/parser/ParserUtils.cpp +2 -0
@@ 3,6 3,8 @@

#include "ParserUtils.hpp"

#include "log/log.hpp" // for LOG_ERROR

using namespace parserFSM;

bool http::isMethodValid(uint8_t method)

M module-services/service-desktop/parser/ParserUtils.hpp => module-services/service-desktop/parser/ParserUtils.hpp +5 -3
@@ 2,10 2,12 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once
#include <stdint.h>
#include <string>
#include <stdint.h>         // for uint8_t
#include <log/log.hpp>      // for LOG_ERROR
#include <bits/exception.h> // for exception
#include <stddef.h>         // for size_t
#include <string>           // for string, allocator, basic_string, stol
#include <vector>
#include <log/log.hpp>

namespace parserFSM
{

M module-services/service-desktop/tests/unittest.cpp => module-services/service-desktop/tests/unittest.cpp +24 -15
@@ 1,21 1,30 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "Common/Common.hpp"
#include "ContactRecord.hpp"
#include "ParserUtils.hpp"
#include "module-services/service-desktop/endpoints/update/UpdateMuditaOS.hpp"
#include "module-services/service-desktop/endpoints/factoryReset/FactoryReset.hpp"
#include "ParserFSM.hpp"
#include "contacts/ContactHelper.hpp"
#include "messages/MessageHelper.hpp"
#include "queries/messages/sms/QuerySMSSearchByType.hpp"
#include "EndpointFactory.hpp"
#include "contacts/ContactsEndpoint.hpp"
#include "json/json11.hpp"
#include <memory>
#include <vfs.hpp>
#include <catch2/catch.hpp>
#include <vfs.hpp>          // for vfs, eMMC_disk
#include <catch2/catch.hpp> // for AssertionHandler, operator""_catch_sr, SourceLineInfo, StringRef, REQUIRE, Section, SECTION, SectionInfo, TEST_CASE
#include <memory>           // for allocator, unique_ptr, make_unique, operator==, allocator_traits<>::value_type
#include <filesystem>       // for path
#include <string>           // for string, operator==, basic_string, operator+, char_traits
#include <vector>           // for vector

#include "Common/Common.hpp" // for ContactNumberType, ContactNumberType::PAGER, SMSType, SMSType::DRAFT
#include "ContactRecord.hpp" // for ContactRecord, ContactRecord::Number
#include "ParserUtils.hpp" // for EndpointType, Method, Method::get, id, EndpointType::contacts, EndpointType::invalid, contactID, date, dateSent, messageBody, templateText, threadID, parserFSM
#include "module-services/service-desktop/endpoints/update/UpdateMuditaOS.hpp" // for UpdateError, UpdateError::NoError, UpdateMuditaOS
#include "module-services/service-desktop/endpoints/factoryReset/FactoryReset.hpp" // for CopyDirContent, DeleteDirContent
#include "ParserFSM.hpp" // for State, StateMachine, State::NoMsg, State::ReceivedPayload, State::ReceivedPartialPayload, State::ReceivedPartialHeader
#include "contacts/ContactHelper.hpp" // for ContactHelper, address, alternativeName, isBlocked, isFavourite, numbers, primaryName
#include "messages/MessageHelper.hpp"    // for MessageHelper
#include "EndpointFactory.hpp"           // for EndpointFactory
#include "contacts/ContactsEndpoint.hpp" // for ContactsEndpoint
#include "json/json11.hpp"               // for Json
#include "Context.hpp"                   // for Context, invalidUuid
#include "Endpoint.hpp"                  // for Endpoint
#include "PhoneNumber.hpp"               // for PhoneNumber, PhoneNumber::View
#include "SMSRecord.hpp"                 // for SMSRecord
#include "SMSTemplateRecord.hpp"         // for SMSTemplateRecord
#include "utf8/UTF8.hpp"                 // for UTF8, operator<<

class vfs vfs;


M module-services/service-eink/ServiceEink.cpp => module-services/service-eink/ServiceEink.cpp +11 -17
@@ 11,28 11,22 @@
// FreeRTOS
extern "C"
{
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "timers.h"
#include "semphr.h"
}
#include <stdio.h>  // for SEEK_SET
#include <string.h> // for memset, memcpy
#include <memory>   // for make_shared, allocator

// module-utils
#include "log/log.hpp"
#include "log/log.hpp" // for LOG_FATAL, LOG_ERROR, LOG_DEBUG, LOG_INFO
// module-vfs
#include "vfs.hpp"
#include "EinkIncludes.hpp"

#include "vfs.hpp" // for vfs
// eink messages
#include "messages/EinkMessage.hpp"
#include "messages/ImageMessage.hpp"
#include "service-gui/messages/GUIMessage.hpp"

#include "SystemManager/SystemManager.hpp"

#include "MessageType.hpp"

#include "messages/EinkMessage.hpp"            // for EinkMessage
#include "messages/ImageMessage.hpp"           // for ImageMessage
#include "service-gui/messages/GUIMessage.hpp" // for GUIMessage
#include "MessageType.hpp" // for MessageType, MessageType::GUIDisplayReady, MessageType::EinkDMATransfer, MessageType::EinkImageData, MessageType::EinkStateRequest, MessageType::EinkTemperatureUpdate
#include "ServiceEink.hpp"
#include "Service/Bus.hpp" // for Bus

enum class EinkWorkerCommands
{

M module-services/service-eink/ServiceEink.hpp => module-services/service-eink/ServiceEink.hpp +9 -5
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

/*


@@ 13,11 13,15 @@

//#include "board.h"

#include "Service/Service.hpp"
#include "Service/Message.hpp"
#include <stdint.h> // for uint32_t, int32_t, int8_t, uint8_t
#include <string>   // for string, allocator

#include "Service/Service.hpp" // for Service
#include "Service/Message.hpp" // for Message_t, DataMessage (ptr only), ResponseMessage (ptr only)
// eink bsp
#include "EinkIncludes.hpp"
#include "Service/Timer.hpp"
#include "EinkIncludes.hpp"   // for EinkWaveFormSettings_t, EinkWaveforms_e
#include "Service/Timer.hpp"  // for Timer, ms
#include "Service/Common.hpp" // for ReturnCodes, ServicePowerMode

class ServiceEink : public sys::Service
{

M module-services/service-eink/board/linux/renderer/src/RArea.cpp => module-services/service-eink/board/linux/renderer/src/RArea.cpp +8 -9
@@ 1,16 1,15 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

/*
 * RArea.cpp
 *
 *  Created on: 24 kwi 2019
 *      Author: robert
 */
#include <gtkmm.h>
#include <cairomm/context.h>
#include <gdkmm/pixbuf.h>
#include <cairomm/context.h> // for Context
#include <gdkmm/pixbuf.h>    // for Pixbuf, COLORSPACE_RGB
#include <glib.h>            // for guchar

#include "RArea.hpp"
#include "cairomm/refptr.h" // for RefPtr
#include "gdkmm/general.h"  // for set_source_pixbuf
#include "glibmm/refptr.h"  // for RefPtr
#include "gtkmm/widget.h"   // for Allocation

RArea::RArea() : data{nullptr}
{}

M module-services/service-eink/board/linux/renderer/src/RArea.hpp => module-services/service-eink/board/linux/renderer/src/RArea.hpp +7 -1
@@ 13,7 13,13 @@

#include <cairomm/context.h>
#include <gtkmm.h>
#include <gtkmm/drawingarea.h>
#include <gtkmm/drawingarea.h> // for DrawingArea

namespace Cairo
{
    class Context;
    template <class T_CppObject> class RefPtr;
} // namespace Cairo

class RArea : public Gtk::DrawingArea
{

M module-services/service-eink/board/linux/renderer/src/RWindow.cpp => module-services/service-eink/board/linux/renderer/src/RWindow.cpp +10 -4
@@ 1,19 1,25 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <glib.h>   // for g_timeout_add, gboolean, gpointer
#include <stddef.h> // for size_t
#include <unistd.h> // for write, ssize_t
/*
 * RWindow.cpp
 *
 *  Created on: 24 kwi 2019
 *      Author: robert
 */
#include <map>
#include <gtk/gtk.h>
#include <map>     // for map, operator!=, _Rb_tree_iterator<>::_Self, map<>::iterator, operator==, _Rb_tree_iterator
#include <utility> // for pair

#include "RWindow.hpp"
#include "module-bsp/bsp/keyboard/key_codes.hpp" // for KeyCodes, KeyCodes::FnLeft, KeyCodes::FnRight, KeyCodes::JoystickDown, KeyCodes::JoystickEnter, KeyCodes::JoystickLeft, KeyCodes::JoystickRight, KeyCodes::JoystickUp, KeyCodes::NumericKey0, KeyCodes::NumericKey1, KeyCodes::NumericKey2, KeyCodes::NumericKey3, KeyCodes::NumericKey4, KeyCodes::NumericKey5, KeyCodes::NumericKey6, KeyCodes::NumericKey7, KeyCodes::NumericKey8, KeyCodes::NumericKey9, KeyCodes::NumericKeyAst, KeyCodes::NumericKeyPnd, KeyCodes::SSwitchDown, KeyCodes::SSwitchMid, KeyCodes::SSwitchUp, KeyCodes::Torch, KeyCodes::VolDown, KeyCodes::VolUp
#include "module-bsp/bsp/common.hpp"             // for KeyEvents, KeyEvents::Pressed, KeyEvents::Released
#include "glibmm/signalproxy.h"                  // for SignalProxy
#include "module-services/service-eink/board/linux/renderer/src/RArea.hpp" // for RArea
#include "sigc++/functors/mem_fun.h"                                       // for bound_mem_functor1, mem_fun

#include "module-bsp/bsp/keyboard/key_codes.hpp"
#include "module-bsp/bsp/common.hpp"
static gboolean viewUpdate(gpointer data)
{
    RWindow *win = reinterpret_cast<RWindow *>(data);

M module-services/service-eink/board/linux/renderer/src/RWindow.hpp => module-services/service-eink/board/linux/renderer/src/RWindow.hpp +6 -4
@@ 11,14 11,16 @@
#ifndef RENDERER_RWINDOW_HPP_
#define RENDERER_RWINDOW_HPP_

#include <map>
#include <cstdint>
#include <gtkmm.h>
#include <gtkmm/drawingarea.h>
#include <gdk/gdk.h> // for GdkEventKey
#include <map>       // for map
#include <cstdint>   // for uint32_t, int8_t

#include "RArea.hpp"

#include "RArea.hpp" // for RArea
#include "module-bsp/bsp/keyboard/key_codes.hpp"
#include "gtkmm/window.h" // for Window

class RWindow : public Gtk::Window
{
  protected:

M module-services/service-eink/board/linux/renderer/src/gui_renderer.cpp => module-services/service-eink/board/linux/renderer/src/gui_renderer.cpp +14 -14
@@ 9,20 9,20 @@
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <cstring>
#include <sys/types.h>

#include <gtkmm.h>
#include <gtkmm/application.h>

#include "RWindow.hpp"
#include <sys/mman.h>          // for mmap, shm_open, MAP_FAILED, MAP_SHARED, PROT_READ, PROT_WRITE
#include <sys/stat.h>          // for mkfifo
#include <fcntl.h>             // for open, O_WRONLY, O_NONBLOCK, O_CREAT, O_RDWR
#include <unistd.h>            // for ftruncate
#include <gtkmm/application.h> // for Application
#include <errno.h>             // for errno
#include <stdint.h>            // for uint32_t, uint8_t
#include <iostream>            // for operator<<, basic_ostream, endl, char_traits, ostream, cerr, cout, std
#include <cstring>             // for strerror, NULL
#include <string>              // for string, allocator

#include "RWindow.hpp"     // for RWindow
#include "glibmm/refptr.h" // for RefPtr

using namespace std;

static const int FrameBufferWidth  = 480;

M module-services/service-evtmgr/EventManager.cpp => module-services/service-evtmgr/EventManager.cpp +31 -29
@@ 10,35 10,37 @@

#include "EventManager.hpp"

#include "log/log.hpp"

#include "bsp/keyboard/keyboard.hpp"
#include "WorkerEvent.hpp"
#include "messages/EVMessages.hpp"

#include "vfs.hpp"

#include "bsp/battery-charger/battery_charger.hpp"
#include "service-appmgr/Controller.hpp"
#include "service-db/api/DBServiceAPI.hpp"
#include "service-db/messages/DBNotificationMessage.hpp"
#include "AudioServiceAPI.hpp"

#include "bsp/harness/bsp_harness.hpp"
#include "harness/Parser.hpp"
#include "harness/events/AtResponse.hpp"
#include "harness/events/FocusApp.hpp"
#include <service-cellular/messages/CellularMessage.hpp>
#include <service-evtmgr/Constants.hpp>

#include <cassert>

#include "bsp/magnetometer/magnetometer.hpp"
#include "bsp/cellular/bsp_cellular.hpp"
#include "bsp/common.hpp"
#include "bsp/rtc/rtc.hpp"

#include <cassert>
#include <service-cellular/messages/CellularMessage.hpp> // for CellularTimeNotificationMessage, RawCommandResp
#include <service-evtmgr/Constants.hpp>                  // for evt_manager
#include <cassert>                                       // for assert
#include <list>                                          // for list
#include <tuple>                                         // for tie, tuple
#include <vector>                                        // for vector

#include "log/log.hpp"             // for LOG_INFO, LOG_DEBUG, LOG_FATAL
#include "WorkerEvent.hpp"         // for WorkerEvent
#include "messages/EVMessages.hpp" // for TorchStateResultMessage, EVMFocusApplication, StatusStateMessage, EVMBoardResponseMessage, SIMMessage, TorchStateMessage
#include "service-appmgr/Controller.hpp"                 // for Controller
#include "service-db/messages/DBNotificationMessage.hpp" // for NotificationMessage
#include "AudioServiceAPI.hpp"                           // for SendEvent
#include "bsp/harness/bsp_harness.hpp"                   // for emit
#include "harness/events/AtResponse.hpp"                 // for AtResponse
#include "harness/events/FocusApp.hpp"                   // for FocusApp
#include "bsp/magnetometer/magnetometer.hpp"             // for GetBoard
#include "bsp/common.hpp"                                // for c_str
#include "bsp/rtc/rtc.hpp"                               // for rtc_SetDateTime
#include "BaseInterface.hpp"                             // for Interface, Interface::Name, Interface::Name::Alarms
#include "MessageType.hpp" // for MessageType, MessageType::EVMModemStatus, MessageType::CellularTimeUpdated, MessageType::DBServiceNotification, MessageType::EVMBatteryLevel, MessageType::EVMChargerPlugged, MessageType::EVMFocusApplication, MessageType::EVMGetBoard, MessageType::EVMMinuteUpdated, MessageType::EVMRingIndicator, MessageType::EVMTimeUpdated, MessageType::EVMTorchStateMessage, MessageType::EVM_GPIO, MessageType::KBDKeyEvent
#include "Service/Bus.hpp" // for Bus
#include "Service/Worker.hpp"              // for WorkerQueueInfo
#include "SystemManager/Constants.hpp"     // for system_manager
#include "SystemManager/SystemManager.hpp" // for SystemManager
#include "bsp/keyboard/key_codes.hpp"      // for KeyCodes, KeyCodes::FnRight, bsp
#include "bsp/torch/torch.hpp" // for State, Action, getColorTemp, getState, toggle, turn, Action::getState, Action::setState, Action::toggle
#include "common_data/RawKey.hpp"                      // for RawKey, RawKey::State, RawKey::State::Pressed
#include "service-audio/messages/AudioMessage.hpp"     // for AudioEventRequest
#include "service-evtmgr/messages/BatteryMessages.hpp" // for BatteryLevelMessage, BatteryPlugMessage
#include "service-evtmgr/messages/KbdMessage.hpp"      // for KbdMessage

EventManager::EventManager(const std::string &name) : sys::Service(name)
{

M module-services/service-evtmgr/EventManager.hpp => module-services/service-evtmgr/EventManager.hpp +8 -3
@@ 11,13 11,18 @@
#ifndef MODULE_SERVICES_SERVICE_KBD_EVENTMANAGER_HPP_
#define MODULE_SERVICES_SERVICE_KBD_EVENTMANAGER_HPP_

#include <stdint.h>    // for uint32_t
#include <sys/types.h> // for time_t
#include <memory>      // for unique_ptr
#include <string>      // for string

#include "bsp/keyboard/key_codes.hpp"
#include "Service/Service.hpp"
#include "Service/Message.hpp"
#include "Service/Service.hpp" // for Service
#include "Service/Message.hpp" // for DataMessage (ptr only), Message_t, ResponseMessage (ptr only)
#include "Service/Worker.hpp"
#include "MessageType.hpp"

#include "bsp/common.hpp"
#include "Service/Common.hpp" // for ReturnCodes, ServicePowerMode

class WorkerEvent;


M module-services/service-evtmgr/WorkerEvent.cpp => module-services/service-evtmgr/WorkerEvent.cpp +37 -29
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

/*


@@ 8,37 8,45 @@
 *      Author: kuba
 */

#include <string.h>

extern "C"
{
#include "FreeRTOS.h"
#include "task.h"
#include "FreeRTOS.h" // for xQueueHandle
#include "projdefs.h" // for pdTRUE
#include "queue.h"    // for xQueueReceive, QueueDefinition, QueueHandle_t
#include "task.h"     // for xTaskGetTickCount
}

#include "Service/Service.hpp"
#include "Service/Message.hpp"
#include "Service/Worker.hpp"
#include "MessageType.hpp"

#include "Audio/AudioCommon.hpp"      // for EventType, EventType::HeadphonesPlugin, EventType::HeadphonesUnplug
#include "common_data/EventStore.hpp" // for GSM, GSM::Tray
#include "common_data/RawKey.hpp"     // for RawKey, RawKey::State, RawKey::State::Pressed, RawKey::State::Released
//#include "harness/harness.hpp"                          // for ETX, STX
#include "log/log.hpp"                                 // for LOG_DEBUG, LOG_ERROR
#include "service-audio/messages/AudioMessage.hpp"     // for AudioEventRequest
#include "service-evtmgr/messages/BatteryMessages.hpp" // for BatteryLevelMessage, BatteryPlugMessage
#include "service-evtmgr/messages/KbdMessage.hpp"      // for KbdMessage

#include <Service/Bus.hpp> // for Bus
//#include <bits/types/struct_tm.h>                       // for tm
#include <sys/types.h> // for time_t
#include <memory>      // for make_shared, __shared_ptr_access, shared_ptr, allocator
#include <optional>    // for optional
#include <string>      // for string
#include <vector>      // for vector

#include "Service/Worker.hpp" // for WorkerQueueInfo, Worker, WorkerCommand
#include "MessageType.hpp" // for MessageType, MessageType::EVMMinuteUpdated, MessageType::EVMModemStatus, MessageType::EVMRingIndicator
#include "WorkerEvent.hpp"
#include "EventManager.hpp"
#include "service-evtmgr/messages/EVMessages.hpp"
#include "AudioServiceAPI.hpp"

#include "bsp/battery-charger/battery_charger.hpp"
#include "bsp/cellular/bsp_cellular.hpp"
#include "bsp/keyboard/keyboard.hpp"
#include "headset.hpp"
#include "bsp/rtc/rtc.hpp"
#include "bsp/vibrator/vibrator.hpp"
#include "bsp/magnetometer/magnetometer.hpp"
#include "bsp/torch/torch.hpp"

#include "Constants.hpp"
#include "bsp/harness/bsp_harness.hpp"
#include "harness/Parser.hpp"
#include <Service/Bus.hpp>
#include "service-evtmgr/messages/EVMessages.hpp"  // for StatusStateMessage, RtcMinuteAlarmMessage
#include "bsp/battery-charger/battery_charger.hpp" // for battery_ClearAllIRQs, battery_Deinit, battery_Init, battery_getBatteryLevel, battery_getChargeStatus, batteryIRQSource, batteryIRQSource::INOKB, batteryIRQSource::INTB
#include "bsp/cellular/bsp_cellular.hpp" // for getStatus, getTray, hotswap_trigger, init, ringIndicatorPin, statusPin, trayPin, value, value::ACTIVE
#include "bsp/keyboard/keyboard.hpp" // for keyboard_Deinit, keyboard_Init, keyboard_get_data
#include "headset.hpp"               // for Deinit, Handler, Init, IsInserted
#include "bsp/rtc/rtc.hpp" // for rtc_GetCurrentTimestamp, rtc_SetMinuteAlarm, rtc_GetCurrentDateTime, rtc_Init
#include "bsp/vibrator/vibrator.hpp"         // for init
#include "bsp/magnetometer/magnetometer.hpp" // for WorkerEventHandler, init
#include "bsp/torch/torch.hpp"               // for deinit, init
#include "Constants.hpp"                     // for evt_manager
#include "bsp/harness/bsp_harness.hpp"       // for Init, emit, flush, read
#include "harness/Parser.hpp"                // for c_str, parse, Error, Error::Success

bool WorkerEvent::handleMessage(uint32_t queueID)
{


@@ 188,7 196,7 @@ bool WorkerEvent::handleMessage(uint32_t queueID)
    return true;
}

#include "harness/events/SysStart.hpp"
#include "harness/events/SysStart.hpp" // for SysStart

bool WorkerEvent::init(std::list<sys::WorkerQueueInfo> queues)
{

M module-services/service-evtmgr/WorkerEvent.hpp => module-services/service-evtmgr/WorkerEvent.hpp +12 -5
@@ 11,15 11,22 @@
#ifndef MODULE_SERVICES_SERVICE_KBD_WorkerEvent_HPP_
#define MODULE_SERVICES_SERVICE_KBD_WorkerEvent_HPP_

#include "bsp/keyboard/key_codes.hpp"
#include <stdint.h> // for uint32_t, uint8_t
#include <list>     // for list
#include <map>      // for map

#include "bsp/keyboard/key_codes.hpp" // for KeyCodes
#include "Service/Service.hpp"
#include "Service/Message.hpp"
#include "Service/Worker.hpp"

#include "Service/Worker.hpp" // for Worker, WorkerQueueInfo (ptr only)
#include "EventManager.hpp"
#include "bsp/common.hpp"             // for KeyEvents, KeyEvents::Released
#include "bsp/keyboard/key_codes.hpp" // for KeyCodes

#include "bsp/common.hpp"
#include "bsp/keyboard/key_codes.hpp"
namespace sys
{
    class Service;
} // namespace sys

struct KeyState
{

M module-services/service-evtmgr/alarm/EventManagerAlarm.cpp => module-services/service-evtmgr/alarm/EventManagerAlarm.cpp +16 -10
@@ 8,18 8,24 @@
 *      Author: kuba
 */

#include "../EventManager.hpp"
#include <sys/types.h> // for time_t
#include <memory>      // for allocator, make_shared, make_unique, __shared_ptr_access, shared_ptr, unique_ptr
#include <string>      // for string
#include <utility>     // for move

#include "log/log.hpp"
#include "../EventManager.hpp"             // for EventManager
#include "../messages/EVMessages.hpp"      // for RtcMinuteAlarmMessage, EVMAlarmSwitchData
#include "service-db/api/DBServiceAPI.hpp" // for DBServiceAPI
#include "service-appmgr/Controller.hpp"   // for Controller
#include "AlarmsRecord.hpp"                // for AlarmsRecord
#include "MessageType.hpp"                 // for MessageType, MessageType::EVMMinuteUpdated
#include "Service/Bus.hpp"                 // for Bus
#include "SwitchData.hpp"                  // for SwitchData

#include "bsp/keyboard/keyboard.hpp"
#include "../WorkerEvent.hpp"
#include "../messages/EVMessages.hpp"

#include "vfs.hpp"

#include "service-db/api/DBServiceAPI.hpp"
#include "service-appmgr/Controller.hpp"
namespace sys
{
    class DataMessage;
} // namespace sys

void EventManager::HandleAlarmTrigger(sys::DataMessage *msgl)
{

M module-services/service-evtmgr/api/EventManagerServiceAPI.cpp => module-services/service-evtmgr/api/EventManagerServiceAPI.cpp +15 -5
@@ 2,12 2,22 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "EventManagerServiceAPI.hpp"
#include <Service/Service.hpp>
#include "../EventManager.hpp"
#include "../messages/EVMessages.hpp"

#include "../Constants.hpp"
#include <Service/Bus.hpp>
#include <Service/Bus.hpp> // for Bus
#include <stdint.h>        // for uint32_t
#include <memory>          // for make_shared, shared_ptr, __shared_ptr<>::element_type
#include <utility>         // for pair

#include "../messages/EVMessages.hpp" // for EVMBoardResponseMessage
#include "../Constants.hpp"           // for evt_manager
#include "MessageType.hpp"            // for MessageType, MessageType::EVMGetBoard
#include "Service/Common.hpp"         // for ReturnCodes, ReturnCodes::Success
#include "Service/Message.hpp"        // for DataMessage

namespace sys
{
    class Service;
} // namespace sys

bsp::Board EventManagerServiceAPI::GetBoard(sys::Service *serv)
{

M module-services/service-evtmgr/api/EventManagerServiceAPI.hpp => module-services/service-evtmgr/api/EventManagerServiceAPI.hpp +7 -1
@@ 5,7 5,13 @@

#include <MessageType.hpp>
#include <Service/Message.hpp>
#include "bsp/common.hpp"

#include "bsp/common.hpp" // for Board

namespace sys
{
    class Service;
} // namespace sys

namespace EventManagerServiceAPI
{

M module-services/service-evtmgr/harness/Parser.cpp => module-services/service-evtmgr/harness/Parser.cpp +17 -8
@@ 2,14 2,23 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "Parser.hpp"
#include "Events.hpp"
#include "actions/CellularCMD.hpp"
#include "events/GPIO.hpp"
#include "events/KeyPress.hpp"
#include <Service/Bus.hpp>
#include <json/json11.hpp>
#include <log/log.hpp>
#include <service-evtmgr/Constants.hpp>

#include <Service/Bus.hpp>              // for Bus
#include <json/json11.hpp>              // for Json, json11
#include <log/log.hpp>                  // for LOG_DEBUG, LOG_ERROR
#include <service-evtmgr/Constants.hpp> // for evt_manager
#include <memory>                       // for shared_ptr

#include "Events.hpp"              // for Events, Type, Data, Events::GPIO, Events::GSMCmd, Events::KeyPress
#include "actions/CellularCMD.hpp" // for gsm_send
#include "events/GPIO.hpp"         // for GPIO
#include "events/KeyPress.hpp"     // for KeyPress

namespace sys
{
    class DataMessage;
    class Service;
} // namespace sys

namespace harness
{

M module-services/service-evtmgr/harness/Parser.hpp => module-services/service-evtmgr/harness/Parser.hpp +8 -2
@@ 3,10 3,16 @@

#pragma once

#include "Events.hpp"
#include <Service/Message.hpp>
#include <Service/Service.hpp>
#include <string>
#include <string> // for string

#include "Events.hpp"

namespace sys
{
    class Service;
} // namespace sys

namespace harness
{

M module-services/service-evtmgr/harness/actions/CellularCMD.cpp => module-services/service-evtmgr/harness/actions/CellularCMD.cpp +12 -3
@@ 2,9 2,18 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "CellularCMD.hpp"
#include <Service/Bus.hpp>
#include <service-cellular/ServiceCellular.hpp>
#include <service-cellular/api/CellularServiceAPI.hpp>

#include <Service/Bus.hpp>                      // for Bus
#include <service-cellular/ServiceCellular.hpp> // for ServiceCellular, ServiceCellular::serviceName
#include <memory>                               // for allocator, make_shared, __shared_ptr_access, shared_ptr

#include "log/log.hpp"                                   // for LOG_ERROR
#include "service-cellular/messages/CellularMessage.hpp" // for RawCommand

namespace sys
{
    class Service;
} // namespace sys

namespace harness
{

M module-services/service-evtmgr/harness/actions/CellularCMD.hpp => module-services/service-evtmgr/harness/actions/CellularCMD.hpp +6 -0
@@ 3,6 3,12 @@

#pragma once
#include <Service/Service.hpp>
#include <string> // for string

namespace sys
{
    class Service;
} // namespace sys

namespace harness
{

M module-services/service-evtmgr/harness/events/AtResponse.cpp => module-services/service-evtmgr/harness/events/AtResponse.cpp +5 -1
@@ 2,7 2,11 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "AtResponse.hpp"
#include <json/json11.hpp>

#include <json/json11.hpp> // for Json, Json::object
#include <map>             // for map<>::mapped_type

#include "service-evtmgr/harness/Events.hpp" // for Data, Type

namespace harness
{

M module-services/service-evtmgr/harness/events/FocusApp.cpp => module-services/service-evtmgr/harness/events/FocusApp.cpp +4 -1
@@ 2,7 2,10 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "FocusApp.hpp"
#include <json/json11.hpp>

#include <json/json11.hpp> // for Json, Json::object, json11
#include <map>             // for map<>::mapped_type
#include <vector>          // for vector

namespace harness
{

M module-services/service-evtmgr/harness/events/FocusApp.hpp => module-services/service-evtmgr/harness/events/FocusApp.hpp +3 -1
@@ 3,7 3,9 @@

#pragma once

#include "../Events.hpp"
#include <string> // for string

#include "../Events.hpp" // for Event, Events, Events::FocusApp

namespace harness
{

M module-services/service-evtmgr/harness/events/GPIO.cpp => module-services/service-evtmgr/harness/events/GPIO.cpp +9 -4
@@ 2,11 2,16 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "GPIO.hpp"
#include "../../messages/EVMessages.hpp"
#include <log/log.hpp>
#include <map>

#include "bsp/harness/bsp_harness.hpp"
#include <log/log.hpp> // for LOG_DEBUG, LOG_ERROR
#include <map>         // for map, map<>::mapped_type
#include <memory>      // for shared_ptr, __shared_ptr_access, make_shared
#include <utility>     // for pair

#include "../../messages/EVMessages.hpp"     // for GPIO
#include "bsp/harness/bsp_harness.hpp"       // for to, read, write
#include "bsp/harness/bsp_pinmap.hpp"        // for harness
#include "service-evtmgr/harness/Events.hpp" // for Data, Type

namespace harness::events
{

M module-services/service-evtmgr/harness/events/GPIO.hpp => module-services/service-evtmgr/harness/events/GPIO.hpp +5 -1
@@ 3,7 3,11 @@

#pragma once

#include "../Events.hpp"
#include <map>    // for map
#include <string> // for string, allocator

#include "../Events.hpp"   // for Event, Events, Events::GPIO
#include "json/json11.hpp" // for Json

namespace harness::events
{

M module-services/service-evtmgr/harness/events/KeyPress.cpp => module-services/service-evtmgr/harness/events/KeyPress.cpp +8 -2
@@ 2,8 2,14 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "KeyPress.hpp"
#include "../../messages/EVMessages.hpp"
#include "../Events.hpp"

#include <map>    // for map<>::mapped_type
#include <memory> // for make_shared, shared_ptr, __shared_ptr_access

#include "../Events.hpp"              // for Data, Type
#include "bsp/keyboard/key_codes.hpp" // for KeyCodes, KeyCodes::FnLeft, KeyCodes::FnRight, KeyCodes::JoystickDown, KeyCodes::JoystickEnter, KeyCodes::JoystickLeft, KeyCodes::JoystickRight, KeyCodes::JoystickUp, KeyCodes::NumericKey0, KeyCodes::NumericKey1, KeyCodes::NumericKey2, KeyCodes::NumericKey3, KeyCodes::NumericKey4, KeyCodes::NumericKey5, KeyCodes::NumericKey6, KeyCodes::NumericKey7, KeyCodes::NumericKey8, KeyCodes::NumericKey9, KeyCodes::NumericKeyAst, KeyCodes::NumericKeyPnd, KeyCodes::SSwitchDown, KeyCodes::SSwitchMid, KeyCodes::SSwitchUp, KeyCodes::Torch, KeyCodes::Undefined, KeyCodes::VolDown, KeyCodes::VolUp
#include "common_data/RawKey.hpp"     // for RawKey, RawKey::State, RawKey::State::Released
#include "service-evtmgr/messages/KbdMessage.hpp" // for KbdMessage

namespace harness::events
{

M module-services/service-evtmgr/harness/events/KeyPress.hpp => module-services/service-evtmgr/harness/events/KeyPress.hpp +4 -1
@@ 3,7 3,10 @@

#pragma once

#include "../Events.hpp"
#include <string> // for string

#include "../Events.hpp"   // for Event, Events, Events::KeyPress
#include "json/json11.hpp" // for Json

namespace harness::events
{

M module-services/service-evtmgr/harness/events/SysStart.cpp => module-services/service-evtmgr/harness/events/SysStart.cpp +3 -1
@@ 2,7 2,9 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "SysStart.hpp"
#include <json/json11.hpp>

#include <json/json11.hpp> // for Json, Json::object, json11
#include <map>             // for map<>::mapped_type

namespace harness
{

M module-services/service-evtmgr/harness/events/SysStart.hpp => module-services/service-evtmgr/harness/events/SysStart.hpp +3 -1
@@ 3,7 3,9 @@

#pragma once

#include "../Events.hpp"
#include <string> // for string

#include "../Events.hpp" // for Event, Events, Events::SysStart

namespace harness
{

M module-services/service-evtmgr/messages/Message.cpp => module-services/service-evtmgr/messages/Message.cpp +3 -1
@@ 2,7 2,9 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "Message.hpp"
#include <Service/Service.hpp>

#include "MessageType.hpp"     // for MessageType
#include "Service/Message.hpp" // for DataMessage

namespace sevm
{

M module-services/service-fota/ServiceFota.cpp => module-services/service-fota/ServiceFota.cpp +27 -24
@@ 1,31 1,34 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "Service/Timer.hpp"
#include "api/FotaServiceAPI.hpp"

#include <Service/Bus.hpp>                             // for Bus
#include <module-cellular/at/Result.hpp>               // for Result, Result::Code, Result::Code::OK
#include <module-cellular/at/URC_QIND.hpp>             // for QIND
#include <service-cellular/api/CellularServiceAPI.hpp> // for GetDataChannel
#include <bits/exception.h>                            // for exception
#include <algorithm>                                   // for find_if, remove, transform
#include <cctype>                                      // for tolower
#include <functional>                                  // for _Bind_helper<>::type, _Placeholder, bind, _1, _2
#include <numeric>                                     // for accumulate
#include <sstream> // for operator<<, basic_ostream, ostringstream, basic_ostream::operator<<, char_traits, basic_istream, istringstream, basic_ostream<>::__ostream_type
#include <string>  // for string, basic_string, stoi, getline, operator<<, operator==, operator+, operator!=
#include <unordered_map> // for unordered_map<>::iterator, _Node_iterator, operator==, _Map_base<>::mapped_type, _Node_iterator_base, unordered_map<>::mapped_type
#include <utility>       // for move, pair
#include <vector>        // for vector

#include "Service/Timer.hpp"      // for Timer
#include "api/FotaServiceAPI.hpp" // for Config, ContextMap, ContextType, HTTPMethod, ContextPair, HTTPMethod::GET, AuthMethod, HTTPErrors, HTTPErrors::OK, HTTPMethod::POST
#include "ServiceFota.hpp"
#include "Service/Service.hpp"
#include "Service/Message.hpp"

#include <Service/Bus.hpp>
#include <module-cellular/Modem/TS0710/TS0710.h>
#include <module-cellular/at/Result.hpp>
#include <module-cellular/at/URC_QIND.hpp>
#include <service-cellular/api/CellularServiceAPI.hpp>

#include "MessageType.hpp"

#include "messages/FotaMessages.hpp"

#include <algorithm>
#include <cctype>
#include <functional>
#include <iostream>
#include <numeric>
#include <sstream>
#include <string>
#include <sstream>
#include "Service/Service.hpp"       // for Service
#include "Service/Message.hpp"       // for Message_t, DataMessage, ResponseMessage
#include "MessageType.hpp"           // for MessageType, MessageType::CellularListCurrentCalls
#include "messages/FotaMessages.hpp" // for FotaResponseMessage, HTTPRequestMessage, ConfigureAPNMessage, HTTPResponseMessage, NotificationMessage, FOTAStart, FOTAProgres, FOTAFinished, FOTARawProgress, InternetRequestMessage, NotificationMessage::Type, ConnectMessage, NotificationMessage::Type::Configured, NotificationMessage::Type::Connected
#include "Commands.hpp"              // for AT, AT::QIGETERROR
#include "Modem/TS0710/DLC_channel.h"                    // for DLC_channel
#include "log/log.hpp"                                   // for LOG_DEBUG, LOG_INFO, LOG_WARN, LOG_ERROR
#include "portmacro.h"                                   // for TickType_t
#include "service-cellular/State.hpp"                    // for State, State::ST, State::ST::Ready
#include "service-cellular/messages/CellularMessage.hpp" // for CellularGetChannelResponseMessage, StateChange

namespace FotaService
{

M module-services/service-fota/ServiceFota.hpp => module-services/service-fota/ServiceFota.hpp +15 -7
@@ 3,17 3,25 @@

#pragma once

#include "api/FotaServiceAPI.hpp"

#include <service-cellular/ServiceCellular.hpp>

#include <Modem/TS0710/DLC_channel.h>
#include <Modem/TS0710/TS0710.h>
#include <Service/Service.hpp>
#include <Service/Message.hpp>

#include <memory>
#include <Service/Service.hpp> // for Service
#include <Service/Message.hpp> // for Message_t
#include <stdint.h>            // for uint32_t
#include <memory>              // for unique_ptr
#include <sstream>
#include <string> // for string

#include "api/FotaServiceAPI.hpp" // for ContextMap
#include "Result.hpp"             // for Result
#include "Service/Common.hpp"     // for ReturnCodes, ReturnCodes::Success, ServicePowerMode

class DLC_channel;
namespace sys
{
    class Timer;
} // namespace sys

namespace FotaService
{

M module-services/service-fota/api/FotaServiceAPI.cpp => module-services/service-fota/api/FotaServiceAPI.cpp +9 -8
@@ 3,14 3,15 @@

#include "FotaServiceAPI.hpp"

#include <service-fota/ServiceFota.hpp>
#include <service-fota/messages/FotaMessages.hpp>
#include <service-cellular/messages/CellularMessage.hpp>
#include <service-cellular/ServiceCellular.hpp>
#include <Service/Bus.hpp>

#include <sstream>
#include <string>
#include <service-fota/ServiceFota.hpp> // for Service, Service::serviceName
#include <service-fota/messages/FotaMessages.hpp> // for HTTPRequestMessage, FOTARawProgress, FOTAStart, ConfigureAPNMessage, ConnectMessage, InternetRequestMessage
#include <Service/Bus.hpp> // for Bus
#include <sstream> // for operator<<, basic_ostream, basic_ostream::operator<<, ostringstream, basic_ostream<>::__ostream_type
#include <string> // for allocator, string, operator<<, char_traits, operator+, to_string
#include <memory> // for make_shared, shared_ptr, __shared_ptr_access

#include "MessageType.hpp" // for MessageType, MessageType::FotaInternetDisconnect
#include "log/log.hpp"     // for LOG_DEBUG

namespace FotaService
{

M module-services/service-fota/api/FotaServiceAPI.hpp => module-services/service-fota/api/FotaServiceAPI.hpp +3 -2
@@ 3,10 3,11 @@

#pragma once

#include <string>
#include <string> // for string
#include <sstream>
#include <unordered_map>
#include <unordered_map> // for unordered_map
#include <vector>
#include <utility> // for pair

namespace sys
{

M module-services/service-gui/ServiceGUI.cpp => module-services/service-gui/ServiceGUI.cpp +27 -24
@@ 1,34 1,37 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <memory>

// module-os
#include "FreeRTOS.h"
#include "semphr.h"
#include <FontManager.hpp> // for FontManager
#include <stddef.h>        // for NULL
#include <memory>          // for unique_ptr, make_shared, allocator
#include <list>            // for list, operator!=, _List_iterator, _List_iterator<>::_Self
#include <utility>         // for move, pair

extern "C"
{
#include <FreeRTOS.h>
#include <semphr.h> // for xSemaphoreGive, vSemaphoreDelete, xSemaphoreCreateBinary, xSemaphoreTake
}
// module-gui
#include "gui/core/Context.hpp"
#include "gui/input/Translator.hpp"

#include "gui/core/Context.hpp" // for Context
// gui service
#include "messages/GUIMessage.hpp"
#include "messages/DrawMessage.hpp"

#include "messages/GUIMessage.hpp" // for GUIMessage
#include "messages/DrawMessage.hpp" // for DrawMessage, DrawMessage::DrawCommand, DrawMessage::DrawCommand::SHUTDOWN, DrawMessage::DrawCommand::SUSPEND
// service-eink
#include "service-eink/messages/ImageMessage.hpp"

#include "service-eink/messages/ImageMessage.hpp" // for ImageMessage
#include "ServiceGUI.hpp"
#include "service-appmgr/Controller.hpp"

#include "../gui/core/ImageManager.hpp"
#include "log/log.hpp"

#include "memory/usermem.h"

#include "SystemManager/SystemManager.hpp"
#include "WorkerGUI.hpp"
#include <FontManager.hpp>
#include "service-appmgr/Controller.hpp"   // for Controller
#include "../gui/core/ImageManager.hpp"    // for ImageManager
#include "log/log.hpp"                     // for LOG_WARN, LOG_DEBUG, LOG_FATAL, LOG_INFO, LOG_ERROR
#include "SystemManager/SystemManager.hpp" // for SystemManager
#include "WorkerGUI.hpp"                   // for WorkerGUI, WorkerGUICommands, WorkerGUICommands::Render
#include "DrawCommand.hpp"                 // for DrawCommand
#include "MessageType.hpp" // for MessageType, MessageType::EinkStateRequest, MessageType::GUICommands, MessageType::GUIDisplayReady, MessageType::GUIFocusInfo, MessageType::GUIRenderingFinished, MessageType::MessageTypeUninitialized
#include "Service/Bus.hpp" // for Bus
#include "Service/Worker.hpp"       // for WorkerQueueInfo
#include "messages/EinkMessage.hpp" // for EinkMessage
#include "projdefs.h"               // for pdMS_TO_TICKS, pdTRUE
#include "task.h"                   // for xTaskGetTickCount

namespace sgui
{

M module-services/service-gui/ServiceGUI.hpp => module-services/service-gui/ServiceGUI.hpp +17 -5
@@ 11,17 11,29 @@
#ifndef MODULE_SERVICES_SERVICE_GUI_SERVICEGUI_HPP_
#define MODULE_SERVICES_SERVICE_GUI_SERVICEGUI_HPP_

#include <memory>
#include <stdint.h> // for uint32_t
#include <memory>   // for allocator, unique_ptr
#include <string>   // for string
#include <vector>   // for vector

// module-gui
#include "gui/core/Context.hpp"
#include "gui/core/Renderer.hpp"
#include "gui/core/Renderer.hpp" // for Renderer
#include "gui/input/Translator.hpp"
#include "messages/DrawMessage.hpp"

#include "Service/Service.hpp"
#include "Service/Message.hpp"
#include "Service/Service.hpp" // for Service
#include "Service/Message.hpp" // for Message_t, DataMessage (ptr only), ResponseMessage (ptr only)
#include "WorkerGUI.hpp"
#include "Common.hpp"         // for RefreshModes, RefreshModes::GUI_REFRESH_DEEP
#include "Service/Common.hpp" // for ReturnCodes, ServicePowerMode
#include "queue.h"            // for QueueDefinition
#include "semphr.h"           // for SemaphoreHandle_t

namespace gui
{
    class Context;
    class DrawCommand;
} // namespace gui

namespace sgui
{

M module-services/service-gui/WorkerGUI.cpp => module-services/service-gui/WorkerGUI.cpp +16 -10
@@ 1,22 1,28 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <string.h>

extern "C"
{
#include "FreeRTOS.h"
#include "task.h"
}

#include "Service/Service.hpp"
#include "Service/Message.hpp"
#include "Service/Worker.hpp"
#include "MessageType.hpp"
#include <Service/Bus.hpp> // for Bus
#include <memory>          // for unique_ptr, make_shared
#include <utility>         // for move
#include <vector>          // for vector

#include "Service/Service.hpp" // for Service
#include "Service/Message.hpp" // for DataMessage
#include "Service/Worker.hpp"  // for Worker, WorkerCommand
#include "MessageType.hpp"     // for MessageType, MessageType::GUIRenderingFinished
#include "WorkerGUI.hpp"
// module-utils
#include "log/log.hpp"
#include <Service/Bus.hpp>
#include "log/log.hpp"                // for LOG_ERROR
#include "DrawCommand.hpp"            // for DrawCommand
#include "Renderer.hpp"               // for Renderer
#include "projdefs.h"                 // for pdMS_TO_TICKS, pdTRUE
#include "queue.h"                    // for xQueueReceive, QueueDefinition, QueueHandle_t
#include "semphr.h"                   // for xSemaphoreGive, xSemaphoreTake
#include "service-gui/ServiceGUI.hpp" // for ServiceGUI

namespace sgui
{

M module-services/service-gui/WorkerGUI.hpp => module-services/service-gui/WorkerGUI.hpp +4 -2
@@ 4,12 4,14 @@
#ifndef MODULE_SERVICES_SERVICE_GUI_WORKERGUI_HPP_
#define MODULE_SERVICES_SERVICE_GUI_WORKERGUI_HPP_

#include <stdint.h> // for uint32_t

#include "core/DrawCommand.hpp"
#include "core/Context.hpp"
#include "messages/GUIMessage.hpp"
#include "ServiceGUI.hpp"
#include "Service/Worker.hpp"
#include "gui/core/Renderer.hpp"
#include "Service/Worker.hpp"    // for Worker
#include "gui/core/Renderer.hpp" // for Renderer

namespace sgui
{

M module-services/service-gui/messages/DrawMessage.cpp => module-services/service-gui/messages/DrawMessage.cpp +4 -2
@@ 1,9 1,11 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "GUIMessage.hpp"
#include "GUIMessage.hpp" // for GUIMessage
#include "DrawMessage.hpp"
#include "MessageType.hpp"
#include "MessageType.hpp" // for MessageType, MessageType::GUICommands
#include "Common.hpp"      // for RefreshModes
#include "DrawCommand.hpp" // for DrawCommand

namespace sgui
{

M module-services/service-gui/messages/DrawMessage.hpp => module-services/service-gui/messages/DrawMessage.hpp +9 -4
@@ 4,13 4,18 @@
#ifndef MODULE_SERVICES_SERVICE_GUI_DRAWMESSAGE_HPP_
#define MODULE_SERVICES_SERVICE_GUI_DRAWMESSAGE_HPP_

#include <list>
#include <memory>
#include <list>   // for list
#include <memory> // for unique_ptr

#include "Service/Message.hpp"
#include "core/DrawCommand.hpp"
#include "GUIMessage.hpp"
#include "gui/Common.hpp"
#include "GUIMessage.hpp" // for GUIMessage
#include "gui/Common.hpp" // for RefreshModes

namespace gui
{
    class DrawCommand;
} // namespace gui

namespace sgui
{

M module-services/service-lwip/ServiceLwIP.cpp => module-services/service-lwip/ServiceLwIP.cpp +15 -10
@@ 2,21 2,26 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "ServiceLwIP.hpp"
#include <log/log.hpp>
#include "MessageType.hpp"
#include "Service/Message.hpp"
#include "Service/Service.hpp"

#include <log/log.hpp>      // for LOG_ERROR, LOG_INFO
#include <bits/exception.h> // for exception
#include <stddef.h>         // for NULL

#include "MessageType.hpp"     // for MessageType, MessageType::LwIP_request
#include "Service/Message.hpp" // for ResponseMessage, DataMessage, Message_t
#include "Service/Service.hpp" // for Service

extern "C"
{
#include "dhcp-server/dhserver.h"
#include "lwip/apps/httpd.h"
#include "lwip/init.h"
#include "lwip/opt.h"
#include "lwip/tcpip.h"
#include "dhcp-server/dhserver.h" // for dhserv_init, dhcp_config_t, dhcp_entry_t
#include "lwip/apps/httpd.h"      // for httpd_init
#include "lwip/tcpip.h"           // for tcpip_init
};

#include <Service/Bus.hpp>
#include <Service/Bus.hpp> // for Bus
#include <memory>          // for make_shared, allocator, shared_ptr
#include <string>          // for string
#include <utility>         // for pair

#define NUM_DHCP_ENTRY 3


M module-services/service-lwip/ServiceLwIP.hpp => module-services/service-lwip/ServiceLwIP.hpp +5 -3
@@ 4,9 4,11 @@
#pragma once

#include <memory>
#include "MessageType.hpp"
#include "Service/Message.hpp"
#include "Service/Service.hpp"

#include "MessageType.hpp"     // for MessageType, MessageType::LwIP_request
#include "Service/Message.hpp" // for DataMessage, Message_t, ResponseMessage (ptr only)
#include "Service/Service.hpp" // for Service
#include "Service/Common.hpp"  // for ReturnCodes, ServicePowerMode

class LwIP_message : public sys::DataMessage
{

M module-services/service-time/ServiceTime.cpp => module-services/service-time/ServiceTime.cpp +13 -5
@@ 2,12 2,20 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "ServiceTime.hpp"
#include "messages/TimeMessage.hpp"
#include <vector>

#include "service-db/messages/DBNotificationMessage.hpp"
#include "service-db/messages/QueryMessage.hpp"
#include <module-db/queries/calendar/QueryEventsSelectFirstUpcoming.hpp>
#include <module-db/queries/calendar/QueryEventsSelectFirstUpcoming.hpp> // for SelectFirstUpcomingResult
#include <vector>                                                        // for vector
#include <memory>  // for make_shared, shared_ptr, operator!=, __shared_ptr_access, unique_ptr
#include <utility> // for move

#include "messages/TimeMessage.hpp"                      // for TimeResponseMessage
#include "service-db/messages/DBNotificationMessage.hpp" // for NotificationMessage
#include "service-db/messages/QueryMessage.hpp"          // for QueryResponse
#include "BaseInterface.hpp"                             // for Interface, Interface::Name, Interface::Name::Events
#include "Common/Query.hpp"                              // for QueryResult
#include "MessageType.hpp" // for MessageType, MessageType::DBServiceNotification, MessageType::ReloadTimers, MessageType::TimersProcessingStart, MessageType::TimersProcessingStop
#include "log/log.hpp"     // for LOG_INFO, LOG_FATAL
#include "service-time/timeEvents/CalendarTimeEvents.hpp" // for CalendarTimeEvents

namespace stm
{

M module-services/service-time/ServiceTime.hpp => module-services/service-time/ServiceTime.hpp +10 -6
@@ 2,15 2,19 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once
#include "Service/Service.hpp"
#include "ServiceTime.hpp"
#include <functional>
#include "MessageType.hpp"
#include "timeEvents/CalendarTimeEvents.hpp"

#include <module-db/queries/calendar/QueryEventsGet.hpp>
#include <module-db/queries/calendar/QueryEventsEdit.hpp>
#include <module-sys/Service/Timer.hpp>
#include <functional>
#include <string> // for allocator, string

#include "Service/Service.hpp" // for Service
#include "ServiceTime.hpp"
#include "MessageType.hpp"
#include "timeEvents/CalendarTimeEvents.hpp" // for CalendarTimeEvents
#include "Service/Common.hpp"                // for ReturnCodes, ServicePowerMode
#include "Service/Message.hpp"               // for Message_t, DataMessage (ptr only), ResponseMessage (ptr only)
#include "service-time/ServiceTime.hpp"

namespace service::name
{

M module-services/service-time/timeEvents/CalendarTimeEvents.cpp => module-services/service-time/timeEvents/CalendarTimeEvents.cpp +22 -8
@@ 3,15 3,29 @@

#include "CalendarTimeEvents.hpp"

#include <module-services/service-appmgr/Controller.hpp>
#include <module-services/service-db/api/DBServiceAPI.hpp>
#include <module-services/service-db/messages/DBNotificationMessage.hpp>
#include <module-db/queries/calendar/QueryEventsSelectFirstUpcoming.hpp>
#include <module-services/service-appmgr/Controller.hpp>                 // for Controller
#include <module-services/service-db/api/DBServiceAPI.hpp>               // for DBServiceAPI
#include <module-db/queries/calendar/QueryEventsSelectFirstUpcoming.hpp> // for SelectFirstUpcoming, SelectFirstUpcomingResult
#include <module-gui/gui/SwitchData.hpp>                                 // for SwitchData
#include <module-apps/application-calendar/data/CalendarData.hpp>        // for EventRecordData
#include <module-apps/application-calendar/ApplicationCalendar.hpp> // for name_calendar
#include <module-apps/application-calendar/data/dateCommon.hpp>     // for TimePointNow, TimePoint, TIME_POINT_INVALID
#include <algorithm>                                                // for min
#include <chrono> // for duration, milliseconds, operator-, operator<, time_point, duration_cast, operator!=, minutes, operator""ms
#include <type_traits> // for __success_type<>::type
#include <utility>     // for move
#include <vector>      // for vector

#include <module-gui/gui/SwitchData.hpp>
#include <module-apps/application-calendar/data/CalendarData.hpp>
#include <module-apps/application-calendar/ApplicationCalendar.hpp>
#include <module-apps/application-calendar/data/dateCommon.hpp>
#include "BaseInterface.hpp"                              // for Interface, Interface::Name, Interface::Name::Events
#include "Common/Query.hpp"                               // for Query, QueryResult
#include "application-calendar/widgets/CalendarStyle.hpp" // for event_reminder_window
#include "queries/calendar/QueryEventsEdit.hpp"           // for Edit
#include "service-time/timeEvents/TimeEvents.hpp"         // for TimeEvents

namespace sys
{
    class Service;
} // namespace sys

namespace stm
{

M module-services/service-time/timeEvents/CalendarTimeEvents.hpp => module-services/service-time/timeEvents/CalendarTimeEvents.hpp +16 -1
@@ 2,8 2,23 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once
#include "TimeEvents.hpp"
#include <module-db/queries/calendar/QueryEventsEdit.hpp>
#include <stdint.h> // for uint32_t
#include <memory>   // for allocator, unique_ptr
#include <string>   // for string

#include "TimeEvents.hpp"                           // for TimeEvents
#include "EventsRecord.hpp"                         // for EventsRecord
#include "application-calendar/data/dateCommon.hpp" // for TIME_POINT_INVALID, TimePoint

namespace db
{
    class QueryResult;
} // namespace db
namespace sys
{
    class Service;
} // namespace sys

namespace stm
{

M module-services/service-time/timeEvents/TimeEvents.cpp => module-services/service-time/timeEvents/TimeEvents.cpp +10 -0
@@ 3,6 3,16 @@

#include "TimeEvents.hpp"

#include <utility> // for move

#include "Common/Query.hpp"  // for QueryResult
#include "Service/Timer.hpp" // for Timer, Timer::Type, Timer::Type::SingleShot

namespace sys
{
    class Service;
} // namespace sys

namespace stm
{
    constexpr static const int eventTimerInitInterval = 1000;

M module-services/service-time/timeEvents/TimeEvents.hpp => module-services/service-time/timeEvents/TimeEvents.hpp +15 -2
@@ 2,9 2,22 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once
#include "Service/Service.hpp"
#include <module-db/queries/calendar/QueryEventsEdit.hpp>
#include <module-sys/Service/Timer.hpp>
#include <module-sys/Service/Timer.hpp> // for Timer
#include <stdint.h>                     // for uint32_t
#include <memory>                       // for unique_ptr
#include <string>                       // for string

#include "Service/Service.hpp"

namespace db
{
    class QueryResult;
} // namespace db
namespace sys
{
    class Service;
} // namespace sys

namespace stm
{