mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
Append id to wifi ssid
This commit is contained in:
@@ -186,20 +186,18 @@ int WifiManager::init_softap() {
|
||||
|
||||
esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, wifi_event_handler, this);
|
||||
|
||||
wifi_config_t wifi_configuration = {
|
||||
.ap =
|
||||
{
|
||||
.ssid = WIFI_SSID,
|
||||
.password = "",
|
||||
.channel = SOFTAP_CHANNEL,
|
||||
.authmode = WIFI_AUTH_OPEN,
|
||||
.ssid_hidden = 0,
|
||||
.max_connection = SOFTAP_MAX_CONNECTIONS,
|
||||
.beacon_interval = 100,
|
||||
.csa_count = 3,
|
||||
.dtim_period = 1,
|
||||
},
|
||||
};
|
||||
std::string ap_ssid = std::string("botchain") + std::to_string(m_config_manager.get_module_id());
|
||||
|
||||
wifi_config_t wifi_configuration = {};
|
||||
wifi_configuration.ap.channel = SOFTAP_CHANNEL;
|
||||
wifi_configuration.ap.authmode = WIFI_AUTH_OPEN;
|
||||
wifi_configuration.ap.ssid_hidden = 0;
|
||||
wifi_configuration.ap.max_connection = SOFTAP_MAX_CONNECTIONS;
|
||||
wifi_configuration.ap.beacon_interval = 100;
|
||||
wifi_configuration.ap.csa_count = 3;
|
||||
wifi_configuration.ap.dtim_period = 1;
|
||||
std::strncpy(reinterpret_cast<char *>(wifi_configuration.ap.ssid), ap_ssid.c_str(), sizeof(wifi_configuration.ap.ssid) - 1);
|
||||
wifi_configuration.ap.ssid_len = static_cast<uint8_t>(ap_ssid.size());
|
||||
|
||||
esp_wifi_set_mode(WIFI_MODE_APSTA); // enable both ap and station mode for scanning
|
||||
esp_wifi_set_config(static_cast<wifi_interface_t>(ESP_IF_WIFI_AP), &wifi_configuration);
|
||||
|
||||
Reference in New Issue
Block a user