CC3X00 Simplelink OTA Extlib API User's Guide: Flc

CC3X00 Simplelink OTA Extlib API

CC3X00 Simplelink OTA Extlib API User's Guide  1.1.0
Flc

Functions

_i32 sl_extlib_FlcCommit (_i32 CommitFlag)
 Commits the newly downloaded images (MCU and NWP) More...
 
_i32 sl_extlib_FlcTest (_i32 flags)
 Set the system to boot in test mode for new downloaded images. More...
 
_i32 sl_extlib_FlcIsPendingCommit (void)
 Check on bootloader flags if the state is IMG_STATUS_TESTING. More...
 
_i32 sl_extlib_FlcOpenFile (_u8 *file_name, _i32 file_size, _u32 *ulToken, _i32 *lFileHandle, _i32 open_flags)
 Open file for write. More...
 
_i32 sl_extlib_FlcReadFile (_i32 fileHandle, _i32 offset, _u8 *buf, _i32 len)
 Read specified number of bytes from a file. More...
 
_i32 sl_extlib_FlcWriteFile (_i32 fileHandle, _i32 offset, _u8 *buf, _i32 len)
 Write specified number of bytes to a file. More...
 
_i32 sl_extlib_FlcCloseFile (_i32 fileHandle, _u8 *pCeritificateFileName, _u8 *pSignature, _u32 SignatureLen)
 Close a previously opened file. More...
 
_i32 sl_extlib_FlcAbortFile (_i32 fileHandle)
 Abort a file update. More...
 

Detailed Description

Function Documentation

_i32 sl_extlib_FlcAbortFile ( _i32  fileHandle)

Abort a file update.

Parameters
[in]fileHandlePointer to the file (assigned from sl_FsOpen)

Abort a file update by closing the file with signature 'A', rolling back to the old file (mirror).

Returns
Returns 0 on success or negative error number.
_i32 sl_extlib_FlcCloseFile ( _i32  fileHandle,
_u8 *  pCeritificateFileName,
_u8 *  pSignature,
_u32  SignatureLen 
)

Close a previously opened file.

Parameters
[in]fileHandleFile Handle to previously opned file.
[in]pCeritificateFileNameReserved for future use. Use NULL.
[in]pSignatureReserved for future use. Use NULL.
[in]SignatureLenReserved for future use. Use 0.
Returns
Returns 0 on success or negative error number.
_i32 sl_extlib_FlcCommit ( _i32  CommitFlag)

Commits the newly downloaded images (MCU and NWP)

Parameters
[in]CommitFlagCommit flag

This function Commits the newly downloaded images for MCU and NWP. After downloading new images, the system is booted in test mode with newly downloaded images. The image(s) should self test and call this function with appropriate CommitFlag to commit or reject the update.

The parameter CommitFlag can be one of the following: \

FLC_COMMITED
FLC_NOT_COMMITED

Returns
Bitmap of reset recommendation to the host: FLC_TEST_RESET_MCU or FLC_TEST_RESET_NWP
See also
Note
Warning
Example:
For example: commit after success NWP start
status = slAccess_start_and_connect(OPEN_LINK_SSID);
if( 0 > status )
{
status = sl_extlib_FlcCommit(FLC_NOT_COMMITED);
if (status == FLC_TEST_RESET_MCU)
{
Report("main: Rebooting...");
Platform_Reset();
}
}
status = sl_extlib_FlcCommit(FLC_COMMITED);
if (status == FLC_TEST_RESET_MCU)
{
Report("main: Rebooting...");
Platform_Reset();
}
_i32 sl_extlib_FlcIsPendingCommit ( void  )

Check on bootloader flags if the state is IMG_STATUS_TESTING.

Returns
TRUE/FLASE
_i32 sl_extlib_FlcOpenFile ( _u8 *  file_name,
_i32  file_size,
_u32 *  ulToken,
_i32 *  lFileHandle,
_i32  open_flags 
)

Open file for write.

Parameters
[in]file_nameFile name
[in]file_sizeMax size to be allocated for this file
[in]ulTokenReserved for future use. Use NULL
[out]lFileHandleFile handle
[in]open_flagsFile open flags

Opens a file for write. In case of OTA MCU (mcuimgA.bin), this function takes care of renaming it to alternate image (mcuimg2.bin or mcuimg3.bin ) name base on the boot info file.

See SL_HOST sl_FsOpen documentation for more details on flags

Returns
Returns 0 on success, negative error number otherwise.
_i32 sl_extlib_FlcReadFile ( _i32  fileHandle,
_i32  offset,
_u8 *  buf,
_i32  len 
)

Read specified number of bytes from a file.

Parameters
[in]fileHandleHandle to file opened for reading
[in]offsetOffset to specific block to be read
[in]bufPointer the data to be read
[in]lenLength of the data in bytes

This function reads len bytes into buf from the file specified by the` fileHandle.

Returns
Returns the number of bytes read or negative error number.
_i32 sl_extlib_FlcTest ( _i32  flags)

Set the system to boot in test mode for new downloaded images.

Parameters
[in]flagsTest flags

This function sets the system to boot in test mode during next boot. The parameter flags can be logical OR of one or more of the following: FLC_TEST_RESET_MCU - There is a new image for testing require a restart FLC_TEST_RESET_MCU_WITH_APP - There is a new MCU for testing. FLC_TEST_RESET_NWP - There is a new NWP for testing.

Use FLC_TEST_RESET_MCU when there is a new image/file but no update to MCU application image is required, use FLC_TEST_RESET_MCU_WITH_APP otherwise.

Returns
Bitmap of reset recommendation to the host: FLC_TEST_RESET_MCU or FLC_TEST_RESET_NWP
See also
Note
Warning
Example:
For example: test images after OTA download done
status = sl_extLib_OtaRun(pvOtaApp);
if ((status & RUN_STAT_DOWNLOAD_DONE))
{
if (status & RUN_STAT_DOWNLOAD_DONE_RESET_MCU) ImageTestFlags |= FLC_TEST_RESET_MCU;
if (status & RUN_STAT_DOWNLOAD_DONE_RESET_MCU) ImageTestFlags |= FLC_TEST_RESET_NWP;
status = sl_extlib_FlcTest(ImageTestFlags);
if (status & FLC_TEST_RESET_MCU)
{
Report("proc_ota_run_step: Rebooting...");
Platform_Reset();
}
if (status & FLC_TEST_RESET_NWP)
{
Report("\nproc_ota_run_step: reset the NWP to test the new image ---\n");
status = slAccess_stop_start(OPEN_LINK_SSID);
}
}
_i32 sl_extlib_FlcWriteFile ( _i32  fileHandle,
_i32  offset,
_u8 *  buf,
_i32  len 
)

Write specified number of bytes to a file.

Parameters
[in]fileHandleHandle to file opened for reading
[in]offsetOffset to specific block to be read
[in]bufPointer the data to be written
[in]lenLength of the data in bytes

This function writes len bytes from buf to the file specified by the` fileHandle.

Returns
Returns the number of bytes written or negative error number.
Generated on Wed Mar 4 2015 15:37:50 for CC3X00 Simplelink OTA Extlib API User's Guide by   doxygen 1.8.7