~aleteoryx/muditaos

ref: b4568c32eb2a4b37e9dfbbe08c446430eee2145c muditaos/module-services/service-cellular/src/TetheringHandler.hpp -rw-r--r-- 1.5 KiB
b4568c32 — Kuba Kleczkowski [MOS-977] Added VoLTE support in additional countries 2 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
// 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 <memory>
#include <functional>
#include <optional>

namespace at
{
    class Cmd;
    class BaseChannel;
} // namespace at

namespace at::qcfg::usbnet
{
    enum class Net;
}
namespace cellular::service
{

    class TetheringHandler
    {
      public:
        /**
         * Reads current Rndis configuration
         * @return true if Rndis is enabled, false if Rndis is disabled
         */
        auto isRndisEnabled() -> bool;
        /**
         * It's called to configure Rndis mode
         * @return
         */
        auto configure() -> bool;
        /**
         * It's enabling tethering mode. Disables all URC and sets modem on passthrough via USB
         * @return true on succes, false on fail
         */
        auto enable() -> bool;
        /**
         * It's disabling tethering mode. Enables all URC, reads all unreaded messages and disables passtrough via USB
         * @return
         */
        auto disable() -> bool;

        /**
         * User callbacks
         */
        std::function<std::optional<at::qcfg::usbnet::Net>()> onIsRndisEnabled;
        std::function<bool()> onEnableRndis;
        std::function<bool()> onDisableUrc;
        std::function<bool()> onEnableUrc;
        std::function<bool()> onReadMessages;
        std::function<void(bool)> onSetPassthrough;
    };
} // namespace cellular::service