comparison g23m-aci/aci/psa_f.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_F
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 global functions of the protocol
18 | stack adapters.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef PSA_F_C
23 #define PSA_F_C
24 #endif
25
26 #include "config.h"
27 #include "fixedconf.h"
28 #include "condat-features.h"
29 #include "aci_conf.h"
30
31 #include "aci_all.h"
32
33 /*==== INCLUDES ===================================================*/
34 #include "aci_cmh.h"
35 #include "ati_cmd.h"
36 #include "aci_cmd.h"
37 #include "psa.h"
38 #include "aci.h"
39 #include "l4_tim.h"
40
41 #include "psa_cc.h"
42 #if defined FF_EOTD
43 #include "psa_lc.h"
44 #endif
45
46 #ifdef UART
47 #include "dti_conn_mng.h"
48 #endif
49
50 #ifdef GPRS
51 #include "gaci_cmh.h"
52 #include "psa_gmm.h"
53 #include "psa_sm.h"
54 #include "psa_gppp.h"
55 #include "ffs/ffs.h"
56 #include "ffs_coat.h"
57 #endif /* GPRS */
58
59 #include "aci_lst.h"
60
61 #ifdef UART
62 #include "dti.h" /* functionality of the dti library */
63 #include "psa_uart.h"
64 #include "cmh_uart.h"
65 #endif
66
67 #ifdef VOCODER_FUNC_INTERFACE
68 #include "hl_audio_drv.h"
69 #endif
70
71 /*==== CONSTANTS ==================================================*/
72
73
74 /*==== TYPES ======================================================*/
75
76
77 /*==== EXPORT =====================================================*/
78
79
80 /*==== VARIABLES ==================================================*/
81
82
83 /*==== FUNCTIONS ==================================================*/
84
85
86 /*
87 +-------------------------------------------------------------------+
88 | PROJECT : GSM-PS (6147) MODULE : CMH |
89 | ROUTINE : psa_Init |
90 +-------------------------------------------------------------------+
91
92 PURPOSE : initialize the protocol stack adapters.
93
94 */
95
96 GLOBAL void psa_Init ( void )
97 {
98
99 /*
100 *-------------------------------------------------------------------
101 * set default parms for protocol stack adapters
102 *-------------------------------------------------------------------
103 */
104
105 /* --- psa init functions --- */
106 }
107
108 /*
109 +-------------------------------------------------------------------+
110 | PROJECT : GSM-PS (6147) MODULE : CMH |
111 | ROUTINE : psa_IsVldOwnid |
112 +-------------------------------------------------------------------+
113
114 PURPOSE : check for a valid owner id.
115
116 */
117
118 GLOBAL BOOL psa_IsVldOwnId ( T_OWN ownId )
119 {
120 if( ownId > ((T_OWN)CMD_SRC_NONE) AND ownId < OWN_SRC_MAX )
121
122 return TRUE;
123
124 return( FALSE );
125 }
126
127 /*
128 +--------------------------------------------------------------------+
129 | PROJECT: GSM-PS (6147) MODULE: ACI_CMD |
130 | STATE : code ROUTINE: psa_timeout |
131 +--------------------------------------------------------------------+
132
133 PURPOSE : A timeout has occured for a timer. The function returns
134 TRUE, if it is a timer which is handled by PSA, else FALSE
135 is returned to indicate that the timer has not been
136 processed.
137
138 */
139
140 GLOBAL UBYTE psa_timeout (USHORT index)
141 {
142 TRACE_FUNCTION ("psa_timeout()");
143
144 switch(index)
145 {
146 case(ACI_TDTMF):
147 /* timeout dtmf timer */
148 psaCC_DTMFTimeout();
149 return(TRUE);
150
151 #ifdef VOCODER_FUNC_INTERFACE
152 case(ACI_VOCODER):
153 {
154 T_HL_VOCODER_ACTION tmpcurrVocoderAction = currVocoderAction;
155 currVocoderAction = VOCODER_IDLE;
156 /*
157 * If the vocoder state is PENDING_ENABLE/DISABLE then
158 * call the function hl_drv_set_vocoder_state() to Enable/Disable
159 * vocoder depending on the state.
160 */
161 switch(tmpcurrVocoderAction)
162 {
163 case VOCODER_PENDING_DISABLE:
164 hl_drv_set_vocoder_state(FALSE); /* Disable vocoder */
165 break;
166
167 case VOCODER_PENDING_ENABLE:
168 hl_drv_set_vocoder_state(TRUE); /* Enable vocoder */
169 break;
170
171 default:
172 TRACE_ERROR ("Unexpected timeout in state");
173 break;
174 }
175
176 return (TRUE); /* Timeout event handled */
177 }
178 #endif
179
180 #ifdef UART
181 case(ACI_IPR):
182 /* timeout AT+IPR: change baud rate */
183 timeout_PlusIPR();
184 return(TRUE);
185 #endif
186
187 #if defined FF_EOTD
188 case(ACI_LC_1):
189 case(ACI_LC_2):
190 case(ACI_LC_3):
191 case(ACI_LC_4):
192 case(ACI_LC_5):
193 psaLC_posDataReq(index);
194 return(TRUE);
195 #endif /* FF_EOTD */
196 }
197
198 /* the timeout is not for PSA */
199 return FALSE;
200 }
201
202 #if defined (GPRS) AND defined (DTI)
203 /*
204 +-------------------------------------------------------------------+
205 | PROJECT : GSM-PS (6147) MODULE : CMH |
206 | ROUTINE : psa_GPRSInit |
207 +-------------------------------------------------------------------+
208
209 PURPOSE : initialize the protocol stack adapters.
210
211 */
212 #define FACTOR_T3314 1000
213 #define FACTOR_T3312 60000
214
215 GLOBAL void psa_GPRSInit ( void )
216 {
217 T_FFS_GPRS_ACI ffsBuffer;
218
219 T_FFS_SIZE size = FFS_fread("/GPRS/baspar_gprs", &ffsBuffer, sizeof(T_FFS_GPRS_ACI));
220
221 if ( size NEQ sizeof(T_FFS_GPRS_ACI) )
222 {
223 # ifndef _SIMULATION_
224 if ( size < 0 )
225 {
226 TRACE_EVENT_P1("FFS can not read \"/GPRS/baspar_gprs\" (%d)", size);
227 }
228 else
229 {
230 TRACE_EVENT_P2("FFS contains old file of \"/GPRS/baspar_gprs\": %dBytes long, but %dBytes expected",
231 size, sizeof(T_FFS_GPRS_ACI));
232 }
233 # endif /* NOT DEFINED _SIMULATION_ */
234
235 ffsBuffer.max_cid = 2; /* not supported at this moment */
236 ffsBuffer.auto_attach = (UBYTE) CGAATT_ATTACH_MODE_MANUAL;/* 1 */
237 ffsBuffer.auto_detach = (UBYTE) CGAATT_DETACH_MODE_OFF; /* 1 */
238 ffsBuffer.default_mobile_class = (UBYTE) GMMREG_CLASS_BG; /* 4 */
239 ffsBuffer.accm = 0; /* 3 */
240 ffsBuffer.restart_timer = PPP_RT_DEFAULT; /* 3 */
241 ffsBuffer.max_configure = PPP_MC_DEFAULT; /* 10 */
242 ffsBuffer.max_terminate = PPP_MT_DEFAULT; /* 2 */
243 ffsBuffer.max_failure = PPP_MF_DEFAULT; /* 5 */
244 }
245
246 psaGPPP_Init( ffsBuffer.accm, ffsBuffer.restart_timer,
247 ffsBuffer.max_configure, ffsBuffer.max_terminate, ffsBuffer.max_failure );
248 psaGMM_Init( ffsBuffer.auto_attach,ffsBuffer.auto_detach, ffsBuffer.default_mobile_class );
249 psaSM_Init();
250 }
251 #endif /* GPRS */
252
253 /*==== EOF ========================================================*/