AWS IoT Firmware
Firmware code for AWS IoT Devices
master_handler.hpp
Go to the documentation of this file.
1 
14 #ifndef _MASTER_HANDLER_HPP
15 #define _MASTER_HANDLER_HPP
16 
17 #include "event_handler_util.hpp"
18 #include "parent_handler.hpp"
19 
20 #include "frozen.h"
21 #include "mgos.h"
22 #include "mgos_mqtt.h"
23 
27 #define MAX_PAYLOAD_SIZE 150
28 
31 #define MAX_RESPONSE_LEN 1500
32 
33 void handleAwsRequest(struct mg_connection *mgCon,
34  struct mg_str * payload,
35  char * jsonBuf,
36  ParentHandler * _handlerList[]);
37 void handleAllReq(struct mg_connection *mgCon, int eventType, void *rawMessage, void *user_data);
38 
39 void handlePolling(struct mg_connection *mgCon, ParentHandler *handlerList[], char *jsonBuf);
40 
41 #endif
42 
header file for event handler utils
void handleAllReq(struct mg_connection *mgCon, int eventType, void *rawMessage, void *user_data)
The entry point of all events, when an mcu receives an event, whether it's a request from aws or just...
Definition: master_handler.cpp:52
void handlePolling(struct mg_connection *mgCon, ParentHandler *handlerList[], char *jsonBuf)
dummy empty function since bed room light controller has no polling need
Definition: polling_function.cpp:30
contain class declaration for the ParentHandler class
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
void handleAwsRequest(struct mg_connection *mgCon, struct mg_str *payload, char *jsonBuf, ParentHandler *_handlerList[])
function used for finding the appropriate handler and hands the request to them or create error messa...
Definition: master_handler.cpp:105