comparison g23m-aci/aci/psa_smsf.c @ 0:75a11d740a02

initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 09 Jun 2016 00:02:41 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:75a11d740a02
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS (6147)
4 | Modul : PSA_SMSF
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 : This module defines the functions for the protocol
18 | stack adapter for the registration part of mobility
19 | management.
20 +-----------------------------------------------------------------------------
21 */
22
23 #ifndef PSA_SMSF_C
24 #define PSA_SMSF_C
25 #endif
26
27 #include "config.h"
28 #include "fixedconf.h"
29 #include "condat-features.h"
30 #include "aci_conf.h"
31
32 #include "aci_all.h"
33
34 #undef TRACING
35
36 /*==== INCLUDES ===================================================*/
37 #include "aci_cmh.h"
38 #include "ati_cmd.h"
39 #include "aci_cmd.h"
40
41 #ifdef FAX_AND_DATA
42 #include "aci_fd.h"
43 #endif /* of #ifdef FAX_AND_DATA */
44
45 #include "aci.h"
46 #include "aci_lst.h"
47 #include "aci_mem.h"
48 #include "psa.h"
49 #ifdef SIM_TOOLKIT
50 #include "psa_cc.h"
51 #include "psa_sat.h"
52 #endif
53 #include "psa_sms.h"
54 #include "psa_util.h"
55 #include "cmh.h"
56 #include "cmh_sms.h"
57 #include "psa_sim.h"
58
59 #if (defined (MFW) AND !defined (FF_MMI_RIV)) OR defined (_CONC_TESTING_)
60 #include "conc_sms.h"
61 #endif
62
63 /*==== CONSTANTS ==================================================*/
64 #define ITM_WDT (14) /* item width in chars */
65 #define HDR_WDT (10) /* header width in chars */
66
67 /*==== TYPES ======================================================*/
68
69 /*==== EXPORT =====================================================*/
70
71 /*==== VARIABLES ==================================================*/
72 GLOBAL T_ACI_LIST *set_prm_list = NULL;
73 /*==== FUNCTIONS ==================================================*/
74
75 #ifdef SIM_TOOLKIT
76 EXTERN BOOL cmhSMS_FileUpdate (int, T_SIM_FILE_UPDATE_IND *);
77 #endif
78
79 /*
80 +-------------------------------------------------------------------+
81 | PROJECT : GSM-PS (6147) MODULE : PSA_SMSF |
82 | ROUTINE : psaSMS_Init |
83 +-------------------------------------------------------------------+
84
85 PURPOSE : initialize the protocol stack adapter for SMS.
86
87 */
88
89 /* MACRO: initializer for set parameter */
90 #define INIT_SET_PARM( dest, def )\
91 {smsShrdPrm.pSetPrm[0]->dest = def;}
92
93
94
95
96
97 GLOBAL void psaSMS_InitParams ( void )
98 {
99 INIT_SET_PARM( sca.ton, SMS_TON_UNKNOWN );
100 INIT_SET_PARM( sca.npi, SMS_NPI_UNKNOWN );
101 INIT_SET_PARM( sca.c_num, 0 );
102 INIT_SET_PARM( vpRel, TP_VP_RELATIVE_DEFAULT );
103 INIT_SET_PARM( pid, SMS_PID_DEFAULT );
104 INIT_SET_PARM( dcs, SMS_DCS_GRP_DEF );
105 INIT_SET_PARM( msgType, (TP_MTI_SMS_SUBMIT + TP_VPF_RELATIVE));
106
107 smsShrdPrm.cbmPrm.cbmFoundIds = 0;
108 memset(smsShrdPrm.cbmPrm.msgId, DEF_MID_RANGE, sizeof(smsShrdPrm.cbmPrm.msgId));
109 }
110 GLOBAL void psaSMS_Init ( void )
111 {
112 int LpCnt; /* holds loop counter for macro */
113 T_SMS_SET_PRM * elem;
114
115 /*
116 *-------------------------------------------------------------------
117 * set default parms
118 *-------------------------------------------------------------------
119 */
120 smsShrdPrm.smsStat = SMS_STATE_NOT_AVAILABLE;
121 smsShrdPrm.accessEnabled = FALSE;
122 smsShrdPrm.aci_sms_parameter.simTotal = 0;
123 smsShrdPrm.aci_sms_parameter.simUsed = 0;
124 smsShrdPrm.aci_sms_parameter.meTotal = 0;
125 smsShrdPrm.aci_sms_parameter.meUsed = 0;
126 smsShrdPrm.owner = (T_OWN)CMD_SRC_NONE;
127 smsShrdPrm.cbmPrm.cbchOwner = (T_OWN)CMD_SRC_NONE;
128 smsShrdPrm.rslt = 0x200/*CS_OK*/;
129
130 smsShrdPrm.aci_sms_parameter.snd_msg_ref = 0;
131
132 smsShrdPrm.aci_sms_parameter.smsParamRecLen = 0;
133 smsShrdPrm.aci_sms_parameter.smsParamMaxRec = 0;
134 smsShrdPrm.mtHndl = MT0;
135 smsShrdPrm.srHndl = DS0;
136 smsShrdPrm.cbmPrm.cbmHndl = BM0;
137 smsShrdPrm.cbmPrm.cbmMode = CBCH_ACCEPT;
138 smsShrdPrm.cbmPrm.cbmFoundIds = 0;
139 smsShrdPrm.cbmPrm.cbmSIMmaxId = 0;
140 smsShrdPrm.cbmPrm.cbmSIMmaxIdRge = 0;
141
142 smsShrdPrm.tpdu.tp_submit = NULL;
143 smsShrdPrm.tpdu.tp_deliver = NULL;
144 smsShrdPrm.tpdu.tp_command = NULL;
145
146 #ifdef FF_HOMEZONE
147 smsShrdPrm.cbmPrm.hzMode = CBHZ_MOD_NotActive;
148 smsShrdPrm.cbmPrm.hzDcs = CS_GsmDef;
149 smsShrdPrm.cbmPrm.hzTimeout = CBHZ_DEF_TIMEOUT;
150 #endif /* FF_HOMEZONE */
151
152 smsShrdPrm.mem1 = MEM_SM;
153 smsShrdPrm.mem2 = MEM_SM;
154 smsShrdPrm.mem3 = MEM_SM;
155 smsShrdPrm.status = CMGD_DEL_INDEX;
156 smsShrdPrm.cnma_ack_expected = FALSE;
157 #ifdef REL99
158 smsShrdPrm.auto_repeat_flag = CMGRS_MODE_DISABLE_AUTO_RETRANS;
159 smsShrdPrm.is_msg_present_for_retrans = FALSE;
160 #endif /* REL99 */
161
162 smsShrdPrm.uiInternalSmsStorage = CMD_SRC_NONE;
163 smsShrdPrm.smsSrcId = CMD_SRC_NONE;
164
165 smsShrdPrm.CSMSservice = CSMS_SERV_GsmPh2;
166 smsShrdPrm.CSMSmt = CSMS_SUPP_Enable;
167 smsShrdPrm.CSMSmo = CSMS_SUPP_Enable;
168 smsShrdPrm.CSMSbm = CSMS_SUPP_Enable;
169
170 smsShrdPrm.CNMImt = CNMI_MT_NoSmsDeliverInd;
171 smsShrdPrm.CNMIbm = CNMI_BM_NoCbmInd;
172 smsShrdPrm.CNMIds = CNMI_DS_NoSmsStatRpt;
173
174
175 smsShrdPrm.prmRdSeq = SMS_READ_SIM_CMPL;
176 smsShrdPrm.pDecMsg = NULL;
177
178 smsShrdPrm.rplyCB.cmss = NULL;
179 smsShrdPrm.errorCB = NULL;
180
181 smsShrdPrm.CMMSmode = CMMS_MODE_DEF;
182
183 #ifdef FF_MMI_RIV
184 smsShrdPrm.perccmgf_smbs_mode = PERC_SMBS_MOD_DISABLE;
185 #endif /* #ifdef FF_MMI_RIV */
186
187 if (set_prm_list EQ NULL)
188 {
189 set_prm_list = new_list();
190 ACI_MALLOC(elem, sizeof(T_SMS_SET_PRM));
191 memset(elem, 0, sizeof(T_SMS_SET_PRM));
192 insert_list(set_prm_list, elem);
193
194 /* all set prm pointer should point to this element */
195 for( LpCnt = 0; LpCnt < OWN_SRC_MAX; LpCnt++ )
196 {
197 smsShrdPrm.pSetPrm[LpCnt] = elem;
198 }
199 }
200
201 #ifndef SMS_PDU_SUPPORT
202 INIT_SET_PARM( CMGFmode, CMGF_MOD_Txt );
203 #else
204 INIT_SET_PARM( CMGFmode, CMGF_MOD_Pdu );
205 #endif
206
207 INIT_SET_PARM( prflId, 1 );
208 INIT_SET_PARM( isCopy, FALSE );
209 INIT_SET_PARM( numOfRefs, OWN_SRC_MAX );
210 INIT_SET_PARM( sca.ton, SMS_TON_UNKNOWN );
211 INIT_SET_PARM( sca.npi, SMS_NPI_UNKNOWN );
212 INIT_SET_PARM( sca.c_num, 0 );
213 INIT_SET_PARM( vpRel, TP_VP_RELATIVE_DEFAULT );
214 INIT_SET_PARM( pid, SMS_PID_DEFAULT );
215 INIT_SET_PARM( dcs, SMS_DCS_GRP_DEF );
216 INIT_SET_PARM( msgType, (TP_MTI_SMS_SUBMIT + TP_VPF_RELATIVE));
217
218 memset(smsShrdPrm.cbmPrm.msgId, DEF_MID_RANGE, sizeof(smsShrdPrm.cbmPrm.msgId));
219 memset(smsShrdPrm.cbmPrm.dcsId, DEF_DCS_RANGE, sizeof(smsShrdPrm.cbmPrm.dcsId));
220
221 smsShrdPrm.pSetPrm[0]->vpAbs.year [0] = 7;
222 smsShrdPrm.pSetPrm[0]->vpAbs.year [1] = 0;
223 smsShrdPrm.pSetPrm[0]->vpAbs.month [0] = 0;
224 smsShrdPrm.pSetPrm[0]->vpAbs.month [1] = 1;
225 smsShrdPrm.pSetPrm[0]->vpAbs.day [0] = 0;
226 smsShrdPrm.pSetPrm[0]->vpAbs.day [1] = 1;
227 smsShrdPrm.pSetPrm[0]->vpAbs.hour [0] = 0;
228 smsShrdPrm.pSetPrm[0]->vpAbs.hour [1] = 0;
229 smsShrdPrm.pSetPrm[0]->vpAbs.minute[0] = 0;
230 smsShrdPrm.pSetPrm[0]->vpAbs.minute[1] = 0;
231 smsShrdPrm.pSetPrm[0]->vpAbs.second[0] = 0;
232 smsShrdPrm.pSetPrm[0]->vpAbs.second[1] = 0;
233 smsShrdPrm.pSetPrm[0]->vpAbs.tz_lsb = 0;
234 smsShrdPrm.pSetPrm[0]->vpAbs.tz_sign = 0;
235 smsShrdPrm.pSetPrm[0]->vpAbs.tz_msb = 0;
236
237 memset(&smsShrdPrm.pSetPrm[0]->vpEnh, 0, sizeof(smsShrdPrm.pSetPrm[0]->vpEnh));
238 smsShrdPrm.pSetPrm[0]->vpEnh.tvpf = SMS_TVPF_RELATIVE;
239 smsShrdPrm.pSetPrm[0]->vpEnh.v_tp_vp_rel = 1;
240 smsShrdPrm.pSetPrm[0]->vpEnh.tp_vp_rel = TP_VP_RELATIVE_DEFAULT;
241
242 #ifdef SIM_TOOLKIT
243 simShrdPrm.fuRef = -1;
244 if (!psaSAT_FURegister (cmhSMS_FileUpdate))
245 {
246 TRACE_EVENT ("FAILED to register the handler cmhSMS_FileUpdate() for FU");
247 }
248 #endif
249
250 #if ((defined (MFW) AND !defined (FF_MMI_RIV)) OR defined (_CONC_TESTING_)) AND defined TI_PS_FF_CONC_SMS
251 concSMS_Init();
252 #endif
253 }
254
255 /*==== EOF ========================================================*/
256