ESP32/components/sdcard_http/sdcard_http.h

33 lines
802 B
C

/*
* sdcard_http.h
*
* Copyright (c) 2025 Umber Networks & Robert McMahon
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef SDCARD_HTTP_H
#define SDCARD_HTTP_H
#include "esp_err.h"
/**
* @brief Start HTTP server that serves files from SD card at GET /sdcard/<path>
* Listens on port 8080. Call once after WiFi and SD card init.
* @return ESP_OK on success
*/
esp_err_t sdcard_http_start(void);
/**
* @brief Stop the SD card HTTP server (optional)
*/
void sdcard_http_stop(void);
/**
* @brief Get HTTP download stats for fiwi-telemetry
* @param attempts Output: total download attempts (may be NULL)
* @param downloads Output: successful downloads (may be NULL)
*/
void sdcard_http_get_telemetry_stats(uint32_t *attempts, uint32_t *downloads);
#endif /* SDCARD_HTTP_H */