Tomáš Pecka | cb7a5f8 | 2021-01-20 15:12:00 +0100 | [diff] [blame] | 1 | /* |
| 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áš Pecka | af8f063 | 2021-01-27 16:45:55 +0100 | [diff] [blame] | 10 | #include <mutex> |
Tomáš Pecka | cb7a5f8 | 2021-01-20 15:12:00 +0100 | [diff] [blame] | 11 | #include <sdbus-c++/sdbus-c++.h> |
| 12 | #include <sysrepo-cpp/Session.hpp> |
| 13 | #include "system/RAUC.h" |
| 14 | #include "utils/log-fwd.h" |
| 15 | |
| 16 | namespace velia::system { |
| 17 | |
Tomáš Pecka | 594a676 | 2021-01-29 11:06:08 +0100 | [diff] [blame] | 18 | class Firmware { |
Tomáš Pecka | cb7a5f8 | 2021-01-20 15:12:00 +0100 | [diff] [blame] | 19 | public: |
Tomáš Pecka | d51d4cb | 2021-02-03 14:15:49 +0100 | [diff] [blame^] | 20 | Firmware(std::shared_ptr<::sysrepo::Connection> srConn, sdbus::IConnection& dbusConnectionSignals, sdbus::IConnection& dbusConnectionMethods); |
Tomáš Pecka | cb7a5f8 | 2021-01-20 15:12:00 +0100 | [diff] [blame] | 21 | |
| 22 | private: |
| 23 | std::shared_ptr<::sysrepo::Connection> m_srConn; |
Tomáš Pecka | af8f063 | 2021-01-27 16:45:55 +0100 | [diff] [blame] | 24 | std::shared_ptr<::sysrepo::Session> m_srSessionOps, m_srSessionRPC; |
| 25 | std::shared_ptr<::sysrepo::Subscribe> m_srSubscribeOps, m_srSubscribeRPC; |
Tomáš Pecka | cb7a5f8 | 2021-01-20 15:12:00 +0100 | [diff] [blame] | 26 | std::shared_ptr<RAUC> m_rauc; |
Tomáš Pecka | af8f063 | 2021-01-27 16:45:55 +0100 | [diff] [blame] | 27 | std::mutex m_mtx; //! @brief locks access to cached elements that are shared from multiple threads |
| 28 | std::string m_installStatus, m_installMessage; |
Tomáš Pecka | cb7a5f8 | 2021-01-20 15:12:00 +0100 | [diff] [blame] | 29 | velia::Log m_log; |
| 30 | }; |
| 31 | } |