~aleteoryx/muditaos

ref: 6ca2bd0492dc530bb05e2e61f25ae3584bd76fc3 muditaos/module-cellular/Modem/BaseChannel.hpp -rw-r--r-- 1.2 KiB
6ca2bd04 — Wojtek Cichon [EGD-6361] Fixed quotation marks in Notes 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// 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>
#include <at/Constants.hpp>

namespace at
{
    struct Cmd;

    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