132 |
132 |
133 /* password */ |
133 /* password */ |
134 sz = sizeof(task_wifi_ConfigSTA->sta.password); |
134 sz = sizeof(task_wifi_ConfigSTA->sta.password); |
135 memcpy(task_wifi_ConfigSTA->sta.password, wifiStation.Password, sz); |
135 memcpy(task_wifi_ConfigSTA->sta.password, wifiStation.Password, sz); |
136 |
136 |
137 ESP_LOGI(TAG, "FetchStaConfig: last connected to ssid: %s", task_wifi_ConfigSTA->sta.ssid); |
137 ESP_LOGD(TAG, "FetchStaConfig: last connected to ssid: %s", task_wifi_ConfigSTA->sta.ssid); |
138 return task_wifi_ConfigSTA->sta.ssid[0] != '\0'; |
138 return task_wifi_ConfigSTA->sta.ssid[0] != '\0'; |
139 } |
139 } |
140 |
140 |
141 ESP_LOGI(TAG, "FetchStaConfig: no last connection found"); |
141 ESP_LOGI(TAG, "FetchStaConfig: no last connection found"); |
142 return false; |
142 return false; |
264 xSemaphoreGive(xSemaphoreWiFi); |
264 xSemaphoreGive(xSemaphoreWiFi); |
265 } else { |
265 } else { |
266 ESP_LOGE(TAG, "wifi_event_handler() lock error WIFI_EVENT_AP_STACONNECTED"); |
266 ESP_LOGE(TAG, "wifi_event_handler() lock error WIFI_EVENT_AP_STACONNECTED"); |
267 } |
267 } |
268 wifi_event_ap_staconnected_t* staconnected = (wifi_event_ap_staconnected_t*) event_data; |
268 wifi_event_ap_staconnected_t* staconnected = (wifi_event_ap_staconnected_t*) event_data; |
269 // const system_event_ap_staconnected_t *staconnected = &event->event_info.sta_connected; |
|
270 ESP_LOGI(TAG, "Event AP connected, mac:" MACSTR ", aid:%d, conns:%d", |
269 ESP_LOGI(TAG, "Event AP connected, mac:" MACSTR ", aid:%d, conns:%d", |
271 MAC2STR(staconnected->mac), staconnected->aid, wifi_state->AP_clients); |
270 MAC2STR(staconnected->mac), staconnected->aid, wifi_state->AP_clients); |
272 break; |
271 break; |
273 } |
272 } |
274 case WIFI_EVENT_AP_STADISCONNECTED: { |
273 case WIFI_EVENT_AP_STADISCONNECTED: { |
280 xSemaphoreGive(xSemaphoreWiFi); |
279 xSemaphoreGive(xSemaphoreWiFi); |
281 } else { |
280 } else { |
282 ESP_LOGE(TAG, "wifi_event_handler() lock error WIFI_EVENT_AP_STADISCONNECTED"); |
281 ESP_LOGE(TAG, "wifi_event_handler() lock error WIFI_EVENT_AP_STADISCONNECTED"); |
283 } |
282 } |
284 wifi_event_ap_stadisconnected_t* stadisconnected = (wifi_event_ap_stadisconnected_t*) event_data; |
283 wifi_event_ap_stadisconnected_t* stadisconnected = (wifi_event_ap_stadisconnected_t*) event_data; |
285 // const system_event_ap_stadisconnected_t *stadisconnected = &event->event_info.sta_disconnected; |
|
286 ESP_LOGI(TAG, "Event AP disconnected, mac:" MACSTR ", aid:%d, conns:%d", |
284 ESP_LOGI(TAG, "Event AP disconnected, mac:" MACSTR ", aid:%d, conns:%d", |
287 MAC2STR(stadisconnected->mac), stadisconnected->aid, wifi_state->AP_clients); |
285 MAC2STR(stadisconnected->mac), stadisconnected->aid, wifi_state->AP_clients); |
288 break; |
286 break; |
289 } |
287 } |
290 default: |
288 default: |