~aleteoryx/muditaos

ref: 06d16390c21c37457bc875e841bb12039d1123d7 muditaos/module-services/service-desktop/endpoints/developerMode/event/ATRequest.cpp -rw-r--r-- 976 bytes
06d16390 — Lefucjusz [MOS-1021] Fix blocked passcode behavior 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
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <endpoints/developerMode/event/ATRequest.hpp>
#include <endpoints/developerMode/DeveloperModeHelper.hpp>
#include <endpoints/JsonKeyNames.hpp>

namespace sdesktop::developerMode
{
    ATResponseEvent::ATResponseEvent(std::string command, std::chrono::milliseconds timeout)
        : command(std::move(command)), timeout(timeout)
    {
        context.setResponseStatus(endpoints::http::Code::InternalServerError);
        context.setResponseBody(json11::Json::object{{endpoints::json::developerMode::ATResponse, ""}});
    }

    void ATResponseEvent::setResponse(const std::vector<std::string> &response)
    {
        context.setResponseBody(json11::Json::object{{endpoints::json::developerMode::ATResponse, response}});
        context.setResponseStatus(endpoints::http::Code::OK);
    }

} // namespace sdesktop::developerMode