network_status.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. *
  3. * Sebastien L. 2023, sle118@hotmail.com
  4. * Philippe G. 2023, philippe_44@outlook.com
  5. *
  6. * This software is released under the MIT License.
  7. * https://opensource.org/licenses/MIT
  8. *
  9. * License Overview:
  10. * ----------------
  11. * The MIT License is a permissive open source license. As a user of this software, you are free to:
  12. * - Use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of this software.
  13. * - Use the software for private, commercial, or any other purposes.
  14. *
  15. * Conditions:
  16. * - You must include the above copyright notice and this permission notice in all
  17. * copies or substantial portions of the Software.
  18. *
  19. * The MIT License offers a high degree of freedom and is well-suited for both open source and
  20. * commercial applications. It places minimal restrictions on how the software can be used,
  21. * modified, and redistributed. For more details on the MIT License, please refer to the link above.
  22. */
  23. #pragma once
  24. #include "network_manager.h"
  25. #include "cJSON.h"
  26. #include "PBW.h"
  27. #include "Status.pb.h"
  28. #include "esp_http_server.h"
  29. #ifdef __cplusplus
  30. extern System::PB<sys_status_data> sys_status_obj;
  31. extern "C" {
  32. #endif
  33. /**
  34. * @brief Generates the connection status json: ssid and IP addresses.
  35. * @note This is not thread-safe and should be called only if network_status_lock_json_buffer call is successful.
  36. */
  37. void network_status_update_ip_info(sys_status_reasons update_reason_code);
  38. bool network_status_send_object(httpd_req_t* req);
  39. void init_network_status();
  40. void network_status_clear_ip();
  41. void network_status_safe_reset_sta_ip();
  42. extern sys_status_data* sys_status;
  43. #ifdef __cplusplus
  44. }
  45. #endif