comparison g23m/condat/ms/src/aci/cmh.h @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
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
25 /*==== CONSTANTS ==================================================*/
26 typedef enum
27 {
28 RAT_OK = 0,
29 RAT_CONNECT,
30 RAT_CME,
31 RAT_NO_CARRIER,
32 RAT_CRING,
33 RAT_DR,
34 RAT_CR,
35 RAT_CPIN,
36 RAT_COPS,
37 RAT_CREG,
38 RAT_CCWA,
39 RAT_CLIP,
40 RAT_CDIP,
41 RAT_COLP,
42 RAT_CRING_OFF,
43
44 #ifdef FF_FAX
45 RAT_FCO,
46 RAT_FIS,
47 RAT_FTI,
48 RAT_FCS,
49 RAT_FCI,
50 #endif
51
52 RAT_CMS,
53 RAT_CSMS,
54 RAT_CMGS,
55 RAT_CMSS,
56 RAT_CMGW,
57 RAT_CDS,
58 RAT_CMGC,
59 RAT_CMGD,
60 RAT_CMGR,
61 RAT_CMGL,
62 RAT_CMTI,
63 RAT_CMT,
64 RAT_CBM,
65 RAT_CPMS,
66
67 #ifdef FF_FAX
68 RAT_FHT,
69 RAT_FHR,
70 RAT_FSA,
71 RAT_FPA,
72 RAT_FPW,
73 RAT_FET,
74 RAT_FVO,
75 RAT_FPO,
76 RAT_FPI,
77 RAT_FNF,
78 RAT_FNS,
79 RAT_FNC,
80 RAT_FHS,
81 RAT_FPS,
82 RAT_FTC,
83 #endif
84
85 RAT_ILRR,
86 RAT_BUSY,
87 RAT_NO_ANSWER,
88 RAT_SIMREM,
89 RAT_CLIR,
90 RAT_COLR,
91 RAT_CSSI,
92 RAT_CSSU,
93 RAT_CUSD,
94 RAT_CCFC,
95 RAT_CLCK,
96 RAT_CIMI,
97 RAT_SATI,
98 RAT_SATE,
99 RAT_KSIR,
100 RAT_CPI,
101 RAT_CTYI,
102 RAT_CNUM,
103 RAT_CPOL,
104 RAT_CCCM,
105 RAT_CTV,
106 RAT_SATN,
107 RAT_SATA,
108 RAT_SMS_READY,
109 RAT_PHB_STATUS,
110 RAT_SIMINS,
111 RAT_CRSM,
112 RAT_CSIM,
113 RAT_CCBS,
114 RAT_CCWV,
115 RAT_CNAP,
116 RAT_SIG_SMS,
117 RAT_CLAN,
118 RAT_CLAE,
119 RAT_CSQ,
120 RAT_ALS,
121 RAT_CTZV,
122 RAT_P_CREG,
123
124 #ifdef GPRS
125 RAT_CGACT,
126 RAT_CGDATA,
127 RAT_CGANS,
128 RAT_CGEREP,
129 RAT_CGREG,
130 RAT_QOS_MOD,
131 RAT_SNCNT,
132 RAT_P_CGREG,
133 RAT_P_CGEV,
134 #endif /* GPRS */
135
136 #ifdef FF_EM_MODE
137 RAT_EM,
138 RAT_EMET,
139 RAT_EMETS,
140 #endif /* FF_EM_MODE */
141
142 #ifdef FF_CPHS
143 RAT_CPNUMS,
144 RAT_CPVWI,
145 RAT_CPROAM,
146 #endif /* FF_CPHS */
147
148 RAT_CIEV,
149 RAT_RDL,
150 RAT_RDLB,
151 RAT_CCCN,
152 RAT_CSSN,
153
154 RAT_CSTAT,
155 RAT_Z,
156 RAT_CPRSM,
157 RAT_P_CTZV,
158 RAT_P_CPRI,
159 RAT_P_SIMEF,
160 RAT_P_CNIV,
161 RAT_P_COPS,
162 RAT_P_CMGR,
163 RAT_P_CMGL,
164 RAT_MAX
165
166 } RAT_ID;
167
168 /*==== TYPES ======================================================*/
169 typedef struct entStatus /* entity status */
170 {
171 T_ACI_CMD_SRC entOwn; /* entity owner */
172 T_ACI_AT_CMD curCmd; /* current command processing */
173 } T_ENT_STAT;
174
175 typedef struct mmCmdPrm /* command parameters related to MM */
176 {
177 T_ACI_COPS_FRMT COPSfrmt;
178 T_ACI_NRG_RGMD NRGregMode;
179 T_ACI_NRG_SVMD NRGsrvMode;
180 T_ACI_NRG_FRMT NRGoprFrmt;
181 T_ACI_CSQ_MODE CSQworkStat;
182 T_ACI_CTZR_MODE CTZRMode;
183 T_ACI_CTZU_MODE CTZUMode;
184 T_ACI_PCTZV_MODE PCTZVMode;
185 T_ACI_CNIV_MODE CNIVMode;
186 T_ACI_IND_MODE sIndicationParam;
187 } T_MM_CMD_PRM;
188
189 typedef struct ccCmdPrm /* command parameters related to CC */
190 {
191 T_ACI_CLIR_MOD CLIRmode;
192 T_ACI_DCD_MOD DCDmode;
193 T_ACI_TOA CSTAtoa;
194 BOOL CSTAdef;
195 T_ACI_CHLD_MOD CHLDmode;
196 T_ACI_CCUG_IDX CCUGidx;
197 T_ACI_CCUG_INFO CCUGinfo;
198 T_ACI_CCUG_MOD CCUGmode;
199 USHORT mltyCncFlg;
200 USHORT mltyDscFlg;
201 T_ACI_ALS_MOD ALSmode; /* mode for Alternate Line Service */
202 T_ACI_CTTY_MOD CTTYmode; /* TTY Service notification */
203 T_ACI_CC_CSCN_MOD CSCNcc_mode;
204 } T_CC_CMD_PRM;
205
206 typedef struct simCmdPrm /* command parameters related to SIM */
207 {
208 UBYTE CNUMActRec;
209 UBYTE CNUMOutput;
210 T_ACI_CPOL_FRMT CPOLfrmt;
211 UBYTE CPOLact;
212 UBYTE CPOLidx;
213 UBYTE CPOLidx2;
214 T_ACI_CPOL_MOD CPOLmode;
215 UBYTE CPOLplmn[3];
216 UBYTE CLANact;
217 } T_SIM_CMD_PRM;
218
219 typedef struct ssCmdPrm /* command parameters related to SS */
220 {
221 UBYTE CXXXpwd[MAX_PWD_NUM+1];
222 UBYTE CXXXnewPwd[MAX_PWD_NUM+1];
223 UBYTE CXXXnewPwd2[MAX_PWD_NUM+1];
224 USHORT mltyTrnFlg;
225 T_ACI_SS_CSCN_MOD CSCNss_mode;
226 } T_SS_CMD_PRM;
227
228 typedef struct phbCmdPrm /* command parameters related to PHB */
229 {
230 T_ACI_PB_STOR cmhStor;
231 UBYTE phbStor; /* T_PHB_TYPE */
232 USHORT order_num; /* Next matching entry, 0 if none */
233 SHORT fndRec;
234 UBYTE wrtRec;
235 T_ACI_CSVM_MOD CSVMmode;
236 T_ACI_CLAE_MOD CLAEmode;
237 UBYTE curCmd;
238 UBYTE temp_cmhStor; /* These data types are used to hold */
239 UBYTE temp_phbStor; /* the phone book storage types temprorily, in
240 case of SIM PIN-2 verification. These values
241 are assigned to the actual storage fileds
242 when SIM PIN-2 verification confirmation
243 comes without any ERROR. */
244 } T_PHB_CMD_PRM;
245
246 /* Fax and data related command parameters have been moved to a specific
247 structure in cmh_ra.h */
248 typedef struct cmhCmdPrm /* handler command parameter */
249 {
250 T_MM_CMD_PRM mmCmdPrm;
251 T_CC_CMD_PRM ccCmdPrm;
252 T_SIM_CMD_PRM simCmdPrm;
253 T_SS_CMD_PRM ssCmdPrm;
254 T_PHB_CMD_PRM phbCmdPrm;
255
256 } T_CMH_PRM;
257
258 /*==== PROTOTYPES =================================================*/
259 EXTERN void cmh_Init ( void );
260 EXTERN void cmh_Reset ( T_ACI_CMD_SRC srcId, BOOL atz );
261 EXTERN BOOL cmh_IsVldCmdSrc ( T_ACI_CMD_SRC cmdSrc );
262 EXTERN UBYTE cmh_mergeTOA ( UBYTE ton, UBYTE npi );
263 EXTERN UBYTE cmh_mergeTOS ( UBYTE tos, UBYTE oe );
264 EXTERN void cmh_demergeTOA ( UBYTE toa, UBYTE* ton, UBYTE* npi );
265 EXTERN void cmh_demergeTOS ( UBYTE tosa, UBYTE* tos, UBYTE* oe );
266 EXTERN CHAR* cmh_setToaDef ( CHAR* number, T_ACI_TOA *toa );
267 EXTERN USHORT cmh_packBCD ( UBYTE *bcd_out, const UBYTE *char_in,
268 USHORT len_in);
269 EXTERN USHORT cmh_unpackBCD ( UBYTE *char_out, const UBYTE *bcd_in,
270 USHORT len_in);
271 EXTERN void cmh_unpackSCTS ( T_ACI_VP_ABS *scts,
272 const UBYTE *buf_in );
273 EXTERN void cmh_logRslt ( T_ACI_CMD_SRC dest, RAT_ID rat,
274 T_ACI_AT_CMD cmd, SHORT cId,
275 T_ACI_BS_SPEED spd, T_ACI_CME_ERR err );
276 EXTERN void cmh_cvtToDefGsm ( CHAR* in,
277 CHAR* out,
278 USHORT* len );
279 EXTERN void cmh_cvtFromDefGsm ( CHAR* in,
280 USHORT len,
281 CHAR* out );
282 EXTERN UBYTE cmh_set_delayed_call( UCHAR (*call) (void*), void* arg );
283 EXTERN UBYTE cmh_start_delayed_call ( ULONG ms );
284 EXTERN UBYTE cmh_timeout ( USHORT handle );
285 EXTERN SHORT cmh_bldCalPrms ( char * pDialStr, T_CLPTY_PRM * calPrm );
286 EXTERN UBYTE qAT_CallActive ( void );
287 EXTERN void cmhSMS_disableAccess ( void );
288 EXTERN T_ACI_RETURN cmhSIM_ReadTranspEF ( T_ACI_CMD_SRC srcId,
289 T_ACI_AT_CMD cmd,
290 USHORT datafield,
291 USHORT offset,
292 UBYTE explen,
293 UBYTE * exchData,
294 void (*rplyCB)(SHORT));
295 EXTERN T_ACI_RETURN cmhSIM_WriteTranspEF (T_ACI_CMD_SRC srcId,
296 T_ACI_AT_CMD cmd,
297 USHORT datafield,
298 USHORT offset,
299 UBYTE datalen,
300 UBYTE * exchData,
301 void (*rplyCB)(SHORT));
302 #ifdef GPRS
303 GLOBAL void cp_pdp_primitive(T_SMREG_PDP_ACTIVATE_CNF * pdp_activate_cnf,
304 T_PPP_PDP_ACTIVATE_RES *activate_result);
305 #endif
306 GLOBAL T_ACI_RETURN cmhSIM_WriteRecordEF (T_ACI_CMD_SRC srcId,
307 T_ACI_AT_CMD cmd,
308 USHORT datafield,
309 UBYTE record,
310 UBYTE datalen,
311 UBYTE * exchData,
312 void (*rplyCB)(SHORT));
313 GLOBAL T_ACI_RETURN cmhSIM_ReadRecordEF ( T_ACI_CMD_SRC srcId,
314 T_ACI_AT_CMD cmd,
315 USHORT datafield,
316 UBYTE record,
317 UBYTE explen,
318 UBYTE * exchData,
319 void (*rplyCB)(SHORT));
320 GLOBAL T_ACI_RETURN cmhSMS_ReadParams (T_ACI_CMD_SRC srcId,
321 T_ACI_AT_CMD cmd,
322 SHORT recNr);
323 GLOBAL T_ACI_RETURN cmhSMS_WriteParams (T_ACI_CMD_SRC srcId,
324 T_ACI_AT_CMD cmd,
325 SHORT recNr);
326 GLOBAL T_ACI_RETURN cmhSIM_GetSIMError ( T_ACI_CMD_SRC srcBuf,
327 T_ACI_AT_CMD cmdBuf );
328 GLOBAL T_ACI_RETURN cmhSIM_CheckSimPinStatus ( T_ACI_CMD_SRC srcBuf,
329 T_ACI_AT_CMD cmdBuf );
330 GLOBAL T_ACI_RETURN cmhSIM_Read_AD ( );
331
332 EXTERN void percentCSTAT_indication(T_ACI_ENTITY_ID_MSG entityId,
333 T_ACI_ENTITY_STATE_MSG entityState);
334
335 EXTERN void cmhSMS_ReadCbDtaDwnl ( T_SIM_MMI_INSERT_IND *sim_mmi_insert_ind );
336
337 GLOBAL void cmhSIM_Get_CSP();
338 GLOBAL void cmhSIM_Read_CSP();
339 #ifdef SIM_PERS
340 GLOBAL void cmhSIM_WriteDefaultValue_DCK();
341 #endif
342
343
344 GLOBAL UBYTE cmhSIM_isplmnmodebit_set();
345
346 GLOBAL T_ACI_CMD_MODE aci_rat_cmd_mode(RAT_ID cmd,T_ACI_CMD_SRC src);
347 GLOBAL T_ACI_CMD_MODE aci_cmd_src_mode_get(T_ACI_CMD_SRC src_id);
348 GLOBAL void aci_cmd_src_mode_set(UBYTE src_id,T_ACI_CMD_MODE mode);
349
350 /*==== MACROS =====================================================*/
351
352 EXTERN T_ACI_CMD_MODE _mode;
353 EXTERN UBYTE srcId_cb;
354 EXTERN USHORT used_sources;
355
356 #define IS_SRC_USED(x) ((used_sources >> x) & 0x01)
357 #define IS_SRC_BT(x) ((used_sources >> (x + 8)) & 0x01)
358
359
360 /* we set the src id only when the src id NEQ local. Bec in ASC test we intentionally
361 set the src from TST to LCL for some purpose, but the srcId_cb should remain TST */
362 #define R_AT(cmd,src)\
363 _mode=aci_rat_cmd_mode(cmd,src);\
364 if (src > CMD_SRC_LCL)\
365 srcId_cb=(UBYTE)src;\
366 if (_mode NEQ CMD_MODE_NONE AND RATJmpTbl[cmd][_mode])\
367 RATJmpTbl[cmd][_mode]
368
369
370 #define ACI_ERR_DESC( errCls, errNr )\
371 {aciErrDesc=(((errCls)<<16) | ((errNr)&0xFFFF));}
372
373 /*==== EXPORT =====================================================*/
374 #ifdef CMH_F_C
375
376 GLOBAL T_CMH_PRM cmhPrm[OWN_MAX];
377 GLOBAL T_ACI_ALS_MOD ALSlock = ALS_MOD_NOTPRESENT;
378 GLOBAL T_ACI_ERR_DESC aciErrDesc = -1;
379
380 #else
381
382 EXTERN T_CMH_PRM cmhPrm[OWN_MAX];
383 EXTERN T_ACI_ALS_MOD ALSlock;
384 EXTERN T_ACI_ERR_DESC aciErrDesc;
385
386 EXTERN const T_VOID_FUNC RATJmpTbl[RAT_MAX][CMD_MODE_MAX]; /* SMI/MFW & ATI */
387
388 #endif /* of #ifndef CMH_F_C */
389
390 #endif /* CMH_H */
391
392 /*==== EOF =======================================================*/