comparison src/aci2/mfw/mfw_nm.h @ 3:93999a60b835

src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 26 Sep 2016 00:29:36 +0000
parents
children
comparison
equal deleted inserted replaced
2:c41a534f33c6 3:93999a60b835
1 /*
2 +--------------------------------------------------------------------+
3 | PROJECT: MMI-Framework (8417) $Workfile:: mfw_nm.h $|
4 | $Author:: Es $Revision:: 1 $|
5 | CREATED: 07.10.98 $Modtime:: 20.01.00 18:48 $|
6 | STATE : code |
7 +--------------------------------------------------------------------+
8
9 PURPOSE: Type definitions for network management
10
11 HISTORY:
12
13 Feb 15, 2006 ER: OMAPS00065203 x0pleela
14 Description: Cingular Operator Name Prioritization implementation required
15 Solution: Incorporated review comments
16 - Implemented prototypes of 2 new functions set_opn_sel_done() and
17 get_opn_sel_done() to set and get the current status of the operator selection
18 - Added T_MFW_NM_OPN opn_read_from as part of T_MFW_NETWORK_STRUCT
19 structure to avoid use of global variable as per review comments
20
21 Feb 09, 2006 ER: OMAPS00065203 x0pleela
22 Description: Cingular Operator Name Prioritization implementation required
23 Solution: Added new enumeration T_MFW_NM_OPN
24 Added new event E_NM_OPN
25 Added prototype of newly incorporated functions
26
27 July 14, 2005 REF: CRR 31916 x0021334
28 Description: rCI_PercentCOPS() and rAT_PercentCOPS() is not implemented
29 Solution: rAT_PercentCOPS() is implemented.
30 */
31
32 #ifndef DEF_MFW_NM
33 #define DEF_MFW_NM
34
35
36
37 /* #include "phb.h" RSA 20/12/01 - Removed */
38 #include"mfw_phb.h" //RSA 20/12/01 - Added
39 #ifdef FF_2TO1_PS
40 #include "prim.h"
41 #else
42 #include "p_mmreg.val"
43 #endif
44 /*
45 * global constants
46 */
47 #define NM_AUTOMATIC 0 /* automatic mode set */
48 #define NM_MANUAL 1 /* manual mode is set */
49
50
51 /* permit maximal value */
52
53 #define MAX_PLMN 12 /* maximal PLMN number */
54
55 #define LONG_NAME 26
56 #define SHORT_NAME 10
57 #define SP_NAME 17
58 #define NUMERIC_LENGTH 7 /* 3 digits MCC + 3 digits MNC + '\0' */
59
60 #define MFW_PLMN_AVAILABLE 0 /* a permitted PLMN */
61 #define MFW_PLMN_FORBIDDEN 1 /* a forbidden PLMN */
62
63 #define MFW_FULL_SERVICE 1 /* definition for services */
64 #define MFW_LIMITED_SERVICE 2
65 #define MFW_SEARCH_NETWORK 3
66 #define MFW_NO_SERVICE 0
67
68 typedef enum
69 {
70 NEW_PREF_PLMN = 1, /* Add a new entry to the end of the list */
71 CHANGE_PREF_PLMN, /* Change the place of two entries */
72 INSERT_PREF_PLMN, /* Add a new entry to the list at a given index */
73 REPLACE_PREF_PLMN, /* Overwrite an existing entry at a given index */
74 DELETE_PREF_PLMN /* Delete an entry from the list */
75 } T_MFW_PPLMN_MODE;
76
77 typedef enum
78 {
79 NM_ERR,
80 NM_OK
81 } T_MFW_NM_RETURN;
82
83 //x0pleela 08 Feb, 2006 ER: OMAPS00065203
84 typedef enum
85 {
86 NM_ROM, /* operator name read from ROM */
87 NM_EONS, /* operator name read from EONS */
88 NM_CPHS, /* operator name read from ONS */
89 NM_NITZ, /* operator name read from NITZ */
90 NM_NONE = 255 /* no operator name */
91 }T_MFW_NM_OPN;
92
93 //x0pleel 8 Feb, 2006 ER: OMAPS00065203
94 #define E_NM_OPN 0x4000 /* Event sent by MFW when operator name is obtained */
95
96 /*
97 * events are organised as bitmaps
98 */
99 #define E_NM_FULL_SERVICE 0x0001
100 #define E_NM_NO_SERVICE 0x0002
101 #define E_NM_LIMITED_SERVICE 0x0004
102 #define E_NM_SEARCH_NETWORK 0x0008
103 #define E_NM_PLMN_LIST 0x0010
104 #define E_NM_NO_NETWORK 0x0020
105 #define E_NM_DEREGISTRATION 0x0040
106 #define E_NM_PREF_PLMN_LIST 0x0080
107 #define E_NM_CHANGE_PPLMN_OK 0x0100
108 #define E_NM_CHANGE_PPLMN_ERR 0x0200
109 #define E_NM_PPLMN_MEM 0x0400
110 #define E_MFW_NET_IND 0x0800
111 #define E_MFW_TIME_IND 0x1000
112 #define E_NM_CELL_SELECT 0x1001
113 #define E_NM_BAND 0x2000 /*SPR919 - SH - added */
114
115 #define E_NM_ALL_SERVICES /*0x0FFF*/ 0xFFFF /* SPR919 - SH - changed */
116
117 /* Structures */
118
119 /* Cell Reselection Structure API 16-04-02 */
120 typedef struct
121 {
122 USHORT ci; /* cell identification */
123 USHORT lid; /* location identification */
124 }T_MFW_CELL_STRUCT;
125
126 typedef struct /* LONG NAME */
127 {
128 UBYTE dcs;
129 UBYTE len; /* length of string data */
130 UBYTE data[LONG_NAME]; /* string data */
131 } T_MFW_LNAME;
132
133 typedef struct /* SHORT NAME */
134 {
135 UBYTE dcs;
136 UBYTE len; /* length of string data */
137 UBYTE data[SHORT_NAME]; /* string data */
138 } T_MFW_SNAME;
139
140 typedef struct /* SERVICE PROVIDER NAME */
141 {
142 UBYTE dcs;
143 UBYTE len; /* length of string data */
144 UBYTE data[SP_NAME]; /* string data */
145 UBYTE dummy;
146 } T_MFW_SP_NAME;
147
148 typedef struct
149 {
150 SHORT index;
151 #ifdef NO_ASCIIZ
152 T_MFW_SP_NAME service_provider; /* service provider name */
153 T_MFW_LNAME network_long; /* operator name in long format */
154 T_MFW_SNAME network_short; /* operator name in short format */
155 #else
156 UBYTE service_provider[LONG_NAME]; /* service provider name */
157 UBYTE network_long [LONG_NAME]; /* operator name in long format */
158 UBYTE network_short[SHORT_NAME]; /* operator name in short format */
159 #endif
160 UBYTE network_numeric[NUMERIC_LENGTH]; /* operator name in numeric format */
161 UBYTE display_condition;
162 UBYTE roaming_indicator; /* PLMN in HPLMN or not */
163 UBYTE forbidden_indicator; /* PLMN is member of the forbidden PLMN list */
164 UBYTE *fieldstrength; /* fieldstrength of PLMN */
165 //x0pleela 15 Feb, 2006 ER: OMAPS00065203
166 //Added as part of this structure to avoid use of global variable as per review comments
167 T_MFW_NM_OPN opn_read_from; /* Holds the source id from where operator name was read */
168 } T_MFW_NETWORK_STRUCT;
169
170 typedef struct {
171 UBYTE count; /* number of entries in perferred PLMN list */
172 T_MFW_NETWORK_STRUCT *plmn; /* plmn identifications */
173 } T_MFW_PREF_PLMN_LIST; /* prefered PLMN list*/
174
175 typedef struct
176 {
177 UBYTE count; /* number of available PLMNs */
178 T_MFW_NETWORK_STRUCT plmn[MAX_PLMN]; /* plmn identifications */
179 } T_MFW_PLMN_LIST;
180
181 typedef struct
182 {
183 UBYTE maxRcd; /* maximum preferred PLMN records in SIM card */
184 UBYTE usedRcd; /* used preferred PLMN records in SIM card */
185 } T_MFW_PPLMN_MEM;
186
187 typedef struct /* data for network name */
188 {
189 UBYTE dcs;
190 UBYTE add_ci;
191 UBYTE num_spare;
192 UBYTE len;
193 #ifdef FF_2TO1_PS
194 UBYTE data[MMREG_MAX_TEXT_LEN];
195 #else
196 UBYTE data[MMR_MAX_TEXT_LEN];
197 #endif
198 } T_MFW_NET_NAME;
199
200 typedef struct /* data buffer for network name */
201 {
202 #ifdef FF_2TO1_PS
203 UBYTE mcc[PS_SIZE_MCC]; /* mobile country code */
204 UBYTE mnc[PS_SIZE_MNC_MAX]; /* mobile network code */
205 #else
206 UBYTE mcc[SIZE_MCC]; /* mobile country code */
207 UBYTE mnc[SIZE_MNC]; /* mobile network code */
208 #endif
209 T_MFW_NET_NAME long_name; /* Network name, long format */
210 T_MFW_NET_NAME short_name; /* Network name, short format */
211 } T_MFW_NET_IND;
212
213 typedef struct /* data for timer zone */
214 {
215 UBYTE year;
216 UBYTE month;
217 UBYTE day;
218 UBYTE hour;
219 UBYTE minute;
220 UBYTE second;
221 UBYTE timezone;
222 } T_MFW_TIME_IND;
223
224 /*
225 * Network Parameter
226 */
227 typedef union
228 {
229 T_MFW_NETWORK_STRUCT ident;
230 T_MFW_PLMN_LIST plmns;
231 T_MFW_PREF_PLMN_LIST pplmns;
232 T_MFW_PPLMN_MEM pplmn_mem;
233 T_MFW_NET_IND net_info;
234 T_MFW_TIME_IND tim_info;
235 T_MFW_CELL_STRUCT cell_info; /* sbh 29-04-02 - Cell reselection */
236 } T_MFW_NM_PARA;
237
238
239
240 /*
241 * Prototypes
242 */
243
244 int nm_init (void);
245 MfwHnd nm_create (MfwHnd hWin, MfwEvt event, MfwCb cbfunc);
246 MfwRes nm_delete (MfwHnd hWin);
247 void nm_set_mode (U8 mode);
248 T_MFW nm_get_mode (void);
249 T_MFW nm_reg_status (void);
250 void nm_select_plmn (U8 *network);
251 void nm_avail_plmn_list (void);
252 void nm_home_plmn (T_MFW_NETWORK_STRUCT *hplmn);
253 int nm_plnm_list(T_MFW_NETWORK_STRUCT *plmn_list, int start, int count);
254
255 int nm_plnm_list_longnames(char**plmn_ln_list, int start, int count); /*SPR 2635.*/
256
257 void nm_pref_plmn_list(T_MFW_NETWORK_STRUCT *pplmn, UBYTE count, SHORT start);
258 T_MFW_NM_RETURN nm_change_pref_plmn(T_MFW_PPLMN_MODE mode,
259 SHORT index, SHORT index2,
260 UBYTE *network_numeric);
261
262 T_MFW_NM_RETURN nm_change_pref_plmn_longname(T_MFW_PPLMN_MODE mode,/*SPR 2635.*/
263 SHORT index, SHORT index2,
264 char* network_long);
265
266 T_MFW nm_registration (U8 mode, U8 freq_bands, U8 limited);
267 void nm_deregistration (void);
268 void nm_abort_avail_plmn(void);
269 void nm_exit (void);
270 T_MFW_NM_RETURN nm_pplmn_mem_req(void);
271
272 //x0pleela 09 Feb, 2006 ER: OMAPS00065203
273 //Conversion from ACI souce Id type to MFW souceid type
274 #ifndef NEPTUNE_BOARD
275 int nm_decodeSourceId( UBYTE sourceId);
276 #endif
277 //To update plmn data after querying COPN
278 void nm_update_plmn_data( T_MFW_NETWORK_STRUCT *plmn_ident,
279 T_ACI_OPER_NTRY oper_ntry);
280 //To query COPN
281 void nm_get_COPN( T_MFW_NETWORK_STRUCT *plmn_ident );
282 //Get operator name from other sources (CPHS or NITZ or ROM)
283 void nm_get_opername(T_MFW_NETWORK_STRUCT * plmn_ident);
284 //gets operator name from network
285 void nm_get_network_data(T_MFW_NETWORK_STRUCT *plmn_netw_data);
286
287 //x0pleela 15 Feb, 2006 ER: OMAPS00065203
288 //sets opn_sel_done flag to TRUE or FALSE
289 void set_opn_sel_done( UBYTE opn_selected );
290 //returns the current value of flag opn_sel_done
291 UBYTE get_opn_sel_done( void );
292
293 #ifdef NO_ASCIIZ
294 void nm_get_spn (T_MFW_SP_NAME *spn);
295 #else
296 /* PATCH PMC 000804 */
297 void nm_get_spn (char *);
298 /* END PATCH PMC */
299 #endif
300 void nm_abort_registraion(void);
301
302 // July 14, 2005 REF: CRR 31916 x0021334
303 // Prototype for new common function 'nm_Plus_Percent_COPS()'
304 void nm_Plus_Percent_COPS (S16 last_ind, T_ACI_COPS_OPDESC *operLst);
305 #endif
306