comparison src/g23m-aci/aci/cmh.h @ 162:53929b40109c

src/g23m-aci: initial import from TCS3.2/LoCosto
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 11 Oct 2016 02:02:43 +0000
parents
children
comparison
equal deleted inserted replaced
161:4557e2a9c18e 162:53929b40109c
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-F&D (8411)
4 | Modul : CMH
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : Definitions for the AT Command Handler
18 +-----------------------------------------------------------------------------
19 */
20
21 #ifndef CMH_H
22 #define CMH_H
23
24 /*==== CONSTANTS ==================================================*/
25 typedef enum
26 {
27 RAT_OK = 0,
28 RAT_CONNECT,
29 RAT_CME,
30 RAT_NO_CARRIER,
31 RAT_CRING,
32 RAT_DR,
33 RAT_CR,
34 RAT_CPIN,
35 RAT_COPS,
36 RAT_CREG,
37 RAT_CCWA,
38 RAT_CLIP,
39 RAT_CDIP,
40 RAT_COLP,
41 RAT_CRING_OFF,
42
43 #ifdef FF_FAX
44 RAT_FCO,
45 RAT_FIS,
46 RAT_FTI,
47 RAT_FCS,
48 RAT_FCI,
49 #endif
50
51 RAT_CMS,
52 RAT_CSMS,
53 RAT_CMGS,
54 RAT_CMSS,
55 RAT_CMGW,
56 RAT_CDS,
57 RAT_CMGC,
58 RAT_CMGD,
59 RAT_CMGR,
60 RAT_CMGL,
61 RAT_CMTI,
62 RAT_CMT,
63 RAT_CBM,
64 RAT_CPMS,
65
66 #ifdef FF_FAX
67 RAT_FHT,
68 RAT_FHR,
69 RAT_FSA,
70 RAT_FPA,
71 RAT_FPW,
72 RAT_FET,
73 RAT_FVO,
74 RAT_FPO,
75 RAT_FPI,
76 RAT_FNF,
77 RAT_FNS,
78 RAT_FNC,
79 RAT_FHS,
80 RAT_FPS,
81 RAT_FTC,
82 #endif
83
84 RAT_ILRR,
85 RAT_BUSY,
86 RAT_NO_ANSWER,
87 RAT_SIMREM,
88 RAT_CLIR,
89 RAT_COLR,
90 RAT_CSSI,
91 RAT_CSSU,
92 RAT_CUSD,
93 RAT_CCFC,
94 RAT_CLCK,
95 RAT_CIMI,
96 RAT_SATI,
97 RAT_SATE,
98 RAT_KSIR,
99 RAT_CPI,
100 RAT_CTYI,
101 RAT_CNUM,
102 RAT_CPOL,
103 RAT_CCCM,
104 RAT_CTV,
105 RAT_SATN,
106 RAT_SATA,
107 RAT_SMS_READY,
108 RAT_PHB_STATUS,
109 RAT_SIMINS,
110 RAT_CRSM,
111 RAT_CSIM,
112 RAT_CCBS,
113 RAT_CCWV,
114 RAT_CNAP,
115 RAT_SIG_SMS,
116 RAT_CLAN,
117 RAT_CLAE,
118 RAT_CSQ,
119 RAT_ALS,
120 RAT_CTZV,
121 RAT_P_CREG,
122 #ifdef REL99
123 RAT_P_CMGRS,
124 #endif /* REL99 */
125 #ifdef GPRS
126 RAT_CGACT,
127 RAT_CGDATA,
128 RAT_CGANS,
129 RAT_CGEREP,
130 RAT_CGREG,
131 RAT_QOS_MOD,
132 RAT_SNCNT,
133 RAT_P_CGREG,
134 #ifdef REL99
135 RAT_CGCMOD,
136 #endif
137 RAT_P_CGEV,
138 #endif /* GPRS */
139
140 #ifdef FF_EM_MODE
141 RAT_EM,
142 RAT_EMET,
143 RAT_EMETS,
144 #endif /* FF_EM_MODE */
145
146 #ifdef FF_CPHS
147 RAT_CPNUMS,
148 RAT_CPVWI,
149 RAT_CPROAM,
150 #endif /* FF_CPHS */
151
152 RAT_CIEV,
153 RAT_RDL,
154 #ifdef TI_PS_FF_AT_P_CMD_RDLB
155 RAT_RDLB,
156 #endif /* TI_PS_FF_AT_P_CMD_RDLB */
157 RAT_CCCN,
158 RAT_CSSN,
159
160 RAT_CSTAT,
161 RAT_Z,
162 #ifdef TI_PS_FF_AT_P_CMD_CPRSM
163 RAT_CPRSM,
164 #endif /*TI_PS_FF_AT_P_CMD_CPRSM*/
165 RAT_P_CTZV,
166 RAT_P_CPRI,
167 RAT_P_SIMEF,
168 RAT_P_CNIV,
169 RAT_P_COPS,
170 RAT_P_CMGR,
171 RAT_P_CMGL,
172 #ifdef FF_CPHS_REL4
173 RAT_P_CFIS,
174 RAT_P_MWIS,
175 RAT_P_MWI,
176 RAT_P_MBI,
177 RAT_P_MBDN,
178 #endif /* FF_CPHS_REL4 */
179 RAT_MAX
180
181 } RAT_ID;
182
183 /*==== TYPES ======================================================*/
184 typedef struct entStatus /* entity status */
185 {
186 T_ACI_CMD_SRC entOwn; /* entity owner */
187 T_ACI_AT_CMD curCmd; /* current command processing */
188 } T_ENT_STAT;
189
190 typedef struct mmCmdPrm /* command parameters related to MM */
191 {
192 T_ACI_COPS_FRMT COPSfrmt;
193 T_ACI_NRG_RGMD NRGregMode;
194 T_ACI_NRG_SVMD NRGsrvMode;
195 T_ACI_NRG_FRMT NRGoprFrmt;
196 T_ACI_CSQ_MODE CSQworkStat;
197 T_ACI_CTZR_MODE CTZRMode;
198 T_ACI_CTZU_MODE CTZUMode;
199 T_ACI_PCTZV_MODE PCTZVMode;
200 T_ACI_CNIV_MODE CNIVMode;
201 T_ACI_IND_MODE sIndicationParam;
202 } T_MM_CMD_PRM;
203
204 typedef struct ccCmdPrm /* command parameters related to CC */
205 {
206 T_ACI_CLIR_MOD CLIRmode;
207 T_ACI_DCD_MOD DCDmode;
208 T_ACI_TOA CSTAtoa;
209 BOOL CSTAdef;
210 T_ACI_CHLD_MOD CHLDmode;
211 T_ACI_CCUG_IDX CCUGidx;
212 T_ACI_CCUG_INFO CCUGinfo;
213 T_ACI_CCUG_MOD CCUGmode;
214 USHORT mltyCncFlg;
215 USHORT mltyDscFlg;
216 T_ACI_ALS_MOD ALSmode; /* mode for Alternate Line Service */
217 T_ACI_CTTY_MOD CTTYmode; /* TTY Service notification */
218 T_ACI_CC_CSCN_MOD CSCNcc_mode;
219 } T_CC_CMD_PRM;
220
221 typedef struct simCmdPrm /* command parameters related to SIM */
222 {
223 UBYTE CNUMActRec;
224 UBYTE CNUMOutput;
225 T_ACI_CPOL_FRMT CPOLfrmt;
226 UBYTE CPOLact;
227 UBYTE CPOLidx;
228 UBYTE CPOLidx2;
229 T_ACI_CPOL_MOD CPOLmode;
230 UBYTE CPOLplmn[3];
231 UBYTE CLANact;
232 } T_SIM_CMD_PRM;
233
234 typedef struct ssCmdPrm /* command parameters related to SS */
235 {
236 UBYTE CXXXpwd[MAX_PWD_NUM+1];
237 UBYTE CXXXnewPwd[MAX_PWD_NUM+1];
238 UBYTE CXXXnewPwd2[MAX_PWD_NUM+1];
239 USHORT mltyTrnFlg;
240 T_ACI_SS_CSCN_MOD CSCNss_mode;
241 } T_SS_CMD_PRM;
242
243 typedef struct phbCmdPrm /* command parameters related to PHB */
244 {
245 T_ACI_PB_STOR cmhStor;
246 UBYTE phbStor; /* T_PHB_TYPE */
247 USHORT order_num; /* Next matching entry, 0 if none */
248 SHORT fndRec;
249 UBYTE wrtRec;
250 T_ACI_CSVM_MOD CSVMmode;
251 T_ACI_CLAE_MOD CLAEmode;
252 UBYTE curCmd;
253 UBYTE temp_cmhStor; /* These data types are used to hold */
254 UBYTE temp_phbStor; /* the phone book storage types temprorily, in
255 case of SIM PIN-2 verification. These values
256 are assigned to the actual storage fileds
257 when SIM PIN-2 verification confirmation
258 comes without any ERROR. */
259 } T_PHB_CMD_PRM;
260
261 /* Fax and data related command parameters have been moved to a specific
262 structure in cmh_ra.h */
263 typedef struct cmhCmdPrm /* handler command parameter */
264 {
265 T_MM_CMD_PRM mmCmdPrm;
266 T_CC_CMD_PRM ccCmdPrm;
267 T_SIM_CMD_PRM simCmdPrm;
268 T_SS_CMD_PRM ssCmdPrm;
269 T_PHB_CMD_PRM phbCmdPrm;
270
271 } T_CMH_PRM;
272
273 /*==== PROTOTYPES =================================================*/
274 EXTERN void cmh_Init ( void );
275 EXTERN void cmh_Reset ( T_ACI_CMD_SRC srcId, BOOL atz );
276 EXTERN BOOL cmh_IsVldCmdSrc ( T_ACI_CMD_SRC cmdSrc );
277 EXTERN UBYTE cmh_mergeTOA ( UBYTE ton, UBYTE npi );
278 EXTERN UBYTE cmh_mergeTOS ( UBYTE tos, UBYTE oe );
279 EXTERN void cmh_demergeTOA ( UBYTE toa, UBYTE* ton, UBYTE* npi );
280 EXTERN void cmh_demergeTOS ( UBYTE tosa, UBYTE* tos, UBYTE* oe );
281 EXTERN CHAR* cmh_setToaDef ( CHAR* number, T_ACI_TOA *toa );
282 EXTERN USHORT cmh_packBCD ( UBYTE *bcd_out, const UBYTE *char_in,
283 USHORT len_in);
284 EXTERN USHORT cmh_unpackBCD ( UBYTE *char_out, const UBYTE *bcd_in,
285 USHORT len_in);
286 EXTERN void cmh_unpackSCTS ( T_ACI_VP_ABS *scts,
287 const UBYTE *buf_in );
288 EXTERN void cmh_logRslt ( T_ACI_CMD_SRC dest, RAT_ID rat,
289 T_ACI_AT_CMD cmd, SHORT cId,
290 T_ACI_BS_SPEED spd, T_ACI_CME_ERR err );
291 EXTERN void cmh_cvtToDefGsm ( CHAR* in,
292 CHAR* out,
293 USHORT* len );
294 EXTERN void cmh_cvtFromDefGsm ( CHAR* in,
295 USHORT len,
296 CHAR* out );
297 EXTERN UBYTE cmh_set_delayed_call( UCHAR (*call) (void*), void* arg );
298 EXTERN UBYTE cmh_start_delayed_call ( ULONG ms );
299 EXTERN UBYTE cmh_timeout ( USHORT handle );
300 EXTERN SHORT cmh_bldCalPrms ( char * pDialStr, T_CLPTY_PRM * calPrm );
301 EXTERN UBYTE qAT_CallActive ( void );
302 EXTERN void cmhSMS_disableAccess ( void );
303 EXTERN T_ACI_RETURN cmhSIM_ReadTranspEF ( T_ACI_CMD_SRC srcId,
304 T_ACI_AT_CMD cmd,
305 BOOL v_path_info,
306 T_path_info *path_info_ptr,
307 USHORT datafield,
308 USHORT offset,
309 UBYTE explen,
310 UBYTE * exchData,
311 void (*rplyCB)(SHORT));
312 EXTERN T_ACI_RETURN cmhSIM_WriteTranspEF (T_ACI_CMD_SRC srcId,
313 T_ACI_AT_CMD cmd,
314 BOOL v_path_info,
315 T_path_info *path_info_ptr,
316 USHORT datafield,
317 USHORT offset,
318 UBYTE datalen,
319 UBYTE * exchData,
320 void (*rplyCB)(SHORT));
321 #ifdef GPRS
322 GLOBAL void cp_pdp_primitive(T_SMREG_PDP_ACTIVATE_CNF * pdp_activate_cnf,
323 T_PPP_PDP_ACTIVATE_RES *activate_result);
324 #endif
325 GLOBAL T_ACI_RETURN cmhSIM_WriteRecordEF (T_ACI_CMD_SRC srcId,
326 T_ACI_AT_CMD cmd,
327 BOOL v_path_info,
328 T_path_info *path_info_ptr,
329 USHORT datafield,
330 UBYTE record,
331 UBYTE datalen,
332 UBYTE * exchData,
333 void (*rplyCB)(SHORT));
334 GLOBAL T_ACI_RETURN cmhSIM_ReadRecordEF ( T_ACI_CMD_SRC srcId,
335 T_ACI_AT_CMD cmd,
336 BOOL v_path_info,
337 T_path_info *path_info_ptr,
338 USHORT datafield,
339 UBYTE record,
340 UBYTE explen,
341 UBYTE * exchData,
342 void (*rplyCB)(SHORT));
343 GLOBAL T_ACI_RETURN cmhSMS_ReadParams (T_ACI_CMD_SRC srcId,
344 T_ACI_AT_CMD cmd,
345 SHORT recNr);
346 GLOBAL T_ACI_RETURN cmhSMS_WriteParams (T_ACI_CMD_SRC srcId,
347 T_ACI_AT_CMD cmd,
348 SHORT recNr);
349 GLOBAL T_ACI_RETURN cmhSIM_GetSIMError ( T_ACI_CMD_SRC srcBuf,
350 T_ACI_AT_CMD cmdBuf );
351 GLOBAL T_ACI_RETURN cmhSIM_CheckSimPinStatus ( T_ACI_CMD_SRC srcBuf,
352 T_ACI_AT_CMD cmdBuf );
353 GLOBAL BOOL cmhSIM_CheckSimStatus();
354 GLOBAL T_ACI_RETURN cmhSIM_Read_AD ( );
355
356 EXTERN void percentCSTAT_indication(T_ACI_ENTITY_ID_MSG entityId,
357 T_ACI_ENTITY_STATE_MSG entityState);
358
359 EXTERN void cmhSMS_ReadCbDtaDwnl ( T_SIM_MMI_INSERT_IND *sim_mmi_insert_ind );
360
361 GLOBAL void cmhSIM_Get_CSP();
362 GLOBAL void cmhSIM_Read_CSP();
363 #ifdef SIM_PERS
364 GLOBAL void cmhSIM_WriteDefaultValue_DCK();
365 #endif
366
367 /* Implements Measure#32: Row 118, 119, 980, 986, 987, 1036 & 1037 */
368 EXTERN void cmhMM_mcc_mnc_print( CHAR *oper,
369 SHORT mcc,
370 SHORT mnc);
371 EXTERN void cmhSMS_sdu_buf_print ( U8 *buf,
372 USHORT offset );
373
374 GLOBAL UBYTE cmhSIM_isplmnmodebit_set();
375
376 EXTERN BOOL aci_get_cb_cmd (RAT_ID cmd, T_ACI_CMD_SRC src);
377
378 GLOBAL T_ACI_CMD_MODE aci_cmd_src_mode_get(T_ACI_CMD_SRC src_id);
379 GLOBAL void aci_cmd_src_mode_set(UBYTE src_id,T_ACI_CMD_MODE mode);
380
381 /*==== MACROS =====================================================*/
382
383 EXTERN T_VOID_FUNC rat_fptr; /* new global function pointer */
384 EXTERN UBYTE srcId_cb;
385 EXTERN USHORT used_sources;
386
387 #define IS_SRC_USED(x) ((used_sources >> x) & 0x01)
388 #define IS_SRC_BT(x) ((used_sources >> (x + 8)) & 0x01)
389
390
391 /* we set the src id only when the src id NEQ local. Bec in ASC test we intentionally
392 set the src from TST to LCL for some purpose, but the srcId_cb should remain TST */
393
394 /* new macro, calling function. function is defined in cmh_f.c, prototype above */
395 #define R_AT(cmd,src)\
396 if (aci_get_cb_cmd (cmd, src)) \
397 (*rat_fptr)
398
399 #define ACI_ERR_DESC( errCls, errNr )\
400 {aciErrDesc=(((errCls)<<16) | ((errNr)&0xFFFF));}
401
402 /*==== EXPORT =====================================================*/
403 #ifdef CMH_F_C
404
405 GLOBAL T_CMH_PRM cmhPrm[OWN_SRC_MAX];
406 GLOBAL T_ACI_ALS_MOD ALSlock = ALS_MOD_NOTPRESENT;
407 GLOBAL T_ACI_ERR_DESC aciErrDesc = (ULONG)-1;
408
409 #else
410
411 EXTERN T_CMH_PRM cmhPrm[OWN_SRC_MAX];
412 EXTERN T_ACI_ALS_MOD ALSlock;
413 EXTERN T_ACI_ERR_DESC aciErrDesc;
414
415 EXTERN const T_VOID_FUNC RATJmpTbl[RAT_MAX][CMD_MODE_MAX]; /* SMI/MFW & ATI */
416
417 #endif /* of #ifndef CMH_F_C */
418
419 /* Implements Measure 25 */
420 EXTERN UBYTE cmh_getAlphabetCb ( UBYTE dcs );
421
422 /* Implements Measure#32: Row 105, 1115 & 1151 */
423 EXTERN const char * const ffff_str;
424 /* Implements Measure#32: Row 110 & 981 */
425 EXTERN const char * const ef_plmn_id;
426 /* Implements Measure#32: Row 971, 976, 1023 & 1072 */
427 EXTERN const char * const ef_clng_id;
428 /* Implements Measure#32: Row 60 & 1039 */
429 EXTERN const char * const ef_mssup_id;
430 /* Implements Measure#32: Row 119, 980, 987, 1037 */
431 EXTERN const char * const format_03x02x_str;
432 /* Implements Measure#32: Row 118, 986, 1036 */
433 EXTERN const char * const format_03x03x_str;
434 /* Implements Measure#32: Row 969, 1027, 1239 & 1240 */
435 EXTERN const char * const num_112_str;
436 EXTERN const char * const num_911_str;
437 /* Implements Measure#32: Row 972, 1024 & 1041 */
438 EXTERN char * const au_str;
439 /* Implements Measure#32: Row 1245, 1277 & 1312 */
440 EXTERN const char * const format_2X_str;
441 /* Implements Measure#32: Row 73, 74, 103, 114 & 1071 */
442 EXTERN const char * const gsm_com_path;
443 EXTERN const char * const gsm_com_redialmode_path;
444 EXTERN const char * const gsm_com_alslock_path;
445 EXTERN const char * const gsm_com_rfcap_path;
446
447 #endif /* CMH_H */
448
449 /*==== EOF =======================================================*/