diff options
author | Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> | 2019-11-11 09:18:09 +0300 |
---|---|---|
committer | Thomaiyar, Richard Marian <richard.marian.thomaiyar@intel.com> | 2019-11-18 19:39:10 +0300 |
commit | d095ccea8df74f9de228ab83b658d80b4fb79460 (patch) | |
tree | d2f85643fa86d28cc646883b6756163eba0b47cf /special-mode-mgr/include/specialmodemgr.hpp | |
parent | c559e2c659b0d3b6ca76e1553c68ab1960d461d0 (diff) | |
download | provingground-d095ccea8df74f9de228ab83b658d80b4fb79460.tar.xz |
Update special mode mgr as per D-Bus interface
Updated special-mode-mgr service to expose the property as
per the D-Bus interface SpecialMode in the community
Tested
1. Verified that manufacturing mode entered as per 15 second power
buttong press during AC cycle
2. Verified that expired based on timeout or restriction mode property
change
3. Verified validation unsecure features works as expected
Change-Id: I87b67424f657a1a19545b4dc18a80a2fddf8ee44
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
Diffstat (limited to 'special-mode-mgr/include/specialmodemgr.hpp')
-rw-r--r-- | special-mode-mgr/include/specialmodemgr.hpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/special-mode-mgr/include/specialmodemgr.hpp b/special-mode-mgr/include/specialmodemgr.hpp index 9146b01..2e60a2c 100644 --- a/special-mode-mgr/include/specialmodemgr.hpp +++ b/special-mode-mgr/include/specialmodemgr.hpp @@ -19,18 +19,11 @@ #include <sdbusplus/asio/object_server.hpp> #include <chrono> #include <filesystem> +#include <xyz/openbmc_project/Control/Security/SpecialMode/server.hpp> -static constexpr const char* strSpecialMode = "SpecialMode"; - -enum SpecialMode : uint8_t +namespace specialMode { - none = 0, - manufacturingExpired = 1, - manufacturingMode = 2, -#ifdef BMC_VALIDATION_UNSECURE_FEATURE - validationUnsecure = 3, -#endif -}; +static constexpr const char* strSpecialMode = "SpecialMode"; class SpecialModeMgr { @@ -38,7 +31,8 @@ class SpecialModeMgr sdbusplus::asio::object_server& server; std::shared_ptr<sdbusplus::asio::connection> conn; std::shared_ptr<sdbusplus::asio::dbus_interface> iface; - uint8_t specialMode = none; + sdbusplus::xyz::openbmc_project::Control::Security::server::SpecialMode:: + Modes specialMode; std::unique_ptr<boost::asio::steady_timer> timer = nullptr; std::unique_ptr<sdbusplus::bus::match::match> intfAddMatchRule = nullptr; std::unique_ptr<sdbusplus::bus::match::match> propUpdMatchRule = nullptr; @@ -48,14 +42,19 @@ class SpecialModeMgr void updateTimer(int countInSeconds); public: - void setSpecialModeValue(uint8_t value) const + void setSpecialModeValue( + const sdbusplus::xyz::openbmc_project::Control::Security::server:: + SpecialMode::Modes value) const { if (iface != nullptr && iface->is_initialized()) { - iface->set_property(strSpecialMode, value); + iface->set_property(strSpecialMode, + sdbusplus::xyz::openbmc_project::Control:: + Security::server::convertForMessage(value)); } } SpecialModeMgr(boost::asio::io_service& io, sdbusplus::asio::object_server& srv, std::shared_ptr<sdbusplus::asio::connection>& conn); }; +} // namespace specialMode |