思澈科技软件开发工具包  2.20
Module Installer

Install module to run in flash. More...

Data Structures

struct  app_installer_info_t
 
typedef void(* module_init_func_t) (void)
 
typedef void(* module_cleanup_func_t) (void)
 
rt_err_t mod_install (const char *mod_name, const char *package_path, const char *install_path)
 Install dlmodule. More...
 
rt_err_t app_install (app_installer_info_t *info)
 Install application. More...
 
int32_t app_uninstall (const char *app_name, const char *res_install_path, const char *pgm_install_path)
 Uninstall application. More...
 
int32_t mod_installer_init (uint32_t sys_prog_start_addr, uint32_t sys_prog_end_addr)
 Init mod_installer. More...
 
#define DLMODULE_STRINGIFY_(val)   #val
 
#define DLMODULE_STRINGIFY(val)   DLMODULE_STRINGIFY_(val)
 
#define DLMODULE_CONCAT_2_(p1, p2)   p1##p2
 
#define DLMODULE_CONCAT_2(p1, p2)   CONCAT_2_(p1, p2)
 Concatenates two parameters. More...
 
#define MODULE_CONTEXT   (DLMODULE_CONCAT_2(MODULE_NAME, _ctx))
 
#define MODULE_CONTEXT_DEFINE   static MODULE_USER_DATA_TYPE *MODULE_CONTEXT
 
#define MODULE_CONTEXT_ALLOC()   do { MODULE_CONTEXT = rt_malloc(sizeof(MODULE_USER_DATA_TYPE)); RT_ASSERT(MODULE_CONTEXT)} while (0)
 
#define MODULE_CONTEXT_FREE()   do {rt_free(MODULE_CONTEXT); MODULE_CONTEXT = RT_NULL;} while (0)
 
#define MODULE_INIT_DEF(init_func)
 
#define MODULE_CLEANUP_DEF(cleanup_func)
 
#define MODULE_NAME   module
 

Detailed Description

Install module to run in flash.

Macro Definition Documentation

◆ DLMODULE_CONCAT_2

#define DLMODULE_CONCAT_2 (   p1,
  p2 
)    CONCAT_2_(p1, p2)

Concatenates two parameters.

It realizes two level expansion to make it sure that all the parameters are actually expanded before gluing them together.

Parameters
p1First parameter to concatenating
p2Second parameter to concatenating
Returns
Two parameters glued together. They have to create correct C mnemonic in other case preprocessor error would be generated.

◆ DLMODULE_STRINGIFY

#define DLMODULE_STRINGIFY (   val)    DLMODULE_STRINGIFY_(val)

Converts a macro argument into a character constant.

Function Documentation

◆ app_install()

rt_err_t app_install ( app_installer_info_t info)

Install application.

Parameters
[in]infoApplication installer info
Return values
RT_EOKsuccess, other: fail, negative value for error code, such as -RT_ERROR

◆ app_uninstall()

int32_t app_uninstall ( const char *  app_name,
const char *  res_install_path,
const char *  pgm_install_path 
)

Uninstall application.

Parameters
[in]app_nameapplication name
[in]res_install_pathResource install path
[in]pgm_install_pathProgram install path
Return values
0success, other: fail

◆ mod_install()

rt_err_t mod_install ( const char *  mod_name,
const char *  package_path,
const char *  install_path 
)

Install dlmodule.

Parameters
[in]mod_namemodule name
[in]package_path.so file path
[in]install_pathwhere to install the module
Return values
RT_EOKsuccess, other: fail, negative value for error code, such as -RT_ERROR

◆ mod_installer_init()

int32_t mod_installer_init ( uint32_t  sys_prog_start_addr,
uint32_t  sys_prog_end_addr 
)

Init mod_installer.

Parameters
[in]sys_prog_start_addrStart address of system program
[in]sys_prog_end_addrEnd address of system program
Return values
0success, other: fail