blob: dfb434db87bb2b6840226b7a968c6fece4ecd298 [file] [log] [blame]
yu.dongc33b3072024-08-21 23:14:49 -07001#ifndef __INC_MCF_UTFWK_H
2#define __INC_MCF_UTFKW_H
3
4#include "ps_public_struct.h"
5#include "mcf_enum.h"
6#include "mcf_utfwk_struct.h"
7#include "mcf_if.h"
8
9#ifndef __MCF_UT_FRAMEWORK_SUPPORT__
10 #define _STATIC static
11 #define MCF_UT_DUMMY_ASSERT ASSERT
12 #define mcf_utfwk_printf(...)
13#else
14 #define MCF_UT_SW_VERNO "LR12A.R3.MP.W18.20.LTE.P1"
15 #define MCF_UT_GEN_TIME "2018/06/06 16:09"
16 #define SBP_NULL_TAG "NA_NA_NA"
17 #define SBP_PARTIAL_TAG "12_NA_NA"
18 #define SBP_PARTIAL_TAG_WITH_MCC "12_33_NA"
19 #define SBP_PARTIAL_TAG_NO_SBPID "NA_33_21"
20 #define SBP_FULL_TAG "12_33_21"
21 #define SBP_TAG_SBPID 12
22 #define SBP_TAG_MCC "33"
23 #define SBP_TAG_MNC "21"
24#if defined(__MD93__)
25 #define MCF_UT_DB_FOLDER_PATH "common\\service\\mcf\\mcf_modis_db"
26#else
27 #define MCF_UT_DB_FOLDER_PATH "service\\mcf\\mcf_modis_db"
28#endif
29
30 #define _STATIC
31 #define MCF_UT_DUMMY_ASSERT(...)
32 #define FS_CreateDir(...) 0
33 #define FS_GetAttributes(...) 0
34 #define FS_GetFileDetail(...) 0
35
36 #define MCF_UT_FAKE_PRINT 0
37 #define MCF_UTFWK_INPUT_VAR static
38 #define MCF_UTFWK_DUMP_VAR static
39
40#if MCF_UT_FAKE_PRINT == 1
41 extern int fake_print(const char *fmt, ...);
42 #define _mcf_utfwk_printf fake_print
43#elif MCF_UT_FAKE_PRINT == 2
44 #define _mcf_utfwk_printf printf
45#else
46 #define _mcf_utfwk_printf(...)
47#endif
48
49#define mcf_utfwk_printf(_fmts, ...) \
50 _mcf_utfwk_printf("%s():%d: " _fmts, __FUNCTION__, __LINE__, ##__VA_ARGS__)
51
52#define mcf_utfwk_format_err_str(_fmts, ...) \
53 kal_sprintf(p_ret_err_str, "%s():%d: " _fmts, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
54 mcf_utfwk_printf("[FAILED] %s():%d: " _fmts, __FUNCTION__, __LINE__, ##__VA_ARGS__)
55
56/*----------------------------------------------------------------------------------------
57 * MCF UTFWK fucntions.
58 *--------------------------------------------------------------------------------------*/
59
60 /*****************************************************************************
61 * FUNCTION
62 * mcf_utfwk_is_working_status
63 * DESCRIPTION
64 * This function is used to get ut fwk status.
65 * To check whether use WIN_FS_CMP_READ to read OTA file.
66 * PARAMETERS
67 * RETURNS
68 * KAL_TRUE : is running
69 * KAL_FALSE : not running
70 *****************************************************************************/
71kal_bool mcf_utfwk_is_working_status();
72
73/*****************************************************************************
74 * FUNCTION
75 * mcf_utfwk_ilm_initial_env
76 * DESCRIPTION
77 * This function is used to do initialization for MCF UTFWK when received ILM.
78 * PARAMETERS
79 * local_para_ptr [IN] local parameter from ilm
80 * RETURNS
81 *****************************************************************************/
82void mcf_utfwk_ilm_initial_env(ilm_struct *ilm);
83
84/*****************************************************************************
85 * FUNCTION
86 * mcf_utfwk_ilm_initial_ota_callback
87 * DESCRIPTION
88 * This function is used to register OTA callback function for MCF UTFWK when received ILM.
89 * PARAMETERS
90 * local_para_ptr [IN] local parameter from ilm
91 * RETURNS
92 *****************************************************************************/
93void mcf_utfwk_ilm_initial_ota_callback(ilm_struct *ilm);
94
95/*****************************************************************************
96 * FUNCTION
97 * mcf_utfwk_ilm_initial_dsbp_callback
98 * DESCRIPTION
99 * This function is used to register DSBP callback function for MCF UTFWK when received ILM.
100 * PARAMETERS
101 * local_para_ptr [IN] local parameter from ilm
102 * RETURNS
103 *****************************************************************************/
104void mcf_utfwk_ilm_initial_dsbp_callback(ilm_struct *ilm);
105
106/*****************************************************************************
107 * FUNCTION
108 * mcf_utfwk_ilm_execute
109 * DESCRIPTION
110 * This function is used to apply OTA for MCF UTFWK when received ILM.
111 * PARAMETERS
112 * local_para_ptr [IN] local parameter from ilm
113 * RETURNS
114 *****************************************************************************/
115void mcf_utfwk_ilm_execute(ilm_struct *ilm);
116
117/*****************************************************************************
118 * FUNCTION
119 * mcf_utfwk_ilm_dump_result
120 * DESCRIPTION
121 * This function is used to dump LID results for MCF UTFWK when received ILM.
122 * PARAMETERS
123 * local_para_ptr [IN] local parameter from ilm
124 * RETURNS
125 *****************************************************************************/
126void mcf_utfwk_ilm_dump_result(ilm_struct *ilm);
127
128/*****************************************************************************
129 * FUNCTION
130 * mcf_utfwk_ilm_reset
131 * DESCRIPTION
132 * This function is used to reset environment for MCF UTFWK when received ILM.
133 * PARAMETERS
134 * local_para_ptr [IN] local parameter from ilm
135 * RETURNS
136 *****************************************************************************/
137void mcf_utfwk_ilm_reset(ilm_struct *ilm);
138
139/*****************************************************************************
140 * FUNCTION
141 * mcf_utfwk_initial_env
142 * DESCRIPTION
143 * This function is used to do initialization for MCF UTFWK.
144 * PARAMETERS
145 * ota_input [IN] OTA input (OTA information)
146 * RETURNS
147 * -1 : Fail
148 * >0 : Success, ID Number
149 *****************************************************************************/
150kal_bool mcf_utfwk_initial_env (mcf_utfwk_ota_input_struct ota_input);
151
152/*****************************************************************************
153 * FUNCTION
154 * mcf_utfwk_initial_dsbp_callback
155 * DESCRIPTION
156 * This function is used to register DSBP callback function.
157 * PARAMETERS
158 * dsbp_func_ptr [IN] DSBP callback function
159 * RETURNS
160 *
161 *****************************************************************************/
162void mcf_utfwk_initial_dsbp_callback(MCF_UTFWK_DSBP_FUNC dsbp_func_ptr);
163
164/*****************************************************************************
165 * FUNCTION
166 * mcf_utfwk_execute
167 * DESCRIPTION
168 * This function is used to apply OTA for MCF UTFWK.
169 * PARAMETERS
170 * RETURNS
171 *
172 *****************************************************************************/
173void mcf_utfwk_execute();
174
175/*****************************************************************************
176 * FUNCTION
177 * mcf_ut_fwk_dump_result
178 * DESCRIPTION
179 * This function is used to dump LID results for MCF UTFWK.
180 * PARAMETERS
181 * lid [IN] LID number
182 * rec_id [IN] Record ID of LID
183 * dump_type [IN] Dump type (LID/parameters)
184 * dump_buffer [IN] destination buffer
185 * size [IN] buffer size
186 * gid [IN] variable global id
187 * array_index [IN] variable array index string
188 * RETURNS
189 * KAL_TRUE : Success
190 * KAL_FALSE : Fail
191 *****************************************************************************/
192kal_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);
193
194/*****************************************************************************
195 * FUNCTION
196 * mcf_utfwk_reset
197 * DESCRIPTION
198 * This function is used to reset environment for MCF UTFWK.
199 * PARAMETERS
200 * RETURNS
201 *
202 *****************************************************************************/
203void mcf_utfwk_reset();
204
205kal_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);
206
207#endif /* MCF_UT_FRAMEWORK_SUPPORT */
208
209#endif /* __INC_MCF_UT_H */
210