14 #ifndef _PARENT_HANDLER_HPP 15 #define _PARENT_HANDLER_HPP 25 #include "mgos_mqtt.h" 35 virtual HandlerError handleRequest(
struct mg_connection* mgCon,
36 struct mg_str* message,
39 virtual HandlerError handleReport(
char* stateReport) = 0;
bool canHandleRequest(char *requestNameSpace)
used to check if a handler object can handle a request with a specific namespace
Definition: parent_handler.cpp:71
char * getNameSpace(void)
return the command namespace that the handler support
Definition: parent_handler.cpp:80
header file for event handler utils
char _nameSpace[MAX_NAMESPACE_LEN]
namespace that the handler supports, all child classes must initialize this variable to let the maste...
Definition: parent_handler.hpp:51
HandlerError createReport(char *report, const char *fmt, uint8_t totalArg,...)
used for generating a json report string based on the format given, usually child handler uses this t...
Definition: parent_handler.cpp:43
#define MAX_NAMESPACE_LEN
maximum length in characters of the namespace name sent by the server
Definition: event_handler_util.hpp:31
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