annotate src/aci2/aci/aci_bat_phb.c @ 631:597869e59805

config: introduced new CONFIG_MCSI_MODEM preprocessor symbol All MCSI functionality was previously conditionalized on CONFIG_TARGET_FCMODEM (even earlier it was CONFIG_TARGET_FCDEV3B), but having a dedicated preprocessor symbol for this purpose (defined in targets/*.h as appropriate) makes it much easier to support different modem targets with MCSI enabled.
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 04 Jan 2020 19:07:02 +0000
parents 93999a60b835
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 +-----------------------------------------------------------------------------
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 | Project : GSM-F&D (8411)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 | Modul : ACI_BAT
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 +-----------------------------------------------------------------------------
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 | Copyright 2002 Texas Instruments Berlin, AG
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 | All rights reserved.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 | This file is confidential and a trade secret of Texas
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 | Instruments Berlin, AG
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 | The receipt of or possession of this file does not convey
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 | any rights to reproduce or disclose its contents or to
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 | manufacture, use, or sell anything it may describe, in
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 | whole, or in part, without the specific written consent of
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 | Texas Instruments Berlin, AG.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 +-----------------------------------------------------------------------------
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 | Purpose : This BAT wrapper modul is ...
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 +-----------------------------------------------------------------------------
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 #include "aci_all.h" /* includes prim.h, which includes p_bat.h */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 #include "aci_cmh.h" /* prototypes of sAT_,qAT_,tAT_ */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 #include "aci_bat_cmh.h" /* prototypes of sBAT_,qBAT_,tBAT_ */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 #include "aci_bat.h"
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 #include "ati_cmd.h"
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 #include "aci_cmd.h"
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 #include "aci_mem.h" /* MAKROS ACI_MALLOC, ACI_MFREE*/
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 | STATE : code ROUTINE : sBAT_PercentPBCF |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 PURPOSE : Select Phonebook Configuration.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 GLOBAL T_ACI_BAT_RSLT sBAT_PercentPBCF (T_ACI_DTI_PRC_PSI *src_infos_psi,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 T_BAT_cmd_send *cmd)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 T_ACI_BAT_RSLT ret;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 T_ACI_PBCF_LDN ldn = PBCF_LDN_NotPresent;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 T_ACI_PBCF_LRN lrn = PBCF_LRN_NotPresent;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 T_ACI_PBCF_LMN lmn = PBCF_LMN_NotPresent;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 TRACE_FUNCTION ("sBAT_PercentPBCF()");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 ldn = (T_ACI_PBCF_LDN)cmd->params.ptr_set_percent_pbcf->ldn;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 lrn = (T_ACI_PBCF_LRN)cmd->params.ptr_set_percent_pbcf->lrn;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 lmn = (T_ACI_PBCF_LMN)cmd->params.ptr_set_percent_pbcf->lmn;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 * Call the corresponding sAT function. T_ACI_BAT_RSLT is
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 * assumed to be equivalent to T_ACI_RESULT.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 /* for BAT we use the old spec, which means the third param is not supported */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 ret = (T_ACI_BAT_RSLT)sAT_PercentPBCF(src_infos_psi->srcId, ldn, lrn, lmn);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 return(ret);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 | STATE : code ROUTINE : qBAT_PlusCPBS |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 PURPOSE :
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 GLOBAL T_ACI_BAT_RSLT qBAT_PercentPBCF (T_ACI_DTI_PRC_PSI *src_infos_psi,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 T_BAT_cmd_send *cmd)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 T_ACI_BAT_RSLT ret;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 T_ACI_PBCF_LDN ldn = PBCF_LDN_NotPresent;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 T_ACI_PBCF_LRN lrn = PBCF_LRN_NotPresent;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 T_ACI_PBCF_LMN lmn = PBCF_LMN_NotPresent;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 TRACE_FUNCTION ("qBAT_PercentPBCF()");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 * Call the corresponding qAT function. T_ACI_BAT_RSLT is
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 * assumed to be equivalent to T_ACI_RESULT.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 ret=(T_ACI_BAT_RSLT)qAT_PercentPBCF(src_infos_psi->srcId, &ldn, &lrn, &lmn);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 * If the query completes, send the response now.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 if (ret==ACI_BAT_CMPL)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 T_BAT_cmd_response resp;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 T_BAT_res_que_percent_pbcf pbcf_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 resp.ctrl_response=BAT_RES_QUE_PERCENT_PBCF;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 resp.response.ptr_que_percent_pbcf = &pbcf_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 * This relies on T_BAT_percent_pbcf_ldn being identical to
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 * T_ACI_PBCF_LDN and so forth for LRN and LMN.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 pbcf_data.ldn=(T_BAT_percent_pbcf_ldn)ldn;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 pbcf_data.lrn=(T_BAT_percent_pbcf_ldn)lrn;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 pbcf_data.lmn=(T_BAT_percent_pbcf_ldn)lmn;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 aci_bat_send(src_infos_psi,&resp);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 return(ret);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 | STATE : code ROUTINE : sBAT_PlusCPBS |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 PURPOSE : Select phonebook memory storage.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCPBS (T_ACI_DTI_PRC_PSI *src_infos_psi,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 T_BAT_cmd_send *cmd)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 T_ACI_BAT_RSLT ret;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 T_ACI_PB_STOR stor;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 TRACE_FUNCTION ("sBAT_PlusCPBS()");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 * This relies on T_BAT_storage being identical to
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 * T_ACI_PB_STOR.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 stor=(T_ACI_PB_STOR)cmd->params.ptr_set_plus_cpbs->storage;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 * Call the corresponding sAT function. T_ACI_BAT_RSLT is
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 * assumed to be equivalent to T_ACI_RESULT.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 /* for BAT we use the old spec, which means the third param is not supported */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 ret=(T_ACI_BAT_RSLT)sAT_PlusCPBS(src_infos_psi->srcId,stor, NULL);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 return(ret);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 | STATE : code ROUTINE : qBAT_PlusCPBS |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 PURPOSE :
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCPBS (T_ACI_DTI_PRC_PSI *src_infos_psi,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154 T_BAT_cmd_send *cmd)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156 T_ACI_BAT_RSLT ret;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 T_ACI_PB_STOR stor;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 SHORT used;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 SHORT total;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 TRACE_FUNCTION ("qBAT_PlusCPBS()");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164 * Call the corresponding qAT function. T_ACI_BAT_RSLT is
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 * assumed to be equivalent to T_ACI_RESULT.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 ret=(T_ACI_BAT_RSLT)qAT_PlusCPBS(src_infos_psi->srcId,&stor,&used,&total);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170 * If the query completes, send the response now.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172 if (ret==ACI_BAT_CMPL)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 T_BAT_cmd_response resp;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175 T_BAT_res_que_plus_cpbs cpbs_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 resp.ctrl_response=BAT_RES_QUE_PLUS_CPBS;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 resp.response.ptr_que_plus_cpbs=&cpbs_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181 * This relies on T_BAT_storage being identical to
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 * T_ACI_PB_STOR.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184 cpbs_data.storage=(T_BAT_storage)stor;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186 cpbs_data.total=(S16)total;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187 cpbs_data.used=(S16)used;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189 aci_bat_send(src_infos_psi,&resp);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
192 return(ret);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
193 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
194
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
195 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198 | STATE : code ROUTINE : qBAT_PercentCPBS |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201 PURPOSE :
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203 GLOBAL T_ACI_BAT_RSLT qBAT_PercentCPBS (T_ACI_DTI_PRC_PSI *src_infos_psi,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204 T_BAT_cmd_send *cmd)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206 T_ACI_BAT_RSLT ret;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 T_ACI_PB_STOR stor;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208 SHORT used;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209 SHORT total;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210 SHORT first;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212 TRACE_FUNCTION ("qBAT_PercentCPBS()");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
215 * Call the corresponding qAT function. T_ACI_BAT_RSLT is
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
216 * assumed to be equivalent to T_ACI_RESULT.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
217 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
218 ret=(T_ACI_BAT_RSLT)qAT_PercentCPBS(src_infos_psi->srcId,&stor,&used,&total,&first);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
219
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
220 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
221 * If the query completes, send the response now.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
222 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
223 if (ret EQ ACI_BAT_CMPL)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
224 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
225 T_BAT_cmd_response resp;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
226 T_BAT_res_que_percent_cpbs cpbs_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
227
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
228 resp.ctrl_response=BAT_RES_QUE_PERCENT_CPBS;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
229 resp.response.ptr_que_percent_cpbs=&cpbs_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
230
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
231 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
232 * This relies on T_BAT_storage being identical to
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
233 * T_ACI_PB_STOR.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
234 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
235 cpbs_data.storage=(T_BAT_storage)stor;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
236
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
237 cpbs_data.total=(S16)total;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
238 cpbs_data.used=(S16)used;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
239 cpbs_data.first=(S16)first;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
240
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
241 aci_bat_send(src_infos_psi,&resp);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
242 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
243
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
244 return(ret);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
245 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
246
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
247 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
248 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
249 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
250 | STATE : code ROUTINE : sBAT_PlusCPBW |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
251 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
252
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
253 PURPOSE :
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
254 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
255 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCPBW (T_ACI_DTI_PRC_PSI *src_infos_psi,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
256 T_BAT_cmd_send *cmd)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
257 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
258 T_ACI_BAT_RSLT ret;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
259 SHORT index;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
260 CHAR number[BAT_MAX_CPBW_NUMBER_LEN+1];
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
261 CHAR *p_number;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
262 T_ACI_TOA toa;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
263 T_ACI_TOA *p_toa;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
264 T_ACI_PB_TEXT text;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
265 T_ACI_PB_TEXT *p_text;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
266 T_ACI_VP_ABS dmy_date_time;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
267 T_BAT_cmd_set_plus_cpbw *cpbw;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
268
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
269 TRACE_FUNCTION ("sBAT_PlusCPBW()");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
270
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
271 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
272 * Get a pointer to the CPBW structure for convenience.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
273 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
274 cpbw=cmd->params.ptr_set_plus_cpbw;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
275
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
276 index=(SHORT)cpbw->index;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
277
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
278 if (cpbw->v_number==TRUE)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
279 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
280 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
281 * The idea here is to get the 'number' parameter into a
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
282 * null terminated string, which is what sAT_PlusCPBW() expects, but
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
283 * is not guaranteed by BAT.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
284 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
285 memset(number,0,sizeof(number));
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
286 memcpy(number,cpbw->number,cpbw->c_number);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
287 p_number=number;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
288
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
289 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
290 * BAT stores the type of address in a single value.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
291 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
292 if (cpbw->type!=-1)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
293 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
294 toa=toa_demerge(cpbw->type);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
295 p_toa=&toa;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
296 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
297 else
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
298 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
299 p_toa=NULL;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
300 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
301 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
302 else
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
303 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
304 p_number=NULL;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
305 p_toa=NULL;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
306 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
307
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
308 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
309 * Associated text
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
310 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
311 if (cpbw->v_text==TRUE)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
312 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
313 USHORT len;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
314
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
315 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
316 * Convert from the currently selected character set into the
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
317 * SIM format.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
318 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
319 utl_chsetToSim(
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
320 (UBYTE *)cpbw->text,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
321 (USHORT)cpbw->c_text,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
322 (UBYTE *)text.data,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
323 &len,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
324 GSM_ALPHA_Def);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
325
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
326 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
327 * Set the length. Note that we cannot do this by passing a
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
328 * reference to text.len into utl_chsetToSim() because it is
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
329 * the wrong type.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
330 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
331 text.len=(UBYTE)len;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
332
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
333 text.cs=CS_Sim;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
334
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
335 p_text=&text;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
336 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
337 else
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
338 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
339 p_text=NULL;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
340 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
341
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
342 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
343 * Call the corresponding sAT function. T_ACI_BAT_RSLT is
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
344 * assumed to be equivalent to T_ACI_RESULT.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
345 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
346 ret=sAT_PlusCPBW(
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
347 src_infos_psi->srcId,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
348 index,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
349 p_number,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
350 p_toa,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
351 p_text,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
352 &dmy_date_time);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
353
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
354 return(ret);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
355 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
356
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
357 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
358 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
359 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
360 | STATE : code ROUTINE : tBAT_PlusCPBW |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
361 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
362
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
363 PURPOSE :
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
364 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
365 GLOBAL T_ACI_BAT_RSLT tBAT_PlusCPBW (T_ACI_DTI_PRC_PSI *src_infos_psi,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
366 T_BAT_cmd_send *cmd)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
367 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
368 T_ACI_BAT_RSLT ret;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
369 SHORT first;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
370 SHORT last;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
371 UBYTE nlength;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
372 UBYTE tlength;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
373
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
374 TRACE_FUNCTION ("tBAT_PlusCPBW()");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
375
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
376 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
377 * Call the corresponding tAT function. T_ACI_BAT_RSLT is
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
378 * assumed to be equivalent to T_ACI_RESULT.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
379 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
380 ret=(T_ACI_BAT_RSLT)tAT_PlusCPBW(src_infos_psi->srcId,&first,&last,&nlength,&tlength);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
381
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
382 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
383 * If the command completes, send the response now.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
384 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
385 if (ret==ACI_BAT_CMPL)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
386 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
387 T_BAT_cmd_response resp;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
388 T_BAT_res_tst_plus_cpbw cpbw_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
389
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
390 resp.ctrl_response=BAT_RES_TST_PLUS_CPBW;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
391 resp.response.ptr_tst_plus_cpbw=&cpbw_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
392
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
393 cpbw_data.index1=(U8)first;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
394 cpbw_data.index2=(U8)last;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
395 cpbw_data.nlength=(S16)nlength;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
396 cpbw_data.tlength=(S16)tlength;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
397
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
398 #pragma message(__TODO__"+CPBW types")
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
399 cpbw_data.c_types=0;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
400 cpbw_data.types[0]=0;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
401
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
402 aci_bat_send(src_infos_psi,&resp);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
403 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
404
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
405 return(ret);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
406 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
407
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
408 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
409 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
410 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
411 | STATE : code ROUTINE : sBAT_PlusCPBR |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
412 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
413
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
414 PURPOSE : Read phonebook entries. If the application wants to read
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
415 more than ACI_BAT_MAX_RESPONSES, then the responses are
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
416 sent block by block (one block = ACI_BAT_MAX_RESPONSES).
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
417 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
418 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCPBR_CB (T_ACI_DTI_PRC_PSI *src_infos_psi)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
419 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
420 T_BAT_cmd_send cmd;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
421 T_BAT_cmd_set_plus_cpbr cpbr;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
422
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
423 cmd.ctrl_params = BAT_CMD_SET_PLUS_CPBR;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
424 cmd.params.ptr_set_plus_cpbr = &cpbr;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
425
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
426 cpbr.index1 = (U8)src_infos_psi->index1;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
427 cpbr.index2 = (S16)src_infos_psi->index2;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
428
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
429 return (sBAT_PlusCPBR(src_infos_psi, &cmd));
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
430 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
431
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
432
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
433 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCPBR (T_ACI_DTI_PRC_PSI *src_infos_psi,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
434 T_BAT_cmd_send *cmd)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
435 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
436 T_ACI_BAT_RSLT ret;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
437 SHORT start_idx;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
438 SHORT stop_idx;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
439 SHORT last_idx = ACI_NumParmNotPresent;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
440 T_ACI_PB_ENTR pb_lst[MAX_PB_ENTR];
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
441
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
442 TRACE_FUNCTION ("sBAT_PlusCPBR()");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
443
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
444 /* define here the variables, which are passed as parameters to sAT_PlusCPBR */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
445 start_idx = (SHORT)cmd->params.ptr_set_plus_cpbr->index1;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
446 stop_idx = (SHORT)cmd->params.ptr_set_plus_cpbr->index2;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
447
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
448 ret = (T_ACI_BAT_RSLT)sAT_PlusCPBR(src_infos_psi->srcId, start_idx, stop_idx, &last_idx, &pb_lst[0]);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
449 if (ret EQ ACI_BAT_CMPL)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
450 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
451 SHORT i;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
452 T_BAT_cmd_response resp;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
453 T_BAT_res_set_plus_cpbr cpbr_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
454
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
455 resp.ctrl_response = BAT_RES_SET_PLUS_CPBR;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
456 resp.response.ptr_set_plus_cpbr = &cpbr_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
457
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
458 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
459 * sAT_PlusCPBR() provides in pb_lst[] up to five entries (MAX_PB_ENTR)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
460 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
461 for (i = 0; ((i < MAX_PB_ENTR) AND (pb_lst[i].index NEQ ACI_NumParmNotPresent)); i++)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
462 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
463 USHORT len_cvtd_text=0;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
464
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
465 cpbr_data.index = (U8)pb_lst[i].index;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
466
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
467 cpbr_data.c_number = strlen((CHAR*)pb_lst[i].number);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
468
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
469 cpbr_data.c_number = (cpbr_data.c_number > BAT_MAX_CPBR_NUMBER_LEN)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
470 ? BAT_MAX_CPBR_NUMBER_LEN
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
471 : cpbr_data.c_number;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
472
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
473 strncpy((CHAR*)cpbr_data.number, pb_lst[i].number, cpbr_data.c_number+1); /* Include null terminator for Resp_.. () */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
474
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
475 /* BAT stores the type of address in a single 8-bit value. */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
476 cpbr_data.type = toa_merge(pb_lst[i].type);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
477
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
478 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
479 * Convert the data read from the SIM into the currently
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
480 * selected character set.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
481 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
482 utl_chsetFromSim(
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
483 (UBYTE *)pb_lst[i].text.data,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
484 pb_lst[i].text.len,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
485 (UBYTE *)cpbr_data.text,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
486 BAT_MAX_CPBR_TEXT_LEN,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
487 &len_cvtd_text,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
488 GSM_ALPHA_Def);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
489
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
490 cpbr_data.c_text=(U8)len_cvtd_text;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
491
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
492 TRACE_EVENT_P2("sBAT_PlusCPBR(): index = %i c_text = %d", cpbr_data.index, cpbr_data.c_text);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
493
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
494 /* vsi_t_sleep (aci_handle, 500); */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
495 aci_bat_send(src_infos_psi,&resp);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
496 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
497 /* remember updated start index and initial stop index for possible next block of entries to send to APP */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
498 src_infos_psi->index1 = last_idx + 1;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
499 src_infos_psi->index2 = stop_idx;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
500 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
501 else
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
502 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
503 ACI_ERR_DESC(ACI_ERR_CLASS_Cme,CME_ERR_Unknown);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
504 return(ACI_BAT_FAIL);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
505 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
506
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
507 if (last_idx < stop_idx)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
508 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
509 src_infos_psi->large_type = TRUE;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
510 return (ACI_BAT_EXCT);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
511 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
512
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
513 src_infos_psi->large_type = FALSE;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
514 return (ACI_BAT_CMPL);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
515 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
516
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
517 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
518 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
519 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
520 | STATE : code ROUTINE : tBAT_PlusCPBR |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
521 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
522
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
523 PURPOSE :
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
524 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
525
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
526 GLOBAL T_ACI_BAT_RSLT tBAT_PlusCPBR (T_ACI_DTI_PRC_PSI *src_infos_psi,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
527 T_BAT_cmd_send *cmd)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
528 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
529 T_ACI_BAT_RSLT ret=ACI_BAT_FAIL;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
530 SHORT first;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
531 SHORT last;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
532 UBYTE nlength;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
533 UBYTE tlength;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
534
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
535 TRACE_FUNCTION ("tBAT_PlusCPBR()");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
536
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
537 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
538 * Call the corresponding tAT function. T_ACI_BAT_RSLT is
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
539 * assumed to be equivalent to T_ACI_RESULT.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
540 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
541 ret=(T_ACI_BAT_RSLT)tAT_PlusCPBR(src_infos_psi->srcId,&first,&last,&nlength,&tlength);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
542
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
543 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
544 * If the command completes, send the response now.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
545 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
546 if (ret==ACI_BAT_CMPL)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
547 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
548 T_BAT_cmd_response resp;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
549 T_BAT_res_tst_plus_cpbr cpbr_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
550
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
551 resp.ctrl_response=BAT_RES_TST_PLUS_CPBR;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
552 resp.response.ptr_tst_plus_cpbr=&cpbr_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
553
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
554 cpbr_data.index_f=(U8)first;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
555 cpbr_data.index_l=(U8)last;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
556 cpbr_data.nlength=(S16)nlength;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
557 cpbr_data.tlength=(S16)tlength;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
558
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
559 aci_bat_send(src_infos_psi,&resp);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
560 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
561
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
562 return(ret);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
563 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
564
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
565 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
566 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
567 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
568 | STATE : code ROUTINE : sBAT_PlusCPBF |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
569 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
570
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
571 PURPOSE :
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
572 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
573 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCPBF_CB (T_ACI_DTI_PRC_PSI *src_infos_psi)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
574 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
575 T_BAT_cmd_send cmd;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
576 T_BAT_cmd_set_plus_cpbf cpbf;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
577
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
578 cmd.ctrl_params = BAT_CMD_SET_PLUS_CPBF;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
579 cmd.params.ptr_set_plus_cpbf = &cpbf;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
580
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
581 TRACE_FUNCTION ("sBAT_PlusCPBF_CB()");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
582
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
583 /* restore search string if ongoing command */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
584 if ( src_infos_psi->search_str_ptr NEQ NULL )
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
585 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
586 TRACE_EVENT("Restore search string");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
587 /* index 1 stores the length of the string in the case of cpbf */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
588 cpbf.c_findtext = (U8)src_infos_psi->index1;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
589 memcpy(cpbf.findtext, src_infos_psi->search_str_ptr, BAT_MAX_CPBF_FIND_TEXT_LEN);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
590 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
591 return (sBAT_PlusCPBF(src_infos_psi, &cmd));
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
592 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
593
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
594 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCPBF (T_ACI_DTI_PRC_PSI *src_infos_psi,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
595 T_BAT_cmd_send *cmd)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
596 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
597 T_ACI_PB_TEXT pbtext;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
598 USHORT len;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
599 T_ACI_BAT_RSLT ret;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
600 T_BAT_cmd_set_plus_cpbf *cpbf_cmd;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
601 SHORT found = -1;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
602 T_ACI_PB_ENTR pb[MAX_PB_ENTR];
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
603 SHORT i;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
604 T_ACI_CPBF_MOD search_mode; // replaced by global var
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
605 T_BAT_cmd_response resp;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
606 T_BAT_res_set_plus_cpbf cpbf_rsp;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
607
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
608 TRACE_FUNCTION ("sBAT_PlusCPBF()");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
609
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
610 resp.ctrl_response = BAT_RES_SET_PLUS_CPBF;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
611 resp.response.ptr_set_plus_cpbf = &cpbf_rsp;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
612
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
613 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
614 * Get a pointer to the CPBF data for convenience.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
615 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
616 cpbf_cmd = cmd->params.ptr_set_plus_cpbf;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
617
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
618 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
619 * We may have to call sAT_PlusCPBF() more than once, if there are
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
620 * more than MAX_PB_ENTR entries found. The search mode is used
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
621 * to tell the ACI whether this is a new search or a continuation of
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
622 * the old one.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
623 * If there has been a valid string pointer saved to the search_str_ptr
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
624 * the seek has to be continued.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
625 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
626
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
627 if ((src_infos_psi->search_str_ptr NEQ NULL)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
628 AND (strncmp(src_infos_psi->search_str_ptr, cpbf_cmd->findtext, cpbf_cmd->c_findtext) EQ 0))
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
629 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
630 found = src_infos_psi->index2; /* recover number found*/
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
631 search_mode = CPBF_MOD_NextSearch;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
632 TRACE_EVENT_P1("Stored Search string: %s", src_infos_psi->search_str_ptr);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
633 TRACE_EVENT_P1("Stored String length: %d", src_infos_psi->index1);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
634 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
635 else
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
636 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
637 search_mode = CPBF_MOD_NewSearch;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
638 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
639
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
640 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
641 * If the search string has zero length or is larger than the ACI function
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
642 * can handle then there's no point continuing.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
643 * In fact there should be a differentiation between UCS2 and 8bit based coding schemes.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
644 * Additionally it has to be considered that the string given within the BAT command is ACSII encoded.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
645 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
646 if (((ati_user_output_cfg[src_infos_psi->srcId].cscsChset EQ CSCS_CHSET_Ucs2)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
647 && ((cpbf_cmd->c_findtext>BAT_MAX_CPBF_FIND_TEXT_LEN)||(cpbf_cmd->c_findtext<1)) )
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
648 ||
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
649 ((ati_user_output_cfg[src_infos_psi->srcId].cscsChset NEQ CSCS_CHSET_Ucs2)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
650 && ((cpbf_cmd->c_findtext>MAX_PHB_NUM_LEN)||(cpbf_cmd->c_findtext<1)) ) )
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
651 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
652 ACI_ERR_DESC(ACI_ERR_CLASS_Cme,CME_ERR_Unknown);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
653 return(ACI_BAT_FAIL);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
654 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
655
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
656 TRACE_EVENT_P1("Search string: %s", cpbf_cmd->findtext);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
657 TRACE_EVENT_P1("String length: %d", cpbf_cmd->c_findtext);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
658
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
659 utl_chsetToSim(
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
660 (UBYTE *)cpbf_cmd->findtext,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
661 (USHORT)cpbf_cmd->c_findtext,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
662 (UBYTE *)pbtext.data,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
663 &len,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
664 GSM_ALPHA_Def);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
665
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
666 if (len > MAX_PHB_NUM_LEN)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
667 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
668 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
669 * Shouldn't get here as that would mean that memory has been
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
670 * overwritten. Currently utl_chsetToSim() has no specific mechanism
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
671 * to prevent this.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
672 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
673 ACI_ERR_DESC(ACI_ERR_CLASS_Cme,CME_ERR_TxtToLong);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
674 return(ACI_BAT_FAIL);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
675 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
676
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
677 pbtext.len = (UBYTE)len;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
678 pbtext.cs = (T_ACI_CS)CS_Sim;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
679
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
680
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
681 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
682 * Call the corresponding sAT function. T_ACI_BAT_RSLT is
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
683 * assumed to be equivalent to T_ACI_RESULT.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
684 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
685
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
686 TRACE_EVENT_P1("search_mode: %d", search_mode);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
687 TRACE_EVENT_P1("pbtext.data: %s", pbtext.data);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
688 TRACE_EVENT_P1("pbtext.len: %d", pbtext.len);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
689
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
690
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
691 /* found is not overwritten in the case of NEXT_SEARCH */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
692 ret=(T_ACI_BAT_RSLT)sAT_PlusCPBF(
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
693 src_infos_psi->srcId,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
694 &pbtext,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
695 search_mode,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
696 &found,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
697 pb);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
698
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
699 TRACE_EVENT_P1("sAT_PlusCPBF returns: %d", ret);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
700 TRACE_EVENT_P1("-- found entries: %d", found);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
701
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
702 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
703 * If the command fails, get out now.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
704 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
705 if (ret!=ACI_BAT_CMPL)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
706 return(ret);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
707
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
708 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
709 * We have received a list, however the BAT response only
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
710 * allows for single items. So we must send each one
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
711 * individually.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
712 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
713 for (i=0;((i<found) && (i<MAX_PB_ENTR));i++)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
714 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
715 USHORT len_cvtd_text=0;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
716
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
717 cpbf_rsp.index=(U8)pb[i].index;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
718
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
719 TRACE_EVENT("send the found entry");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
720 strncpy((CHAR*)cpbf_rsp.number,pb[i].number,BAT_MAX_CPBF_NUMBER_LEN);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
721 cpbf_rsp.c_number=strlen((CHAR*)cpbf_rsp.number);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
722
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
723 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
724 * BAT stores the type of address in a single 8-bit value.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
725 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
726 cpbf_rsp.type=toa_merge(pb[i].type);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
727
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
728 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
729 * Convert the data read from the SIM into the currently
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
730 * selected character set.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
731 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
732 utl_chsetFromSim(
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
733 (UBYTE *)pb[i].text.data,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
734 pb[i].text.len,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
735 (UBYTE *)cpbf_rsp.text,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
736 BAT_MAX_CPBF_TEXT_LEN,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
737 &len_cvtd_text,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
738 GSM_ALPHA_Def);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
739
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
740 cpbf_rsp.c_text=(U8)len_cvtd_text;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
741
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
742 /* vsi_t_sleep (aci_handle, 500); */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
743
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
744 aci_bat_send(src_infos_psi,&resp);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
745 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
746
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
747 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
748 * Set the search mode for the next iteration, should there be
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
749 * one.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
750 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
751
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
752 if (found>MAX_PB_ENTR)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
753 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
754 TRACE_EVENT("More entries found");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
755 /* remember the string to search for (only necessary for first iteration)*/
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
756 if (search_mode EQ CPBF_MOD_NewSearch)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
757 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
758 TRACE_EVENT("Store string");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
759 src_infos_psi->index1 = (U16)cpbf_cmd->c_findtext; /* str length */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
760 ACI_MALLOC(src_infos_psi->search_str_ptr, BAT_MAX_CPBF_FIND_TEXT_LEN);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
761 memcpy(src_infos_psi->search_str_ptr, cpbf_cmd->findtext, BAT_MAX_CPBF_FIND_TEXT_LEN);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
762 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
763 /* This is a multi-line response */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
764 src_infos_psi->large_type = TRUE;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
765 /* Save the number of found items - MAX_PB_ENTR send to user */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
766 src_infos_psi->index2 = found - MAX_PB_ENTR;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
767 /* Still executing */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
768 ret = ACI_BAT_EXCT;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
769 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
770 else /* no further entries to find */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
771 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
772 TRACE_EVENT("reset search string");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
773 /* reset search string info for iterations */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
774 src_infos_psi->index1 = 0; /* str length reset */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
775 src_infos_psi->index2 = 0; /* number found reset */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
776 if (src_infos_psi->search_str_ptr NEQ NULL) /* str mem reset, if necessary */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
777 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
778 ACI_MFREE(src_infos_psi->search_str_ptr);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
779 src_infos_psi->search_str_ptr = NULL;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
780 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
781 /* This is NO multiline response */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
782 src_infos_psi->large_type = FALSE;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
783 /* completed */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
784 ret = ACI_BAT_CMPL;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
785 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
786
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
787 return (ret);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
788
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
789 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
790
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
791 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
792 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
793 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
794 | STATE : code ROUTINE : tBAT_PlusCPBF |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
795 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
796
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
797 PURPOSE :
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
798 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
799 GLOBAL T_ACI_BAT_RSLT tBAT_PlusCPBF (T_ACI_DTI_PRC_PSI *src_infos_psi,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
800 T_BAT_cmd_send *cmd)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
801 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
802 T_ACI_BAT_RSLT ret;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
803 UBYTE nlength;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
804 UBYTE tlength;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
805
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
806 TRACE_FUNCTION ("tBAT_PlusCPBF()");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
807
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
808 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
809 * Call the corresponding ACI function. T_ACI_BAT_RSLT is
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
810 * assumed to be equivalent to T_ACI_RESULT.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
811 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
812 ret=(T_ACI_BAT_RSLT)tAT_PlusCPBF(src_infos_psi->srcId,&nlength,&tlength);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
813
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
814 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
815 * If the command completes, send the response now.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
816 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
817 if (ret==ACI_BAT_CMPL)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
818 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
819 T_BAT_cmd_response resp;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
820 T_BAT_res_tst_plus_cpbf cpbf_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
821
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
822 resp.ctrl_response=BAT_RES_TST_PLUS_CPBF;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
823 resp.response.ptr_tst_plus_cpbf=&cpbf_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
824
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
825 cpbf_data.nlength=(S16)nlength;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
826 cpbf_data.tlength=(S16)tlength;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
827
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
828 aci_bat_send(src_infos_psi,&resp);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
829 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
830
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
831 return(ret);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
832 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
833
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
834 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
835 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
836 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
837 | STATE : code ROUTINE : sBAT_PlusCSVM |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
838 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
839
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
840 PURPOSE :
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
841 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
842 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCSVM (T_ACI_DTI_PRC_PSI *src_infos_psi,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
843 T_BAT_cmd_send *cmd)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
844 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
845 T_ACI_BAT_RSLT ret;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
846 T_ACI_TOA toa;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
847 CHAR number[BAT_MAX_CSVM_NUMBER_LEN+1];
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
848 CHAR *pnumber;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
849 T_ACI_CSVM_MOD mode;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
850 T_BAT_cmd_set_plus_csvm *csvm;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
851 UBYTE num_len;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
852
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
853 TRACE_FUNCTION ("sBAT_PlusCSVM()");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
854
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
855 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
856 * Get a pointer to the BAT structure for convenience.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
857 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
858 csvm=cmd->params.ptr_set_plus_csvm;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
859
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
860 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
861 * This assumes that T_ACI_CSVM_MOD and T_BAT_plus_csvm_mode are
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
862 * equivalent. They are, except that the ACI version has a
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
863 * NotPresent value - this is not a problem here as we are converting
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
864 * from BAT format to ACI format.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
865 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
866 mode=(T_ACI_CSVM_MOD)csvm->mode;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
867
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
868 if (csvm->v_number==TRUE)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
869 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
870 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
871 * I don't think that CSVM requires a null-terminated string, but
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
872 * it's best to err on the side of caution.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
873 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
874 pnumber=number;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
875 memset(number,0,sizeof(number));
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
876 memcpy(number,csvm->number,BAT_MAX_CSVM_NUMBER_LEN);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
877
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
878 if (csvm->c_number>BAT_MAX_CSVM_NUMBER_LEN)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
879 num_len=(UBYTE)BAT_MAX_CSVM_NUMBER_LEN;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
880 else
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
881 num_len=(UBYTE)csvm->c_number;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
882 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
883 else
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
884 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
885 pnumber=NULL;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
886 num_len=0;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
887 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
888
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
889 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
890 * BAT stores the type of address in a single 8-bit value. We need to
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
891 * convert this to the ACI format.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
892 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
893 toa=toa_demerge(csvm->type);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
894
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
895 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
896 * Call the corresponding ACI function. T_ACI_BAT_RSLT is
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
897 * assumed to be equivalent to T_ACI_RESULT.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
898 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
899 ret=(T_ACI_BAT_RSLT)sAT_PlusCSVM(src_infos_psi->srcId,mode,pnumber,num_len,&toa);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
900
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
901 return(ret);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
902 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
903
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
904 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
905 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
906 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
907 | STATE : code ROUTINE : qBAT_PlusCSVM |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
908 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
909
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
910 PURPOSE :
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
911 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
912 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCSVM (T_ACI_DTI_PRC_PSI *src_infos_psi,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
913 T_BAT_cmd_send *cmd)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
914 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
915 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
916 T_ACI_CSVM_MOD mode;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
917 CHAR number[BAT_MAX_CSVM_NUMBER_LEN+1];
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
918 SHORT toa_val;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
919
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
920 TRACE_FUNCTION ("qBAT_PlusCSVM()");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
921
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
922 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
923 * Call the corresponding qAT function. T_ACI_BAT_RSLT is
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
924 * assumed to be equivalent to T_ACI_RESULT.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
925 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
926 ret=(T_ACI_BAT_RSLT)qAT_PlusCSVM(
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
927 src_infos_psi->srcId,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
928 &mode,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
929 number,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
930 BAT_MAX_CSVM_NUMBER_LEN,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
931 &toa_val);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
932
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
933 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
934 * If the query completes, send the response now.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
935 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
936 if (ret==ACI_BAT_CMPL)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
937 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
938 T_BAT_cmd_response resp;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
939 T_BAT_res_que_plus_csvm csvm_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
940
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
941 resp.ctrl_response=BAT_RES_QUE_PLUS_CSVM;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
942 resp.response.ptr_que_plus_csvm=&csvm_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
943
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
944 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
945 * We can't just cast the ACI value to the BAT value as it
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
946 * might be CSVM_MOD_NotPresent, for which the BAT has no
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
947 * equivalent.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
948 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
949 csvm_data.mode=(mode==CSVM_MOD_Enable) ? BAT_CSVM_MODE_ENABLE:BAT_CSVM_MODE_DISABLE;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
950
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
951 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
952 * We trust the ACI to give us a null-terminated string.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
953 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
954 strcpy((CHAR*)csvm_data.number,number);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
955 csvm_data.c_number=strlen((CHAR*)csvm_data.number);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
956
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
957 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
958 * Note that in this instance the ACI is giving us the TOA as
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
959 * a single number, rather than in its usual T_ACI_TOA format.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
960 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
961 csvm_data.type=(U8)toa_val;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
962
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
963 aci_bat_send(src_infos_psi,&resp);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
964 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
965
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
966 return(ret);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
967 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
968
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
969 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
970 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
971 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
972 | STATE : code ROUTINE : sBAT_PlusCLAN |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
973 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
974
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
975 PURPOSE :
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
976 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
977 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCLAN (T_ACI_DTI_PRC_PSI *src_infos_psi,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
978 T_BAT_cmd_send *cmd)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
979 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
980 T_ACI_BAT_RSLT ret;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
981 T_ACI_LAN_SUP lng;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
982 CHAR str[BAT_MAX_CLAN_CODE_LEN+1];
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
983 USHORT i;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
984
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
985 TRACE_FUNCTION ("sBAT_PlusCLAN()");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
986
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
987 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
988 * Ensure that we have a null-terminated string.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
989 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
990 memset(str,0,sizeof(str));
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
991 memcpy(str,cmd->params.ptr_set_plus_clan->code,BAT_MAX_CLAN_CODE_LEN);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
992
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
993 lng.str=NULL;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
994
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
995 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
996 * The BAT provides the language in string form only, we must also
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
997 * calculate the corresponding value. To do this we use the lookup
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
998 * table "lngs".
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
999 *
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1000 * GSM 07.07 says that "AUTO" should be used for automatic mode, but
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1001 * the (ATI) code uses "au". Here we want to accept both.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1002 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1003 if (!strcmp(str,"AUTO"))
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1004 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1005 lng.lng=CLAN_LNG_AUT;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1006 lng.str="AUTO";
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1007 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1008 else
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1009 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1010 for (i=0;lngs[i].str;i++)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1011 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1012 if (!strcmp(lngs[i].str,str))
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1013 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1014 lng.str=lngs[i].str;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1015 lng.lng=lngs[i].lng;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1016 break;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1017 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1018 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1019 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1020
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1021 if (lng.str==NULL)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1022 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1023 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1024 * Can't work out the language so give up.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1025 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1026 ACI_ERR_DESC(ACI_ERR_CLASS_Cme,CME_ERR_OpNotSupp);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1027 return(ACI_BAT_FAIL);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1028 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1029
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1030 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1031 * Call the corresponding ACI function. T_ACI_BAT_RSLT is
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1032 * assumed to be equivalent to T_ACI_RESULT.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1033 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1034 ret=(T_ACI_BAT_RSLT)sAT_PlusCLAN(src_infos_psi->srcId,&lng);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1035
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1036 return(ret);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1037 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1038
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1039 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1040 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1041 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1042 | STATE : code ROUTINE : qBAT_PlusCLAN |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1043 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1044
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1045 PURPOSE :
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1046 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1047 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCLAN (T_ACI_DTI_PRC_PSI *src_infos_psi,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1048 T_BAT_cmd_send *cmd)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1049 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1050 T_ACI_BAT_RSLT ret;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1051 T_ACI_LAN_SUP lng;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1052 T_BAT_cmd_response resp;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1053 T_BAT_res_que_plus_clan clan_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1054
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1055 TRACE_FUNCTION ("qBAT_PlusCLAN()");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1056
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1057 resp.ctrl_response=BAT_RES_QUE_PLUS_CLAN;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1058 resp.response.ptr_que_plus_clan=&clan_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1059
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1060 memset(&clan_data,0,sizeof(clan_data));
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1061 lng.str=(CHAR *)clan_data.code;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1062
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1063 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1064 * Call the corresponding ACI function. T_ACI_BAT_RSLT is
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1065 * assumed to be equivalent to T_ACI_RESULT.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1066 * We are trusting this function not to deliver too long
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1067 * a string. At the time of writing, it can only give us two
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1068 * characters, which we easily have room for in the BAT
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1069 * message.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1070 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1071 ret=(T_ACI_BAT_RSLT)qAT_PlusCLAN(src_infos_psi->srcId,&lng);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1072
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1073 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1074 * If the query completes, send the response now.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1075 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1076 if (ret==ACI_BAT_CMPL)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1077 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1078 clan_data.c_code=strlen(lng.str);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1079 aci_bat_send(src_infos_psi,&resp);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1080 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1081
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1082 return(ret);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1083 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1084
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1085 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1086 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1087 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1088 | STATE : code ROUTINE : tBAT_PlusCLAN |
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1089 +--------------------------------------------------------------------+
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1090
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1091 PURPOSE :
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1092 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1093 GLOBAL T_ACI_BAT_RSLT tBAT_PlusCLAN (T_ACI_DTI_PRC_PSI *src_infos_psi,
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1094 T_BAT_cmd_send *cmd)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1095 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1096 T_ACI_BAT_RSLT ret;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1097 T_ACI_LAN_SUP lng[MAX_LAN];
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1098 SHORT last_idx;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1099
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1100 TRACE_FUNCTION ("tBAT_PlusCLAN()");
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1101
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1102 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1103 * Call the corresponding ACI function. T_ACI_BAT_RSLT is
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1104 * assumed to be equivalent to T_ACI_RESULT.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1105 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1106 ret=(T_ACI_BAT_RSLT)tAT_PlusCLAN(src_infos_psi->srcId,&last_idx,lng);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1107
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1108 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1109 * If the command completes, send the response now.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1110 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1111 if (ret==ACI_BAT_CMPL)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1112 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1113 USHORT i;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1114 T_BAT_cmd_response resp;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1115 T_BAT_res_tst_plus_clan clan_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1116
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1117 resp.ctrl_response=BAT_RES_TST_PLUS_CLAN;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1118 resp.response.ptr_tst_plus_clan=&clan_data;
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1119
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1120 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1121 * We have received a list, however the BAT response only
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1122 * allows for single items. So we must send each one
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1123 * individually.
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1124 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1125 for (i=0;i<last_idx;i++)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1126 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1127 clan_data.c_code=strlen(lng[i].str);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1128
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1129 /*
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1130 * Discard any languages for which the string is too long for
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1131 * BAT (this should never happen).
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1132 */
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1133 if (clan_data.c_code<=BAT_MAX_CLAN_CODE_LEN)
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1134 {
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1135 memcpy(clan_data.code,lng[i].str,BAT_MAX_CLAN_CODE_LEN);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1136 aci_bat_send(src_infos_psi,&resp);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1137 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1138 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1139 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1140
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1141 return(ret);
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1142 }
93999a60b835 src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1143