comparison src/aci2/aci/cmh_lcq.c @ 3:93999a60b835

src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 26 Sep 2016 00:29:36 +0000
parents
children
comparison
equal deleted inserted replaced
2:c41a534f33c6 3:93999a60b835
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS (6147)
4 | Modul : CMH_LCQ
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 provides the query functions related to the
18 | protocol stack adapter for the location service.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef CMH_LCQ_C
23 #define CMH_LCQ_C
24 #endif
25
26 #ifdef FF_EOTD
27
28 #ifdef MFW
29 #define ENTITY_MFW
30 #else
31 #ifdef SMI
32 #define ENTITY_SMI
33 #else
34 #define ENTITY_ACI
35 #endif
36 #endif
37
38 #define ACI_MEMBER
39
40 /*==== INCLUDES ===================================================*/
41 #include "aci_all.h"
42 #include "aci_cmh.h"
43 #include "ati_cmd.h"
44 #include "aci_cmd.h"
45
46 #include "psa.h"
47 #include "cmh.h"
48
49 #include "cmh_lc.h"
50
51
52
53 /*==== CONSTANTS ==================================================*/
54
55 /*==== EXPORT =====================================================*/
56
57 /*==== VARIABLES ==================================================*/
58
59 /*==== FUNCTIONS ==================================================*/
60 /*
61 +--------------------------------------------------------------------+
62 | PROJECT : GSM-PS (6147) MODULE : CMH_LC |
63 | STATE : code ROUTINE : qAT_PlusCLSA |
64 +--------------------------------------------------------------------+
65
66 PURPOSE : This is the functional counterpart to the +CLSA?
67 AT command which returns the Service Mobile Location
68 Center source and destination address.
69
70 <mlcsc>: mobile location center source address
71 <mlcda>: mobile location center destination address
72
73 */
74 GLOBAL T_ACI_RETURN qAT_PlusCLSA ( T_ACI_CMD_SRC srcId,
75 CHAR* mlcsc,
76 CHAR* mlcda)
77 {
78 T_LOC_SERV_PARA *p_lsprm = 0;
79
80 TRACE_FUNCTION ("qAT_PlusCLSA ()");
81
82 /*
83 *-----------------------------------------------------------------
84 * check command source
85 *-----------------------------------------------------------------
86 */
87 if(!cmh_IsVldCmdSrc (srcId))
88 {
89 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_LCS_CmdNotRec);
90 return( AT_FAIL );
91 }
92
93 p_lsprm = &locServPrm; /* global structure LC parameters */
94
95 /*
96 *-----------------------------------------------------------------
97 * fill in parameters
98 *-----------------------------------------------------------------
99 */
100
101 if(!mlcsc)
102 {
103 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_LCS_CmdNotRec);
104 return( AT_FAIL );
105 }
106 else
107 {
108 if(p_lsprm->mlcsrc.toa.ton EQ TON_International)
109 *mlcsc++ = '+';
110 strncpy(mlcsc,p_lsprm->mlcsrc.address,strlen(p_lsprm->mlcsrc.address));
111 }
112 if(!mlcda)
113 ;
114 else
115 {
116 if(p_lsprm->mlcdest.toa.ton EQ TON_International)
117 *mlcda++ = '+';
118 strncpy(mlcda,p_lsprm->mlcdest.address,strlen(p_lsprm->mlcdest.address));
119 }
120
121 return ( AT_CMPL );
122 }
123
124 /*
125 +--------------------------------------------------------------------+
126 | PROJECT : GSM-PS (6147) MODULE : CMH_LC |
127 | STATE : code ROUTINE : qAT_PlusCLOM |
128 +--------------------------------------------------------------------+
129
130 PURPOSE : This is the functional counterpart to the +CLOM?
131 AT command which returns the Operating mode settings of
132 Location service
133 <number_lc_clients>: number of LC client entries in list
134 <client_list>: pointer to list of LC clients
135
136 */
137 GLOBAL T_ACI_RETURN qAT_PlusCLOM ( T_ACI_CMD_SRC srcId,
138 UBYTE * number_lc_clients,
139 T_LOC_SERV_PARA ** client_list)
140 {
141 T_LOC_SERV_PARA *p_client_list = 0;
142
143 TRACE_FUNCTION ("qAT_PlusCLOM ()");
144 /*
145 *-----------------------------------------------------------------
146 * check command source
147 *-----------------------------------------------------------------
148 */
149 if(!cmh_IsVldCmdSrc (srcId))
150 {
151 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_LCS_CmdNotRec );
152 return( AT_FAIL );
153 }
154 p_client_list = &locServPrm; /* global structure LC parameters */
155 /*
156 *-----------------------------------------------------------------
157 * fill in parameters
158 *-----------------------------------------------------------------
159 */
160
161 *number_lc_clients = p_client_list->numb_lc_clients;
162 *client_list = p_client_list;
163 return ( AT_CMPL );
164 }
165
166 /*
167 +--------------------------------------------------------------------+
168 | PROJECT : GSM-PS (6147) MODULE : CMH_LC |
169 | STATE : code ROUTINE : qAT_PlusCLPS |
170 +--------------------------------------------------------------------+
171
172 PURPOSE : This is the functional counterpart to the +CLPS?
173 AT command which returns the Periodic Update settings of
174 Location service
175 <number_lc_clients>: number of LC client entries in list
176 <client_list>: pointer to list of LC clients
177
178 */
179 GLOBAL T_ACI_RETURN qAT_PlusCLPS ( T_ACI_CMD_SRC srcId,
180 UBYTE * number_lc_clients,
181 T_LOC_SERV_PARA ** client_list)
182 {
183 T_LOC_SERV_PARA *p_client_list = 0;
184
185 TRACE_FUNCTION ("qAT_PlusCLPS ()");
186 /*
187 *-----------------------------------------------------------------
188 * check command source
189 *-----------------------------------------------------------------
190 */
191 if(!cmh_IsVldCmdSrc (srcId))
192 {
193 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_LCS_CmdNotRec );
194 return( AT_FAIL );
195 }
196 p_client_list = &locServPrm; /* global structure LC parameters */
197 /*
198 *-----------------------------------------------------------------
199 * fill in parameters
200 *-----------------------------------------------------------------
201 */
202
203 *number_lc_clients = p_client_list->numb_lc_clients;
204 *client_list = p_client_list;
205 return ( AT_CMPL );
206 }
207
208 #endif /* FF_EOTD */
209 /*==== EOF ========================================================*/