Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 1 | #pragma once |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 2 | |
| 3 | #include <sdbusplus/bus.hpp> |
| 4 | #include "xyz/openbmc_project/Software/Version/server.hpp" |
| 5 | |
| 6 | namespace phosphor |
| 7 | { |
| 8 | namespace software |
| 9 | { |
| 10 | namespace manager |
| 11 | { |
| 12 | |
Gunnar Mills | 9b7c0b6 | 2017-04-24 12:59:58 -0500 | [diff] [blame] | 13 | using BMCVersionInherit = sdbusplus::server::object::object< |
Gunnar Mills | 2ce7da2 | 2017-05-04 15:37:56 -0500 | [diff] [blame] | 14 | sdbusplus::xyz::openbmc_project::Software::server::Version>; |
Gunnar Mills | af4759e | 2017-02-13 16:50:16 -0600 | [diff] [blame] | 15 | |
Gunnar Mills | 9b7c0b6 | 2017-04-24 12:59:58 -0500 | [diff] [blame] | 16 | /** @class BMCVersion |
Gunnar Mills | 2ce7da2 | 2017-05-04 15:37:56 -0500 | [diff] [blame] | 17 | * @brief OpenBMC version software management implementation |
Gunnar Mills | 9b7c0b6 | 2017-04-24 12:59:58 -0500 | [diff] [blame] | 18 | * for the active BMC software image. |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 19 | * @details A concrete implementation for xyz.openbmc_project.Software.Version |
Gunnar Mills | 2ce7da2 | 2017-05-04 15:37:56 -0500 | [diff] [blame] | 20 | * DBus API. |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 21 | */ |
Gunnar Mills | 9b7c0b6 | 2017-04-24 12:59:58 -0500 | [diff] [blame] | 22 | class BMCVersion : public BMCVersionInherit |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 23 | { |
| 24 | public: |
Gunnar Mills | 2ce7da2 | 2017-05-04 15:37:56 -0500 | [diff] [blame] | 25 | /** @brief Constructs BMC Version Software Manager for |
Gunnar Mills | 9b7c0b6 | 2017-04-24 12:59:58 -0500 | [diff] [blame] | 26 | * the active BMC software image. |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 27 | * |
Gunnar Mills | a673ee0 | 2017-01-23 16:45:03 -0600 | [diff] [blame] | 28 | * @note This constructor passes 'true' to the base class in order to |
| 29 | * defer dbus object registration until we can |
| 30 | * set our properties |
| 31 | * |
| 32 | * @param[in] bus - The Dbus bus object |
| 33 | * @param[in] objPath - The Dbus object path |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 34 | */ |
Gunnar Mills | 9b7c0b6 | 2017-04-24 12:59:58 -0500 | [diff] [blame] | 35 | BMCVersion(sdbusplus::bus::bus& bus, |
| 36 | const char* objPath) : BMCVersionInherit( |
| 37 | bus, (std::string{objPath} + '/' + getId()).c_str(), |
| 38 | true) |
Gunnar Mills | a673ee0 | 2017-01-23 16:45:03 -0600 | [diff] [blame] | 39 | { |
| 40 | // Set properties. |
| 41 | purpose(VersionPurpose::BMC); |
| 42 | version(getVersion()); |
| 43 | |
| 44 | // Emit deferred signal. |
| 45 | emit_object_added(); |
| 46 | } |
Gunnar Mills | 01a323b | 2017-01-18 09:48:13 -0600 | [diff] [blame] | 47 | |
| 48 | private: |
| 49 | /** |
| 50 | * @brief Get the code version identifier. |
| 51 | * |
| 52 | * @return The version identifier. |
| 53 | **/ |
| 54 | const std::string getVersion() const; |
| 55 | |
| 56 | /** |
| 57 | * @brief Get the Software Version id. |
| 58 | * |
| 59 | * @return The id. |
| 60 | **/ |
| 61 | const std::string getId() const; |
| 62 | }; |
| 63 | |
| 64 | } // namespace manager |
| 65 | } // namespace software |
| 66 | } // namespace phosphor |