Files
MuditaOS/module-cellular/Modem/BaseChannel.hpp
Wiktor S. Ovalle Correa 3b141041e9 [EGD-5737] Merge master into experimental
Keep experimental up to date with changes from master
2021-02-17 17:09:37 +01:00

38 lines
1.1 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::string cmd_receive() = 0;
virtual void cmd_post() = 0;
/// }
};
} // namespace at