2
0

network_wifi.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #pragma once
  2. #include "network_manager.h"
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. void init_network_wifi();
  7. void destroy_network_wifi();
  8. /**
  9. * @brief saves the current STA wifi config to flash ram storage.
  10. */
  11. esp_err_t network_wifi_save_sta_config();
  12. /**
  13. * @brief fetch a previously STA wifi config in the flash ram storage.
  14. * @return true if a previously saved config was found, false otherwise.
  15. */
  16. bool wifi_manager_fetch_wifi_sta_config();
  17. wifi_config_t* wifi_manager_get_wifi_sta_config();
  18. /**
  19. * @brief Registers handler for wifi and ip events
  20. */
  21. void wifi_manager_register_handlers();
  22. /**
  23. * @brief Generates the list of access points after a wifi scan.
  24. * @note This is not thread-safe and should be called only if wifi_manager_lock_json_buffer call is successful.
  25. */
  26. void wifi_manager_generate_access_points_json(cJSON ** ap_list);
  27. /**
  28. * @brief Clear the list of access points.
  29. * @note This is not thread-safe and should be called only if wifi_manager_lock_json_buffer call is successful.
  30. */
  31. void wifi_manager_clear_access_points_json();
  32. void wifi_manager_config_ap();
  33. void wifi_manager_filter_unique( wifi_ap_record_t * aplist, uint16_t * aps);
  34. esp_err_t wifi_scan_done(queue_message *msg);
  35. esp_err_t network_wifi_start_scan(queue_message *msg);
  36. esp_err_t network_wifi_load_restore(queue_message *msg);
  37. esp_err_t network_wifi_order_connect(queue_message *msg);
  38. esp_err_t network_wifi_disconnected(queue_message *msg);
  39. esp_err_t network_wifi_start_ap(queue_message *msg);
  40. bool wifi_manager_load_wifi_sta_config(wifi_config_t* config );
  41. esp_err_t network_wifi_handle_event(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data);
  42. esp_err_t network_wifi_connect(wifi_config_t * cfg);
  43. bool is_wifi_up();
  44. void network_wifi_clear_config();
  45. esp_netif_t *network_wifi_get_interface();
  46. bool network_wifi_sta_config_changed();
  47. void network_wifi_get_stats( int32_t * ret_total_connected_time, int64_t * ret_last_connected, uint16_t * ret_num_disconnect);
  48. #ifdef __cplusplus
  49. }
  50. #endif