mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-06-28 10:17:24 -04:00
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
38 lines
1.2 KiB
C++
38 lines
1.2 KiB
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <at/Commands.hpp>
|
|
#include <at/Result.hpp>
|
|
|
|
namespace at
|
|
{
|
|
class BaseChannel
|
|
{
|
|
public:
|
|
/// @defgroup Channel OS dependent methods
|
|
/// {
|
|
|
|
/// waits till ok or timeout
|
|
virtual auto cmd(const std::string &cmd,
|
|
std::chrono::milliseconds timeout = at::default_timeout,
|
|
size_t rxCount = 0) -> Result = 0;
|
|
virtual auto cmd(const at::AT &at) -> Result = 0;
|
|
virtual auto cmd(const at::Cmd &at) -> Result = 0;
|
|
/// }
|
|
|
|
/// @defgroup Channel Platform independent methods
|
|
/// {
|
|
virtual void cmd_log(std::string cmd, const Result &result, uint32_t timeout)
|
|
{}
|
|
virtual void cmd_init() = 0;
|
|
virtual void cmd_send(std::string cmd) = 0;
|
|
virtual std::vector<std::string> cmd_receive() = 0;
|
|
virtual void cmd_post() = 0;
|
|
/// }
|
|
};
|
|
} // namespace at
|