 |
ESP3D
3.0
Firmware for ESP boards connected to 3D Printer
|
Go to the documentation of this file.
20 #include "../../include/esp3d_config.h"
21 #if defined (NOTIFICATION_FEATURE)
22 #include "../commands.h"
23 #include "../esp3doutput.h"
24 #include "../settings_esp3d.h"
25 #include "../../modules/authentication/authentication_service.h"
26 #include "../../modules/notifications/notifications_service.h"
34 #ifdef AUTHENTICATION_FEATURE
36 output->
printERROR(
"Wrong authentication!", 401);
41 #endif //AUTHENTICATION_FEATURE
44 if (parameter.length() == 0) {
54 parameter =
get_param (cmd_params,
"type=");
55 if (parameter.length() > 0) {
57 parameter.toUpperCase();
58 if (parameter ==
"NONE") {
60 }
else if (parameter ==
"PUSHOVER") {
62 }
else if (parameter ==
"EMAIL") {
64 }
else if (parameter ==
"LINE") {
67 output->
printERROR(
"Only NONE, PUSHOVER, EMAIL, LINE are supported!");
78 parameter =
get_param (cmd_params,
"TS=");
79 if (parameter.length() > 0) {
88 parameter =
get_param (cmd_params,
"T1=");
89 if (parameter.length() > 0) {
98 parameter =
get_param (cmd_params,
"T2=");
99 if (parameter.length() > 0) {
112 output->
printERROR (
"Invalid parameter! Only type, T1, T2 and TS are supported");
118 #endif //NOTIFICATION_FEATURE
static bool write_byte(int pos, const uint8_t value)
#define ESP_EMAIL_NOTIFICATION
const char * get_param(const char *cmd_params, const char *label)
static const char * read_string(int pos, bool *haserror=NULL)
#define ESP_LINE_NOTIFICATION
NotificationsService notificationsservice
#define ESP_NOTIFICATION_TYPE
bool ESP610(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
#define ESP_NOTIFICATION_TOKEN1
#define ESP_NOTIFICATION_SETTINGS
size_t printMSG(const char *s, bool withNL=true)
size_t printERROR(const char *s, int code_error=200)
static bool write_string(int pos, const char *byte_buffer)
#define ESP_PUSHOVER_NOTIFICATION
static uint8_t read_byte(int pos, bool *haserror=NULL)
#define ESP_NOTIFICATION_TOKEN2