powermanagerClient.h
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include "../../../../LIBRARIES/MIDDLEWARE/src/com/dpyMwClient.h"
7 #include "powerProto.pb.h"
8 #include "powermanagerApi.h"
9 
15 class PowerClient: public DpyMwClient
16 {
17 
18 private:
19  void RegisterCallbacks();
20 public:
21  PowerClient(std::string ip, int dport, int sport);
22  ~PowerClient();
23  void asyncGetCurrentEvent(dpyPowermanager::event_handler_function handler);
24  void getPowerEvent_S(dpyPowermanager::event_handler_function handler, dpyPowermanager::ConfigType configuration);
25  void getPowerEvent_U();
26  void asyncShutdownRequest(dpyPowermanager::answer_pm_handler_function handler);
27  void asyncRebootRequest(dpyPowermanager::answer_pm_handler_function handler);
28  void asyncStandbyRequest(dpyPowermanager::answer_pm_handler_function handler);
29  void asyncAbortRequest(dpyPowermanager::answer_pm_handler_function handler);
30  void asyncCriticalBatteryRequest(dpyPowermanager::answer_pm_handler_function handler);
31  void asyncCheckPowerRailsStatus(dpyPowermanager::power_rails_handler_function handler);
32  void asyncSetDebugMode(dpyPowermanager::answer_pm_handler_function handler, bool debug);
33  void asyncGetDebugMode(dpyPowermanager::debug_pm_handler_function handler);
34  void asyncSetTimers(dpyPowermanager::answer_pm_handler_function handler, std::uint32_t standbyTimer, std::uint32_t haltTimer);
35  void asyncGetTimers(dpyPowermanager::timers_pm_handler_function handler);
36  void asyncGetStateWakeupTimers(dpyPowermanager::timers_state_pm_handler_function handler);
37  void asyncSetStateWakeupTimers(dpyPowermanager::answer_pm_handler_function handler, bool standbyEnabled, bool haltEnabled);
38  void asyncSetTransitionIntervals(dpyPowermanager::answer_pm_handler_function handler, std::uint32_t cancelTime, std::uint32_t guardTime);
39  void asyncGetTransitionIntervals(dpyPowermanager::transition_intervals_pm_handler_function handler);
40  void asyncSetWakeupTime(dpyPowermanager::answer_pm_handler_function handler, struct tm &wakeupTime, bool localTime);
41  void asyncGetWakeupTime(dpyPowermanager::wakeup_time_pm_handler_function handler);
42  void asyncSetIgnitionOffTimeout(dpyPowermanager::answer_pm_handler_function handler, int minutes);
43  void asyncGetIgnitionOffTimeout(dpyPowermanager::ignition_off_timeout_pm_handler_function handler);
44 
45 };
ConfigType
An enum definition which represents the different types of messages that it is wanted to be subscribe...
Definition: iPower.h:72
boost::function< void(boost::system::error_code &ec, dpyPowermanager::TransitionIntervals)> transition_intervals_pm_handler_function
Transition Intervals handler function.
Definition: iPower.h:148
This class allows to interact with the Power Manager Service.
Definition: powermanagerClient.h:15
boost::function< void(boost::system::error_code &ec)> answer_pm_handler_function
Answer handler function.
Definition: iPower.h:144
boost::function< void(boost::system::error_code &ec, dpyPowermanager::PowerEvent event)> event_handler_function
Handlers to the functions the client has to implement.
Definition: iPower.h:142
boost::function< void(boost::system::error_code &ec, dpyPowermanager::Timers)> timers_pm_handler_function
Timers handler function.
Definition: iPower.h:145
boost::function< void(boost::system::error_code &ec, bool standbyEnabled, bool haltEnabled)> timers_state_pm_handler_function
Timers State handler function.
Definition: iPower.h:147
boost::function< void(boost::system::error_code &ec, bool rightConfiguration)> power_rails_handler_function
Power Rails handler function.
Definition: iPower.h:146
Manages dealer and susbriber.
Definition: dpyMwClient.h:59
boost::function< void(boost::system::error_code &ec, struct tm dateTime)> wakeup_time_pm_handler_function
Wakeup Time handler function.
Definition: iPower.h:149
boost::function< void(boost::system::error_code ec, bool active)> debug_pm_handler_function
Debug handler to check if the debug is active or not.
Definition: iPower.h:143
boost::function< void(boost::system::error_code &ec, int minutes)> ignition_off_timeout_pm_handler_function
Ignition Off Timeout handler function.
Definition: iPower.h:150