76 lines
2.0 KiB
C
76 lines
2.0 KiB
C
#pragma once
|
|
#include "time.h"
|
|
#include "stdbool.h"
|
|
#include "stateManagement.h"
|
|
|
|
/*struct node {
|
|
struct node *next;
|
|
int e;
|
|
};
|
|
|
|
struct Hashtable {
|
|
unsigned Tablesize;
|
|
struct node *Cells;
|
|
};
|
|
*/
|
|
|
|
struct dailyforecast_prev
|
|
{
|
|
float min;
|
|
float max;
|
|
char desc[25];
|
|
char icon[9];
|
|
};
|
|
|
|
struct forecast_prev
|
|
{
|
|
float value;
|
|
char desc[25];
|
|
char icon[9];
|
|
};
|
|
|
|
typedef struct meteodailyforecast_data // Meteo "par jour"
|
|
{
|
|
char *type;
|
|
time_t datetime;
|
|
bool isValid;
|
|
struct dailyforecast_prev previsions;
|
|
} meteodailyforecast_data;
|
|
|
|
typedef struct meteoforecast_data // Meteo "par heure"
|
|
{
|
|
char *type;
|
|
time_t datetime;
|
|
bool isValid;
|
|
struct forecast_prev previsions;
|
|
} meteoforecast_data;
|
|
|
|
typedef struct {
|
|
meteodailyforecast_data daily[3];
|
|
meteoforecast_data forecast[3];
|
|
} meteo_event_payload_t;
|
|
|
|
typedef void (*weather_data_callback)(meteo_event_payload_t *datas);
|
|
typedef void (*weather_data_start_callback)();
|
|
|
|
typedef struct
|
|
{
|
|
unsigned int humidity;
|
|
float temperature;
|
|
float pressure;
|
|
unsigned long retreival_period;
|
|
weather_data_callback data_retreived_cb;
|
|
weather_data_start_callback data_retreived_cb_start;
|
|
} weather_data;
|
|
|
|
void printdftemp(struct dailyforecast_prev * tmp);
|
|
void printftemp(struct forecast_prev * tmp);
|
|
void printfdf(struct meteodailyforecast_data * tmp);
|
|
void dtToString(time_t, char *buffer);
|
|
void dtHToString(time_t, char *buffer);
|
|
void printff(struct meteoforecast_data * tmp);
|
|
|
|
void on_weather_data_retrieval(weather_data_callback data_retreived_cb);
|
|
void on_weather_data_retrieval_start(weather_data_callback data_retreived_cb);
|
|
void initialise_weather_data_retrieval(unsigned long retreival_period, void *evtGroup);
|