FreeCalypso > hg > leo2moko-debug
comparison g23m/condat/ms/src/aci/ati_fd.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 : | |
4 | Modul : J:\g23m-aci\aci\ati_fd.c | |
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 : | |
18 +----------------------------------------------------------------------------- | |
19 */ | |
20 | |
21 #ifndef ACI_FD_CMD_C | |
22 #define ACI_FD_CMD_C | |
23 #endif | |
24 | |
25 #include "aci_all.h" | |
26 #include "dti.h" /* functionality of the dti library */ | |
27 | |
28 #include "aci_lst.h" | |
29 #include "aci_cmh.h" | |
30 #include "ati_cmd.h" | |
31 #include "aci_io.h" | |
32 #include "aci_cmd.h" | |
33 | |
34 #include "aci_fd.h" | |
35 | |
36 #include "aci_mem.h" | |
37 #include "aci_prs.h" | |
38 | |
39 #include "ati_int.h" | |
40 | |
41 #ifdef FF_ATI_BAT | |
42 | |
43 #include "typedefs.h" | |
44 #include "gdd.h" | |
45 #include "bat.h" | |
46 | |
47 #include "ati_bat.h" | |
48 | |
49 #endif /* FF_ATI_BAT */ | |
50 | |
51 #define RPT_LEN (20) /* hex report length per line */ | |
52 #define SIZE_TMP_BUF (5) | |
53 | |
54 LOCAL void OutHexReport( UBYTE srcId, USHORT len, UBYTE * buf ); | |
55 EXTERN T_ATI_RSLT setflowCntr(CHAR* cl, UBYTE srcId); | |
56 EXTERN T_ATI_RSLT queflowCntr(CHAR* cl, UBYTE srcId); | |
57 | |
58 #ifdef FF_FAX | |
59 /* | |
60 +--------------------------------------------------------------------+ | |
61 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD | | |
62 | STATE : code ROUTINE : atPlusFLO | | |
63 +--------------------------------------------------------------------+ | |
64 | |
65 PURPOSE : +FLO command (DTE DCE / DCE DTE flow control) | |
66 */ | |
67 | |
68 GLOBAL T_ATI_RSLT setatPlusFLO(char *cl, UBYTE srcId) | |
69 { | |
70 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id); | |
71 | |
72 #ifdef FF_ATI_BAT | |
73 { | |
74 T_BAT_cmd_send cmd; | |
75 T_BAT_cmd_set_plus_flo my_bat_set_plus_flo; | |
76 | |
77 T_ACI_RX_FLOW_CTRL DCE_by_DTE = RX_FLOW_NotPresent; /* by TE: Rx flow control */ | |
78 T_ACI_RX_FLOW_CTRL DTE_by_DCE = TX_FLOW_NotPresent; /* by TA: Tx flow control */ | |
79 | |
80 TRACE_FUNCTION("setatPlusFLO() calls bat_send() <=== as APPLICATION"); | |
81 | |
82 cl = parse (cl, "dd", &DCE_by_DTE, &DTE_by_DCE); | |
83 | |
84 if(!cl) | |
85 { | |
86 cmdAtError(atError); | |
87 return ATI_FAIL; | |
88 } | |
89 | |
90 memset(&my_bat_set_plus_flo, 0, sizeof(my_bat_set_plus_flo)); | |
91 cmd.ctrl_params = BAT_CMD_SET_PLUS_FLO; | |
92 cmd.params.ptr_set_plus_flo = &my_bat_set_plus_flo; | |
93 | |
94 my_bat_set_plus_flo.flo_c = DCE_by_DTE; | |
95 | |
96 bat_send(ati_bat_get_client(srcId), &cmd); | |
97 | |
98 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
99 } | |
100 #else /* OLD FUNCTION BODY */ | |
101 | |
102 TRACE_FUNCTION("setatPlusFLO()"); | |
103 | |
104 src_params->curAtCmd = AT_CMD_FLO; | |
105 return setflowCntr(cl, srcId); | |
106 | |
107 #endif /* no FF_ATI_BAT*/ | |
108 } | |
109 | |
110 /* | |
111 +--------------------------------------------------------------------+ | |
112 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD | | |
113 | STATE : code ROUTINE : atPlusFLO | | |
114 +--------------------------------------------------------------------+ | |
115 | |
116 PURPOSE : +FLO command (DTE DCE / DCE DTE flow control) | |
117 */ | |
118 | |
119 GLOBAL T_ATI_RSLT queatPlusFLO(char *cl, UBYTE srcId) | |
120 { | |
121 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id); | |
122 TRACE_FUNCTION("queatPlusFLO()"); | |
123 | |
124 src_params->curAtCmd = AT_CMD_FLO; | |
125 return queflowCntr(cl, srcId); | |
126 } | |
127 #endif | |
128 | |
129 /************************************************************************ | |
130 ************ Fax and Data only commands... | |
131 ************************************************************************/ | |
132 | |
133 #if defined (FAX_AND_DATA) AND defined (DTI) | |
134 | |
135 /* | |
136 +--------------------------------------------------------------------+ | |
137 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD | | |
138 | STATE : code ROUTINE : atO | | |
139 +--------------------------------------------------------------------+ | |
140 | |
141 PURPOSE : O command (return to online state) | |
142 */ | |
143 | |
144 GLOBAL T_ATI_RSLT atO(char *cl, UBYTE srcId) | |
145 { | |
146 T_ACI_RETURN ret = AT_FAIL; | |
147 | |
148 TRACE_FUNCTION("atO()"); | |
149 | |
150 return (map_aci_2_ati_rslt(sAT_O(srcId))); | |
151 } | |
152 | |
153 /* | |
154 +--------------------------------------------------------------------+ | |
155 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
156 | STATE : code ROUTINE : atPlusDR | | |
157 +--------------------------------------------------------------------+ | |
158 | |
159 PURPOSE : +DR command (Select DATA Compression reporting) | |
160 */ | |
161 GLOBAL T_ATI_RSLT setatPlusDR (char *cl, UBYTE srcId) | |
162 { | |
163 SHORT val; | |
164 TRACE_FUNCTION("setatPLusDR()"); | |
165 | |
166 switch(*cl) | |
167 { | |
168 case('0'): | |
169 case('1'): | |
170 { | |
171 val=*cl - '0'; | |
172 break; | |
173 } | |
174 default: | |
175 { | |
176 cmdAtError(atError); | |
177 return ATI_FAIL; | |
178 } | |
179 } | |
180 cl++; | |
181 if (!(*cl EQ 0 || *cl EQ ';')) | |
182 { | |
183 cmdAtError(atError); | |
184 return ATI_FAIL; | |
185 } | |
186 ati_user_output_cfg[srcId].DR_stat=(UBYTE)val; | |
187 return ATI_CMPL; | |
188 } | |
189 | |
190 GLOBAL T_ATI_RSLT queatPlusDR (char *cl, UBYTE srcId) | |
191 { | |
192 TRACE_FUNCTION("queatPLusDR()"); | |
193 | |
194 resp_disp(srcId, cl,"b",&ati_user_output_cfg[srcId].DR_stat); | |
195 return ATI_CMPL; | |
196 } | |
197 | |
198 /* | |
199 +--------------------------------------------------------------------+ | |
200 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
201 | STATE : code ROUTINE : atPlusDS | | |
202 +--------------------------------------------------------------------+ | |
203 | |
204 PURPOSE : +DS command (Select DATA Compression) | |
205 */ | |
206 | |
207 GLOBAL T_ATI_RSLT setatPlusDS (char *cl, UBYTE srcId) | |
208 { | |
209 T_ACI_RETURN ret = AT_FAIL; | |
210 T_ACI_DS_DIR dir = DS_DIR_NotPresent; | |
211 T_ACI_DS_COMP comp = DS_COMP_NotPresent; | |
212 LONG maxDict = ACI_NumParmNotPresent; | |
213 SHORT maxStr = ACI_NumParmNotPresent ; | |
214 | |
215 cl = parse(cl, "dddr", &dir, &comp, &maxDict, &maxStr); | |
216 if (!cl) | |
217 { | |
218 cmdAtError(atError); | |
219 return ATI_FAIL; | |
220 } | |
221 #ifdef FF_ATI_BAT | |
222 { | |
223 T_BAT_cmd_send cmd; | |
224 T_BAT_cmd_set_plus_ds my_bat_set_plus_ds; | |
225 | |
226 TRACE_FUNCTION("atPLusDS() calls bat_send() <=== as APPLICATION"); | |
227 | |
228 memset(&my_bat_set_plus_ds, 0, sizeof(my_bat_set_plus_ds)); | |
229 cmd.ctrl_params = BAT_CMD_SET_PLUS_DS; | |
230 cmd.params.ptr_set_plus_ds = &my_bat_set_plus_ds; | |
231 | |
232 my_bat_set_plus_ds.dir = dir; | |
233 my_bat_set_plus_ds.neg ; | |
234 my_bat_set_plus_ds.p1; | |
235 my_bat_set_plus_ds.p2; | |
236 | |
237 bat_send(ati_bat_get_client(srcId), &cmd); | |
238 | |
239 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
240 } | |
241 #else /* OLD FUNCTION BODY */ | |
242 | |
243 TRACE_FUNCTION("atPLusDS()"); | |
244 | |
245 ret = sAT_PlusDS(srcId,dir,comp,maxDict,maxStr); | |
246 | |
247 if (ret EQ AT_FAIL) | |
248 { | |
249 cmdAtError(atError); | |
250 } | |
251 return (map_aci_2_ati_rslt(ret)); | |
252 | |
253 #endif /* no FF_ATI_BAT*/ | |
254 } | |
255 | |
256 GLOBAL T_ATI_RSLT queatPlusDS (char *cl, UBYTE srcId) | |
257 { | |
258 T_ACI_RETURN ret = AT_FAIL; | |
259 T_ACI_DS_DIR dir=DS_DIR_NotPresent; | |
260 T_ACI_DS_COMP comp=DS_COMP_NotPresent; | |
261 LONG maxDict=ACI_NumParmNotPresent; | |
262 SHORT maxStr=ACI_NumParmNotPresent ; | |
263 | |
264 TRACE_FUNCTION("atPLusDS()"); | |
265 | |
266 ret = qAT_PlusDS(srcId,&dir,&comp,&maxDict,&maxStr); | |
267 if (ret EQ AT_CMPL) | |
268 { | |
269 resp_disp(srcId, cl,"eels",&dir,&comp,&maxDict,&maxStr); | |
270 } | |
271 if (ret EQ AT_FAIL) | |
272 { | |
273 cmdAtError(atError); | |
274 } | |
275 return (map_aci_2_ati_rslt(ret)); | |
276 } | |
277 | |
278 /* | |
279 +--------------------------------------------------------------------+ | |
280 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
281 | STATE : code ROUTINE : atPlusCRLP | | |
282 +--------------------------------------------------------------------+ | |
283 | |
284 PURPOSE : +CRLP command (Select RADIO LINK Protokoll) | |
285 */ | |
286 | |
287 GLOBAL T_ATI_RSLT setatPlusCRLP(char *cl, UBYTE srcId) | |
288 { | |
289 T_ACI_RETURN ret = AT_FAIL; | |
290 SHORT iws =- 1, mws = -1, t1 = -1, n2 = -1; /* !!! */ | |
291 | |
292 cl = parse(cl, "rrrr", &iws, &mws, &t1, &n2); | |
293 if (!cl) | |
294 { | |
295 cmdCmeError(CME_ERR_OpNotAllow); | |
296 return ATI_FAIL; | |
297 } | |
298 | |
299 #ifdef FF_ATI_BAT | |
300 { | |
301 T_BAT_cmd_send cmd; | |
302 T_BAT_cmd_set_plus_crlp my_bat_set_plus_crlp; | |
303 | |
304 TRACE_FUNCTION("setatPLusCRLP() calls bat_send() <=== as APPLICATION"); | |
305 | |
306 memset(&my_bat_set_plus_crlp, 0, sizeof(my_bat_set_plus_crlp)); | |
307 cmd.ctrl_params = BAT_CMD_SET_PLUS_CRLP; | |
308 cmd.params.ptr_set_plus_crlp = &my_bat_set_plus_crlp; | |
309 | |
310 my_bat_set_plus_crlp.iws = iws; | |
311 my_bat_set_plus_crlp.mws = mws; | |
312 my_bat_set_plus_crlp.t1 = t1; | |
313 my_bat_set_plus_crlp.n2 = n2; | |
314 | |
315 bat_send(ati_bat_get_client(srcId), &cmd); | |
316 | |
317 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
318 } | |
319 #else /* OLD FUNCTION BODY */ | |
320 | |
321 TRACE_FUNCTION("setatPLusCRLP()"); | |
322 | |
323 ret = sAT_PlusCRLP(srcId,iws,mws,t1,n2); | |
324 if (ret EQ AT_FAIL) | |
325 { | |
326 cmdCmeError(CME_ERR_Unknown); | |
327 } | |
328 return (map_aci_2_ati_rslt(ret)); | |
329 | |
330 #endif /* no FF_ATI_BAT*/ | |
331 } | |
332 | |
333 GLOBAL T_ATI_RSLT queatPlusCRLP(char *cl, UBYTE srcId) | |
334 { | |
335 T_ACI_RETURN ret = AT_FAIL; | |
336 SHORT iws=-1,mws=-1,t1=-1,n2=-1; /* !!! */ | |
337 | |
338 TRACE_FUNCTION("queatPLusCRLP()"); | |
339 | |
340 ret = qAT_PlusCRLP(srcId,&iws,&mws,&t1,&n2); | |
341 if (ret EQ AT_CMPL) | |
342 { | |
343 resp_disp(srcId, cl,"ssss",&iws,&mws,&t1,&n2); | |
344 } | |
345 if (ret EQ AT_FAIL) | |
346 { | |
347 cmdCmeError(CME_ERR_Unknown); | |
348 } | |
349 return (map_aci_2_ati_rslt(ret)); | |
350 } | |
351 | |
352 #ifdef FF_FAX | |
353 | |
354 /* | |
355 * | |
356 * | |
357 *---------------------------------------- FAX Commands ------------------------------------------ | |
358 * | |
359 * | |
360 */ | |
361 /* | |
362 +--------------------------------------------------------------------+ | |
363 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
364 | STATE : code ROUTINE : atPlusFAP | | |
365 +--------------------------------------------------------------------+ | |
366 | |
367 PURPOSE : +FAP command (address and polling capabilities ) | |
368 */ | |
369 | |
370 GLOBAL T_ATI_RSLT setatPlusFAP (char *cl, UBYTE srcId) | |
371 { | |
372 T_ACI_RETURN ret = AT_FAIL; | |
373 T_ACI_FAP_VAL sub=FAP_VAL_NotPresent, | |
374 sep=FAP_VAL_NotPresent, | |
375 pwd=FAP_VAL_NotPresent; | |
376 | |
377 cl = parse(cl,"ddd",&sub,&sep,&pwd); | |
378 if (!cl) | |
379 { | |
380 cmdAtError(atError); | |
381 return ATI_FAIL; | |
382 } | |
383 | |
384 #ifdef FF_ATI_BAT | |
385 { | |
386 T_BAT_cmd_send cmd; | |
387 T_BAT_cmd_set_plus_fap my_bat_set_plus_fap; | |
388 | |
389 TRACE_FUNCTION("setatPlusFAP() calls bat_send() <=== as APPLICATION"); | |
390 | |
391 memset(&my_bat_set_plus_fap, 0, sizeof(my_bat_set_plus_fap)); | |
392 cmd.ctrl_params = BAT_CMD_SET_PLUS_FAP; | |
393 cmd.params.ptr_set_plus_fap = &my_bat_set_plus_fap; | |
394 | |
395 my_bat_set_plus_fap.sub = sub; | |
396 my_bat_set_plus_fap.sep = sep; | |
397 my_bat_set_plus_fap.pwd = pwd; | |
398 | |
399 bat_send(ati_bat_get_client(srcId), &cmd); | |
400 | |
401 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
402 } | |
403 #else /* OLD FUNCTION BODY */ | |
404 | |
405 TRACE_FUNCTION("setatPlusFAP()"); | |
406 | |
407 ret = sAT_PlusFAP(srcId,sub,sep,pwd); | |
408 if (ret EQ AT_FAIL) | |
409 { | |
410 cmdAtError(atError); | |
411 } | |
412 return (map_aci_2_ati_rslt(ret)); | |
413 | |
414 #endif /* no FF_ATI_BAT*/ | |
415 } | |
416 | |
417 GLOBAL T_ATI_RSLT queatPlusFAP (char *cl, UBYTE srcId) | |
418 { | |
419 T_ACI_RETURN ret = AT_FAIL; | |
420 T_ACI_FAP_VAL sub=FAP_VAL_NotPresent, | |
421 sep=FAP_VAL_NotPresent, | |
422 pwd=FAP_VAL_NotPresent; | |
423 | |
424 TRACE_FUNCTION("queatPlusFAP()"); | |
425 | |
426 ret = qAT_PlusFAP(srcId,&sub,&sep,&pwd); | |
427 if (ret EQ AT_CMPL) | |
428 { | |
429 sprintf(g_sa,"+FAP:%d,%d,%d",sub,sep,pwd); | |
430 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
431 } | |
432 else | |
433 { | |
434 cmdAtError(atError); | |
435 } | |
436 return (map_aci_2_ati_rslt(ret)); | |
437 } | |
438 | |
439 /* | |
440 +--------------------------------------------------------------------+ | |
441 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
442 | STATE : code ROUTINE : atPlusFBU | | |
443 +--------------------------------------------------------------------+ | |
444 | |
445 PURPOSE : +FBU | |
446 */ | |
447 | |
448 GLOBAL T_ATI_RSLT setatPlusFBU(char *cl, UBYTE srcId) | |
449 { | |
450 SHORT fbu = -1; | |
451 | |
452 cl = parse(cl,"r",&fbu); | |
453 if (!cl || fbu > 1) | |
454 { | |
455 cmdAtError(atError); | |
456 return ATI_FAIL; | |
457 } | |
458 | |
459 #ifdef FF_ATI_BAT | |
460 { | |
461 T_BAT_cmd_send cmd; | |
462 T_BAT_cmd_set_plus_fbu my_bat_set_plus_fbu; | |
463 | |
464 TRACE_FUNCTION("setatPlusFBU() calls bat_send() <=== as APPLICATION"); | |
465 | |
466 memset(&my_bat_set_plus_fbu, 0, sizeof(my_bat_set_plus_fbu)); | |
467 cmd.ctrl_params = BAT_CMD_SET_PLUS_FBU; | |
468 cmd.params.ptr_set_plus_fbu = &my_bat_set_plus_fbu; | |
469 | |
470 my_bat_set_plus_fbu.value = fbu; | |
471 | |
472 bat_send(ati_bat_get_client(srcId), &cmd); | |
473 | |
474 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
475 } | |
476 #else /* OLD FUNCTION BODY */ | |
477 | |
478 TRACE_FUNCTION("setatPlusFBU()"); | |
479 | |
480 if (fbu NEQ -1) | |
481 { | |
482 fd.FBU_stat = (char) fbu; | |
483 } | |
484 return ATI_CMPL; | |
485 | |
486 #endif /* no FF_ATI_BAT*/ | |
487 } | |
488 | |
489 GLOBAL T_ATI_RSLT queatPlusFBU(char *cl, UBYTE srcId) | |
490 { | |
491 SHORT fbu=-1; | |
492 | |
493 TRACE_FUNCTION("queatPlusFBU()"); | |
494 | |
495 sprintf(g_sa,"+FBU:%d",fd.FBU_stat); | |
496 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
497 return ATI_CMPL; | |
498 } | |
499 | |
500 /* | |
501 +--------------------------------------------------------------------+ | |
502 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
503 | STATE : code ROUTINE : atPlusFCC | | |
504 +--------------------------------------------------------------------+ | |
505 | |
506 PURPOSE : | |
507 | |
508 ITU-T.32/8.5.1.1 DCE capabilities parameters, +FCC | |
509 | |
510 – Write syntax: +FCC=VR,BR,WD,LN,DF,EC,BF,ST,JP | |
511 – Valid values: see Table 21 | |
512 – Default values: set by manufacturer | |
513 – Mandatory values: as required by Recommendation T.30 | |
514 | |
515 +FCC allows the DTE to sense and constrain the capabilities of the facsimile DCE, | |
516 from the choices defined in Table 2/T.30. | |
517 When +FCC is modified by the DTE, the DCE shall copy +FCC into +FIS. | |
518 | |
519 */ | |
520 | |
521 GLOBAL T_ATI_RSLT setatPlusFCC (char *cl, UBYTE srcId) | |
522 { | |
523 T_ACI_RETURN ret = AT_FAIL; | |
524 | |
525 T_ACI_F_VR vr = F_VR_NotPresent; | |
526 T_ACI_F_BR br = F_BR_NotPresent; | |
527 T_ACI_F_WD wd = F_WD_NotPresent; | |
528 T_ACI_F_LN ln = F_LN_NotPresent; | |
529 T_ACI_F_DF df = F_DF_NotPresent; | |
530 T_ACI_F_EC ec = F_EC_NotPresent; | |
531 T_ACI_F_BF bf = F_BF_NotPresent; | |
532 T_ACI_F_ST st = F_ST_NotPresent; | |
533 T_ACI_F_JP jp = F_JP_NotPresent; | |
534 | |
535 UBYTE bvr = NOT_PRESENT_8BIT, | |
536 bbf = NOT_PRESENT_8BIT, | |
537 bjp = NOT_PRESENT_8BIT; | |
538 | |
539 cl = parse(cl,"xdddddxdx",&bvr,&br,&wd,&ln,&df,&ec,&bbf,&st,&bjp); | |
540 | |
541 if ( !cl ) | |
542 { | |
543 cmdAtError(atError); | |
544 return ATI_FAIL; | |
545 } | |
546 | |
547 if (bvr NEQ NOT_PRESENT_8BIT) | |
548 { | |
549 vr = (T_ACI_F_VR)bvr; | |
550 } | |
551 if (bbf NEQ NOT_PRESENT_8BIT) | |
552 { | |
553 bf = (T_ACI_F_BF)bbf; | |
554 } | |
555 if (bjp NEQ NOT_PRESENT_8BIT) | |
556 { | |
557 jp = (T_ACI_F_JP)bjp; | |
558 } | |
559 | |
560 #ifdef FF_ATI_BAT | |
561 { | |
562 T_BAT_cmd_send cmd; | |
563 T_BAT_cmd_set_plus_fcc my_bat_set_plus_fcc; | |
564 | |
565 TRACE_FUNCTION("setatPlusFCC() calls bat_send() <=== as APPLICATION"); | |
566 | |
567 memset(&my_bat_set_plus_fcc, 0, sizeof(my_bat_set_plus_fcc)); | |
568 cmd.ctrl_params = BAT_CMD_SET_PLUS_FCC; | |
569 cmd.params.ptr_set_plus_fcc = &my_bat_set_plus_fcc; | |
570 | |
571 my_bat_set_plus_fcc.vr = vr; | |
572 my_bat_set_plus_fcc.br = br; | |
573 my_bat_set_plus_fcc.wd = wd; | |
574 my_bat_set_plus_fcc.ln = ln; | |
575 my_bat_set_plus_fcc.df = df; | |
576 my_bat_set_plus_fcc.ec = ec; | |
577 my_bat_set_plus_fcc.bf = bf; | |
578 my_bat_set_plus_fcc.st = st; | |
579 my_bat_set_plus_fcc.jp = jp; | |
580 | |
581 bat_send(ati_bat_get_client(srcId), &cmd); | |
582 | |
583 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
584 } | |
585 #else /* OLD FUNCTION BODY */ | |
586 | |
587 TRACE_FUNCTION("setatPlusFCC()"); | |
588 | |
589 ret = sAT_PlusFCC(srcId,vr,br,wd,ln,df,ec,bf,st,jp); | |
590 if (ret EQ AT_FAIL) | |
591 { | |
592 cmdAtError(atError); | |
593 } | |
594 return (map_aci_2_ati_rslt(ret)); | |
595 | |
596 #endif /* no FF_ATI_BAT*/ | |
597 } | |
598 | |
599 GLOBAL T_ATI_RSLT queatPlusFCC (char *cl, UBYTE srcId) | |
600 { | |
601 T_ACI_RETURN ret = AT_FAIL; | |
602 T_ACI_F_VR vr = F_VR_NotPresent; | |
603 T_ACI_F_BR br = F_BR_NotPresent; | |
604 T_ACI_F_WD wd = F_WD_NotPresent; | |
605 T_ACI_F_LN ln = F_LN_NotPresent; | |
606 T_ACI_F_DF df = F_DF_NotPresent; | |
607 T_ACI_F_EC ec = F_EC_NotPresent; | |
608 T_ACI_F_BF bf = F_BF_NotPresent; | |
609 T_ACI_F_ST st = F_ST_NotPresent; | |
610 T_ACI_F_JP jp = F_JP_NotPresent; | |
611 SHORT bvr = -1, | |
612 bbf = -1, | |
613 bjp = -1; | |
614 | |
615 TRACE_FUNCTION("queatPlusFCC()"); | |
616 | |
617 ret = qAT_PlusFCC(srcId, &vr,&br,&wd,&ln,&df,&ec,&bf,&st,&jp); | |
618 if (ret EQ AT_CMPL) | |
619 { | |
620 sprintf(g_sa,"+FCC:%X,%d,%d,%d,%d,%d,%X,%d,%X",vr,br,wd,ln,df,ec,bf,st,jp); | |
621 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
622 } | |
623 else | |
624 { | |
625 cmdAtError(atError); | |
626 } | |
627 return (map_aci_2_ati_rslt(ret)); | |
628 } | |
629 | |
630 /* | |
631 +--------------------------------------------------------------------+ | |
632 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
633 | STATE : code ROUTINE : atPlusFCLASS | | |
634 +--------------------------------------------------------------------+ | |
635 | |
636 PURPOSE : +FCLASS command (Service Class Indication) | |
637 */ | |
638 | |
639 GLOBAL T_ATI_RSLT setatPlusFCLASS (char *cl, UBYTE srcId) | |
640 { | |
641 T_ACI_RETURN ret = AT_FAIL; | |
642 char val[4]="-1"; | |
643 T_ACI_FCLASS_CLASS class_type = FCLASS_CLASS_NotPresent; | |
644 | |
645 switch (*cl) | |
646 { | |
647 case('0'): | |
648 { | |
649 cl++; | |
650 class_type = FCLASS_CLASS_Data; | |
651 break; | |
652 } | |
653 case('2'): | |
654 { | |
655 cl++; | |
656 if (*cl EQ '.') | |
657 { | |
658 cl++; | |
659 if (*cl EQ '0') | |
660 { | |
661 cl++; | |
662 class_type = FCLASS_CLASS_Fax20; | |
663 break; | |
664 } | |
665 } | |
666 cmdAtError(atError); | |
667 return ATI_FAIL; | |
668 } | |
669 case('8'): | |
670 { | |
671 cl++; | |
672 class_type = FCLASS_CLASS_Voice; | |
673 break; | |
674 } | |
675 default: | |
676 { | |
677 cmdAtError(atError); | |
678 return ATI_FAIL; | |
679 } | |
680 } | |
681 if (*cl NEQ '\0' && *cl NEQ ';') | |
682 { | |
683 cmdAtError(atError); | |
684 return ATI_FAIL; | |
685 } | |
686 | |
687 #ifdef FF_ATI_BAT | |
688 { | |
689 T_BAT_cmd_send cmd; | |
690 T_BAT_cmd_set_plus_fclass my_bat_set_plus_fclass; | |
691 | |
692 TRACE_FUNCTION("setatPlusFCLASS() calls bat_send() <=== as APPLICATION"); | |
693 | |
694 memset(&my_bat_set_plus_fclass, 0, sizeof(my_bat_set_plus_fclass)); | |
695 cmd.ctrl_params = BAT_CMD_SET_PLUS_FCLASS; | |
696 cmd.params.ptr_set_plus_fclass = &my_bat_set_plus_fclass; | |
697 | |
698 my_bat_set_plus_fclass.n = class_type; | |
699 | |
700 bat_send(ati_bat_get_client(srcId), &cmd); | |
701 | |
702 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
703 } | |
704 #else /* OLD FUNCTION BODY */ | |
705 | |
706 TRACE_FUNCTION("setatPlusFCLASS()"); | |
707 | |
708 ret = sAT_PlusFCLASS(srcId, class_type); | |
709 if (ret EQ AT_FAIL) | |
710 { | |
711 cmdAtError(atError); | |
712 } | |
713 return (map_aci_2_ati_rslt(ret)); | |
714 | |
715 #endif /* no FF_ATI_BAT*/ | |
716 } | |
717 | |
718 GLOBAL T_ATI_RSLT queatPlusFCLASS (char *cl, UBYTE srcId) | |
719 { | |
720 T_ACI_RETURN ret = AT_FAIL; | |
721 char val[4]="-1"; | |
722 T_ACI_FCLASS_CLASS class_type = FCLASS_CLASS_NotPresent; | |
723 | |
724 TRACE_FUNCTION("atPlusFCLASS()"); | |
725 | |
726 ret = qAT_PlusFCLASS(srcId, &class_type); | |
727 if (ret EQ AT_CMPL) | |
728 { | |
729 if (class_type EQ 20) | |
730 { | |
731 sprintf(g_sa,"%s","2.0"); | |
732 } | |
733 else | |
734 { | |
735 sprintf(g_sa,"%d",class_type); | |
736 } | |
737 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
738 } | |
739 else | |
740 { | |
741 cmdAtError(atError); | |
742 } | |
743 return (map_aci_2_ati_rslt(ret)); | |
744 } | |
745 | |
746 /* | |
747 +--------------------------------------------------------------------+ | |
748 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
749 | STATE : code ROUTINE : atPlusFCQ | | |
750 +--------------------------------------------------------------------+ | |
751 | |
752 PURPOSE : +FCQ command (quality control) | |
753 */ | |
754 | |
755 GLOBAL T_ATI_RSLT setatPlusFCQ (char *cl, UBYTE srcId) | |
756 { | |
757 T_ACI_RETURN ret = AT_FAIL; | |
758 T_ACI_FCQ_RQ rq=FCQ_RQ_NotPresent; | |
759 T_ACI_FCQ_TQ tq=FCQ_TQ_NotPresent; | |
760 | |
761 cl = parse(cl,"dd",&rq,&tq); | |
762 if ( !cl ) | |
763 { | |
764 cmdAtError(atError); | |
765 return ATI_FAIL; | |
766 } | |
767 | |
768 #ifdef FF_ATI_BAT | |
769 { | |
770 T_BAT_cmd_send cmd; | |
771 T_BAT_cmd_set_plus_fcq my_bat_set_plus_fcq; | |
772 | |
773 TRACE_FUNCTION("setatPlusFCQ() calls bat_send() <=== as APPLICATION"); | |
774 | |
775 memset(&my_bat_set_plus_fcq, 0, sizeof(my_bat_set_plus_fcq)); | |
776 cmd.ctrl_params = BAT_CMD_SET_PLUS_FCQ; | |
777 cmd.params.ptr_set_plus_fcq = &my_bat_set_plus_fcq; | |
778 | |
779 my_bat_set_plus_fcq.rq = rq; | |
780 my_bat_set_plus_fcq.tq = tq; | |
781 | |
782 bat_send(ati_bat_get_client(srcId), &cmd); | |
783 | |
784 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
785 } | |
786 #else /* OLD FUNCTION BODY */ | |
787 | |
788 TRACE_FUNCTION("setatPlusFCQ()"); | |
789 | |
790 ret = sAT_PlusFCQ(srcId,rq,tq); | |
791 if (ret EQ AT_FAIL) | |
792 { | |
793 cmdAtError(atError); | |
794 } | |
795 return (map_aci_2_ati_rslt(ret)); | |
796 | |
797 #endif /* no FF_ATI_BAT*/ | |
798 } | |
799 | |
800 GLOBAL T_ATI_RSLT queatPlusFCQ (char *cl, UBYTE srcId) | |
801 { | |
802 T_ACI_RETURN ret = AT_FAIL; | |
803 T_ACI_FCQ_RQ rq=FCQ_RQ_NotPresent; | |
804 T_ACI_FCQ_TQ tq=FCQ_TQ_NotPresent; | |
805 | |
806 TRACE_FUNCTION("queatPlusFCQ()"); | |
807 | |
808 ret = qAT_PlusFCQ(srcId, &rq,&tq); | |
809 if (ret EQ AT_CMPL) | |
810 { | |
811 sprintf(g_sa,"%s%d,%d","+FCQ:",rq,tq); | |
812 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
813 } | |
814 else | |
815 { | |
816 cmdAtError(atError); | |
817 } | |
818 return (map_aci_2_ati_rslt(ret)); | |
819 } | |
820 | |
821 /* | |
822 +--------------------------------------------------------------------+ | |
823 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
824 | STATE : code ROUTINE : atPlusFCR | | |
825 +--------------------------------------------------------------------+ | |
826 | |
827 PURPOSE : +FCR command (Receive capability) | |
828 */ | |
829 | |
830 GLOBAL T_ATI_RSLT setatPlusFCR (char *cl, UBYTE srcId) | |
831 { | |
832 T_ACI_RETURN ret = AT_FAIL; | |
833 T_ACI_FCR_VAL val = FCR_VAL_NotPresent; | |
834 | |
835 cl = parse(cl,"d",&val); | |
836 if ( !cl ) | |
837 { | |
838 cmdAtError(atError); | |
839 return ATI_FAIL; | |
840 } | |
841 | |
842 #ifdef FF_ATI_BAT | |
843 { | |
844 T_BAT_cmd_send cmd; | |
845 T_BAT_cmd_set_plus_fcr my_bat_set_plus_fcr; | |
846 | |
847 TRACE_FUNCTION("setatPlusFCR() calls bat_send() <=== as APPLICATION"); | |
848 | |
849 memset(&my_bat_set_plus_fcr, 0, sizeof(my_bat_set_plus_fcr)); | |
850 cmd.ctrl_params = BAT_CMD_SET_PLUS_FCR; | |
851 cmd.params.ptr_set_plus_fcr = &my_bat_set_plus_fcr; | |
852 | |
853 my_bat_set_plus_fcr.value = val; | |
854 | |
855 bat_send(ati_bat_get_client(srcId), &cmd); | |
856 | |
857 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
858 } | |
859 #else /* OLD FUNCTION BODY */ | |
860 | |
861 TRACE_FUNCTION("setatPlusFCR()"); | |
862 | |
863 ret = sAT_PlusFCR(srcId,val); | |
864 if (ret EQ AT_FAIL) | |
865 { | |
866 cmdAtError(atError); | |
867 } | |
868 return (map_aci_2_ati_rslt(ret)); | |
869 | |
870 #endif /* no FF_ATI_BAT*/ | |
871 } | |
872 | |
873 GLOBAL T_ATI_RSLT queatPlusFCR (char *cl, UBYTE srcId) | |
874 { | |
875 T_ACI_RETURN ret = AT_FAIL; | |
876 T_ACI_FCR_VAL val = FCR_VAL_NotPresent; | |
877 | |
878 TRACE_FUNCTION("queatPlusFCR()"); | |
879 | |
880 ret = qAT_PlusFCR(srcId, &val); | |
881 if (ret EQ AT_CMPL) | |
882 { | |
883 sprintf(g_sa,"+FCR:%d",val); | |
884 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
885 } | |
886 else | |
887 { | |
888 cmdAtError(atError); | |
889 } | |
890 return (map_aci_2_ati_rslt(ret)); | |
891 } | |
892 | |
893 /* | |
894 +--------------------------------------------------------------------+ | |
895 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
896 | STATE : code ROUTINE : atPlusFCS | | |
897 +--------------------------------------------------------------------+ | |
898 | |
899 PURPOSE: | |
900 | |
901 ITU-T.32/8.5.1.3 Current session results, +FCS | |
902 | |
903 – Read syntax: +FCS? | |
904 – DCE response: VR,BR,WD,LN,DF,EC,BF,ST,JP | |
905 – Valid values: see Table 21 | |
906 – Default values: 0,0,0,0,0,0,0,0,0 | |
907 – Mandatory values: as required by Recommendation T.30 | |
908 | |
909 The +FCS parameter is loaded with the negotiated T.30 parameters for the current session. | |
910 A transmitting DCE generates DCS; | |
911 a receiving DCE gets DCS from the remote station. | |
912 | |
913 The DTE may only read this parameter. | |
914 The DCE shall set the +FCS parameter to the default values on DCE initialization, | |
915 on +FIP command execution, and at the end of a session. | |
916 | |
917 The contents of +FCS are spontaneously reported | |
918 during execution of +FDR (8.3.4) or +FDT (8.3.3) commands, | |
919 by the +FCS:VR,BR,WD,LN,DF,EC,BF,ST,JP response, | |
920 using the same compound parameter format. See 8.4.2.1. | |
921 | |
922 NOTE – The use of additional subparameters for the +FCS, | |
923 in order to support future T.30 features, is for further study. | |
924 */ | |
925 | |
926 GLOBAL T_ATI_RSLT queatPlusFCS(char *cl, UBYTE srcId) | |
927 { | |
928 T_ACI_RETURN ret = AT_FAIL; | |
929 T_ACI_F_VR vr; | |
930 T_ACI_F_BR br; | |
931 T_ACI_F_WD wd; | |
932 T_ACI_F_LN ln; | |
933 T_ACI_F_DF df; | |
934 T_ACI_F_EC ec; | |
935 T_ACI_F_BF bf; | |
936 T_ACI_F_ST st; | |
937 T_ACI_F_JP jp; | |
938 | |
939 TRACE_FUNCTION("queatPlusFCS()"); | |
940 | |
941 ret = qAT_PlusFCS(srcId,&vr,&br,&wd,&ln,&df,&ec,&bf,&st,&jp); | |
942 | |
943 if(ret EQ AT_CMPL) | |
944 { | |
945 sprintf(g_sa,"+FCS:%X,%d,%d,%d,%d,%d,%X,%d,%X",vr,br,wd,ln,df,ec,bf,st,jp); | |
946 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
947 } | |
948 else | |
949 { | |
950 cmdAtError(atError); | |
951 } | |
952 return (map_aci_2_ati_rslt(ret)); | |
953 } | |
954 | |
955 /* | |
956 +--------------------------------------------------------------------+ | |
957 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
958 | STATE : code ROUTINE : atPlusFEA | | |
959 +--------------------------------------------------------------------+ | |
960 | |
961 PURPOSE : +FEA | |
962 */ | |
963 | |
964 GLOBAL T_ATI_RSLT setatPlusFEA(char *cl, UBYTE srcId) | |
965 { | |
966 SHORT fea = -1; | |
967 | |
968 cl = parse(cl, "r", &fea); | |
969 if (!cl) | |
970 { | |
971 cmdAtError(atError); | |
972 return ATI_FAIL; | |
973 } | |
974 | |
975 #ifdef FF_ATI_BAT | |
976 { | |
977 T_BAT_cmd_send cmd; | |
978 T_BAT_cmd_set_plus_fea my_bat_set_plus_fea; | |
979 | |
980 TRACE_FUNCTION("setatPlusFEA() calls bat_send() <=== as APPLICATION"); | |
981 | |
982 memset(&my_bat_set_plus_fea, 0, sizeof(my_bat_set_plus_fea)); | |
983 cmd.ctrl_params = BAT_CMD_SET_PLUS_FEA; | |
984 cmd.params.ptr_set_plus_fea = &my_bat_set_plus_fea; | |
985 | |
986 my_bat_set_plus_fea.value = fea; | |
987 | |
988 bat_send(ati_bat_get_client(srcId), &cmd); | |
989 | |
990 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
991 } | |
992 #else /* OLD FUNCTION BODY */ | |
993 | |
994 TRACE_FUNCTION("setatPlusFEA()"); | |
995 | |
996 if (fea NEQ -1) | |
997 { | |
998 fd.FEA_stat = (char) fea; | |
999 } | |
1000 return ATI_CMPL; | |
1001 | |
1002 #endif /* no FF_ATI_BAT*/ | |
1003 } | |
1004 | |
1005 GLOBAL T_ATI_RSLT queatPlusFEA(char *cl, UBYTE srcId) | |
1006 { | |
1007 SHORT fea=-1; | |
1008 | |
1009 TRACE_FUNCTION("queatPlusFEA()"); | |
1010 | |
1011 sprintf(g_sa,"+FEA:%d", fd.FEA_stat); | |
1012 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
1013 return ATI_CMPL; | |
1014 } | |
1015 | |
1016 /* | |
1017 +--------------------------------------------------------------------+ | |
1018 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
1019 | STATE : code ROUTINE : atPlusFFC | | |
1020 +--------------------------------------------------------------------+ | |
1021 | |
1022 PURPOSE : +FFC command (format conversion) | |
1023 */ | |
1024 | |
1025 GLOBAL T_ATI_RSLT setatPlusFFC (char *cl, UBYTE srcId) | |
1026 { | |
1027 T_ACI_RETURN ret = AT_FAIL; | |
1028 T_ACI_FFC_VRC vrc=FFC_VRC_NotPresent; | |
1029 T_ACI_FFC_DFC dfc=FFC_DFC_NotPresent; | |
1030 T_ACI_FFC_LNC lnc=FFC_LNC_NotPresent; | |
1031 T_ACI_FFC_WDC wdc=FFC_WDC_NotPresent; | |
1032 | |
1033 cl = parse(cl,"dddd",&vrc,&dfc,&lnc,&wdc); | |
1034 if ( !cl ) | |
1035 { | |
1036 cmdAtError(atError); | |
1037 return ATI_FAIL; | |
1038 } | |
1039 | |
1040 #ifdef FF_ATI_BAT | |
1041 { | |
1042 T_BAT_cmd_send cmd; | |
1043 T_BAT_cmd_set_plus_ffc my_bat_set_plus_ffc; | |
1044 | |
1045 TRACE_FUNCTION("setatPlusFFC() calls bat_send() <=== as APPLICATION"); | |
1046 | |
1047 memset(&my_bat_set_plus_ffc, 0, sizeof(my_bat_set_plus_ffc)); | |
1048 cmd.ctrl_params = BAT_CMD_SET_PLUS_FFC; | |
1049 cmd.params.ptr_set_plus_ffc = &my_bat_set_plus_ffc; | |
1050 | |
1051 my_bat_set_plus_ffc.vrc = vrc; | |
1052 my_bat_set_plus_ffc.dfc = dfc; | |
1053 my_bat_set_plus_ffc.lnc = lnc; | |
1054 my_bat_set_plus_ffc.wdc = wdc; | |
1055 | |
1056 bat_send(ati_bat_get_client(srcId), &cmd); | |
1057 | |
1058 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
1059 } | |
1060 #else /* OLD FUNCTION BODY */ | |
1061 | |
1062 TRACE_FUNCTION("setatPlusFFC()"); | |
1063 | |
1064 ret = sAT_PlusFFC(srcId,vrc,dfc,lnc,wdc); | |
1065 if (ret EQ AT_FAIL) | |
1066 { | |
1067 cmdAtError(atError); | |
1068 } | |
1069 return (map_aci_2_ati_rslt(ret)); | |
1070 | |
1071 #endif /* no FF_ATI_BAT*/ | |
1072 } | |
1073 | |
1074 GLOBAL T_ATI_RSLT queatPlusFFC (char *cl, UBYTE srcId) | |
1075 { | |
1076 T_ACI_RETURN ret = AT_FAIL; | |
1077 T_ACI_FFC_VRC vrc=FFC_VRC_NotPresent; | |
1078 T_ACI_FFC_DFC dfc=FFC_DFC_NotPresent; | |
1079 T_ACI_FFC_LNC lnc=FFC_LNC_NotPresent; | |
1080 T_ACI_FFC_WDC wdc=FFC_WDC_NotPresent; | |
1081 | |
1082 TRACE_FUNCTION("atPlusFFC()"); | |
1083 | |
1084 ret = qAT_PlusFFC(srcId,&vrc,&dfc,&lnc,&wdc); | |
1085 if (ret EQ AT_CMPL) | |
1086 { | |
1087 sprintf(g_sa,"+FFC:%d,%d,%d,%d",vrc,dfc,lnc,wdc); | |
1088 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
1089 } | |
1090 else | |
1091 { | |
1092 cmdAtError(atError); | |
1093 } | |
1094 return (map_aci_2_ati_rslt(ret)); | |
1095 } | |
1096 | |
1097 /* | |
1098 +--------------------------------------------------------------------+ | |
1099 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
1100 | STATE : code ROUTINE : atPlusFHS | | |
1101 +--------------------------------------------------------------------+ | |
1102 | |
1103 PURPOSE : +FHS command (query termination status) | |
1104 */ | |
1105 | |
1106 GLOBAL T_ATI_RSLT queatPlusFHS(char *cl, UBYTE srcId) | |
1107 { | |
1108 T_ACI_RETURN ret = AT_FAIL; | |
1109 T_ACI_FHS_STAT stat; | |
1110 | |
1111 TRACE_FUNCTION("queatPlusFHS()"); | |
1112 | |
1113 ret = qAT_PlusFHS(srcId,&stat); | |
1114 if (ret EQ AT_CMPL) | |
1115 { | |
1116 sprintf(g_sa,"+FHS:%02X",stat); | |
1117 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
1118 } | |
1119 else | |
1120 { | |
1121 cmdAtError(atError); | |
1122 } | |
1123 return (map_aci_2_ati_rslt(ret)); | |
1124 } | |
1125 /* | |
1126 +--------------------------------------------------------------------+ | |
1127 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
1128 | STATE : code ROUTINE : atPlusFIE | | |
1129 +--------------------------------------------------------------------+ | |
1130 | |
1131 PURPOSE : +FIE command (procedure interrupt enable) | |
1132 */ | |
1133 | |
1134 GLOBAL T_ATI_RSLT setatPlusFIE (char *cl, UBYTE srcId) | |
1135 { | |
1136 T_ACI_RETURN ret = AT_FAIL; | |
1137 T_ACI_FIE_VAL val=FIE_VAL_NotPresent; | |
1138 | |
1139 cl = parse(cl,"d",&val); | |
1140 if ( !cl ) | |
1141 { | |
1142 cmdAtError(atError); | |
1143 return ATI_FAIL; | |
1144 } | |
1145 | |
1146 #ifdef FF_ATI_BAT | |
1147 { | |
1148 T_BAT_cmd_send cmd; | |
1149 T_BAT_cmd_set_plus_fie my_bat_set_plus_fie; | |
1150 | |
1151 TRACE_FUNCTION("setatPlusFIE() calls bat_send() <=== as APPLICATION"); | |
1152 | |
1153 memset(&my_bat_set_plus_fie, 0, sizeof(my_bat_set_plus_fie)); | |
1154 cmd.ctrl_params = BAT_CMD_SET_PLUS_FIE; | |
1155 cmd.params.ptr_set_plus_fie = &my_bat_set_plus_fie; | |
1156 | |
1157 my_bat_set_plus_fie.value = val; | |
1158 | |
1159 bat_send(ati_bat_get_client(srcId), &cmd); | |
1160 | |
1161 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
1162 } | |
1163 #else /* OLD FUNCTION BODY */ | |
1164 | |
1165 TRACE_FUNCTION("atPlusFIE()"); | |
1166 | |
1167 ret = sAT_PlusFIE(srcId,val); | |
1168 if (ret EQ AT_FAIL) | |
1169 { | |
1170 cmdAtError(atError); | |
1171 } | |
1172 return (map_aci_2_ati_rslt(ret)); | |
1173 | |
1174 #endif /* no FF_ATI_BAT*/ | |
1175 } | |
1176 | |
1177 GLOBAL T_ATI_RSLT queatPlusFIE (char *cl, UBYTE srcId) | |
1178 { | |
1179 T_ACI_RETURN ret = AT_FAIL; | |
1180 T_ACI_FIE_VAL val=FIE_VAL_NotPresent; | |
1181 | |
1182 TRACE_FUNCTION("queatPlusFIE()"); | |
1183 | |
1184 ret = qAT_PlusFIE(srcId, &val); | |
1185 if (ret EQ AT_CMPL) | |
1186 { | |
1187 sprintf(g_sa,"+FIE:%d",val); | |
1188 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
1189 } | |
1190 else | |
1191 { | |
1192 cmdAtError(atError); | |
1193 } | |
1194 return (map_aci_2_ati_rslt(ret)); | |
1195 } | |
1196 | |
1197 /* | |
1198 +--------------------------------------------------------------------+ | |
1199 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
1200 | STATE : code ROUTINE : atPlusFIS | | |
1201 +--------------------------------------------------------------------+ | |
1202 | |
1203 PURPOSE : | |
1204 | |
1205 ITU-T.32/8.5.1.2 Current session parameters, +FIS | |
1206 | |
1207 – Write syntax: +FIS=VR,BR,WD,LN,DF,EC,BF,ST,JP | |
1208 – Valid values: see Table 21 | |
1209 – Default values: set by manufacturer | |
1210 – Mandatory values: as required by Recommendation T.30. | |
1211 | |
1212 The +FIS parameter allows the DTE to sense and constrain | |
1213 the capabilities used for the current session. | |
1214 The DCE uses +FIS to generate DIS or DTC messages directly, | |
1215 and uses +FIS and received DIS messages to generate DCS messages. | |
1216 | |
1217 The DCE shall set the +FIS parameter from the +FCC parameter | |
1218 on DCE initialization, | |
1219 upon +FIP command execution, when +FCC is written, | |
1220 and at the end of a session. | |
1221 */ | |
1222 | |
1223 GLOBAL T_ATI_RSLT setatPlusFIS (char *cl, UBYTE srcId) | |
1224 { | |
1225 T_ACI_RETURN ret = AT_FAIL; | |
1226 T_ACI_F_VR vr = F_VR_NotPresent; | |
1227 T_ACI_F_BR br = F_BR_NotPresent; | |
1228 T_ACI_F_WD wd = F_WD_NotPresent; | |
1229 T_ACI_F_LN ln = F_LN_NotPresent; | |
1230 T_ACI_F_DF df = F_DF_NotPresent; | |
1231 T_ACI_F_EC ec = F_EC_NotPresent; | |
1232 T_ACI_F_BF bf = F_BF_NotPresent; | |
1233 T_ACI_F_ST st = F_ST_NotPresent; | |
1234 T_ACI_F_JP jp = F_JP_NotPresent; | |
1235 | |
1236 UBYTE bvr = NOT_PRESENT_8BIT, | |
1237 bbf = NOT_PRESENT_8BIT, | |
1238 bjp = NOT_PRESENT_8BIT; | |
1239 | |
1240 | |
1241 cl = parse(cl,"xdddddxdx",&bvr,&br,&wd,&ln,&df,&ec,&bbf,&st,&bjp); | |
1242 | |
1243 if (bvr NEQ NOT_PRESENT_8BIT) | |
1244 vr = (LONG)bvr; | |
1245 | |
1246 if (bbf NEQ NOT_PRESENT_8BIT) | |
1247 bf=(LONG)bbf; | |
1248 | |
1249 if (bjp NEQ NOT_PRESENT_8BIT) | |
1250 jp=(LONG)bjp; | |
1251 | |
1252 if ( !cl ) | |
1253 { | |
1254 cmdAtError(atError); | |
1255 return ATI_FAIL; | |
1256 } | |
1257 | |
1258 #ifdef FF_ATI_BAT | |
1259 { | |
1260 T_BAT_cmd_send cmd; | |
1261 T_BAT_cmd_set_plus_fis my_bat_set_plus_fis; | |
1262 | |
1263 TRACE_FUNCTION("setatPlusFIS() calls bat_send() <=== as APPLICATION"); | |
1264 | |
1265 memset(&my_bat_set_plus_fis, 0, sizeof(my_bat_set_plus_fis)); | |
1266 cmd.ctrl_params = BAT_CMD_SET_PLUS_FIS; | |
1267 cmd.params.ptr_set_plus_fis = &my_bat_set_plus_fis; | |
1268 | |
1269 my_bat_set_plus_fis.vr = vr; | |
1270 my_bat_set_plus_fis.br = br; | |
1271 my_bat_set_plus_fis.wd = wd; | |
1272 my_bat_set_plus_fis.ln = ln; | |
1273 my_bat_set_plus_fis.df = df; | |
1274 my_bat_set_plus_fis.ec = ec; | |
1275 my_bat_set_plus_fis.bf = bf; | |
1276 my_bat_set_plus_fis.st = st; | |
1277 my_bat_set_plus_fis.jp = jp; | |
1278 | |
1279 bat_send(ati_bat_get_client(srcId), &cmd); | |
1280 | |
1281 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
1282 } | |
1283 #else /* OLD FUNCTION BODY */ | |
1284 | |
1285 TRACE_FUNCTION("setatPlusFIS()"); | |
1286 | |
1287 ret = sAT_PlusFIS(srcId,vr,br,wd,ln,df,ec,bf,st,jp); | |
1288 if (ret EQ AT_FAIL) | |
1289 { | |
1290 cmdAtError(atError); | |
1291 } | |
1292 return (map_aci_2_ati_rslt(ret)); | |
1293 | |
1294 #endif /* no FF_ATI_BAT*/ | |
1295 } | |
1296 | |
1297 GLOBAL T_ATI_RSLT queatPlusFIS (char *cl, UBYTE srcId) | |
1298 { | |
1299 T_ACI_RETURN ret = AT_FAIL; | |
1300 T_ACI_F_VR vr = F_VR_NotPresent; | |
1301 T_ACI_F_BR br = F_BR_NotPresent; | |
1302 T_ACI_F_WD wd = F_WD_NotPresent; | |
1303 T_ACI_F_LN ln = F_LN_NotPresent; | |
1304 T_ACI_F_DF df = F_DF_NotPresent; | |
1305 T_ACI_F_EC ec = F_EC_NotPresent; | |
1306 T_ACI_F_BF bf = F_BF_NotPresent; | |
1307 T_ACI_F_ST st = F_ST_NotPresent; | |
1308 T_ACI_F_JP jp = F_JP_NotPresent; | |
1309 SHORT bvr = -1, | |
1310 bbf = -1, | |
1311 bjp = -1; | |
1312 TRACE_FUNCTION("queatPlusFIS()"); | |
1313 | |
1314 ret = qAT_PlusFIS(srcId, &vr,&br,&wd,&ln,&df,&ec,&bf,&st,&jp); | |
1315 if (ret EQ AT_CMPL) | |
1316 { | |
1317 sprintf(g_sa,"+FIS:%X,%d,%d,%d,%d,%d,%X,%d,%X",vr,br,wd,ln,df,ec,bf,st,jp); | |
1318 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
1319 } | |
1320 else | |
1321 { | |
1322 cmdAtError(atError); | |
1323 } | |
1324 return (map_aci_2_ati_rslt(ret)); | |
1325 } | |
1326 | |
1327 /* | |
1328 +--------------------------------------------------------------------+ | |
1329 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
1330 | STATE : code ROUTINE : atPlusFLI | | |
1331 +--------------------------------------------------------------------+ | |
1332 | |
1333 PURPOSE : +FLI command (Local Station ID) | |
1334 */ | |
1335 | |
1336 GLOBAL T_ATI_RSLT setatPlusFLI (char *cl, UBYTE srcId) | |
1337 { | |
1338 T_ACI_RETURN ret = AT_FAIL; | |
1339 char idstr[MAX_ID_CHAR]={0}; | |
1340 | |
1341 cl = parse(cl, "s", (LONG)MAX_ID_CHAR, idstr); | |
1342 if ( !cl ) | |
1343 { | |
1344 cmdAtError(atError); | |
1345 return ATI_FAIL; | |
1346 } | |
1347 #ifdef FF_ATI_BAT | |
1348 { | |
1349 T_BAT_cmd_send cmd; | |
1350 T_BAT_cmd_set_plus_fli my_bat_set_plus_fli; | |
1351 | |
1352 TRACE_FUNCTION("setatPlusFLI() calls bat_send() <=== as APPLICATION"); | |
1353 | |
1354 memset(&my_bat_set_plus_fli, 0, sizeof(my_bat_set_plus_fli)); | |
1355 cmd.ctrl_params = BAT_CMD_SET_PLUS_FLI; | |
1356 cmd.params.ptr_set_plus_fli = &my_bat_set_plus_fli; | |
1357 | |
1358 my_bat_set_plus_fli.c_id_str = strlen(idstr); | |
1359 memcpy(my_bat_set_plus_fli.id_str, idstr, my_bat_set_plus_fli.c_id_str); | |
1360 | |
1361 bat_send(ati_bat_get_client(srcId), &cmd); | |
1362 | |
1363 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
1364 } | |
1365 #else /* OLD FUNCTION BODY */ | |
1366 | |
1367 TRACE_FUNCTION("setatPlusFLI()"); | |
1368 | |
1369 ret = sAT_PlusFLI(srcId,idstr); | |
1370 if (ret EQ AT_FAIL) | |
1371 { | |
1372 cmdAtError(atError); | |
1373 } | |
1374 return (map_aci_2_ati_rslt(ret)); | |
1375 | |
1376 #endif /* no FF_ATI_BAT*/ | |
1377 } | |
1378 | |
1379 GLOBAL T_ATI_RSLT queatPlusFLI (char *cl, UBYTE srcId) | |
1380 { | |
1381 T_ACI_RETURN ret = AT_FAIL; | |
1382 char idstr[MAX_ID_CHAR]={0}; | |
1383 | |
1384 TRACE_FUNCTION("queatPlusFLI()"); | |
1385 | |
1386 ret = qAT_PlusFLI(srcId, idstr); | |
1387 if (ret EQ AT_CMPL) | |
1388 { | |
1389 sprintf(g_sa,"+FLI:\"%s\"",idstr); | |
1390 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
1391 } | |
1392 else | |
1393 { | |
1394 cmdAtError(atError); | |
1395 } | |
1396 return (map_aci_2_ati_rslt(ret)); | |
1397 } | |
1398 | |
1399 /* | |
1400 +--------------------------------------------------------------------+ | |
1401 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
1402 | STATE : code ROUTINE : atPlusFLP | | |
1403 +--------------------------------------------------------------------+ | |
1404 | |
1405 PURPOSE : +FLP command (document to poll indication) | |
1406 */ | |
1407 | |
1408 GLOBAL T_ATI_RSLT setatPlusFLP (char *cl, UBYTE srcId) | |
1409 { | |
1410 T_ACI_RETURN ret = AT_FAIL; | |
1411 T_ACI_FLP_VAL val=FLP_VAL_NotPresent; | |
1412 | |
1413 cl = parse(cl,"d",&val); | |
1414 if ( !cl) | |
1415 { | |
1416 cmdAtError(atError); | |
1417 return ATI_FAIL; | |
1418 } | |
1419 #ifdef FF_ATI_BAT | |
1420 { | |
1421 T_BAT_cmd_send cmd; | |
1422 T_BAT_cmd_set_plus_flp my_bat_set_plus_flp; | |
1423 | |
1424 TRACE_FUNCTION("setatPlusFLP() calls bat_send() <=== as APPLICATION"); | |
1425 | |
1426 memset(&my_bat_set_plus_flp, 0, sizeof(my_bat_set_plus_flp)); | |
1427 cmd.ctrl_params = BAT_CMD_SET_PLUS_FLP; | |
1428 cmd.params.ptr_set_plus_flp = &my_bat_set_plus_flp; | |
1429 | |
1430 my_bat_set_plus_flp.value = val; | |
1431 | |
1432 bat_send(ati_bat_get_client(srcId), &cmd); | |
1433 | |
1434 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
1435 } | |
1436 #else /* OLD FUNCTION BODY */ | |
1437 | |
1438 TRACE_FUNCTION("setatPlusFLP()"); | |
1439 | |
1440 ret = sAT_PlusFLP(srcId,val); | |
1441 if (ret EQ AT_FAIL) | |
1442 { | |
1443 cmdAtError(atError); | |
1444 } | |
1445 return (map_aci_2_ati_rslt(ret)); | |
1446 | |
1447 #endif /* no FF_ATI_BAT*/ | |
1448 } | |
1449 | |
1450 GLOBAL T_ATI_RSLT queatPlusFLP (char *cl, UBYTE srcId) | |
1451 { | |
1452 T_ACI_RETURN ret = AT_FAIL; | |
1453 T_ACI_FLP_VAL val=FLP_VAL_NotPresent; | |
1454 | |
1455 TRACE_FUNCTION("queatPlusFLP()"); | |
1456 | |
1457 ret = qAT_PlusFLP(srcId, &val); | |
1458 if (ret EQ AT_CMPL) | |
1459 { | |
1460 sprintf(g_sa,"+FLP:%d",val); | |
1461 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
1462 } | |
1463 else | |
1464 { | |
1465 cmdAtError(atError); | |
1466 } | |
1467 return (map_aci_2_ati_rslt(ret)); | |
1468 } | |
1469 | |
1470 /* | |
1471 +--------------------------------------------------------------------+ | |
1472 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
1473 | STATE : code ROUTINE : atPlusFMS | | |
1474 +--------------------------------------------------------------------+ | |
1475 | |
1476 PURPOSE : +FMS command (minimum phase C speed) | |
1477 */ | |
1478 | |
1479 GLOBAL T_ATI_RSLT setatPlusFMS (char *cl, UBYTE srcId) | |
1480 { | |
1481 T_ACI_RETURN ret = AT_FAIL; | |
1482 T_ACI_F_BR val=F_BR_NotPresent; | |
1483 | |
1484 cl = parse(cl,"d",&val); | |
1485 if ( !cl) | |
1486 { | |
1487 cmdAtError(atError); | |
1488 return ATI_FAIL; | |
1489 } | |
1490 #ifdef FF_ATI_BAT | |
1491 { | |
1492 T_BAT_cmd_send cmd; | |
1493 T_BAT_cmd_set_plus_fms my_bat_set_plus_fms; | |
1494 | |
1495 TRACE_FUNCTION("setatPlusFMS() calls bat_send() <=== as APPLICATION"); | |
1496 | |
1497 memset(&my_bat_set_plus_fms, 0, sizeof(my_bat_set_plus_fms)); | |
1498 cmd.ctrl_params = BAT_CMD_SET_PLUS_FMS; | |
1499 cmd.params.ptr_set_plus_fms = &my_bat_set_plus_fms; | |
1500 | |
1501 my_bat_set_plus_fms.value = val; | |
1502 | |
1503 bat_send(ati_bat_get_client(srcId), &cmd); | |
1504 | |
1505 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
1506 } | |
1507 #else /* OLD FUNCTION BODY */ | |
1508 | |
1509 TRACE_FUNCTION("setatPlusFMS()"); | |
1510 | |
1511 ret = sAT_PlusFMS(srcId, val); | |
1512 if (ret EQ AT_FAIL) | |
1513 { | |
1514 cmdAtError(atError); | |
1515 } | |
1516 return (map_aci_2_ati_rslt(ret)); | |
1517 | |
1518 #endif /* no FF_ATI_BAT*/ | |
1519 } | |
1520 | |
1521 GLOBAL T_ATI_RSLT queatPlusFMS (char *cl, UBYTE srcId) | |
1522 { | |
1523 T_ACI_RETURN ret = AT_FAIL; | |
1524 T_ACI_F_BR val=F_BR_NotPresent; | |
1525 | |
1526 TRACE_FUNCTION("queatPlusFMS()"); | |
1527 | |
1528 ret=qAT_PlusFMS(srcId, &val); | |
1529 if (ret EQ AT_CMPL) | |
1530 { | |
1531 sprintf(g_sa,"+FMS:%d",val); | |
1532 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
1533 } | |
1534 else | |
1535 { | |
1536 cmdAtError(atError); | |
1537 } | |
1538 return (map_aci_2_ati_rslt(ret)); | |
1539 } | |
1540 | |
1541 /* | |
1542 +--------------------------------------------------------------------+ | |
1543 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
1544 | STATE : code ROUTINE : atPlusFNR | | |
1545 +--------------------------------------------------------------------+ | |
1546 | |
1547 PURPOSE : +FNR | |
1548 */ | |
1549 | |
1550 GLOBAL T_ATI_RSLT setatPlusFNR(char *cl, UBYTE srcId) | |
1551 { | |
1552 SHORT r=-1,t=-1,i=-1,n=-1; | |
1553 | |
1554 cl = parse(cl,"rrrr",&r,&t,&i,&n); | |
1555 if (!cl OR r > 1 OR t > 1 OR i > 1 OR n > 1 | |
1556 OR (r EQ -1 AND t EQ -1 AND i EQ -1 AND n EQ -1)) | |
1557 { | |
1558 cmdAtError(atError); | |
1559 return ATI_FAIL; | |
1560 } | |
1561 #ifdef FF_ATI_BAT | |
1562 { | |
1563 /* | |
1564 T_BAT_cmd_send cmd; | |
1565 T_BAT_cmd_set_plus_fnr my_bat_set_plus_fnr; //??? | |
1566 | |
1567 TRACE_FUNCTION("setatPlusFNR() calls bat_send() <=== as APPLICATION"); | |
1568 | |
1569 memset(&my_bat_set_plus_fnr, 0, sizeof(my_bat_set_plus_fnr)); | |
1570 cmd.ctrl_params = BAT_CMD_SET_PLUS_FNR; | |
1571 cmd.params.ptr_set_plus_fnr = &my_bat_set_plus_fnr; | |
1572 | |
1573 my_bat_set_plus_fnr.value = val; | |
1574 bat_send(ati_bat_get_client(srcId), &cmd); | |
1575 | |
1576 return ATI_EXCT; | |
1577 */ | |
1578 TRACE_EVENT("setatPlusFNR(): is obsolete ? <=== !!! consult KJF"); | |
1579 return ATI_FAIL; | |
1580 } | |
1581 #else /* OLD FUNCTION BODY */ | |
1582 | |
1583 TRACE_FUNCTION("setatPlusFNR()"); | |
1584 if(r NEQ -1) | |
1585 fd.FNR.rpr_stat = (char) r; | |
1586 if(t NEQ -1) | |
1587 fd.FNR.tpr_stat = (char) t; | |
1588 if(i NEQ -1) | |
1589 fd.FNR.idr_stat = (char) i; | |
1590 if(n NEQ -1) | |
1591 fd.FNR.nsr_stat = (char) n; | |
1592 return ATI_CMPL; | |
1593 | |
1594 #endif /* no FF_ATI_BAT*/ | |
1595 } | |
1596 | |
1597 GLOBAL T_ATI_RSLT queatPlusFNR(char *cl, UBYTE srcId) | |
1598 { | |
1599 SHORT r=-1,t=-1,i=-1,n=-1; | |
1600 | |
1601 TRACE_FUNCTION("queatPlusFNR()"); | |
1602 sprintf(g_sa,"+FNR:%d,%d,%d,%d",fd.FNR.rpr_stat,fd.FNR.tpr_stat,fd.FNR.idr_stat,fd.FNR.nsr_stat); | |
1603 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
1604 return ATI_CMPL; | |
1605 } | |
1606 | |
1607 /* | |
1608 +--------------------------------------------------------------------+ | |
1609 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
1610 | STATE : code ROUTINE : atPlusFND | | |
1611 +--------------------------------------------------------------------+ | |
1612 | |
1613 PURPOSE : +FND command (NSF message data indication) | |
1614 */ | |
1615 | |
1616 GLOBAL T_ATI_RSLT setatPlusFND (char *cl, UBYTE srcId) | |
1617 { | |
1618 T_ACI_RETURN ret = AT_FAIL; | |
1619 T_ACI_FND_VAL val=FND_VAL_NotPresent; | |
1620 | |
1621 cl = parse(cl,"d",&val); | |
1622 if ( !cl) | |
1623 { | |
1624 cmdAtError(atError); | |
1625 return ATI_FAIL; | |
1626 } | |
1627 #ifdef FF_ATI_BAT | |
1628 { | |
1629 /* | |
1630 T_BAT_cmd_send cmd; | |
1631 T_BAT_cmd_set_plus_fnd my_bat_set_plus_fnd; //??? | |
1632 | |
1633 TRACE_FUNCTION("setatPlusFND() calls bat_send() <=== as APPLICATION"); | |
1634 | |
1635 memset(&my_bat_set_plus_fnd, 0, sizeof(my_bat_set_plus_fnd)); | |
1636 cmd.ctrl_params = BAT_CMD_SET_PLUS_FND; | |
1637 cmd.params.ptr_set_plus_fnd = &my_bat_set_plus_fnd; | |
1638 | |
1639 my_bat_set_plus_fnd.value = val; | |
1640 bat_send(ati_bat_get_client(srcId), &cmd); | |
1641 | |
1642 return ATI_EXCT; | |
1643 */ | |
1644 TRACE_EVENT("setatPlusFND(): is obsolete ? <=== !!! consult KJF"); | |
1645 return ATI_FAIL; | |
1646 } | |
1647 #else /* OLD FUNCTION BODY */ | |
1648 | |
1649 TRACE_FUNCTION("setatPlusFND()"); | |
1650 | |
1651 ret = sAT_PlusFND(srcId,val); | |
1652 if (ret EQ AT_FAIL) | |
1653 { | |
1654 cmdAtError(atError); | |
1655 } | |
1656 return (map_aci_2_ati_rslt(ret)); | |
1657 | |
1658 #endif /* no FF_ATI_BAT*/ | |
1659 } | |
1660 | |
1661 GLOBAL T_ATI_RSLT queatPlusFND (char *cl, UBYTE srcId) | |
1662 { | |
1663 T_ACI_RETURN ret = AT_FAIL; | |
1664 T_ACI_FND_VAL val=FND_VAL_NotPresent; | |
1665 | |
1666 TRACE_FUNCTION("queatPlusFND()"); | |
1667 | |
1668 ret = qAT_PlusFND(srcId, &val); | |
1669 if (ret EQ AT_CMPL) | |
1670 { | |
1671 sprintf(g_sa,"+FND:%d",val); | |
1672 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
1673 } | |
1674 else | |
1675 { | |
1676 cmdAtError(atError); | |
1677 } | |
1678 return (map_aci_2_ati_rslt(ret)); | |
1679 } | |
1680 | |
1681 /* | |
1682 +--------------------------------------------------------------------+ | |
1683 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
1684 | STATE : code ROUTINE : atPlusFNS | | |
1685 +--------------------------------------------------------------------+ | |
1686 | |
1687 PURPOSE : +FNS command (non standard facilities) | |
1688 */ | |
1689 | |
1690 GLOBAL T_ATI_RSLT setatPlusFNS (char *cl, UBYTE srcId) | |
1691 { | |
1692 char *me="+FNS:"; /* weird...!! */ | |
1693 T_ACI_RETURN ret = AT_FAIL; | |
1694 UBYTE len=0; | |
1695 UBYTE nsf[90]; | |
1696 LOCAL char nsf_str[269]={0}; | |
1697 char buf [3]; | |
1698 SHORT i=0; | |
1699 | |
1700 cl = parse(cl, "s", (LONG)269, nsf_str); | |
1701 if ( !cl ) | |
1702 { | |
1703 cmdAtError(atError); | |
1704 return ATI_FAIL; | |
1705 } | |
1706 | |
1707 compact(nsf_str,(USHORT)strlen(nsf_str)); | |
1708 while (nsf_str[i] NEQ '\0') | |
1709 { | |
1710 buf[0]=nsf_str[i++]; | |
1711 buf[1]=nsf_str[i++]; | |
1712 buf[2]='\0'; | |
1713 me = parse (buf, "x", &nsf[len++]); | |
1714 if (!me) | |
1715 { | |
1716 cmdAtError(atError); | |
1717 return ATI_FAIL; | |
1718 } | |
1719 } | |
1720 #ifdef FF_ATI_BAT | |
1721 { | |
1722 T_BAT_cmd_send cmd; | |
1723 T_BAT_cmd_set_plus_fns my_bat_set_plus_fns; | |
1724 | |
1725 TRACE_FUNCTION("setatPlusFNS() calls bat_send() <=== as APPLICATION"); | |
1726 | |
1727 memset(&my_bat_set_plus_fns, 0, sizeof(my_bat_set_plus_fns)); | |
1728 cmd.ctrl_params = BAT_CMD_SET_PLUS_FNS; | |
1729 cmd.params.ptr_set_plus_fns = &my_bat_set_plus_fns; | |
1730 | |
1731 my_bat_set_plus_fns.v_nsf = TRUE; | |
1732 my_bat_set_plus_fns.c_nsf = len; | |
1733 memcpy(my_bat_set_plus_fns.nsf, nsf, len); | |
1734 | |
1735 bat_send(ati_bat_get_client(srcId), &cmd); | |
1736 | |
1737 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
1738 } | |
1739 #else /* OLD FUNCTION BODY */ | |
1740 | |
1741 TRACE_FUNCTION("setatPlusFNS()"); | |
1742 | |
1743 ret = sAT_PlusFNS(srcId, len, nsf); | |
1744 if (ret EQ AT_FAIL) | |
1745 { | |
1746 cmdAtError(atError); | |
1747 } | |
1748 return (map_aci_2_ati_rslt(ret)); | |
1749 | |
1750 #endif /* no FF_ATI_BAT*/ | |
1751 } | |
1752 | |
1753 GLOBAL T_ATI_RSLT queatPlusFNS (char *cl, UBYTE srcId) | |
1754 { | |
1755 T_ACI_RETURN ret = AT_FAIL; | |
1756 UBYTE len=0; | |
1757 UBYTE nsf[90]; | |
1758 LOCAL char nsf_str[269]={0}; | |
1759 SHORT i=0; | |
1760 | |
1761 TRACE_FUNCTION("queatPlusFNS()"); | |
1762 | |
1763 ret=qAT_PlusFNS(srcId, &len, nsf); | |
1764 if (ret EQ AT_CMPL) | |
1765 { | |
1766 strcpy(g_sa,"+FNS:"); | |
1767 OutHexReport(srcId, (USHORT)len, nsf); | |
1768 } | |
1769 else | |
1770 { | |
1771 cmdAtError(atError); | |
1772 } | |
1773 return (map_aci_2_ati_rslt(ret)); | |
1774 } | |
1775 | |
1776 /* | |
1777 +--------------------------------------------------------------------+ | |
1778 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
1779 | STATE : code ROUTINE : atPlusFPA | | |
1780 +--------------------------------------------------------------------+ | |
1781 | |
1782 PURPOSE : +FPA command (selective polling address string) | |
1783 */ | |
1784 | |
1785 GLOBAL T_ATI_RSLT setatPlusFPA (char *cl, UBYTE srcId) | |
1786 { | |
1787 T_ACI_RETURN ret = AT_FAIL; | |
1788 char sepstr[MAX_ID_CHAR]={0}; | |
1789 | |
1790 cl =parse(cl,"s",(LONG)MAX_ID_CHAR,sepstr); | |
1791 if (!cl) | |
1792 { | |
1793 cmdAtError(atError); | |
1794 return ATI_FAIL; | |
1795 } | |
1796 #ifdef FF_ATI_BAT | |
1797 { | |
1798 T_BAT_cmd_send cmd; | |
1799 T_BAT_cmd_set_plus_fpa my_bat_set_plus_fpa; | |
1800 | |
1801 TRACE_FUNCTION("setatPlusFPA() calls bat_send() <=== as APPLICATION"); | |
1802 | |
1803 memset(&my_bat_set_plus_fpa, 0, sizeof(my_bat_set_plus_fpa)); | |
1804 cmd.ctrl_params = BAT_CMD_SET_PLUS_FPA; | |
1805 cmd.params.ptr_set_plus_fpa = &my_bat_set_plus_fpa; | |
1806 | |
1807 my_bat_set_plus_fpa.c_spa_str = strlen(sepstr); | |
1808 memcpy(my_bat_set_plus_fpa.spa_str, sepstr, my_bat_set_plus_fpa.c_spa_str); | |
1809 | |
1810 bat_send(ati_bat_get_client(srcId), &cmd); | |
1811 | |
1812 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
1813 } | |
1814 #else /* OLD FUNCTION BODY */ | |
1815 | |
1816 TRACE_FUNCTION("setatPlusFPA()"); | |
1817 | |
1818 ret = sAT_PlusFPA(srcId, sepstr); | |
1819 if (ret EQ AT_FAIL) | |
1820 { | |
1821 cmdAtError(atError); | |
1822 } | |
1823 return (map_aci_2_ati_rslt(ret)); | |
1824 | |
1825 #endif /* no FF_ATI_BAT*/ | |
1826 } | |
1827 | |
1828 GLOBAL T_ATI_RSLT queatPlusFPA (char *cl, UBYTE srcId) | |
1829 { | |
1830 T_ACI_RETURN ret = AT_FAIL; | |
1831 char sepstr[MAX_ID_CHAR]={0}; | |
1832 | |
1833 TRACE_FUNCTION("atPlusFPA()"); | |
1834 | |
1835 ret = qAT_PlusFPA(srcId, sepstr); | |
1836 if (ret EQ AT_CMPL) | |
1837 { | |
1838 sprintf(g_sa,"+FPA:\"%s\"",sepstr); | |
1839 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
1840 } | |
1841 else | |
1842 { | |
1843 cmdAtError(atError); | |
1844 } | |
1845 return (map_aci_2_ati_rslt(ret)); | |
1846 } | |
1847 | |
1848 /* | |
1849 +--------------------------------------------------------------------+ | |
1850 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
1851 | STATE : code ROUTINE : atPlusFPI | | |
1852 +--------------------------------------------------------------------+ | |
1853 | |
1854 PURPOSE : +FPI command (local fax station id string) | |
1855 */ | |
1856 | |
1857 GLOBAL T_ATI_RSLT setatPlusFPI (char *cl, UBYTE srcId) | |
1858 { | |
1859 T_ACI_RETURN ret = AT_FAIL; | |
1860 char idstr[MAX_ID_CHAR] = {0}; | |
1861 | |
1862 cl = parse(cl, "s", (LONG)MAX_ID_CHAR, idstr); | |
1863 if (!cl) | |
1864 { | |
1865 cmdAtError(atError); | |
1866 return ATI_FAIL; | |
1867 } | |
1868 #ifdef FF_ATI_BAT | |
1869 { | |
1870 T_BAT_cmd_send cmd; | |
1871 T_BAT_cmd_set_plus_fpi my_bat_set_plus_fpi; | |
1872 | |
1873 TRACE_FUNCTION("setatPlusFPI() calls bat_send() <=== as APPLICATION"); | |
1874 | |
1875 memset(&my_bat_set_plus_fpi, 0, sizeof(my_bat_set_plus_fpi)); | |
1876 cmd.ctrl_params = BAT_CMD_SET_PLUS_FPI; | |
1877 cmd.params.ptr_set_plus_fpi = &my_bat_set_plus_fpi; | |
1878 | |
1879 my_bat_set_plus_fpi.c_id_str = strlen(idstr); | |
1880 memcpy(my_bat_set_plus_fpi.id_str, idstr, my_bat_set_plus_fpi.c_id_str); | |
1881 | |
1882 bat_send(ati_bat_get_client(srcId), &cmd); | |
1883 | |
1884 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
1885 } | |
1886 #else /* OLD FUNCTION BODY */ | |
1887 | |
1888 TRACE_FUNCTION("setatPlusFPI()"); | |
1889 | |
1890 ret = sAT_PlusFPI(srcId, idstr); | |
1891 if (ret EQ AT_FAIL) | |
1892 { | |
1893 cmdAtError(atError); | |
1894 } | |
1895 return (map_aci_2_ati_rslt(ret)); | |
1896 | |
1897 #endif /* no FF_ATI_BAT*/ | |
1898 } | |
1899 | |
1900 GLOBAL T_ATI_RSLT queatPlusFPI (char *cl, UBYTE srcId) | |
1901 { | |
1902 T_ACI_RETURN ret = AT_FAIL; | |
1903 char idstr[MAX_ID_CHAR]={0}; | |
1904 | |
1905 TRACE_FUNCTION("queatPlusFPI()"); | |
1906 | |
1907 ret = qAT_PlusFPI(srcId, idstr); | |
1908 if (ret EQ AT_CMPL) | |
1909 { | |
1910 sprintf(g_sa,"+FPI:\"%s\"",idstr); | |
1911 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
1912 } | |
1913 else | |
1914 { | |
1915 cmdAtError(atError); | |
1916 } | |
1917 return (map_aci_2_ati_rslt(ret)); | |
1918 } | |
1919 | |
1920 /* | |
1921 +--------------------------------------------------------------------+ | |
1922 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
1923 | STATE : code ROUTINE : atPlusFPS | | |
1924 +--------------------------------------------------------------------+ | |
1925 | |
1926 PURPOSE : +FPS command (page status) | |
1927 */ | |
1928 | |
1929 GLOBAL T_ATI_RSLT setatPlusFPS (char *cl, UBYTE srcId) | |
1930 { | |
1931 T_ACI_RETURN ret = AT_FAIL; | |
1932 T_ACI_FPS_PPR ppr=FPS_PPR_NotPresent; | |
1933 | |
1934 cl = parse(cl,"d",&ppr); | |
1935 if ( !cl) | |
1936 { | |
1937 cmdAtError(atError); | |
1938 return ATI_FAIL; | |
1939 } | |
1940 #ifdef FF_ATI_BAT | |
1941 { | |
1942 T_BAT_cmd_send cmd; | |
1943 T_BAT_cmd_set_plus_fps my_bat_set_plus_fps; | |
1944 | |
1945 TRACE_FUNCTION("setatPlusFPS() calls bat_send() <=== as APPLICATION"); | |
1946 | |
1947 memset(&my_bat_set_plus_fps, 0, sizeof(my_bat_set_plus_fps)); | |
1948 cmd.ctrl_params = BAT_CMD_SET_PLUS_FPS; | |
1949 cmd.params.ptr_set_plus_fps = &my_bat_set_plus_fps; | |
1950 | |
1951 my_bat_set_plus_fps.ppr = ppr; | |
1952 | |
1953 bat_send(ati_bat_get_client(srcId), &cmd); | |
1954 | |
1955 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
1956 } | |
1957 #else /* OLD FUNCTION BODY */ | |
1958 | |
1959 TRACE_FUNCTION("setatPlusFPS()"); | |
1960 | |
1961 ret = sAT_PlusFPS(srcId, ppr); | |
1962 if (ret EQ AT_FAIL) | |
1963 { | |
1964 cmdAtError(atError); | |
1965 } | |
1966 return (map_aci_2_ati_rslt(ret)); | |
1967 | |
1968 #endif /* no FF_ATI_BAT*/ | |
1969 } | |
1970 | |
1971 GLOBAL T_ATI_RSLT queatPlusFPS (char *cl, UBYTE srcId) | |
1972 { | |
1973 T_ACI_RETURN ret = AT_FAIL; | |
1974 T_ACI_FPS_PPR ppr=FPS_PPR_NotPresent; | |
1975 | |
1976 TRACE_FUNCTION("queatPlusFPS()"); | |
1977 | |
1978 ret = qAT_PlusFPS(srcId, &ppr); | |
1979 if (ret EQ AT_CMPL) | |
1980 { | |
1981 sprintf(g_sa,"+FPS:%d",ppr); | |
1982 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
1983 } | |
1984 else | |
1985 { | |
1986 cmdAtError(atError); | |
1987 } | |
1988 return (map_aci_2_ati_rslt(ret)); | |
1989 } | |
1990 | |
1991 /* | |
1992 +--------------------------------------------------------------------+ | |
1993 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
1994 | STATE : code ROUTINE : atPlusFPW | | |
1995 +--------------------------------------------------------------------+ | |
1996 | |
1997 PURPOSE : +FPW command (password string) | |
1998 */ | |
1999 | |
2000 GLOBAL T_ATI_RSLT setatPlusFPW (char *cl, UBYTE srcId) | |
2001 { | |
2002 T_ACI_RETURN ret = AT_FAIL; | |
2003 char pwdstr[MAX_ID_CHAR]={0}; | |
2004 | |
2005 cl = parse(cl,"s",(LONG)MAX_ID_CHAR,pwdstr); | |
2006 if (!cl) | |
2007 { | |
2008 cmdAtError(atError); | |
2009 return ATI_FAIL; | |
2010 } | |
2011 #ifdef FF_ATI_BAT | |
2012 { | |
2013 T_BAT_cmd_send cmd; | |
2014 T_BAT_cmd_set_plus_fpw my_bat_set_plus_fpw; | |
2015 | |
2016 TRACE_FUNCTION("setatPlusFPW() calls bat_send() <=== as APPLICATION"); | |
2017 | |
2018 memset(&my_bat_set_plus_fpw, 0, sizeof(my_bat_set_plus_fpw)); | |
2019 cmd.ctrl_params = BAT_CMD_SET_PLUS_FPW; | |
2020 cmd.params.ptr_set_plus_fpw = &my_bat_set_plus_fpw; | |
2021 | |
2022 my_bat_set_plus_fpw.c_pw_str = strlen(pwdstr); | |
2023 memcpy(my_bat_set_plus_fpw.pw_str, pwdstr, my_bat_set_plus_fpw.c_pw_str); | |
2024 | |
2025 bat_send(ati_bat_get_client(srcId), &cmd); | |
2026 | |
2027 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
2028 } | |
2029 #else /* OLD FUNCTION BODY */ | |
2030 | |
2031 TRACE_FUNCTION("setatPlusFPW()"); | |
2032 | |
2033 ret = sAT_PlusFPW(srcId, pwdstr); | |
2034 if (ret EQ AT_FAIL) | |
2035 { | |
2036 cmdAtError(atError); | |
2037 } | |
2038 return (map_aci_2_ati_rslt(ret)); | |
2039 | |
2040 #endif /* no FF_ATI_BAT*/ | |
2041 } | |
2042 | |
2043 GLOBAL T_ATI_RSLT queatPlusFPW (char *cl, UBYTE srcId) | |
2044 { | |
2045 T_ACI_RETURN ret = AT_FAIL; | |
2046 char pwdstr[MAX_ID_CHAR]={0}; | |
2047 | |
2048 TRACE_FUNCTION("queatPlusFPW()"); | |
2049 | |
2050 ret = qAT_PlusFPW(srcId, pwdstr); | |
2051 if (ret EQ AT_CMPL) | |
2052 { | |
2053 sprintf(g_sa,"+FPW:\"%s\"",pwdstr); | |
2054 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
2055 } | |
2056 else | |
2057 { | |
2058 cmdAtError(atError); | |
2059 } | |
2060 return (map_aci_2_ati_rslt(ret)); | |
2061 } | |
2062 | |
2063 /* | |
2064 +--------------------------------------------------------------------+ | |
2065 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2066 | STATE : code ROUTINE : atPlusFRQ | | |
2067 +--------------------------------------------------------------------+ | |
2068 | |
2069 PURPOSE : +FRQ command (quality control) | |
2070 */ | |
2071 | |
2072 GLOBAL T_ATI_RSLT setatPlusFRQ (char *cl, UBYTE srcId) | |
2073 { | |
2074 T_ACI_RETURN ret = AT_FAIL; | |
2075 UBYTE pgl = NOT_PRESENT_8BIT, | |
2076 cbl = NOT_PRESENT_8BIT; | |
2077 | |
2078 cl = parse(cl,"xx",&pgl,&cbl); | |
2079 if ( !cl ) | |
2080 { | |
2081 cmdAtError(atError); | |
2082 return ATI_FAIL; | |
2083 } | |
2084 #ifdef FF_ATI_BAT | |
2085 { | |
2086 T_BAT_cmd_send cmd; | |
2087 T_BAT_cmd_set_plus_frq my_bat_set_plus_frq; | |
2088 | |
2089 TRACE_FUNCTION("setatPlusFRQ() calls bat_send() <=== as APPLICATION"); | |
2090 | |
2091 memset(&my_bat_set_plus_frq, 0, sizeof(my_bat_set_plus_frq)); | |
2092 cmd.ctrl_params = BAT_CMD_SET_PLUS_FRQ; | |
2093 cmd.params.ptr_set_plus_frq = &my_bat_set_plus_frq; | |
2094 | |
2095 my_bat_set_plus_frq.pgl = pgl; | |
2096 my_bat_set_plus_frq.cbl = cbl; | |
2097 | |
2098 bat_send(ati_bat_get_client(srcId), &cmd); | |
2099 | |
2100 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
2101 } | |
2102 #else /* OLD FUNCTION BODY */ | |
2103 | |
2104 TRACE_FUNCTION("setatPlusFRQ()"); | |
2105 | |
2106 ret = sAT_PlusFRQ(srcId, pgl, cbl); | |
2107 if (ret EQ AT_FAIL) | |
2108 { | |
2109 cmdAtError(atError); | |
2110 } | |
2111 return (map_aci_2_ati_rslt(ret)); | |
2112 | |
2113 #endif /* no FF_ATI_BAT*/ | |
2114 } | |
2115 | |
2116 GLOBAL T_ATI_RSLT queatPlusFRQ (char *cl, UBYTE srcId) | |
2117 { | |
2118 T_ACI_RETURN ret = AT_FAIL; | |
2119 SHORT pgl = ACI_NumParmNotPresent, | |
2120 cbl = ACI_NumParmNotPresent; | |
2121 | |
2122 TRACE_FUNCTION("queatPlusFRQ()"); | |
2123 | |
2124 ret = qAT_PlusFRQ(srcId, &pgl,&cbl); | |
2125 if (ret EQ AT_CMPL) | |
2126 { | |
2127 sprintf(g_sa,"+FRQ:%X,%X",pgl,cbl); | |
2128 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
2129 } | |
2130 else | |
2131 { | |
2132 cmdAtError(atError); | |
2133 } | |
2134 return (map_aci_2_ati_rslt(ret)); | |
2135 } | |
2136 | |
2137 /* | |
2138 +--------------------------------------------------------------------+ | |
2139 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2140 | STATE : code ROUTINE : atPlusFCT | | |
2141 +--------------------------------------------------------------------+ | |
2142 | |
2143 PURPOSE : +FCT command (phase C response timeout) | |
2144 */ | |
2145 | |
2146 GLOBAL T_ATI_RSLT setatPlusFCT (char *cl, UBYTE srcId) | |
2147 { | |
2148 T_ACI_RETURN ret = AT_FAIL; | |
2149 UBYTE val = NOT_PRESENT_8BIT; | |
2150 | |
2151 cl = parse(cl,"x",&val); | |
2152 if ( !cl ) | |
2153 { | |
2154 cmdAtError(atError); | |
2155 return ATI_FAIL; | |
2156 } | |
2157 #ifdef FF_ATI_BAT | |
2158 { | |
2159 T_BAT_cmd_send cmd; | |
2160 T_BAT_cmd_set_plus_fct my_bat_set_plus_fct; | |
2161 | |
2162 TRACE_FUNCTION("setatPlusFCT() calls bat_send() <=== as APPLICATION"); | |
2163 | |
2164 memset(&my_bat_set_plus_fct, 0, sizeof(my_bat_set_plus_fct)); | |
2165 cmd.ctrl_params = BAT_CMD_SET_PLUS_FCT; | |
2166 cmd.params.ptr_set_plus_fct = &my_bat_set_plus_fct; | |
2167 | |
2168 my_bat_set_plus_fct.value = val; | |
2169 | |
2170 bat_send(ati_bat_get_client(srcId), &cmd); | |
2171 | |
2172 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
2173 } | |
2174 #else /* OLD FUNCTION BODY */ | |
2175 | |
2176 TRACE_FUNCTION("setatPlusFCT()"); | |
2177 | |
2178 ret = sAT_PlusFCT(srcId,val); | |
2179 if (ret EQ AT_FAIL) | |
2180 { | |
2181 cmdAtError(atError); | |
2182 } | |
2183 return (map_aci_2_ati_rslt(ret)); | |
2184 | |
2185 #endif /* no FF_ATI_BAT*/ | |
2186 } | |
2187 | |
2188 GLOBAL T_ATI_RSLT queatPlusFCT (char *cl, UBYTE srcId) | |
2189 { | |
2190 T_ACI_RETURN ret = AT_FAIL; | |
2191 SHORT val=-1; | |
2192 | |
2193 TRACE_FUNCTION("queatPlusFCT()"); | |
2194 | |
2195 ret = qAT_PlusFCT(srcId,(SHORT*)&val); | |
2196 if (ret EQ AT_CMPL) | |
2197 { | |
2198 sprintf(g_sa,"+FCT:%X",val); | |
2199 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
2200 } | |
2201 else | |
2202 { | |
2203 cmdAtError(atError); | |
2204 } | |
2205 return (map_aci_2_ati_rslt(ret)); | |
2206 } | |
2207 | |
2208 /* | |
2209 +--------------------------------------------------------------------+ | |
2210 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2211 | STATE : code ROUTINE : atPlusFSA | | |
2212 +--------------------------------------------------------------------+ | |
2213 | |
2214 PURPOSE : +FSA command (destination subaddress string) | |
2215 */ | |
2216 | |
2217 GLOBAL T_ATI_RSLT setatPlusFSA (char *cl, UBYTE srcId) | |
2218 { | |
2219 T_ACI_RETURN ret = AT_FAIL; | |
2220 char substr[MAX_ID_CHAR]={0}; | |
2221 | |
2222 cl = parse(cl,"s",(LONG)MAX_ID_CHAR,substr); | |
2223 if (!cl) | |
2224 { | |
2225 cmdAtError(atError); | |
2226 return ATI_FAIL; | |
2227 } | |
2228 #ifdef FF_ATI_BAT | |
2229 { | |
2230 T_BAT_cmd_send cmd; | |
2231 T_BAT_cmd_set_plus_fsa my_bat_set_plus_fsa; | |
2232 | |
2233 TRACE_FUNCTION("setatPlusFSA() calls bat_send() <=== as APPLICATION"); | |
2234 | |
2235 memset(&my_bat_set_plus_fsa, 0, sizeof(my_bat_set_plus_fsa)); | |
2236 cmd.ctrl_params = BAT_CMD_SET_PLUS_FSA; | |
2237 cmd.params.ptr_set_plus_fsa = &my_bat_set_plus_fsa; | |
2238 | |
2239 my_bat_set_plus_fsa.c_sub_str = strlen(substr); | |
2240 memcpy(my_bat_set_plus_fsa.sub_str, substr, my_bat_set_plus_fsa.c_sub_str); | |
2241 | |
2242 bat_send(ati_bat_get_client(srcId), &cmd); | |
2243 | |
2244 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
2245 } | |
2246 #else /* OLD FUNCTION BODY */ | |
2247 | |
2248 TRACE_FUNCTION("setatPlusFSA()"); | |
2249 | |
2250 ret = sAT_PlusFSA(srcId, substr); | |
2251 if (ret EQ AT_FAIL) | |
2252 { | |
2253 cmdAtError(atError); | |
2254 } | |
2255 return (map_aci_2_ati_rslt(ret)); | |
2256 | |
2257 #endif /* no FF_ATI_BAT*/ | |
2258 } | |
2259 | |
2260 GLOBAL T_ATI_RSLT queatPlusFSA (char *cl, UBYTE srcId) | |
2261 { | |
2262 T_ACI_RETURN ret = AT_FAIL; | |
2263 char substr[MAX_ID_CHAR]={0}; | |
2264 | |
2265 TRACE_FUNCTION("queatPlusFSA()"); | |
2266 | |
2267 ret = qAT_PlusFSA(srcId, substr); | |
2268 if (ret EQ AT_CMPL) | |
2269 { | |
2270 sprintf(g_sa,"+FSA:\"%s\"",substr); | |
2271 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
2272 } | |
2273 else | |
2274 { | |
2275 cmdAtError(atError); | |
2276 } | |
2277 return (map_aci_2_ati_rslt(ret)); | |
2278 } | |
2279 | |
2280 /* | |
2281 +--------------------------------------------------------------------+ | |
2282 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2283 | STATE : code ROUTINE : atPlusFSP | | |
2284 +--------------------------------------------------------------------+ | |
2285 | |
2286 PURPOSE : +FSP command (document to poll indication) | |
2287 */ | |
2288 | |
2289 GLOBAL T_ATI_RSLT setatPlusFSP (char *cl, UBYTE srcId) | |
2290 { | |
2291 T_ACI_RETURN ret = AT_FAIL; | |
2292 T_ACI_FSP_VAL val=FSP_VAL_NotPresent; | |
2293 | |
2294 cl = parse(cl, "d", &val); | |
2295 if ( !cl ) | |
2296 { | |
2297 cmdAtError(atError); | |
2298 return ATI_FAIL; | |
2299 } | |
2300 #ifdef FF_ATI_BAT | |
2301 { | |
2302 T_BAT_cmd_send cmd; | |
2303 T_BAT_cmd_set_plus_fsp my_bat_set_plus_fsp; | |
2304 | |
2305 TRACE_FUNCTION("setatPlusFSP() calls bat_send() <=== as APPLICATION"); | |
2306 | |
2307 memset(&my_bat_set_plus_fsp, 0, sizeof(my_bat_set_plus_fsp)); | |
2308 cmd.ctrl_params = BAT_CMD_SET_PLUS_FSP; | |
2309 cmd.params.ptr_set_plus_fsp = &my_bat_set_plus_fsp; | |
2310 | |
2311 my_bat_set_plus_fsp.poll = val; | |
2312 | |
2313 bat_send(ati_bat_get_client(srcId), &cmd); | |
2314 | |
2315 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
2316 } | |
2317 #else /* OLD FUNCTION BODY */ | |
2318 | |
2319 TRACE_FUNCTION("setatPlusFSP()"); | |
2320 | |
2321 ret = sAT_PlusFSP(srcId, val); | |
2322 if (ret EQ AT_FAIL) | |
2323 { | |
2324 cmdAtError(atError); | |
2325 } | |
2326 return (map_aci_2_ati_rslt(ret)); | |
2327 | |
2328 #endif /* no FF_ATI_BAT*/ | |
2329 } | |
2330 | |
2331 GLOBAL T_ATI_RSLT queatPlusFSP (char *cl, UBYTE srcId) | |
2332 { | |
2333 T_ACI_RETURN ret = AT_FAIL; | |
2334 T_ACI_FSP_VAL val=FSP_VAL_NotPresent; | |
2335 | |
2336 TRACE_FUNCTION("queatPlusFSP()"); | |
2337 | |
2338 ret = qAT_PlusFSP(srcId, &val); | |
2339 if (ret EQ AT_CMPL) | |
2340 { | |
2341 sprintf(g_sa,"+FSP:%d",val); | |
2342 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
2343 } | |
2344 else | |
2345 { | |
2346 cmdAtError(atError); | |
2347 } | |
2348 return (map_aci_2_ati_rslt(ret)); | |
2349 } | |
2350 | |
2351 /*--------- Action Commands -------------------------------------*/ | |
2352 | |
2353 | |
2354 | |
2355 /* | |
2356 +--------------------------------------------------------------------+ | |
2357 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2358 | STATE : code ROUTINE : atPlusFDT | | |
2359 +--------------------------------------------------------------------+ | |
2360 | |
2361 PURPOSE : +FDT command (data transmission) | |
2362 */ | |
2363 | |
2364 GLOBAL T_ATI_RSLT setatPlusFDT(char *cl, UBYTE srcId) | |
2365 { | |
2366 T_ACI_RETURN ret = AT_FAIL; | |
2367 | |
2368 TRACE_FUNCTION("setatPlusFDT()"); | |
2369 ret = sAT_PlusFDT(srcId); | |
2370 if (ret EQ AT_FAIL) | |
2371 { | |
2372 cmdAtError(atError); | |
2373 } | |
2374 return (map_aci_2_ati_rslt(ret)); | |
2375 } | |
2376 | |
2377 /* | |
2378 +--------------------------------------------------------------------+ | |
2379 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2380 | STATE : code ROUTINE : atPlusFDR | | |
2381 +--------------------------------------------------------------------+ | |
2382 | |
2383 PURPOSE : +FDR command (data reception) | |
2384 */ | |
2385 | |
2386 GLOBAL T_ATI_RSLT setatPlusFDR(char *cl, UBYTE srcId) | |
2387 { | |
2388 T_ACI_RETURN ret = AT_FAIL; | |
2389 | |
2390 TRACE_FUNCTION("setatPlusFDR()"); | |
2391 | |
2392 ret = sAT_PlusFDR(srcId); | |
2393 if (ret EQ AT_FAIL) | |
2394 { | |
2395 cmdAtError(atError); | |
2396 } | |
2397 return (map_aci_2_ati_rslt(ret)); | |
2398 } | |
2399 | |
2400 /* | |
2401 +--------------------------------------------------------------------+ | |
2402 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2403 | STATE : code ROUTINE : atPlusFIP | | |
2404 +--------------------------------------------------------------------+ | |
2405 | |
2406 PURPOSE : | |
2407 | |
2408 ITU-T.32/8.3.6 Initialize facsimile parameters, +FIP | |
2409 | |
2410 – Syntax: +FIP[=<value>] | |
2411 | |
2412 The +FIP command causes the DCE | |
2413 to initialize all Service Class 2 Facsimile Parameters | |
2414 to the manufacturer determined default settings. | |
2415 | |
2416 This command does not change the setting of +FCLASS. | |
2417 This command has the same effect as if the DTE had issued | |
2418 individual parameter setting commands. | |
2419 | |
2420 Manufacturers may also provide a selection of default profiles, | |
2421 chosen by the optional <value>. | |
2422 | |
2423 If <value> is unspecified or 0, the parameters shall be set to those | |
2424 specified in this Recommendation (e.g. Appendix I). | |
2425 | |
2426 For other <value>s, the manufacturer determines the profile settings. | |
2427 | |
2428 This command may be issued during a session. | |
2429 | |
2430 The DCE shall use the new settings at the next time they are sampled; | |
2431 for example, a new +FIS setting would be used the next time | |
2432 the DCE enters Phase B. | |
2433 */ | |
2434 | |
2435 GLOBAL T_ATI_RSLT setatPlusFIP(char *cl, UBYTE srcId) | |
2436 { | |
2437 T_ACI_RETURN ret = AT_FAIL; | |
2438 | |
2439 #ifdef FF_ATI_BAT | |
2440 { | |
2441 /* | |
2442 T_BAT_cmd_send cmd; | |
2443 T_BAT_cmd_set_plus_fip my_bat_set_plus_fip; //??? | |
2444 | |
2445 TRACE_FUNCTION("setatPlusFIP() calls bat_send() <=== as APPLICATION"); | |
2446 | |
2447 memset(&my_bat_set_plus_fip, 0, sizeof(my_bat_set_plus_fip)); | |
2448 cmd.ctrl_params = BAT_CMD_SET_PLUS_FIP; | |
2449 cmd.params.ptr_set_plus_fip = &my_bat_set_plus_fip; | |
2450 | |
2451 my_bat_set_plus_fip.value = val; | |
2452 bat_send(ati_bat_get_client(srcId), &cmd); | |
2453 | |
2454 return ATI_EXCT; | |
2455 */ | |
2456 TRACE_EVENT("setatPlusFIP(): is obsolete ? <=== !!! consult KJF"); | |
2457 return ATI_FAIL; | |
2458 } | |
2459 #else /* OLD FUNCTION BODY */ | |
2460 | |
2461 TRACE_FUNCTION("setatPlusFIP()"); | |
2462 | |
2463 ret = sAT_PlusFIP(srcId); | |
2464 if (ret EQ AT_FAIL) | |
2465 { | |
2466 cmdAtError(atError); | |
2467 } | |
2468 return (map_aci_2_ati_rslt(ret)); | |
2469 /* | |
2470 * sAT_PlusFIP always returns AT_CMPL in the present implementation | |
2471 * and so setatPlusFIP always results in an error .. | |
2472 * this happens for example in testcase ACIFD052 | |
2473 */ | |
2474 | |
2475 #endif /* no FF_ATI_BAT*/ | |
2476 } | |
2477 | |
2478 /* | |
2479 +--------------------------------------------------------------------+ | |
2480 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2481 | STATE : code ROUTINE : atPlusFKS | | |
2482 +--------------------------------------------------------------------+ | |
2483 | |
2484 PURPOSE : +FKS command (terminate) | |
2485 */ | |
2486 | |
2487 GLOBAL T_ATI_RSLT setatPlusFKS(char *cl, UBYTE srcId) | |
2488 { | |
2489 T_ACI_RETURN ret = AT_FAIL; | |
2490 | |
2491 #ifdef FF_ATI_BAT | |
2492 { | |
2493 T_BAT_cmd_send cmd; | |
2494 /* | |
2495 T_BAT_cmd_set_plus_fks my_bat_set_plus_fks; //??? | |
2496 | |
2497 TRACE_FUNCTION("setatPlusFKS() calls bat_send() <=== as APPLICATION"); | |
2498 | |
2499 memset(&my_bat_set_plus_fks, 0, sizeof(my_bat_set_plus_fks)); | |
2500 cmd.ctrl_params = BAT_CMD_SET_PLUS_FKS; | |
2501 cmd.params.ptr_set_plus_fks = &my_bat_set_plus_fks; | |
2502 | |
2503 my_bat_set_plus_fks.value = val; | |
2504 */ | |
2505 bat_send(ati_bat_get_client(srcId), &cmd); | |
2506 | |
2507 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
2508 } | |
2509 #else /* OLD FUNCTION BODY */ | |
2510 | |
2511 TRACE_FUNCTION("setatPlusFKS()"); | |
2512 | |
2513 ret = sAT_PlusFKS(srcId); | |
2514 if (ret EQ AT_FAIL) | |
2515 { | |
2516 cmdAtError(atError); | |
2517 } | |
2518 return (map_aci_2_ati_rslt(ret)); | |
2519 | |
2520 #endif /* no FF_ATI_BAT*/ | |
2521 } | |
2522 | |
2523 /* | |
2524 +--------------------------------------------------------------------+ | |
2525 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2526 | STATE : code ROUTINE : atPlusFIT | | |
2527 +--------------------------------------------------------------------+ | |
2528 | |
2529 PURPOSE : +FIT command (inactivity timeout) | |
2530 */ | |
2531 | |
2532 GLOBAL T_ATI_RSLT setatPlusFIT (char *cl, UBYTE srcId) | |
2533 { | |
2534 T_ACI_RETURN ret = AT_FAIL; | |
2535 T_ACI_FIT_ACT act = FIT_ACT_NotPresent; | |
2536 SHORT time = ACI_NumParmNotPresent; | |
2537 | |
2538 cl = parse(cl,"dd",&time,&act); | |
2539 if ( !cl) | |
2540 { | |
2541 cmdAtError(atError); | |
2542 return ATI_FAIL; | |
2543 } | |
2544 #ifdef FF_ATI_BAT | |
2545 { | |
2546 T_BAT_cmd_send cmd; | |
2547 T_BAT_cmd_set_plus_fit my_bat_set_plus_fit; | |
2548 | |
2549 TRACE_FUNCTION("setatPlusFIT() calls bat_send() <=== as APPLICATION"); | |
2550 | |
2551 memset(&my_bat_set_plus_fit, 0, sizeof(my_bat_set_plus_fit)); | |
2552 cmd.ctrl_params = BAT_CMD_SET_PLUS_FIT; | |
2553 cmd.params.ptr_set_plus_fit = &my_bat_set_plus_fit; | |
2554 | |
2555 my_bat_set_plus_fit.time = time; | |
2556 my_bat_set_plus_fit.action = act; | |
2557 | |
2558 bat_send(ati_bat_get_client(srcId), &cmd); | |
2559 | |
2560 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
2561 } | |
2562 #else /* OLD FUNCTION BODY */ | |
2563 | |
2564 TRACE_FUNCTION("setatPlusFIT()"); | |
2565 | |
2566 ret = sAT_PlusFIT(srcId, time, act); | |
2567 if (ret EQ AT_FAIL) | |
2568 { | |
2569 cmdAtError(atError); | |
2570 } | |
2571 return (map_aci_2_ati_rslt(ret)); | |
2572 | |
2573 #endif /* no FF_ATI_BAT*/ | |
2574 } | |
2575 | |
2576 GLOBAL T_ATI_RSLT queatPlusFIT (char *cl, UBYTE srcId) | |
2577 { | |
2578 T_ACI_RETURN ret = AT_FAIL; | |
2579 T_ACI_FIT_ACT act = FIT_ACT_NotPresent; | |
2580 SHORT time = ACI_NumParmNotPresent; | |
2581 | |
2582 TRACE_FUNCTION("queatPlusFIT()"); | |
2583 | |
2584 ret = qAT_PlusFIT(srcId, &time, &act); | |
2585 if (ret EQ AT_CMPL) | |
2586 { | |
2587 sprintf(g_sa,"+FIT:%d,%d",time,act); | |
2588 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
2589 } | |
2590 else | |
2591 { | |
2592 cmdAtError(atError); | |
2593 } | |
2594 return (map_aci_2_ati_rslt(ret)); | |
2595 } | |
2596 | |
2597 /* | |
2598 +--------------------------------------------------------------------+ | |
2599 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2600 | STATE : code ROUTINE : atPlusFBO | | |
2601 +--------------------------------------------------------------------+ | |
2602 | |
2603 PURPOSE : +FBO command (data bit order) | |
2604 */ | |
2605 | |
2606 GLOBAL T_ATI_RSLT setatPlusFBO (char *cl, UBYTE srcId) | |
2607 { | |
2608 T_ACI_RETURN ret = AT_FAIL; | |
2609 T_ACI_FBO_VAL val = FBO_VAL_NotPresent; | |
2610 | |
2611 cl = parse(cl,"d",&val); | |
2612 if ( !cl) | |
2613 { | |
2614 cmdAtError(atError); | |
2615 return ATI_FAIL; | |
2616 } | |
2617 #ifdef FF_ATI_BAT | |
2618 { | |
2619 T_BAT_cmd_send cmd; | |
2620 T_BAT_cmd_set_plus_fbo my_bat_set_plus_fbo; | |
2621 | |
2622 TRACE_FUNCTION("setatPlusFBO() calls bat_send() <=== as APPLICATION"); | |
2623 | |
2624 memset(&my_bat_set_plus_fbo, 0, sizeof(my_bat_set_plus_fbo)); | |
2625 cmd.ctrl_params = BAT_CMD_SET_PLUS_FBO; | |
2626 cmd.params.ptr_set_plus_fbo = &my_bat_set_plus_fbo; | |
2627 | |
2628 my_bat_set_plus_fbo.value = val; | |
2629 | |
2630 bat_send(ati_bat_get_client(srcId), &cmd); | |
2631 | |
2632 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
2633 } | |
2634 #else /* OLD FUNCTION BODY */ | |
2635 | |
2636 TRACE_FUNCTION("setatPlusFBO()"); | |
2637 | |
2638 ret = sAT_PlusFBO(srcId,val); | |
2639 if (ret EQ AT_FAIL) | |
2640 { | |
2641 cmdAtError(atError); | |
2642 } | |
2643 return (map_aci_2_ati_rslt(ret)); | |
2644 | |
2645 #endif /* no FF_ATI_BAT*/ | |
2646 } | |
2647 | |
2648 GLOBAL T_ATI_RSLT queatPlusFBO (char *cl, UBYTE srcId) | |
2649 { | |
2650 T_ACI_RETURN ret = AT_FAIL; | |
2651 T_ACI_FBO_VAL val = FBO_VAL_NotPresent; | |
2652 | |
2653 TRACE_FUNCTION("queatPlusFBO()"); | |
2654 | |
2655 ret = qAT_PlusFBO(srcId, &val); | |
2656 if (ret EQ AT_CMPL) | |
2657 { | |
2658 sprintf(g_sa,"+FBO:%d",val); | |
2659 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
2660 } | |
2661 else | |
2662 { | |
2663 cmdAtError(atError); | |
2664 } | |
2665 return (map_aci_2_ati_rslt(ret)); | |
2666 } | |
2667 | |
2668 /* | |
2669 +--------------------------------------------------------------------+ | |
2670 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2671 | STATE : code ROUTINE : atPlusFBS | | |
2672 +--------------------------------------------------------------------+ | |
2673 | |
2674 PURPOSE : +FBS command (buffer size) | |
2675 */ | |
2676 | |
2677 GLOBAL T_ATI_RSLT queatPlusFBS (char *cl, UBYTE srcId) | |
2678 { | |
2679 SHORT tbs; | |
2680 SHORT rbs; | |
2681 T_ACI_RETURN ret = AT_FAIL; | |
2682 | |
2683 TRACE_FUNCTION("queatPlusFBS()"); | |
2684 | |
2685 ret = qAT_PlusFBS(srcId, &tbs,&rbs); | |
2686 if (ret EQ AT_CMPL) | |
2687 { | |
2688 sprintf(g_sa,"+FBS:%X,%X",tbs,rbs); | |
2689 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
2690 } | |
2691 else | |
2692 { | |
2693 cmdAtError(atError); | |
2694 } | |
2695 return (map_aci_2_ati_rslt(ret)); | |
2696 } | |
2697 | |
2698 /*---------------------- Call Backs -----------------------------------------*/ | |
2699 | |
2700 /* | |
2701 +--------------------------------------------------------------------+ | |
2702 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2703 | STATE : code ROUTINE : rCI_PlusFCI | | |
2704 +--------------------------------------------------------------------+ | |
2705 | |
2706 PURPOSE : +FCI answer (remote ID CSI report) | |
2707 */ | |
2708 | |
2709 GLOBAL void rCI_PlusFCI( /*UBYTE srcId,*/ CHAR * rmtId) | |
2710 { | |
2711 UBYTE srcId = srcId_cb; | |
2712 | |
2713 if (fd.FNR.idr_stat) | |
2714 { | |
2715 if(rmtId) | |
2716 sprintf(g_sa,"%s\"%s\"","+FCI:",rmtId); | |
2717 else | |
2718 strcpy(g_sa,"+FCI:"); | |
2719 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
2720 } | |
2721 } | |
2722 | |
2723 /* | |
2724 +--------------------------------------------------------------------+ | |
2725 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2726 | STATE : code ROUTINE : rCI_PlusFCO | | |
2727 +--------------------------------------------------------------------+ | |
2728 | |
2729 PURPOSE : +FCO answer (connect information) | |
2730 */ | |
2731 | |
2732 GLOBAL void rCI_PlusFCO(void) | |
2733 { | |
2734 UBYTE srcId = srcId_cb; | |
2735 | |
2736 io_sendMessage(srcId, "+FCO", ATI_NORMAL_OUTPUT); | |
2737 } | |
2738 | |
2739 /* | |
2740 +--------------------------------------------------------------------+ | |
2741 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2742 | STATE : code ROUTINE : rCI_PlusFCS | | |
2743 +--------------------------------------------------------------------+ | |
2744 | |
2745 PURPOSE : +FCS answer (DCS frame information) | |
2746 */ | |
2747 | |
2748 GLOBAL void rCI_PlusFCS ( /*UBYTE srcId,*/ | |
2749 T_ACI_F_VR vr, | |
2750 T_ACI_F_BR br, | |
2751 T_ACI_F_WD wd, | |
2752 T_ACI_F_LN ln, | |
2753 T_ACI_F_DF df, | |
2754 T_ACI_F_EC ec, | |
2755 T_ACI_F_BF bf, | |
2756 T_ACI_F_ST st, | |
2757 T_ACI_F_JP jp ) | |
2758 { | |
2759 UBYTE srcId = srcId_cb; | |
2760 | |
2761 if (fd.FNR.tpr_stat) | |
2762 { | |
2763 sprintf(g_sa,"+FCS:%X,%d,%d,%d,%d,%d,%X,%d,%X",vr,br,wd,ln,df,ec,bf,st,jp); | |
2764 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
2765 } | |
2766 } | |
2767 | |
2768 /* | |
2769 +--------------------------------------------------------------------+ | |
2770 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2771 | STATE : code ROUTINE : rCI_PlusFDM | | |
2772 +--------------------------------------------------------------------+ | |
2773 | |
2774 PURPOSE : +FDM answer (transition to data modem) | |
2775 */ | |
2776 GLOBAL void rCI_PlusFDM (UBYTE srcId) | |
2777 { | |
2778 io_sendMessage(srcId, "+FDM", ATI_NORMAL_OUTPUT); | |
2779 } | |
2780 | |
2781 /* | |
2782 +--------------------------------------------------------------------+ | |
2783 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2784 | STATE : code ROUTINE : atPlusFET | | |
2785 +--------------------------------------------------------------------+ | |
2786 | |
2787 PURPOSE : +FET command (procedure interrupt enable) | |
2788 */ | |
2789 GLOBAL void rCI_PlusFET( /*UBYTE srcId,*/ T_ACI_FET_PPM ppm) | |
2790 { | |
2791 UBYTE srcId = srcId_cb; | |
2792 | |
2793 sprintf(g_sa,"%s%d","+FET:",ppm); | |
2794 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
2795 } | |
2796 | |
2797 /* | |
2798 +--------------------------------------------------------------------+ | |
2799 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2800 | STATE : code ROUTINE : rCI_PlusFFD | | |
2801 +--------------------------------------------------------------------+ | |
2802 | |
2803 PURPOSE : +FFD answer (file diagnostics) | |
2804 */ | |
2805 GLOBAL void rCI_PlusFFD (UBYTE srcId) | |
2806 { | |
2807 io_sendMessage(srcId, "+FFD", ATI_NORMAL_OUTPUT); | |
2808 } | |
2809 | |
2810 /* | |
2811 +--------------------------------------------------------------------+ | |
2812 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2813 | STATE : code ROUTINE : rCI_PlusFHS | | |
2814 +--------------------------------------------------------------------+ | |
2815 | |
2816 PURPOSE : +FHS answer (hang up information) | |
2817 */ | |
2818 | |
2819 GLOBAL void rCI_PlusFHS( /*UBYTE srcId,*/ T_ACI_FHS_STAT stat) | |
2820 { | |
2821 UBYTE srcId = srcId_cb; | |
2822 | |
2823 sprintf(g_sa,"+FHS:%02X", stat); | |
2824 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
2825 } | |
2826 | |
2827 /* | |
2828 +--------------------------------------------------------------------+ | |
2829 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2830 | STATE : code ROUTINE : rCI_PlusFHR | | |
2831 +--------------------------------------------------------------------+ | |
2832 | |
2833 PURPOSE : +FHR answer (received HDLC frame reporting) | |
2834 */ | |
2835 | |
2836 | |
2837 GLOBAL void rCI_PlusFHR( /*UBYTE srcId,*/ USHORT len, UBYTE * hdlc) | |
2838 { | |
2839 UBYTE srcId = srcId_cb; | |
2840 | |
2841 if (fd.FBU_stat) | |
2842 { | |
2843 strcpy(g_sa,"+FHR:"); | |
2844 OutHexReport(srcId, len, hdlc); | |
2845 } | |
2846 } | |
2847 | |
2848 /* | |
2849 +--------------------------------------------------------------------+ | |
2850 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2851 | STATE : code ROUTINE : rCI_PlusFHT | | |
2852 +--------------------------------------------------------------------+ | |
2853 | |
2854 PURPOSE : +FHT answer (transmitted HDLC Frame reporting) | |
2855 */ | |
2856 | |
2857 | |
2858 GLOBAL void rCI_PlusFHT( /*UBYTE srcId,*/ USHORT len, UBYTE * hdlc) | |
2859 { | |
2860 UBYTE srcId = srcId_cb; | |
2861 | |
2862 if (fd.FBU_stat) | |
2863 { | |
2864 strcpy(g_sa,"+FHT:"); | |
2865 OutHexReport(srcId, len, hdlc); | |
2866 } | |
2867 } | |
2868 | |
2869 /* | |
2870 +--------------------------------------------------------------------+ | |
2871 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2872 | STATE : code ROUTINE : rCI_PlusFIS | | |
2873 +--------------------------------------------------------------------+ | |
2874 | |
2875 PURPOSE : +FIS answer (DIS frame information) | |
2876 */ | |
2877 | |
2878 GLOBAL void rCI_PlusFIS ( /*UBYTE srcId,*/ | |
2879 T_ACI_F_VR vr, | |
2880 T_ACI_F_BR br, | |
2881 T_ACI_F_WD wd, | |
2882 T_ACI_F_LN ln, | |
2883 T_ACI_F_DF df, | |
2884 T_ACI_F_EC ec, | |
2885 T_ACI_F_BF bf, | |
2886 T_ACI_F_ST st, | |
2887 T_ACI_F_JP jp ) | |
2888 { | |
2889 UBYTE srcId = srcId_cb; | |
2890 | |
2891 if (fd.FNR.rpr_stat) | |
2892 { | |
2893 sprintf(g_sa,"+FIS:%X,%d,%d,%d,%d,%d,%X,%d,%X",vr,br,wd,ln,df,ec,bf,st,jp); | |
2894 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
2895 } | |
2896 } | |
2897 | |
2898 | |
2899 /* | |
2900 +--------------------------------------------------------------------+ | |
2901 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2902 | STATE : code ROUTINE : rCI_PlusFNC | | |
2903 +--------------------------------------------------------------------+ | |
2904 | |
2905 PURPOSE : +FNC answer (non standard command reporting) | |
2906 */ | |
2907 | |
2908 | |
2909 GLOBAL void rCI_PlusFNC( /*UBYTE srcId,*/ USHORT len, UBYTE * nsc) | |
2910 { | |
2911 UBYTE srcId = srcId_cb; | |
2912 | |
2913 if (fd.FNR.nsr_stat) | |
2914 { | |
2915 strcpy(g_sa,"+FNC:"); | |
2916 | |
2917 OutHexReport(srcId, len, nsc); | |
2918 } | |
2919 } | |
2920 | |
2921 | |
2922 /* | |
2923 +--------------------------------------------------------------------+ | |
2924 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2925 | STATE : code ROUTINE : rCI_PlusFNF | | |
2926 +--------------------------------------------------------------------+ | |
2927 | |
2928 PURPOSE : +FNF answer (non standard facility reporting) | |
2929 */ | |
2930 | |
2931 | |
2932 GLOBAL void rCI_PlusFNF( /*UBYTE srcId,*/ USHORT len, UBYTE * nsf) | |
2933 { | |
2934 UBYTE srcId = srcId_cb; | |
2935 | |
2936 if (fd.FNR.nsr_stat) | |
2937 { | |
2938 strcpy(g_sa,"+FNF:"); | |
2939 | |
2940 OutHexReport(srcId, len, nsf); | |
2941 } | |
2942 } | |
2943 | |
2944 /* | |
2945 +--------------------------------------------------------------------+ | |
2946 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2947 | STATE : code ROUTINE : rCI_PlusFNS | | |
2948 +--------------------------------------------------------------------+ | |
2949 | |
2950 PURPOSE : +FNS answer (non standard setup reporting) | |
2951 */ | |
2952 | |
2953 | |
2954 GLOBAL void rCI_PlusFNS( /*UBYTE srcId,*/ USHORT len, UBYTE * nss) | |
2955 { | |
2956 UBYTE srcId = srcId_cb; | |
2957 | |
2958 if (fd.FNR.nsr_stat) | |
2959 { | |
2960 strcpy(g_sa,"+FNS:"); | |
2961 | |
2962 OutHexReport(srcId, len, nss); | |
2963 } | |
2964 } | |
2965 | |
2966 /* | |
2967 +--------------------------------------------------------------------+ | |
2968 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2969 | STATE : code ROUTINE : rCI_PlusFPA | | |
2970 +--------------------------------------------------------------------+ | |
2971 | |
2972 PURPOSE : +FPA answer (report polling address) | |
2973 */ | |
2974 GLOBAL void rCI_PlusFPA (/*UBYTE srcId,*/ char *sep) | |
2975 { | |
2976 UBYTE srcId = srcId_cb; | |
2977 | |
2978 if(sep) | |
2979 sprintf(g_sa,"+FPA:\"%s\"",sep); | |
2980 else | |
2981 strcpy(g_sa,"+FPA:"); | |
2982 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
2983 } | |
2984 | |
2985 /* | |
2986 +--------------------------------------------------------------------+ | |
2987 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
2988 | STATE : code ROUTINE : rCI_PlusFPI | | |
2989 +--------------------------------------------------------------------+ | |
2990 | |
2991 PURPOSE : +FPI answer (remote ID CIG report) | |
2992 */ | |
2993 | |
2994 GLOBAL void rCI_PlusFPI( /*UBYTE srcId,*/ CHAR *cig) | |
2995 { | |
2996 UBYTE srcId = srcId_cb; | |
2997 | |
2998 if (fd.FNR.idr_stat) | |
2999 { | |
3000 if(cig) | |
3001 sprintf(g_sa,"%s\"%s\"","+FPI:",cig); | |
3002 else | |
3003 strcpy(g_sa,"+FPI:"); | |
3004 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
3005 } | |
3006 } | |
3007 | |
3008 | |
3009 /* | |
3010 +--------------------------------------------------------------------+ | |
3011 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
3012 | STATE : code ROUTINE : rCI_PlusFPO | | |
3013 +--------------------------------------------------------------------+ | |
3014 | |
3015 PURPOSE : +FPO answer (polling request) | |
3016 */ | |
3017 | |
3018 GLOBAL void rCI_PlusFPO(void) | |
3019 { | |
3020 UBYTE srcId = srcId_cb; | |
3021 | |
3022 io_sendMessage(srcId, "+FPO", ATI_NORMAL_OUTPUT); | |
3023 } | |
3024 | |
3025 /* | |
3026 +--------------------------------------------------------------------+ | |
3027 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
3028 | STATE : code ROUTINE : rCI_PlusFPS | | |
3029 +--------------------------------------------------------------------+ | |
3030 | |
3031 PURPOSE : +FPS answer (DIS frame information) | |
3032 */ | |
3033 | |
3034 GLOBAL void rCI_PlusFPS ( /*UBYTE srcId,*/ | |
3035 T_ACI_FPS_PPR ppr, | |
3036 SHORT lc, | |
3037 SHORT blc, | |
3038 SHORT cblc, | |
3039 SHORT lbc ) | |
3040 { | |
3041 UBYTE srcId = srcId_cb; | |
3042 | |
3043 sprintf(g_sa,"%s%d,%d,%d,%d,%d","+FPS:",ppr,lc,blc,cblc,lbc); | |
3044 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
3045 } | |
3046 | |
3047 /* | |
3048 +--------------------------------------------------------------------+ | |
3049 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
3050 | STATE : code ROUTINE : rCI_PlusFPW | | |
3051 +--------------------------------------------------------------------+ | |
3052 | |
3053 PURPOSE : +FPW answer (report password) | |
3054 */ | |
3055 GLOBAL void rCI_PlusFPW (/*UBYTE srcId,*/ char *pwd) | |
3056 { | |
3057 UBYTE srcId = srcId_cb; | |
3058 | |
3059 if(pwd) | |
3060 sprintf(g_sa,"+FPW:\"%s\"",pwd); | |
3061 else | |
3062 strcpy(g_sa,"+FPW:"); | |
3063 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
3064 } | |
3065 | |
3066 | |
3067 /* | |
3068 +--------------------------------------------------------------------+ | |
3069 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
3070 | STATE : code ROUTINE : rCI_PlusFSA | | |
3071 +--------------------------------------------------------------------+ | |
3072 | |
3073 PURPOSE : +FSA answer (report subaddress) | |
3074 */ | |
3075 GLOBAL void rCI_PlusFSA (/*UBYTE srcId,*/ char *sub) | |
3076 { | |
3077 UBYTE srcId = srcId_cb; | |
3078 | |
3079 if(sub) | |
3080 sprintf(g_sa,"+FSA:\"%s\"",sub); | |
3081 else | |
3082 sprintf(g_sa,"+FSA:"); | |
3083 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
3084 } | |
3085 | |
3086 /* | |
3087 +--------------------------------------------------------------------+ | |
3088 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
3089 | STATE : code ROUTINE : rCI_PlusFTC | | |
3090 +--------------------------------------------------------------------+ | |
3091 | |
3092 PURPOSE : +FTC answer (DTC frame information) | |
3093 */ | |
3094 | |
3095 GLOBAL void rCI_PlusFTC ( /*UBYTE srcId,*/ | |
3096 T_ACI_F_VR vr, | |
3097 T_ACI_F_BR br, | |
3098 T_ACI_F_WD wd, | |
3099 T_ACI_F_LN ln, | |
3100 T_ACI_F_DF df, | |
3101 T_ACI_F_EC ec, | |
3102 T_ACI_F_BF bf, | |
3103 T_ACI_F_ST st, | |
3104 T_ACI_F_JP jp ) | |
3105 { | |
3106 UBYTE srcId = srcId_cb; | |
3107 | |
3108 if (fd.FNR.rpr_stat) | |
3109 { | |
3110 | |
3111 sprintf(g_sa,"+FTC:%X,%d,%d,%d,%d,%d,%X,%d,%X",vr,br,wd,ln,df,ec,bf,st,jp); | |
3112 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
3113 | |
3114 } | |
3115 } | |
3116 | |
3117 /* | |
3118 +--------------------------------------------------------------------+ | |
3119 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
3120 | STATE : code ROUTINE : rCI_PlusFTI | | |
3121 +--------------------------------------------------------------------+ | |
3122 | |
3123 PURPOSE : +FTI answer (remote ID TSI report) | |
3124 */ | |
3125 | |
3126 GLOBAL void rCI_PlusFTI( CHAR * tsi) | |
3127 { | |
3128 UBYTE srcId = srcId_cb; | |
3129 | |
3130 if (fd.FNR.idr_stat) | |
3131 { | |
3132 if(tsi) | |
3133 sprintf(g_sa,"%s\"%s\"","+FTI:",tsi); | |
3134 else | |
3135 strcpy(g_sa,"+FTI:"); | |
3136 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
3137 } | |
3138 } | |
3139 | |
3140 /* | |
3141 +--------------------------------------------------------------------+ | |
3142 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
3143 | STATE : code ROUTINE : rCI_PlusFVO | | |
3144 +--------------------------------------------------------------------+ | |
3145 | |
3146 PURPOSE : +FVO answer (transition to voice) | |
3147 */ | |
3148 | |
3149 GLOBAL void rCI_PlusFVO(void /*UBYTE srcId*/) | |
3150 { | |
3151 UBYTE srcId = srcId_cb; | |
3152 | |
3153 io_sendMessage(srcId, "+FVO", ATI_NORMAL_OUTPUT); | |
3154 } | |
3155 | |
3156 /* | |
3157 +--------------------------------------------------------------------+ | |
3158 | PROJECT : GSM-F&D (8411) MODULE : ACI_FD_CMD | | |
3159 | STATE : code ROUTINE : OutHexReport | | |
3160 +--------------------------------------------------------------------+ | |
3161 | |
3162 PURPOSE : formatted hex report output | |
3163 */ | |
3164 | |
3165 GLOBAL void OutHexReport( UBYTE srcId, USHORT len, UBYTE * buf ) | |
3166 { | |
3167 USHORT i; | |
3168 UBYTE tmpBuf[SIZE_TMP_BUF]; | |
3169 /* memory should be allocated before the function is called for sa !!! | |
3170 | |
3171 sa needs at most (len * SIZE_TMP_BUF + 1) for what will be used here */ | |
3172 for( i=0; i < len; i++ ) | |
3173 { | |
3174 sprintf((char*)tmpBuf, "%02X ", buf[i]); | |
3175 strcat( g_sa, (char*)tmpBuf ); | |
3176 | |
3177 } | |
3178 g_sa[strlen(g_sa)-1] = '\0'; /* cut off last space char */ | |
3179 io_sendMessage(srcId, g_sa, ATI_FORCED_OUTPUT); | |
3180 } | |
3181 | |
3182 #endif /* FF_FAX */ | |
3183 | |
3184 #endif /* FAX_AND_DATA */ | |
3185 | |
3186 | |
3187 |