~aleteoryx/muditaos

ref: 40fa31a954b10383da6cee6b98c06b5fb932d266 muditaos/module-services/service-cellular/src/volte/VolteCapabilityHandlerCellular.cpp -rw-r--r-- 842 bytes
40fa31a9 — Maciej-Mudita [MOS-827] Fix looping on the SIM card selection screen 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
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "VolteCapabilityHandlerCellular.hpp"
#include <modem/mux/CellularMux.h>

namespace cellular::service
{
    void VolteCapabilityCellular::setChannel(at::BaseChannel *channel)
    {
        this->channel = channel;
    }

    auto VolteCapabilityCellular::getImsi() -> std::optional<std::string>
    {
        if (channel == nullptr) {
            LOG_ERROR("No channel provided. Request ignored");
            return std::nullopt;
        }

        auto result = channel->cmd(at::AT::CIMI);
        if (not result) {
            LOG_ERROR("Failed to read IMSI, disable VoLTE.");
            return std::nullopt;
        }

        return result.response[0];
    }
} // namespace cellular::service