ESP3D  3.0
Firmware for ESP boards connected to 3D Printer
notifications_service.h
Go to the documentation of this file.
1 /*
2  notifications_service.h - notifications service functions class
3 
4  Copyright (c) 2014 Luc Lebosse. All rights reserved.
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 
21 
22 
23 #ifndef _NOTIFICATIONS_SERVICE_H
24 #define _NOTIFICATIONS_SERVICE_H
25 
26 
28 {
29 public:
32  bool begin();
33  void end();
34  void handle();
35  bool sendMSG(const char * title, const char * message);
36  const char * getTypeString();
37  bool started();
39  {
40  return _autonotification;
41  };
42  void setAutonotification(bool value)
43  {
44  _autonotification = value;
45  };
46  bool sendAutoNotification(const char * msg);
47 private:
48  bool _started;
49  bool _autonotification;
50  uint8_t _notificationType;
51  String _token1;
52  String _token2;
53  String _settings;
54  String _serveraddress;
55  uint16_t _port;
56  bool sendPushoverMSG(const char * title, const char * message);
57  bool sendEmailMSG(const char * title, const char * message);
58  bool sendLineMSG(const char * title, const char * message);
59  bool getPortFromSettings();
60  bool getServerAddressFromSettings();
61  bool getEmailFromSettings();
62 };
63 
65 
66 #endif //_NOTIFICATIONS_SERVICE_H
67 
NotificationsService::sendAutoNotification
bool sendAutoNotification(const char *msg)
Definition: notifications_service.cpp:98
NotificationsService::isAutonotification
bool isAutonotification()
Definition: notifications_service.h:38
NotificationsService::begin
bool begin()
Definition: notifications_service.cpp:389
NotificationsService::setAutonotification
void setAutonotification(bool value)
Definition: notifications_service.h:42
NotificationsService::end
void end()
Definition: notifications_service.cpp:428
NotificationsService::handle
void handle()
Definition: notifications_service.cpp:442
NotificationsService::~NotificationsService
~NotificationsService()
Definition: notifications_service.cpp:127
NotificationsService::getTypeString
const char * getTypeString()
Definition: notifications_service.cpp:137
NotificationsService::NotificationsService
NotificationsService()
Definition: notifications_service.cpp:119
NotificationsService::started
bool started()
Definition: notifications_service.cpp:132
notificationsservice
NotificationsService notificationsservice
Definition: notifications_service.cpp:67
NotificationsService::sendMSG
bool sendMSG(const char *title, const char *message)
Definition: notifications_service.cpp:152
NotificationsService
Definition: notifications_service.h:27