71 lines
1.5 KiB
C
71 lines
1.5 KiB
C
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include "esp_err.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* @brief Initialize CSI Manager state
|
|
*/
|
|
void csi_mgr_init(void);
|
|
|
|
/**
|
|
* @brief Enable CSI capture asynchronously
|
|
* Spawns a task to wait 2 seconds (to let connection settle) then enables CSI.
|
|
* Safe to call from Event Handlers.
|
|
*/
|
|
void csi_mgr_enable_async(void);
|
|
|
|
/**
|
|
* @brief Disable CSI capture immediately
|
|
*/
|
|
void csi_mgr_disable(void);
|
|
|
|
/**
|
|
* @brief Dump collected CSI data to UART asynchronously
|
|
* Spawns a task that waits 20s then dumps data (simulating your original logic).
|
|
*/
|
|
void csi_mgr_schedule_dump(void);
|
|
|
|
/**
|
|
* @brief Check if CSI is currently enabled
|
|
*/
|
|
bool csi_mgr_is_enabled(void);
|
|
|
|
/**
|
|
* @brief Get total packet count (stats)
|
|
*/
|
|
uint32_t csi_mgr_get_packet_count(void);
|
|
|
|
/**
|
|
* @brief Save CSI enable state to NVS
|
|
*
|
|
* @param enable true to enable CSI on boot, false to disable
|
|
* @return esp_err_t ESP_OK on success
|
|
*/
|
|
esp_err_t csi_mgr_save_enable_state(bool enable);
|
|
|
|
/**
|
|
* @brief Load CSI enable state from NVS
|
|
*
|
|
* @param enable Output: CSI enable state (default: false if not found)
|
|
* @return esp_err_t ESP_OK on success, ESP_ERR_NVS_NOT_FOUND if not set
|
|
*/
|
|
esp_err_t csi_mgr_load_enable_state(bool *enable);
|
|
|
|
/**
|
|
* @brief Check if CSI should be enabled based on NVS config
|
|
* Returns false by default if no config exists
|
|
*
|
|
* @return bool true if CSI should be enabled
|
|
*/
|
|
bool csi_mgr_should_enable(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|