~aleteoryx/muditaos

ref: 106440c78daac588394d01910fe7a5514497a5d1 muditaos/module-bluetooth/Bluetooth/command/Command.hpp -rw-r--r-- 1.3 KiB
106440c7 — Kuba [MOS-326] Change call logic removed from call window 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
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once
#include "CommandData.hpp"

namespace bluetooth
{

    class Command
    {
      public:
        enum Type
        {
            StartScan,
            StopScan,
            getDevicesAvailable,
            VisibilityOn,
            VisibilityOff,
            ConnectAudio,
            DisconnectAudio,
            PowerOn,
            PowerOff,
            Pair,
            Unpair,
            StartRinging,
            StopRinging,
            StartRouting,
            StartStream,
            StopStream,
            SwitchProfile,
            CallAnswered,
            IncomingCallNumber,
            SignalStrengthData,
            OperatorNameData,
            BatteryLevelData,
            None,
        };

        struct CommandPack
        {
            Command::Type commandType         = Command::None;
            std::unique_ptr<CommandData> data = nullptr;
        };

        explicit Command(CommandPack &&);
        explicit Command(Command::Type type)
        {
            pack.commandType = type;
        }
        auto getType() const noexcept -> Command::Type;
        auto getData() -> DataVariant;

      private:
        CommandPack pack;
    };

} // namespace bluetooth