inkplate-6-arduino-library/examples/3. Projects/1-Daily_weather_station_exa.../Network.h

40 lines
885 B
C
Raw Normal View History

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);
void getData(char *city, char *temp1, char *temp2, char *temp3, char *temp4, char *currentTemp, char *currentWind, char *currentTime, char *currentWeather, char *currentWeatherAbbr);
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