~aleteoryx/muditaos

ref: 8fafd788a5ef70d89e4d20cb80052261d13d09ff muditaos/module-cellular/at/cmd/QECCNUM.hpp -rw-r--r-- 1.6 KiB
8fafd788 — Paweł Joński [BH-1346] Fix minute singular copy in Spanish 3 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// 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 "Result.hpp"
#include <at/Cmd.hpp>
#include <functional>
#include <PhoneNumber.hpp>

namespace at
{
    namespace result
    {
        /// more details: EC25&EC21_AT_Commands_Manual_V1.3
        class QECCNUM : public Result
        {
          public:
            explicit QECCNUM(const Result &);

            std::vector<std::string> eccNumbersNoSim;
            std::vector<std::string> eccNumbersSim;
        };
    } // namespace result

    namespace cmd
    {
        class QECCNUM : public Cmd
        {
          public:
            enum class Mode
            {
                Query,
                Add,
                Delete
            };

            enum class NumberType
            {
                WithSim,
                WithoutSim,
            };

            QECCNUM() noexcept;
            explicit QECCNUM(Mode mode, NumberType numberType, const std::vector<std::string> &number) noexcept;

            [[nodiscard]] auto parseQECCNUM(const Result &base_result) -> result::QECCNUM;

          private:
            void setRequestParameters(Mode mode, NumberType numberType, const std::vector<std::string> &numbers);

            static constexpr auto qeccnumCmd      = "+QECCNUM";
            static constexpr auto commandPostfix  = ":";
            static constexpr auto dataSeparator   = ',';
            static constexpr auto stringDelimiter = '\"';
        };
    } // namespace cmd

} // namespace at