blob: 5ff6723ea9e39068838903d610860fcf5b04e365 [file] [log] [blame]
Tomáš Peckacb7a5f82021-01-20 15:12:00 +01001/*
2 * Copyright (C) 2021 CESNET, https://photonics.cesnet.cz/
3 *
4 * Written by Tomáš Pecka <tomas.pecka@cesnet.cz>
5 *
6 */
7#pragma once
8
9#include <filesystem>
Tomáš Peckaaf8f0632021-01-27 16:45:55 +010010#include <mutex>
Tomáš Peckacb7a5f82021-01-20 15:12:00 +010011#include <sdbus-c++/sdbus-c++.h>
12#include <sysrepo-cpp/Session.hpp>
13#include "system/RAUC.h"
14#include "utils/log-fwd.h"
15
16namespace velia::system {
17
Tomáš Pecka594a6762021-01-29 11:06:08 +010018class Firmware {
Tomáš Peckacb7a5f82021-01-20 15:12:00 +010019public:
Tomáš Peckad51d4cb2021-02-03 14:15:49 +010020 Firmware(std::shared_ptr<::sysrepo::Connection> srConn, sdbus::IConnection& dbusConnectionSignals, sdbus::IConnection& dbusConnectionMethods);
Tomáš Peckacb7a5f82021-01-20 15:12:00 +010021
22private:
23 std::shared_ptr<::sysrepo::Connection> m_srConn;
Tomáš Peckaaf8f0632021-01-27 16:45:55 +010024 std::shared_ptr<::sysrepo::Session> m_srSessionOps, m_srSessionRPC;
25 std::shared_ptr<::sysrepo::Subscribe> m_srSubscribeOps, m_srSubscribeRPC;
Tomáš Peckacb7a5f82021-01-20 15:12:00 +010026 std::shared_ptr<RAUC> m_rauc;
Tomáš Peckaaf8f0632021-01-27 16:45:55 +010027 std::mutex m_mtx; //! @brief locks access to cached elements that are shared from multiple threads
28 std::string m_installStatus, m_installMessage;
Tomáš Peckacb7a5f82021-01-20 15:12:00 +010029 velia::Log m_log;
30};
31}