summaryrefslogtreecommitdiffstats
path: root/manager.hpp
diff options
context:
space:
mode:
authorLei YU <mine260309@gmail.com>2017-10-13 13:21:37 +0800
committerLei YU <mine260309@gmail.com>2017-10-16 20:41:02 +0800
commitdebe1d8f47bab3d61b3340c84f802f1dc6388ca0 (patch)
treed591f7fd56911eee9579918303f141f20d84392f /manager.hpp
parent88ad42bd84d05825255c035963afc29eeefcc79d (diff)
downloadphosphor-time-manager-debe1d8f47bab3d61b3340c84f802f1dc6388ca0.tar.gz
phosphor-time-manager-debe1d8f47bab3d61b3340c84f802f1dc6388ca0.zip
Use host state object to check if host is on
The code was using pgood to determine if host is on or off. Now we have host state object, which is a more appropriate way to check host on/off. So change pgood related code to use host state object. Change-Id: I553c1a40922ca2e8bc6904688c55e85971bd4720 Signed-off-by: Lei YU <mine260309@gmail.com>
Diffstat (limited to 'manager.hpp')
-rw-r--r--manager.hpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/manager.hpp b/manager.hpp
index f9ee511..e84652c 100644
--- a/manager.hpp
+++ b/manager.hpp
@@ -45,8 +45,8 @@ class Manager
/** @brief The match of settings property change */
std::vector<sdbusplus::bus::match::match> settingsMatches;
- /** @brief The match of pgood change */
- sdbusplus::bus::match::match pgoodChangeMatch;
+ /** @brief The match of host state change */
+ std::unique_ptr<sdbusplus::bus::match::match> hostStateChangeMatch;
/** @brief The container to hold all the listeners */
std::set<PropertyChangeListner*> listeners;
@@ -135,11 +135,17 @@ class Manager
void onPropertyChanged(const std::string& key,
const std::string& value);
- /** @brief Notified on pgood has changed
+ /** @brief Notified on host state has changed
*
- * @param[in] pgood - The changed pgood value
+ * @param[in] msg - sdbusplus dbusmessage
*/
- void onPgoodChanged(bool pgood);
+ void onHostStateChanged(sdbusplus::message::message& msg);
+
+ /** @brief Notified on host state has changed
+ *
+ * @param[in] on - Indicate if the host is on or off
+ */
+ void onHostState(bool on);
/** @brief Set the property as requested time mode/owner
*
@@ -179,16 +185,6 @@ class Manager
void* userData,
sd_bus_error* retError);
- /** @brief Notified on pgood has changed
- *
- * @param[in] msg - Data associated with subscribed signal
- * @param[in] userData - Pointer to this object instance
- * @param[out] retError - Not used but required with signal API
- */
- static int onPgoodChanged(sd_bus_message* msg,
- void* userData,
- sd_bus_error* retError);
-
/** @brief The string of time mode property */
static constexpr auto PROPERTY_TIME_MODE = "TimeSyncMethod";
OpenPOWER on IntegriCloud