SWRU455M February 2017 – October 2020 CC3120 , CC3120MOD , CC3130 , CC3135 , CC3135MOD , CC3220MOD , CC3220MODA , CC3220R , CC3220S , CC3220SF , CC3230S , CC3230SF , CC3235MODAS , CC3235MODASF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF
The host provides different functions for creating a new file, or open for write an existing file. The following is a list of open file methods.
Example:
_i32 FileHdl;
unsigned char DeviceFileName[180];
_u32 MaxSize, MasterToken;
FileHdl = sl_FsOpen(unsigned char *)DeviceFileName,
SL_FS_CREATE|SL_FS_CREATE_SECURE |SL_FS_OVERWRITE |
SL_FS_CREATE_NOSIGNATURE | SL_FS_CREATE_MAX_SIZE( MaxSize ),
&MasterToken);
if(FileHdl < 0 )
{
/*error */
}
Example:
_i32 FileHdl;
unsigned char DeviceFileName[180];
_u32 MaxSize, MasterToken;
FileHdl = sl_FsOpen(unsigned char *)DeviceFileName,
SL_FS_CREATE|SL_FS_CREATE_SECURE |
SL_FS_CREATE_NOSIGNATURE | SL_FS_CREATE_MAX_SIZE( MaxSize ),
&MasterToken);
if(FileHdl < 0 )
{
/*error */
}
Example:
_i32 FileHdl;
unsigned char DeviceFileName[180];
_u32 MaxSize, MasterToken;
FileHdl = sl_FsOpen(unsigned char *)DeviceFileName,
SL_FS_OVERWRITE | SL_FS_CREATE_SECURE |
SL_FS_CREATE_NOSIGNATURE | SL_FS_CREATE_MAX_SIZE( MaxSize ),
&MasterToken);
if(FileHdl < 0 )
{
/* error */
}