Initial commit
This commit is contained in:
25
include/wifi_manager.h
Normal file
25
include/wifi_manager.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <Preferences.h>
|
||||
|
||||
struct WifiMqttConfig {
|
||||
String ssid;
|
||||
String password;
|
||||
String mqtt_host;
|
||||
uint16_t mqtt_port;
|
||||
String mqtt_user;
|
||||
String mqtt_pass;
|
||||
String ntp_server_1;
|
||||
String ntp_server_2;
|
||||
bool valid;
|
||||
};
|
||||
|
||||
void wifi_manager_init();
|
||||
bool wifi_load_config(WifiMqttConfig &config);
|
||||
bool wifi_save_config(const WifiMqttConfig &config);
|
||||
|
||||
bool wifi_connect_sta(const WifiMqttConfig &config, uint32_t timeout_ms = 10000);
|
||||
void wifi_start_ap(const char *ap_ssid, const char *ap_pass);
|
||||
bool wifi_is_connected();
|
||||
String wifi_get_ssid();
|
||||
Reference in New Issue
Block a user