2024-08-31 18:00:23 +08:00
|
|
|
#ifndef _WIFI_STATION_H_
|
|
|
|
|
#define _WIFI_STATION_H_
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include "esp_event.h"
|
|
|
|
|
|
|
|
|
|
class WifiStation {
|
|
|
|
|
public:
|
|
|
|
|
WifiStation();
|
|
|
|
|
void Start();
|
|
|
|
|
bool IsConnected();
|
|
|
|
|
std::string ssid() { return ssid_; }
|
|
|
|
|
std::string ip_address() { return ip_address_; }
|
2024-09-05 17:22:01 +08:00
|
|
|
int8_t rssi() { return rssi_; }
|
|
|
|
|
uint8_t channel() { return channel_; }
|
2024-08-31 18:00:23 +08:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
EventGroupHandle_t event_group_;
|
|
|
|
|
std::string ssid_;
|
|
|
|
|
std::string password_;
|
|
|
|
|
std::string ip_address_;
|
2024-09-05 17:22:01 +08:00
|
|
|
uint8_t rssi_ = 0;
|
|
|
|
|
uint8_t channel_ = 0;
|
2024-08-31 18:00:23 +08:00
|
|
|
int reconnect_count_ = 0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // _WIFI_STATION_H_
|