mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-12 06:27:12 +03:00
Start of 5.X work
This commit is contained in:
@@ -1,46 +1,54 @@
|
||||
/*
|
||||
*
|
||||
* Sebastien L. 2023, sle118@hotmail.com
|
||||
* Philippe G. 2023, philippe_44@outlook.com
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*
|
||||
* License Overview:
|
||||
* ----------------
|
||||
* The MIT License is a permissive open source license. As a user of this software, you are free to:
|
||||
* - Use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of this software.
|
||||
* - Use the software for private, commercial, or any other purposes.
|
||||
*
|
||||
* Conditions:
|
||||
* - You must include the above copyright notice and this permission notice in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* The MIT License offers a high degree of freedom and is well-suited for both open source and
|
||||
* commercial applications. It places minimal restrictions on how the software can be used,
|
||||
* modified, and redistributed. For more details on the MIT License, please refer to the link above.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "network_manager.h"
|
||||
#include "cJSON.h"
|
||||
#include "Configurator.h"
|
||||
#include "PBW.h"
|
||||
#include "Status.pb.h"
|
||||
#include "esp_http_server.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
|
||||
extern System::PB<sys_status_data> sys_status_obj;
|
||||
|
||||
extern "C" {
|
||||
|
||||
#endif
|
||||
extern sys_Status status;
|
||||
char* network_status_alloc_get_ip_info_json();
|
||||
/**
|
||||
* @brief Tries to get access to json buffer mutex.
|
||||
*
|
||||
* The HTTP server can try to access the json to serve clients while the wifi manager thread can try
|
||||
* to update it. These two tasks are synchronized through a mutex.
|
||||
*
|
||||
* The mutex is used by both the access point list json and the connection status json.\n
|
||||
* These two resources should technically have their own mutex but we lose some flexibility to save
|
||||
* on memory.
|
||||
*
|
||||
* This is a simple wrapper around freeRTOS function xSemaphoreTake.
|
||||
*
|
||||
* @param xTicksToWait The time in ticks to wait for the semaphore to become available.
|
||||
* @return true in success, false otherwise.
|
||||
*/
|
||||
bool network_status_lock_structure(TickType_t xTicksToWait);
|
||||
|
||||
/**
|
||||
* @brief Releases the json buffer mutex.
|
||||
*/
|
||||
void network_status_unlock_structure();
|
||||
|
||||
|
||||
/**
|
||||
* @brief Generates the connection status json: ssid and IP addresses.
|
||||
* @note This is not thread-safe and should be called only if network_status_lock_json_buffer call is successful.
|
||||
*/
|
||||
void network_status_update_ip_info(sys_UPDATE_REASONS update_reason_code);
|
||||
|
||||
void network_status_update_ip_info(sys_status_reasons update_reason_code);
|
||||
bool network_status_send_object(httpd_req_t* req);
|
||||
void init_network_status();
|
||||
void destroy_network_status();
|
||||
|
||||
void network_status_clear_ip();
|
||||
void network_status_safe_reset_sta_ip();
|
||||
extern sys_status_data* sys_status;
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user