SWRU455M February 2017 – October 2020 CC3120 , CC3120MOD , CC3130 , CC3135 , CC3135MOD , CC3220MOD , CC3220MODA , CC3220R , CC3220S , CC3220SF , CC3230S , CC3230SF , CC3235MODAS , CC3235MODASF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF
Retrieves the file list, names, and their main attributes, and observes how many blocks (subsector = 4096 bytes) each file occupies on the SFLASH.
This function is an iterative function; the host retrieves an iterator that can be used to retrieve the next bulk of files.
Example:
_i32 NumOfEntriesOrError = 1;
_i32 Index = -1;
slGetfileList_t File[COUNT];
_i32 i;
_i32 Status = 0;
while( NumOfEntriesOrError > 0 )
{
NumOfEntriesOrError = sl_FsGetFileList( &Index, COUNT, (_u8)(SL_FS_MAX_FILE_NAME_LENGTH +
sizeof(SlFileAttributes_t)), (unsigned char*)File, SL_FS_GET_FILE_ATTRIBUTES);
if (NumOfEntriesOrError < 0)
{
Status = NumOfEntriesOrError;//errorbreak;
}
for (i = 0; i < NumOfEntriesOrError; i++)
{
/* print
File[i].fileName
File[i].attribute.FileAllocatedBlocks
File[i].attribute.FileMaxSize,(_u16)File[i].attribute.Properties
*/
}
}
return Status;//0 means O.K