mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-06-28 18:27:08 -04:00
* [EGD-2420] tokenizer refactoring new class CellularCall * [EDG-2420] new file added * [EGD-2420] fixed include * [EGD-2420] added new ModemCall type and its usage in Sevice Cellular. missing dep in module-cellular. Fix in tokenizer. * [EGD-2420] get calllogrecordID one adding new entry to DB number as contact name * [EGD-2420] fixes at DB level api for update and delete Outgoing call seems to add proper calllog entries now * [EGD-2420][fix] fix for HF during call before full modem init * [EGD-2420] incoming and missed calls are handled code clean-up * [EGD-2420] ModemCall::to_string * [EGD-2420] added proper exceptions * [EGD-2420] minor clean up * [EGD-2420] split string with multichar delimiter * [EGD-2420] done some TODOs * [EGD-2420] PR fixes * [EGD-2420] separation between cellularcall and cellularservice PR fixes * [EGD-2420] duration based on timestamp instead of timer * [EGD-2420] new to_strings * [EGD-2420] fixes after rebase * [EGD-2420] operator<< * [EGD-2420] changed split params * [EGD-2420] changed returned db id * [EGD-2420] comment with explantaion
76 lines
1.5 KiB
C++
76 lines
1.5 KiB
C++
|
|
/*
|
|
* @file ATParser.hpp
|
|
* @author Mateusz Piesta (mateusz.piesta@mudita.com)
|
|
* @date 17.07.19
|
|
* @brief
|
|
* @copyright Copyright (C) 2019 mudita.com
|
|
* @details
|
|
*/
|
|
|
|
|
|
#ifndef PUREPHONE_ATPARSER_HPP
|
|
#define PUREPHONE_ATPARSER_HPP
|
|
|
|
#include <memory>
|
|
#include <optional>
|
|
#include <vector>
|
|
#include "FreeRTOS.h"
|
|
#include "task.h"
|
|
#include "mutex.hpp"
|
|
#include "Service/Service.hpp"
|
|
|
|
#define DEBUG_MODEM_OUTPUT_RESPONSE 0
|
|
#define DEBUG_MODEM_TIMEOUT_AS_ERROR 0
|
|
|
|
#if DEBUG_MODEM_TIMEOUT_AS_ERROR
|
|
#define LOG_MODEM_TIMEOUT(...) LOG_ERROR(__VA_ARGS__)
|
|
#else
|
|
#define LOG_MODEM_TIMEOUT(...) LOG_INFO(__VA_ARGS__)
|
|
#endif
|
|
|
|
namespace bsp{
|
|
class Cellular;
|
|
}
|
|
|
|
class ATParser {
|
|
public:
|
|
|
|
enum class Urc{
|
|
MeInitializationSuccessful,
|
|
FullFuncionalityAvailable,
|
|
SimCardReady,
|
|
SMSInitializationComplete,
|
|
PhonebookInitializationComplete
|
|
|
|
};
|
|
|
|
ATParser(bsp::Cellular* cellular);
|
|
|
|
int ProcessNewData(sys::Service *service);
|
|
|
|
std::vector<std::string> SendCommand(const char *cmd, size_t rxCount, uint32_t timeout = 500);
|
|
|
|
// @param maxTokenCount max token count, if 0 no max number limitation
|
|
static std::vector<std::string> Tokenizer(const std::string &input, const std::string &delimiter, uint32_t maxTokenCount = 0);
|
|
|
|
private:
|
|
|
|
std::vector<Urc> ParseURC();
|
|
|
|
bsp::Cellular* cellular = nullptr;
|
|
|
|
std::string responseBuffer;
|
|
|
|
TaskHandle_t blockedTaskHandle = nullptr;
|
|
cpp_freertos::MutexStandard mutex;
|
|
|
|
std::vector<ATParser::Urc> urcs;
|
|
|
|
bool isInitialized = false;
|
|
|
|
};
|
|
|
|
|
|
#endif //PUREPHONE_ATPARSER_HPP
|