ESP3D  3.0
Firmware for ESP boards connected to 3D Printer
time_server.h
Go to the documentation of this file.
1 /*
2  time_server.h - time server 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 _TIME_SERVER_H
24 #define _TIME_SERVER_H
25 
26 #include <time.h>
27 
29 {
30 public:
31  TimeServer();
32  ~TimeServer();
33  bool begin();
34  void end();
35  void handle();
36  const char * current_time(time_t t = 0);
37  bool setTime(const char* stime);
38  bool started();
39  bool is_internet_time(bool readfromsettings = false);
40 private:
41  bool _started;
42  bool _is_internet_time;
43 };
44 
45 extern TimeServer timeserver;
46 
47 #endif //_TIME_SERVER_H
48 
TimeServer::started
bool started()
TimeServer::handle
void handle()
timeserver
TimeServer timeserver
TimeServer::setTime
bool setTime(const char *stime)
TimeServer::TimeServer
TimeServer()
TimeServer::begin
bool begin()
TimeServer
Definition: time_server.h:28
TimeServer::is_internet_time
bool is_internet_time(bool readfromsettings=false)
TimeServer::end
void end()
TimeServer::~TimeServer
~TimeServer()
TimeServer::current_time
const char * current_time(time_t t=0)