feat(storage/vfs): Make lwip specific API private

This commit is contained in:
Tomáš Rohlínek
2025-12-03 14:09:25 +01:00
parent 1bf8b030e3
commit e3cb10835c
6 changed files with 38 additions and 18 deletions
+1
View File
@@ -13,6 +13,7 @@
#include <sys/select.h>
#include "esp_attr.h"
#include "esp_vfs.h"
#include "esp_private/socket.h"
#include "sdkconfig.h"
#include "lwip/sockets.h"
#include "lwip/sys.h"
@@ -0,0 +1,34 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "esp_vfs.h"
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Special case function for registering a VFS that uses a method other than
* open() to open new file descriptors from the interval <min_fd; max_fd).
*
* This is a special-purpose function intended for registering LWIP sockets to VFS.
*
* @param vfs Pointer to esp_vfs_fs_ops_t. Meaning is the same as for esp_vfs_register_fs().
* @param ctx Pointer to context structure. Meaning is the same as for esp_vfs_register_fs().
* @param min_fd The smallest file descriptor this VFS will use.
* @param max_fd Upper boundary for file descriptors this VFS will use (the biggest file descriptor plus one).
*
* @return ESP_OK if successful,
* ESP_ERR_NO_MEM if too many VFSes are registered,
* ESP_ERR_INVALID_ARG if the file descriptor boundaries are incorrect.
*/
esp_err_t esp_vfs_register_fd_range(const esp_vfs_fs_ops_t *vfs, int flags, void *ctx, int min_fd, int max_fd);
#ifdef __cplusplus
}
#endif
-17
View File
@@ -275,23 +275,6 @@ typedef struct
*/
esp_err_t esp_vfs_register(const char* base_path, const esp_vfs_t* vfs, void* ctx);
/**
* Special case function for registering a VFS that uses a method other than
* open() to open new file descriptors from the interval <min_fd; max_fd).
*
* This is a special-purpose function intended for registering LWIP sockets to VFS.
*
* @param vfs Pointer to esp_vfs_t. Meaning is the same as for esp_vfs_register().
* @param ctx Pointer to context structure. Meaning is the same as for esp_vfs_register().
* @param min_fd The smallest file descriptor this VFS will use.
* @param max_fd Upper boundary for file descriptors this VFS will use (the biggest file descriptor plus one).
*
* @return ESP_OK if successful, ESP_ERR_NO_MEM if too many VFSes are
* registered, ESP_ERR_INVALID_ARG if the file descriptor boundaries
* are incorrect.
*/
esp_err_t esp_vfs_register_fd_range(const esp_vfs_fs_ops_t *vfs, int flags, void *ctx, int min_fd, int max_fd);
/**
* Special case function for registering a VFS that uses a method other than
* open() to open new file descriptors. In comparison with
@@ -15,6 +15,7 @@
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "esp_vfs.h"
#include "esp_private/socket.h"
#include "unity.h"
#include "esp_log.h"
#include "test_utils.h"
+1 -1
View File
@@ -19,7 +19,7 @@
#include "freertos/semphr.h"
#include "esp_vfs.h"
#include "esp_vfs_private.h"
#include "include/esp_vfs.h"
#include "esp_private/socket.h"
#include "sdkconfig.h"
// Warn about using deprecated option
+1
View File
@@ -19,6 +19,7 @@
#include "freertos/semphr.h"
#include "esp_log.h"
#include "esp_vfs.h"
#include "esp_private/socket.h"
#include "esp_vfs_private.h"
#include "esp_vfs_utils.h"
#include "sdkconfig.h"