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