diff options
author | Matt Spinler <spinler@us.ibm.com> | 2018-05-01 15:13:53 -0500 |
---|---|---|
committer | Matt Spinler <spinler@us.ibm.com> | 2018-05-01 15:31:46 -0500 |
commit | 1275bd13cc207167b489f661d10a7263b211bbcb (patch) | |
tree | 198f0a845ba7dd9e930a5cd207326326d3a33934 /log_manager.hpp | |
parent | 5f4247f05d528345c56ca64a97d3ba571f26611d (diff) | |
download | phosphor-logging-1275bd13cc207167b489f661d10a7263b211bbcb.tar.gz phosphor-logging-1275bd13cc207167b489f661d10a7263b211bbcb.zip |
Add function to read code version
Read the BMC code version once at startup. This will
be added to error logs in future commits.
The code is getting the version from a file instead
of from D-Bus in order to reduce dependencies.
Tested: Call the function and check that it returned the
correct thing.
Change-Id: I9a4729e946a130ec32c375c283fd22a7658121f5
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'log_manager.hpp')
-rw-r--r-- | log_manager.hpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/log_manager.hpp b/log_manager.hpp index d62a25e..d5ca4e9 100644 --- a/log_manager.hpp +++ b/log_manager.hpp @@ -54,7 +54,8 @@ class Manager : public details::ServerObject<details::ManagerIface> Manager(sdbusplus::bus::bus& bus, const char* objPath) : details::ServerObject<details::ManagerIface>(bus, objPath), busLog(bus), - entryId(0){}; + entryId(0), + fwVersion(readFWVersion()) {}; /* * @fn commit() @@ -136,6 +137,12 @@ class Manager : public details::ServerObject<details::ManagerIface> */ void journalSync(); + /** @brief Reads the BMC code level + * + * @return std::string - the version string + */ + static std::string readFWVersion(); + /** @brief Persistent sdbusplus DBus bus connection. */ sdbusplus::bus::bus& busLog; @@ -150,6 +157,9 @@ class Manager : public details::ServerObject<details::ManagerIface> /** @brief Id of last error log entry */ uint32_t entryId; + + /** @brief The BMC firmware version */ + const std::string fwVersion; }; } //namespace internal |