SWRU455M February 2017 – October 2020 CC3120 , CC3120MOD , CC3130 , CC3135 , CC3135MOD , CC3220MOD , CC3220MODA , CC3220R , CC3220S , CC3220SF , CC3230S , CC3230SF , CC3235MODAS , CC3235MODASF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF
When the read is completed, the host must close the file. Closing the file releases the file resources from the device memory.
An abort file command can be invoked without using the file handle; the reference can be found in the file commit-rollback function.
An abort file command open for read has the same functionality as the close function. In case of an unexpected or sudden shutdown, each file opened for read that is not closed is treated as if it is aborted.
The following is a partial list of errors that might be returned by the close after read function:
Close file example:
_i32 FileHdl;
_i16 Status;
const _u32 SignatureLen;
_u8* pSignature, pCeritificateFileName;
pCeritificateFileName = 0;
pSignature = 0;
SignatureLen = 0;
Status = sl_FsClose(FileHdl,pCeritificateFileName,pSignature,SignatureLen);
if( Status < 0 )
{
/* error */
/* abort */
sl_FsClose(FileHdl,0,'A',1);
}
Abort file example:
i32 FileHdl;
_i16 Status;
const _u8 Signature;
const _u32 SignatureLen;
_u8* pCeritificateFileName;
pCeritificateFileName = 0;
Signature = 'A';
SignatureLen = 1;
Status = sl_FsClose(FileHdl,pCeritificateFileName,Signature,SignatureLen);
if( Status < 0 )
{
/*error */
}