2020-07-29 08:51:24 +02:00
|
|
|
#include "Arduino.h"
|
|
|
|
|
|
|
|
#include <WiFi.h>
|
|
|
|
|
|
|
|
#include <HTTPClient.h>
|
|
|
|
|
|
|
|
#include <WiFiClientSecure.h>
|
|
|
|
|
2020-07-29 09:37:28 +02:00
|
|
|
// To get timeZone from main file
|
2020-07-29 08:51:24 +02:00
|
|
|
extern int timeZone;
|
|
|
|
|
|
|
|
// wifi ssid and password
|
|
|
|
extern char *ssid;
|
|
|
|
extern char *pass;
|
|
|
|
|
|
|
|
#ifndef NETWORK_H
|
|
|
|
#define NETWORK_H
|
|
|
|
|
2020-07-29 09:37:28 +02:00
|
|
|
// All functions defined in Network.cpp
|
2020-07-29 08:51:24 +02:00
|
|
|
|
|
|
|
class Network
|
|
|
|
{
|
|
|
|
public:
|
2020-07-29 09:37:28 +02:00
|
|
|
// Functions we can access in main file
|
2020-07-29 08:51:24 +02:00
|
|
|
void begin(char *city);
|
|
|
|
void getTime(char *timeStr);
|
2020-08-11 09:26:59 +02:00
|
|
|
void getData(char *city, char *temp1, char *temp2, char *temp3, char *temp4, char *currentTemp, char *currentWind, char *currentTime, char *currentWeather, char *currentWeatherAbbr, char* abbr1, char* abbr2, char* abbr3, char* abbr4);
|
2020-07-29 08:51:24 +02:00
|
|
|
void getDays(char *day, char *day1, char *day2, char *day3);
|
|
|
|
|
2020-07-29 09:37:28 +02:00
|
|
|
// Used to store loaction woeid (world id), set in findCity()
|
2020-07-29 08:51:24 +02:00
|
|
|
int location = -1;
|
|
|
|
|
|
|
|
private:
|
2020-07-29 09:37:28 +02:00
|
|
|
// Functions called from within our class
|
2020-07-29 08:51:24 +02:00
|
|
|
void setTime();
|
|
|
|
void findCity(char *city);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|