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