2023-03-30 01:28:31 +02:00
|
|
|
#ifndef WLAN_H
|
|
|
|
#define WLAN_H
|
|
|
|
|
2023-04-11 07:35:27 +02:00
|
|
|
#include "config.h"
|
2023-04-03 03:26:12 +02:00
|
|
|
#include <ESP8266WiFi.h>
|
|
|
|
#include <PubSubClient.h>
|
|
|
|
|
2023-04-06 08:28:01 +02:00
|
|
|
void initial_connection(const char *ssid, const char *psk);
|
2023-04-11 07:35:27 +02:00
|
|
|
void connect_wlan(Config *config);
|
|
|
|
void connect_mqtt(PubSubClient &client, Config *config);
|
2023-04-03 06:23:03 +02:00
|
|
|
void disconnect_mqtt(PubSubClient &client, const char *topic);
|
|
|
|
size_t construct_json(float *data, char *buffer, int buffer_size);
|
2023-04-11 07:35:27 +02:00
|
|
|
void mqtt_transfer(PubSubClient &client, Config *config, float *data);
|
2023-04-06 08:28:01 +02:00
|
|
|
void enter_deep_sleep(bool wifi_timeout, int sleep_time);
|
2023-03-30 01:28:31 +02:00
|
|
|
|
|
|
|
#endif /* WLAN_H */
|