2022-01-08 18:32:31 +08:00
|
|
|
#ifndef __UTILS__
|
|
|
|
#define __UTILS__
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
2022-01-09 16:53:22 +08:00
|
|
|
#include <ESP8266WiFi.h>
|
2022-01-08 18:32:31 +08:00
|
|
|
|
2022-01-09 16:53:22 +08:00
|
|
|
#define WiFiSSID "Info Board"
|
|
|
|
#define WiFipswd "cj160217"
|
|
|
|
|
|
|
|
// Variable Type Definition
|
|
|
|
typedef struct IPConfig {
|
|
|
|
IPAddress ip;
|
|
|
|
IPAddress gw;
|
|
|
|
IPAddress sn;
|
|
|
|
} IPConfig;
|
|
|
|
|
2022-01-09 17:42:48 +08:00
|
|
|
typedef struct BoardInfo {
|
|
|
|
String Version;
|
|
|
|
IPAddress ip;
|
|
|
|
} BoardInfo;
|
|
|
|
|
2022-01-09 16:53:22 +08:00
|
|
|
|
|
|
|
// Global Variable
|
|
|
|
extern IPConfig APStatic;
|
|
|
|
extern IPConfig STAStatic;
|
2022-01-09 17:42:48 +08:00
|
|
|
extern BoardInfo Board;
|
2022-01-08 18:32:31 +08:00
|
|
|
|
|
|
|
extern long follower;
|
|
|
|
extern long view;
|
|
|
|
extern long likes;
|
|
|
|
|
2022-01-09 01:19:45 +08:00
|
|
|
extern long dayView;
|
|
|
|
extern long weekView;
|
|
|
|
extern long monthView;
|
|
|
|
|
|
|
|
void initNtp();
|
|
|
|
String ntpTime();
|
|
|
|
|
2022-01-09 17:42:48 +08:00
|
|
|
void getData();
|
2022-01-09 01:19:45 +08:00
|
|
|
void getFollower();
|
|
|
|
void getViewAndLikes();
|
|
|
|
void getWebView();
|
2022-01-08 18:32:31 +08:00
|
|
|
|
|
|
|
#endif
|