123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- #include "network_manager.h"
- #include <stdbool.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include "network_ethernet.h"
- #include "network_status.h"
- #include "network_wifi.h"
- #define LOG_LOCAL_LEVEL ESP_LOG_DEBUG
- #include "esp_log.h"
- #include "platform_esp32.h"
- #include "esp_system.h"
- #include "freertos/FreeRTOS.h"
- #include "freertos/task.h"
- #include "esp_netif.h"
- #include "cJSON.h"
- #include "cmd_system.h"
- #include "esp_app_format.h"
- #include "esp_event.h"
- #include "esp_ota_ops.h"
- #include "esp_wifi.h"
- #include "esp_wifi_types.h"
- #include "lwip/api.h"
- #include "lwip/err.h"
- #include "lwip/ip4_addr.h"
- #include "lwip/netdb.h"
- #include "mdns.h"
- #include "messaging.h"
- #include "state_machine.h"
- #include "platform_config.h"
- #include "trace.h"
- #include "accessors.h"
- #include "globdefs.h"
- #include "http_server_handlers.h"
- #ifndef STR_OR_BLANK
- #define STR_OR_BLANK(p) p == NULL ? "" : p
- #endif
- void (**cb_ptr_arr)(void*) = NULL;
- const int WIFI_MANAGER_WIFI_CONNECTED_BIT = BIT0;
- const int WIFI_MANAGER_AP_STA_CONNECTED_BIT = BIT1;
- const int WIFI_MANAGER_AP_STARTED_BIT = BIT2;
- const int WIFI_MANAGER_REQUEST_STA_CONNECT_BIT = BIT3;
- const int WIFI_MANAGER_STA_DISCONNECT_BIT = BIT4;
- const int WIFI_MANAGER_REQUEST_RESTORE_STA_BIT = BIT5;
- const int WIFI_MANAGER_REQUEST_WIFI_DISCONNECT_BIT = BIT6;
- const int WIFI_MANAGER_SCAN_BIT = BIT7;
- const int WIFI_MANAGER_REQUEST_DISCONNECT_BIT = BIT8;
- const int WIFI_MANAGER_REQUEST_STA_CONNECT_FAILED_BIT = BIT9;
- void wifi_manager_set_callback(message_code_t message_code, void (*func_ptr)(void*)) {
- if (cb_ptr_arr && message_code < MESSAGE_CODE_COUNT) {
- cb_ptr_arr[message_code] = func_ptr;
- }
- }
|