AWS IoT Firmware
Firmware code for AWS IoT Devices
power_ctrl_handler.hpp
1 
14 #ifndef _POWER_CTRL_HANDLER_HPP
15 #define _POWER_CTRL_HANDLER_HPP
16 
17 #include "parent_handler.hpp"
18 
19 #include "event_handler_util.hpp"
20 
21 #include "frozen.h"
22 #include "mgos.h"
23 #include "mgos_mqtt.h"
24 
30  public:
31  HandlerError handleRequest(struct mg_connection* mgCon,
32  struct mg_str* message,
33  char* commandName,
34  char* response);
35  HandlerError handleReport(char* stateReport);
36  ~PowerCtrlHandler(void){};
37  PowerCtrlHandler(void);
38  static void setLightStatus(bool lightStatus);
39  static bool getLightStatus(void);
40 
41  private:
45  static bool _lightIsOn;
46 };
47 
48 #endif
49 
PowerCtrlHandler(void)
Construct a new Power Ctrl Handler:: Power Ctrl Handler object intialize a power controller handler f...
Definition: power_ctrl_handler.cpp:38
header file for event handler utils
HandlerError handleRequest(struct mg_connection *mgCon, struct mg_str *message, char *commandName, char *response)
implement the handle request function for the power control endpoint for the bedroom light controller...
Definition: power_ctrl_handler.cpp:54
static bool getLightStatus(void)
retrieve the status of the bed room lgiht
Definition: power_ctrl_handler.cpp:108
HandlerError handleReport(char *stateReport)
write a state report for the powercontroller endpoint to the given buffer
Definition: power_ctrl_handler.cpp:116
power controller class for the bed room light controller, responsible for handling an requests pertai...
Definition: power_ctrl_handler.hpp:29
contain class declaration for the ParentHandler class
HandlerError
enum defining errors that the system(including master handler and other child handler) may have ...
Definition: event_handler_util.hpp:37
the parent handler class that is the blueprint for other child handlers to implement, it also defines a couple functions that child handler can use
Definition: parent_handler.hpp:31
static void setLightStatus(bool lightStatus)
set the light status variable
Definition: power_ctrl_handler.cpp:99