14 #ifndef _EVENT_HANDLER_UTIL_H 15 #define _EVENT_HANDLER_UTIL_H 18 #include "mgos_mqtt.h" 26 #define MAX_COMMAND_LEN 30 31 #define MAX_NAMESPACE_LEN 30 39 MQTT_ERR_UNKNOWN_COMMAND,
43 JSON_UNKNOWN_NAMESPACE,
54 const char* errorMessage;
59 const char* awsPayloadFormat,
60 const uint8_t& totalArg,
67 struct mg_str* payload,
HandlerError write_pin(const uint8_t pinNum, const uint8_t pinState)
used for writing to a digital pin given its pin number and state
Definition: event_handler_util.cpp:80
HandlerError printStateReportEnd(char *jsonOut)
print the ending part of an aws iot state report
Definition: event_handler_util.cpp:184
HandlerError read_pin(const uint8_t pinNum, uint8_t *pinState)
used to reat the status of a digital pin
Definition: event_handler_util.cpp:94
HandlerError printStateReportOpen(char *jsonOut)
print the beginning of an aws smarthome state report
Definition: event_handler_util.cpp:162
HandlerError
enum defining errors that the system(including master handler and other child handler) may have ...
Definition: event_handler_util.hpp:37
used for storing the error code and its corresponding error message
Definition: event_handler_util.hpp:52
HandlerError getAwsPayload(const struct mg_str *message, const char *awsPayloadFormat, const uint8_t &totalArg,...)
Get the Aws Payload json key.
Definition: event_handler_util.cpp:138
HandlerError create_error_message(const HandlerError error, struct mg_str *payload, char *errorMessage)
create error message based on the error code given and stores it in the given buffer ...
Definition: event_handler_util.cpp:38
HandlerError printStateReportDelimiter(char *jsonOut)
print the delimiter between endpoints reports in aws iot state report
Definition: event_handler_util.cpp:173
HandlerError getCommandInfo(struct mg_str *message, char *commandName, char *nameSpace)
get command name as well as command namespace of messages sent from aws lambda
Definition: event_handler_util.cpp:108