Files
MuditaOS/module-cellular/Modem/ATParser.hpp
Adam Dobrowolski 78a52c0705 [EGD-5451] Added SMS Center SMSC check to OS
Extended cmd mechanism to provide class defined responses and
implemented SMS center verification to check if SIM card is properly
cofigured and is able to send SMS messagess at all.
This check is needed because if SMS Center is lost we are not able
to send SMS messages with no verbose error codes.
Added milliseconds and noexcept specifiers for at commands
Fixed Chanel name to Channel
2021-01-31 11:24:37 +01:00

53 lines
1.2 KiB
C++

// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#ifndef PUREPHONE_ATPARSER_HPP
#define PUREPHONE_ATPARSER_HPP
#include "ATCommon.hpp"
#include <FreeRTOS.h>
#include <Service/Service.hpp>
#include <memory>
#include <optional>
#include <task.h>
#include <vector>
namespace bsp
{
class Cellular;
}
class ATParser : public at::Channel
{
public:
enum class Urc
{
MeInitializationSuccessful,
FullFuncionalityAvailable,
SimCardReady,
SMSInitializationComplete,
PhonebookInitializationComplete,
Fota,
NotHandled,
};
ATParser(bsp::Cellular *cellular);
virtual ~ATParser() = default;
int ProcessNewData(sys::Service *service);
virtual void cmd_init() override final;
virtual void cmd_send(std::string cmd) override final;
virtual std::vector<std::string> cmd_receive() override final;
virtual void cmd_post() override final;
private:
std::vector<Urc> ParseURC();
bsp::Cellular *cellular = nullptr;
std::string responseBuffer;
std::vector<ATParser::Urc> urcs;
bool isInitialized = false;
};
#endif // PUREPHONE_ATPARSER_HPP