| #ifndef __INC_MCF_UTFWK_H |
| #define __INC_MCF_UTFKW_H |
| |
| #include "ps_public_struct.h" |
| #include "mcf_enum.h" |
| #include "mcf_utfwk_struct.h" |
| #include "mcf_if.h" |
| |
| #ifndef __MCF_UT_FRAMEWORK_SUPPORT__ |
| #define _STATIC static |
| #define MCF_UT_DUMMY_ASSERT ASSERT |
| #define mcf_utfwk_printf(...) |
| #else |
| #define MCF_UT_SW_VERNO "LR12A.R3.MP.W18.20.LTE.P1" |
| #define MCF_UT_GEN_TIME "2018/06/06 16:09" |
| #define SBP_NULL_TAG "NA_NA_NA" |
| #define SBP_PARTIAL_TAG "12_NA_NA" |
| #define SBP_PARTIAL_TAG_WITH_MCC "12_33_NA" |
| #define SBP_PARTIAL_TAG_NO_SBPID "NA_33_21" |
| #define SBP_FULL_TAG "12_33_21" |
| #define SBP_TAG_SBPID 12 |
| #define SBP_TAG_MCC "33" |
| #define SBP_TAG_MNC "21" |
| #if defined(__MD93__) |
| #define MCF_UT_DB_FOLDER_PATH "common\\service\\mcf\\mcf_modis_db" |
| #else |
| #define MCF_UT_DB_FOLDER_PATH "service\\mcf\\mcf_modis_db" |
| #endif |
| |
| #define _STATIC |
| #define MCF_UT_DUMMY_ASSERT(...) |
| #define FS_CreateDir(...) 0 |
| #define FS_GetAttributes(...) 0 |
| #define FS_GetFileDetail(...) 0 |
| |
| #define MCF_UT_FAKE_PRINT 0 |
| #define MCF_UTFWK_INPUT_VAR static |
| #define MCF_UTFWK_DUMP_VAR static |
| |
| #if MCF_UT_FAKE_PRINT == 1 |
| extern int fake_print(const char *fmt, ...); |
| #define _mcf_utfwk_printf fake_print |
| #elif MCF_UT_FAKE_PRINT == 2 |
| #define _mcf_utfwk_printf printf |
| #else |
| #define _mcf_utfwk_printf(...) |
| #endif |
| |
| #define mcf_utfwk_printf(_fmts, ...) \ |
| _mcf_utfwk_printf("%s():%d: " _fmts, __FUNCTION__, __LINE__, ##__VA_ARGS__) |
| |
| #define mcf_utfwk_format_err_str(_fmts, ...) \ |
| kal_sprintf(p_ret_err_str, "%s():%d: " _fmts, __FUNCTION__, __LINE__, ##__VA_ARGS__); \ |
| mcf_utfwk_printf("[FAILED] %s():%d: " _fmts, __FUNCTION__, __LINE__, ##__VA_ARGS__) |
| |
| /*---------------------------------------------------------------------------------------- |
| * MCF UTFWK fucntions. |
| *--------------------------------------------------------------------------------------*/ |
| |
| /***************************************************************************** |
| * FUNCTION |
| * mcf_utfwk_is_working_status |
| * DESCRIPTION |
| * This function is used to get ut fwk status. |
| * To check whether use WIN_FS_CMP_READ to read OTA file. |
| * PARAMETERS |
| * RETURNS |
| * KAL_TRUE : is running |
| * KAL_FALSE : not running |
| *****************************************************************************/ |
| kal_bool mcf_utfwk_is_working_status(); |
| |
| /***************************************************************************** |
| * FUNCTION |
| * mcf_utfwk_ilm_initial_env |
| * DESCRIPTION |
| * This function is used to do initialization for MCF UTFWK when received ILM. |
| * PARAMETERS |
| * local_para_ptr [IN] local parameter from ilm |
| * RETURNS |
| *****************************************************************************/ |
| void mcf_utfwk_ilm_initial_env(ilm_struct *ilm); |
| |
| /***************************************************************************** |
| * FUNCTION |
| * mcf_utfwk_ilm_initial_ota_callback |
| * DESCRIPTION |
| * This function is used to register OTA callback function for MCF UTFWK when received ILM. |
| * PARAMETERS |
| * local_para_ptr [IN] local parameter from ilm |
| * RETURNS |
| *****************************************************************************/ |
| void mcf_utfwk_ilm_initial_ota_callback(ilm_struct *ilm); |
| |
| /***************************************************************************** |
| * FUNCTION |
| * mcf_utfwk_ilm_initial_dsbp_callback |
| * DESCRIPTION |
| * This function is used to register DSBP callback function for MCF UTFWK when received ILM. |
| * PARAMETERS |
| * local_para_ptr [IN] local parameter from ilm |
| * RETURNS |
| *****************************************************************************/ |
| void mcf_utfwk_ilm_initial_dsbp_callback(ilm_struct *ilm); |
| |
| /***************************************************************************** |
| * FUNCTION |
| * mcf_utfwk_ilm_execute |
| * DESCRIPTION |
| * This function is used to apply OTA for MCF UTFWK when received ILM. |
| * PARAMETERS |
| * local_para_ptr [IN] local parameter from ilm |
| * RETURNS |
| *****************************************************************************/ |
| void mcf_utfwk_ilm_execute(ilm_struct *ilm); |
| |
| /***************************************************************************** |
| * FUNCTION |
| * mcf_utfwk_ilm_dump_result |
| * DESCRIPTION |
| * This function is used to dump LID results for MCF UTFWK when received ILM. |
| * PARAMETERS |
| * local_para_ptr [IN] local parameter from ilm |
| * RETURNS |
| *****************************************************************************/ |
| void mcf_utfwk_ilm_dump_result(ilm_struct *ilm); |
| |
| /***************************************************************************** |
| * FUNCTION |
| * mcf_utfwk_ilm_reset |
| * DESCRIPTION |
| * This function is used to reset environment for MCF UTFWK when received ILM. |
| * PARAMETERS |
| * local_para_ptr [IN] local parameter from ilm |
| * RETURNS |
| *****************************************************************************/ |
| void mcf_utfwk_ilm_reset(ilm_struct *ilm); |
| |
| /***************************************************************************** |
| * FUNCTION |
| * mcf_utfwk_initial_env |
| * DESCRIPTION |
| * This function is used to do initialization for MCF UTFWK. |
| * PARAMETERS |
| * ota_input [IN] OTA input (OTA information) |
| * RETURNS |
| * -1 : Fail |
| * >0 : Success, ID Number |
| *****************************************************************************/ |
| kal_bool mcf_utfwk_initial_env (mcf_utfwk_ota_input_struct ota_input); |
| |
| /***************************************************************************** |
| * FUNCTION |
| * mcf_utfwk_initial_dsbp_callback |
| * DESCRIPTION |
| * This function is used to register DSBP callback function. |
| * PARAMETERS |
| * dsbp_func_ptr [IN] DSBP callback function |
| * RETURNS |
| * |
| *****************************************************************************/ |
| void mcf_utfwk_initial_dsbp_callback(MCF_UTFWK_DSBP_FUNC dsbp_func_ptr); |
| |
| /***************************************************************************** |
| * FUNCTION |
| * mcf_utfwk_execute |
| * DESCRIPTION |
| * This function is used to apply OTA for MCF UTFWK. |
| * PARAMETERS |
| * RETURNS |
| * |
| *****************************************************************************/ |
| void mcf_utfwk_execute(); |
| |
| /***************************************************************************** |
| * FUNCTION |
| * mcf_ut_fwk_dump_result |
| * DESCRIPTION |
| * This function is used to dump LID results for MCF UTFWK. |
| * PARAMETERS |
| * lid [IN] LID number |
| * rec_id [IN] Record ID of LID |
| * dump_type [IN] Dump type (LID/parameters) |
| * dump_buffer [IN] destination buffer |
| * size [IN] buffer size |
| * gid [IN] variable global id |
| * array_index [IN] variable array index string |
| * RETURNS |
| * KAL_TRUE : Success |
| * KAL_FALSE : Fail |
| *****************************************************************************/ |
| kal_bool mcf_utfwk_dump_result(kal_uint16 lid, kal_uint16 rec_id, mcf_utfwk_dump_type_enum dump_type, void *dump_buffer, kal_uint32 size, kal_uint16 gid, kal_char* array_index); |
| |
| /***************************************************************************** |
| * FUNCTION |
| * mcf_utfwk_reset |
| * DESCRIPTION |
| * This function is used to reset environment for MCF UTFWK. |
| * PARAMETERS |
| * RETURNS |
| * |
| *****************************************************************************/ |
| void mcf_utfwk_reset(); |
| |
| kal_bool mcf_utfwk_generate_gid_ota_file(kal_uint8 *buff, mcf_utfwk_ota_input_struct ota_input, kal_bool *is_general, kal_uint16 *buff_size); |
| |
| #endif /* MCF_UT_FRAMEWORK_SUPPORT */ |
| |
| #endif /* __INC_MCF_UT_H */ |
| |