![]() |
CC3X00 Simplelink OTA Extlib API User's Guide
1.1.0
|
Functions | |
void * | sl_extLib_OtaInit (_i32 runMode, FlcCb_t *pFlcHostCb) |
Initialize OTA application. More... | |
_i32 | sl_extLib_OtaRun (void *pvOtaApp) |
Run the OTA App state machine. More... | |
_i32 | sl_extLib_OtaSet (void *pvOtaApp, _i32 Option, _i32 OptionLen, _u8 *pOptionVal) |
Set OTA command/parameter. More... | |
_i32 | sl_extLib_OtaGet (void *pvOtaApp, _i32 Option, _i32 *OptionLen, _u8 *pOptionVal) |
Get the current OTA status. More... | |
Detailed Description
Function Documentation
_i32 sl_extLib_OtaGet | ( | void * | pvOtaApp, |
_i32 | Option, | ||
_i32 * | OptionLen, | ||
_u8 * | pOptionVal | ||
) |
Get the current OTA status.
- Parameters
-
[in] pvOtaApp OTA control block pointer [in] Option Selects the option [in] OptionLen option structure length [in] pOptionVal pointer to the option structure
This function gets the current OTA of active or Idle. The parameter option, could be one of the following:
EXTLIB_OTA_GET_OPT_IS_ACTIVE - Check if OTA process is active or idle
Value at pOptionVal will be set to 1 if OTA process is active, 0 if Idle
EXTLIB_OTA_GET_OPT_PRINT_STAT - Prints statistics
- Returns
- Return 0 on success, -1 otherwise.
- See also
- Note
- Warning
- Example:
- For example: Get OTA running statussl_extLib_OtaGet(pvOtaApp, EXTLIB_OTA_GET_OPT_IS_ACTIVE, &ProcActiveLen, (_u8 *)&ProcActive);
void * sl_extLib_OtaInit | ( | _i32 | runMode, |
FlcCb_t * | pFlcHostCb | ||
) |
Initialize OTA application.
- Parameters
-
[in] RunMode Is the run mode for the application [in] pFlcHostCb Pointer to file commit call back functions
This function initializes the OTA application and modules. The parameter RunMode configure the OTA lib to run with OS or noneOS, use blocking or noneBlocking calls. It can be logical OR combination of following:
-RUN_MODE_OS
-RUN_MODE_NONE_OS
-RUN_MODE_BLOCKING
-RUN_MODE_NONE_BLOCKING
The parameter pFlcHostCb is a pointer to FlcCb_t structure containing callback function to download files to storage other than SFLASH.
- Returns
- OTA control block pointer
- See also
- Note
- Currently OTA supports only NON-OS Blocking mode and pFlcHostCb should be set to NULL.
- Warning
- Example:
- For example: To initialize OTA from host invokepvOtaApp = sl_extLib_OtaInit(RUN_MODE_NONE_OS | RUN_MODE_BLOCKING, NULL);
_i32 sl_extLib_OtaRun | ( | void * | pvOtaApp | ) |
Run the OTA App state machine.
- Parameters
-
[in] pvOtaApp Pointer to OTA application pointer
Run one step from the OTA application state machine. Host should repeat calling this function and examine the return value in order to check if OTA completed or got error or just need to be continued. This pattern is useful in host with NON-OS. In host with OS, host should start OTA task and continuously calling this function till OTA completed.
- Returns
- Return zero or +ve bitmap number on success, -ve otherwise.
-RUN_STAT_CONTINUE - Host should continue calling sl_extLib_OtaRun
-RUN_STAT_NO_UPDATES - No updates for now, host can retry
-RUN_STAT_DOWNLOAD_DONE - Current OTA update completed, host should test bit 2,3 to reset the MCU/NWP
-RUN_STAT_ERROR_CONTINUOUS_ACCESS_FAILURES - Fatal access error, OTA try more than 10 times to reach the OTA server and failed, it is recommended to reset the NWP.
Other negative value - OTA error, OTA can recover from this failue, host should continue calling sl_extLib_OtaRun.
- See also
- Note
- Warning
- Example:
- For example: Run OTA from hostpvOtaApp = sl_extLib_OtaRun(pvOtaApp);
_i32 sl_extLib_OtaSet | ( | void * | pvOtaApp, |
_i32 | Option, | ||
_i32 | OptionLen, | ||
_u8 * | pOptionVal | ||
) |
Set OTA command/parameter.
- Parameters
-
[in] pvOtaApp OTA control block pointer [in] Option Select the option [in] OptionLen Option structure length [in] pOptionVal pointer to the option structure
This function sets OTA command/parameter. The parameter Option can be one of the following:
EXTLIB_OTA_SET_OPT_SERVER_INFO - Set the Server information
EXTLIB_OTA_SET_OPT_VENDOR_ID - Set the Vendor ID string
EXTLIB_OTA_SET_OPT_COMMITED - Commit the last OTA update & move to idle
- Returns
- On success, zero is returned. On error, -1 is returned
- See also
- Note
- Warning
- Example:
- For example: Set OTA server info from hostsl_extLib_OtaSet(pvOtaApp, EXTLIB_OTA_SET_OPT_SERVER_INFO,sizeof(g_otaOptServerInfo), (_u8 *)&g_otaOptServerInfo);
Generated on Wed Mar 4 2015 15:37:50 for CC3X00 Simplelink OTA Extlib API User's Guide by
