Embedded TCP/IP stack: ROM File System API

FNET

Embedded TCP/IP stack  4.1.0

Detailed Description

The FNET ROM File System provides read-only access to files and directories.
The FNET project has the special GUI PC tool that is used to create the ROM file-system image files.

After the FS is initialized by calling the fnet_fs_init() function, a user application should call the fnet_fs_rom_register() function and finally mount a ROM FS Image by passing the FNET_FS_ROM_NAME and the fnet_fs_rom_image structure as arguments to the fnet_fs_mount() function.
Thereafter an application has access to files and directories on the mounted FNET ROM FS image.

For example:

...
// FNET FS initialization.
{
// Register FNET ROM FS.
// Mount FNET ROM FS image.
if( fnet_fs_mount( FNET_FS_ROM_NAME, "rom", (void *)&fnet_fs_image ) == FNET_ERR )
fnet_println("ERROR: FS image mount is failed!");
...
// Print directory content.
{
struct fnet_fs_dirent ep;
fnet_uint8_t name[FNET_CFG_FS_MOUNT_NAME_MAX+1];
// Open dir.
dir = fnet_fs_opendir("rom");
if (dir)
{
fnet_memset_zero(&ep, sizeof(struct fnet_fs_dirent) );
ep.d_name = name;
ep.d_name_size = sizeof(name);
// Print the dir content.
while ((fnet_fs_readdir (dir, &ep))==FNET_OK)
fnet_println ("%7s - %s", (ep.d_type == DT_DIR)?"<DIR>":"<FILE>",ep.d_name);
// Close dir.
}
else
fnet_println("ERROR: The directory is failed!");
}
...
}
else
{
fnet_println("ERROR: FNET FS initialization is failed!");
}
...


Configuration parameters:

Data Structures

struct  fnet_fs_rom_node
 FNET ROM file-system node.
The node represents a file or a directory. More...
 
struct  fnet_fs_rom_image
 FNET ROM file-system image. More...
 

Macros

#define FNET_FS_ROM_NAME
 FNET ROM file-system name string. More...
 
#define FNET_FS_ROM_VERSION
 FNET ROM file-system current version. More...
 

Functions

void fnet_fs_rom_register (void)
 Registers the FNET ROM file system. More...
 
void fnet_fs_rom_unregister (void)
 Unregisters the FNET ROM file system. More...
 

© 2005-2018 by Andrey Butok. http://fnet.sourceforge.net