comparison src/ui3/mfw/mfw_phb.h @ 420:e8ddbb0837ed

src/ui3: initial import of TCS3/LoCosto BMI & MFW code
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 21 Jan 2018 03:09:00 +0000
parents
children
comparison
equal deleted inserted replaced
419:59143cd42ec7 420:e8ddbb0837ed
1 /*
2 +--------------------------------------------------------------------+
3 | PROJECT: GSM-MFW (8417) $Workfile:: mfw_phb.h $|
4 | $Author:: Vo $Revision:: 1 $|
5 | CREATED: 7.1.99 $Modtime:: 24.03.00 11:47 $|
6 | STATE : code |
7 +--------------------------------------------------------------------+
8
9 PURPOSE : Types defination for phonebook management
10 .
11 */
12
13 #ifndef DEF_MFW_PHB
14 #define DEF_MFW_PHB
15
16 #include "message.h"
17 #include "prim.h"
18 #include "aci_cmh.h"
19 #ifdef FF_2TO1_PS
20 #include "p_8010_127_sim_sap.h" //GW 22/11/01 - Added
21 #else
22 #include "prim.h"
23 #endif
24 #include "phb.h" //GW 22/11/01 - Added
25 #ifdef NEPTUNE_BOARD
26 #include "Ffs.h"
27 #endif
28 /*
29 * events are organised as bitmaps
30 */
31 #define E_PHB_STATUS 0x0001
32 #define E_PHB_ERROR 0x0002
33 #define E_PHB_UPN_LIST 0x0004
34 #define E_PHB_READY 0x0008
35 #define E_PHB_BUSY 0x0010
36
37 #define PHB_MAX_DIGITS 2
38 #define PHB_MAX_ENTRY_NUM 5
39
40 /* SPR#1112 - Internal phonebook */
41 #ifdef INT_PHONEBOOK
42 #define DEFAULT_PB 0
43 #endif
44
45 #ifdef TI_PS_FFS_PHB
46 //#define PHB_MAX_LEN MAX_PHB_NUM_LEN /* Phonebook number length + '\0' */
47 #define PHB_MAX_LEN (44+1) /* Phonebook number length + '\0' */
48 #else
49 //GW-SPR#762 For 44 digit phonebook, see aci_cmh.h
50 #ifdef PHONEBOOK_EXTENSION
51 #define PHB_MAX_LEN (44+1) /* Phonebook number length + '\0' */
52 #else
53 #define PHB_MAX_LEN (20+1) /* Phonebook number length + '\0' */
54 #endif /* else, #ifdef PHONEBOOK_EXTENSION */
55 #endif /* else, #ifdef TI_PS_FFS_PHB */
56
57 #define MAX_UPN_NUM 6
58
59 #define PHB_UNRESTRICTED 0
60 #define PHB_RESTRICTED 1
61 #define PHB_LOADING 2
62 #define PHB_NOT_ALLOCATED 3
63
64 #define PHB_AUTO_OFF 0
65 #define PHB_AUTO_ON 1
66
67
68 /* global constants */
69
70 typedef enum /* phonebook type */
71 {
72 PHB_ECC = 0, /* Emergency call numbers */
73 PHB_ADN, /* Abbreviated dialing number */
74 PHB_FDN, /* Fixed dialing number */
75 PHB_BDN, /* Barred dialing number */
76 PHB_LDN, /* Last dialing number */
77 PHB_LRN, /* Last received number */
78 PHB_SDN, /* Service dialing number */
79 PHB_LMN,
80 PHB_ADN_FDN,
81 PHB_UPN,
82 #ifdef INT_PHONEBOOK /* SPR#1112 - Internal phonebook */
83 PHB_IPB,
84 #endif
85 PHB_NONE,
86 MAX_PHB_TYPE
87 } T_MFW_PHB_TYPE;
88
89 typedef enum /* type of number */
90 {
91 MFW_TON_UNKNOWN,
92 MFW_TON_INTERNATIONAL,
93 MFW_TON_NATIONAL,
94 MFW_TON_NET_SPECIFIC,
95 MFW_TON_DED_ACCESS,
96 MFW_TON_ALPHA_NUMERIC,
97 MFW_TON_ABBREVIATED,
98 MFW_TON_EXTENDED
99 } T_MFW_PHB_TON;
100
101 typedef enum /* numbering plan identifier */
102 {
103 MFW_NPI_UNKNOWN,
104 MFW_NPI_ISDN = 1,
105 MFW_NPI_DATA = 3,
106 MFW_NPI_TELEX = 4,
107 MFW_NPI_NATIONAL = 8,
108 MFW_NPI_PRIVATE = 9,
109 MFW_NPI_M_ERMES = 10,
110 MFW_NPI_M_CTS = 11
111 } T_MFW_PHB_NPI;
112
113 typedef enum /* service related to the phone number */
114 {
115 SERVICE_UNKNOWN,
116 SERVICE_ASYNCH, /* asynchronous modem */
117 SERVICE_SYNCH, /* synchronous modem */
118 SERVICE_PAD_ASYNCH, /* PAD access (asynchronous) */
119 SERVICE_PACKET_SYNCH, /* packet access (synchronous) */
120 SERVICE_VOICE, /* voice */
121 SERVICE_FAX /* fax */
122 } T_MFW_PHB_SERVICE;
123
124 typedef enum /* Result of operation */
125 {
126 MFW_NO_ENTRY,
127 MFW_ENTRY_EXIST
128 } T_MFW_PHB_RESULT;
129
130
131 typedef enum /* Return values */
132 {
133 MFW_PHB_OK, /* success */
134 MFW_PHB_FULL, /* phonebook is full */
135 MFW_PHB_PIN2_REQ,
136 MFW_PHB_PUK2_REQ,
137 MFW_PHB_FAIL ,
138 //x0061560 Date May16,07 (sateeshg) OMAPS00133241
139 MFW_PHB_EXCT
140 } T_MFW_PHB_RETURN;
141
142 typedef enum /* mode of sorted phonebook */
143 {
144 MFW_PHB_ALPHA,
145 MFW_PHB_NUMBER,
146 MFW_PHB_PHYSICAL,
147 MFW_PHB_INDEX
148 } T_MFW_PHB_MODE;
149
150 /* Structures */
151 typedef struct /* Character */
152 {
153 UBYTE dcs;
154 UBYTE len; /* length of string data */
155 UBYTE data[PHB_MAX_LEN]; /* string data */
156 UBYTE dummy;
157 } T_MFW_PHB_TEXT;
158
159 typedef struct
160 {
161 UBYTE year [PHB_MAX_DIGITS];
162 UBYTE month [PHB_MAX_DIGITS];
163 UBYTE day [PHB_MAX_DIGITS];
164 UBYTE dummy1;
165 UBYTE dummy2;
166 } T_MFW_PHB_DATE;
167
168 typedef struct
169 {
170 UBYTE hour [PHB_MAX_DIGITS];
171 UBYTE minute [PHB_MAX_DIGITS];
172 UBYTE second [PHB_MAX_DIGITS];
173 UBYTE dummy1;
174 UBYTE dummy2;
175 } T_MFW_PHB_TIME;
176
177
178 typedef struct /* Phonebook entry */
179 {
180 UBYTE book; /* phonebook */
181 UBYTE dummy1;
182 UBYTE dummy2;
183 UBYTE dummy3;
184 #ifdef NO_ASCIIZ
185 T_MFW_PHB_TEXT name; /* length of name */
186 #else
187 UBYTE name[/*PHB_MAX_LEN*/MAX_ALPHA_LEN]; /* alpha identifier */
188 #endif
189 UBYTE number[PHB_MAX_LEN+1]; /* telephone number, +1 for '+' in intl. numbers */
190 SHORT index; /* index in phonebook table */
191 UBYTE ton; /* type of number */
192 UBYTE npi; /* numbering plan identifier */
193 T_MFW_PHB_DATE date; /* date of entry */
194 T_MFW_PHB_TIME time; /* time of entry */
195 UBYTE line;
196 } T_MFW_PHB_ENTRY;
197
198
199 typedef struct /* phonebook read operation */
200 {
201 UBYTE result; /* result of operation */
202 UBYTE book; /* phonebook */
203 SHORT num_entries; /* number of phonebook entries */
204 T_MFW_PHB_ENTRY *entry; /* phonebook entries */
205 } T_MFW_PHB_LIST;
206
207
208 typedef struct /* phonebook status indication */
209 {
210 UBYTE book; /* phonebook */
211 SHORT max_entries; /* max entries in the phonebook */
212 UBYTE tag_len; /*length of alpha identifier */
213 SHORT used_entries; /* used entries in the phonebook */
214 SHORT avail_entries;
215 } T_MFW_PHB_STATUS;
216
217 typedef struct /* MSISDN number */
218 {
219 #ifdef NO_ASCIIZ
220 T_MFW_PHB_TEXT name; /* length of name */
221 #else
222 UBYTE name[/*PHB_MAX_LEN*/MAX_ALPHA_LEN/*MC, SPR1257*/]; /* alpha identifier */
223 #endif
224 UBYTE number[PHB_MAX_LEN+1]; /* telephone number, +1 for '+' in intl. numbers */
225 T_MFW_PHB_SERVICE service; /* service related to phone number */
226 T_MFW_PHB_TON ton; /* type of number */
227 T_MFW_PHB_NPI npi; /* numbering plan identifier */
228 } T_MFW_UPN;
229
230 typedef struct
231 {
232 UBYTE count;
233 T_MFW_UPN upn[MAX_UPN_NUM];
234 } T_MFW_UPN_LIST;
235
236
237 /* PHB Parameter */
238
239 typedef union
240 {
241 T_MFW_PHB_STATUS phb_status;
242 T_MFW_UPN_LIST upn_list;
243 } T_MFW_PHB_PARA;
244
245 EXTERN void phb_init (void);
246 EXTERN void phb_exit (void);
247 EXTERN T_MFW_HND phb_create (T_MFW_HND hWin,
248 T_MFW_EVENT event,
249 T_MFW_CB cbfunc);
250 EXTERN T_MFW_RES phb_delete (T_MFW_HND h);
251 EXTERN T_MFW phb_read_entries (UBYTE book,
252 UBYTE index,
253 UBYTE mode,
254 UBYTE num_entries,
255 T_MFW_PHB_LIST *entries);
256 #ifdef NO_ASCIIZ
257 EXTERN T_MFW phb_find_entries (UBYTE book,
258 SHORT *index,
259 UBYTE mode,
260 SHORT num_entries,
261 T_MFW_PHB_TEXT *search_pattern,
262 T_MFW_PHB_LIST *entries);
263 #else
264 EXTERN T_MFW phb_find_entries (UBYTE book,
265 SHORT *index,
266 UBYTE mode,
267 SHORT num_entries,
268 CHAR *search_pattern,
269 T_MFW_PHB_LIST *entries);
270 #endif
271 EXTERN T_MFW phb_store_entry (UBYTE book,
272 T_MFW_PHB_ENTRY *entry,
273 T_MFW_PHB_STATUS *status);
274 EXTERN T_MFW phb_delete_entry (UBYTE book, UBYTE index,
275 T_MFW_PHB_STATUS *status);
276 EXTERN T_MFW phb_delete_book (UBYTE book);
277 EXTERN T_MFW phb_set_mode (UBYTE book, UBYTE *passed);
278 EXTERN T_MFW phb_check_number (UBYTE *number);
279 EXTERN T_MFW phb_get_status (T_MFW_PHB_STATUS *status);
280 EXTERN T_MFW phb_set_auto_off (UBYTE mode);
281 EXTERN T_MFW phb_get_auto_off (UBYTE *mode);
282 EXTERN T_MFW_PHB_RETURN phb_switch_entry (T_MFW_PHB_ENTRY *entry, UBYTE *passwd);
283 EXTERN void phb_get_upn (void);
284 EXTERN T_MFW phb_save_upn (T_MFW_UPN *upn);
285 EXTERN void phb_Alpha2Gsm(T_ACI_PB_TEXT *text, UBYTE *alpha);
286 EXTERN void phb_Gsm2Alpha(UBYTE *alpha, T_ACI_PB_TEXT *text);
287 EXTERN int phb_get_mode (void);
288 EXTERN int numbersMatch(char * num1, char* num2);
289
290 /* Added to remove warning Aug - 11 */
291 #ifdef NEPTUNE_BOARD
292 EXTERN UBYTE dspl_Enable (UBYTE in_Enable);
293 #ifdef PCM_2_FFS
294 EXTERN T_FFS_SIZE ffs_ReadRecord(const char *name, void * addr, int size, int index, int recsize);
295 #endif /* PCM_2_FFS */
296 #endif /* NEPTUNE_BOARD */
297 /* End - remove warning Aug - 11 */
298
299 #endif
300