annotate gsm-fw/g23m-aci/aci/ati_cphs.c @ 775:eedbf248bac0

gsm-fw/g23m-aci subtree: initial import from LoCosto source
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 12 Oct 2014 01:45:14 +0000
parents
children 09382de17df9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
775
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 | PROJECT: $Workfile:: ati_cphs.c $|
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 | $Author:: $Revision:: $|
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 | CREATED: $Modtime:: $|
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 | STATE : code |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 MODULE : ATI
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 PURPOSE : CPHS related proprietery AT commands.
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 #ifndef ATI_CPHS_C
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 #define ATI_CPHS_C
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 #include "aci_all.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19 #include "aci_cmh.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20 #include "ati_cmd.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 #include "aci_cmd.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22 #include "aci_lst.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
23 #include "ati_int.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
24 #include "aci_prs.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
25 #include "aci_mem.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
26 #include "aci_io.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
27
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
28 #include "cphs.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
29 #include "aci_cphs.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
30
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
31 #ifdef FF_ATI_BAT
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
32
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
33 #include "typedefs.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
34 #include "gdd.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
35 #include "bat.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
36
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
37 #include "ati_bat.h"
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
38
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
39 #endif /* FF_ATI_BAT */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
40
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
41 LOCAL T_ATI_RSLT query_indicator_flags(UBYTE srcId, T_CPHS_LINES queried_lines, T_ACI_AT_CMD indicator_type);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
42
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
43 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
44 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
45 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
46 | STATE : code ROUTINE : atPercentCPHS |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
47 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
48
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
49 PURPOSE : %CPHS: CPHS module initialing/closing/refreshing
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
50 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
51
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
52 GLOBAL T_ATI_RSLT setatPercentCPHS (CHAR *cl, UBYTE srcId)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
53 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
54 T_ACI_CPHS_INIT initMode;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
55 T_ACI_RETURN ret = AT_FAIL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
56 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
57
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
58 cl = parse(cl, "d", &initMode);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
59 if (cl EQ NULL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
60 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
61 cmdCmeError(CME_ERR_OpNotAllow);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
62 return ATI_FAIL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
63 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
64
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
65 #ifdef FF_ATI_BAT
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
66 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
67 T_BAT_cmd_send cmd;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
68 T_BAT_cmd_set_percent_cphs my_bat_set_percent_cphs;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
69
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
70 TRACE_FUNCTION("setatPercentCPHS() calls bat_send() <=== as APPLICATION");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
71
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
72 memset(&my_bat_set_percent_cphs, 0, sizeof(my_bat_set_percent_cphs));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
73 cmd.ctrl_params = BAT_CMD_SET_PERCENT_CPHS;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
74 cmd.params.ptr_set_percent_cphs = &my_bat_set_percent_cphs;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
75
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
76 my_bat_set_percent_cphs.init_mode = initMode;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
77 src_params->curAtCmd = AT_CMD_CPHS;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
78 bat_send(ati_bat_get_client(srcId), &cmd);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
79
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
80 return ATI_EXCT; /* executing, because response is passed by callback function */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
81 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
82 #else /* OLD FUNCTION BODY */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
83 TRACE_FUNCTION("setatPercentCPHS()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
84
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
85 ret=sAT_PercentCPHS((T_ACI_CMD_SRC)srcId, initMode);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
86
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
87 switch (ret)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
88 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
89 case (AT_EXCT):
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
90 src_params->curAtCmd = AT_CMD_CPHS;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
91 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
92
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
93 case (AT_BUSY):
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
94 cmdCmeError(CME_ERR_SimBusy);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
95 return(ATI_FAIL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
96
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
97 case (AT_FAIL):
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
98 cmdCmeError(CME_ERR_Unknown);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
99 return(ATI_FAIL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
100 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
101
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
102 return(map_aci_2_ati_rslt(ret));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
103
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
104 #endif /* no FF_ATI_BAT*/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
105 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
106
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
107 GLOBAL T_ATI_RSLT queatPercentCPHS (CHAR *cl, UBYTE srcId)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
108 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
109 T_ACI_CPHS_INIT initMode;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
110 T_ACI_RETURN ret;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
111
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
112 TRACE_FUNCTION("queatPercentCPHS()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
113
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
114 ret = qAT_PercentCPHS((T_ACI_CMD_SRC)srcId, &initMode);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
115
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
116 if (ret NEQ AT_CMPL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
117 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
118 cmdCmeError(CME_ERR_Unknown);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
119 return(ATI_FAIL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
120 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
121
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
122 sprintf(g_sa, "%s%d", "%CPHS: ", initMode);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
123 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
124 return(ATI_CMPL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
125 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
126
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
127
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
128 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
129 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
130 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
131 | STATE : code ROUTINE : atPercentCPNUMS |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
132 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
133
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
134 PURPOSE : %CPNUMS: CPHS information numbers management.
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
135 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
136
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
137 GLOBAL T_ATI_RSLT setatPercentCPNUMS (CHAR *cl, UBYTE srcId)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
138 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
139 SHORT element_id;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
140 T_CPHS_CPNUMS_MODE mode;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
141 T_ACI_RETURN ret = AT_FAIL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
142
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
143 cl = parse(cl, "rd", &element_id, &mode);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
144 if (cl EQ NULL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
145 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
146 cmdCmeError(CME_ERR_OpNotAllow);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
147 return ATI_FAIL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
148 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
149
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
150 #ifdef FF_ATI_BAT
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
151 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
152 T_BAT_cmd_send cmd;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
153 T_BAT_cmd_set_percent_cpnums my_bat_set_percent_cpnums;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
154
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
155 TRACE_FUNCTION("setatPercentYYYY() calls bat_send() <=== as APPLICATION");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
156
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
157 memset(&my_bat_set_percent_cpnums, 0, sizeof(my_bat_set_percent_cpnums));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
158 cmd.ctrl_params = BAT_CMD_SET_PERCENT_CPNUMS;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
159 cmd.params.ptr_set_percent_cpnums = &my_bat_set_percent_cpnums;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
160
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
161 my_bat_set_percent_cpnums.element_id = (U8)element_id;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
162 my_bat_set_percent_cpnums.mode = mode;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
163
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
164 bat_send(ati_bat_get_client(srcId), &cmd);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
165
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
166 return ATI_EXCT; /* executing, because response is passed by callback function */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
167 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
168 #else /* OLD FUNCTION BODY */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
169
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
170 TRACE_FUNCTION("setatPercentCPNUMS()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
171
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
172 ret=sAT_PercentCPNUMS((T_ACI_CMD_SRC)srcId, (UBYTE)element_id, (UBYTE)mode);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
173
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
174 if (ret NEQ AT_CMPL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
175 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
176 cmdCmeError(CME_ERR_Unknown);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
177 return(ATI_FAIL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
178 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
179
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
180 return(ATI_CMPL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
181
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
182 #endif /* no FF_ATI_BAT*/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
183 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
184
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
185 GLOBAL T_ATI_RSLT tesatPercentCPNUMS (CHAR *cl, UBYTE srcId)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
186 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
187 T_ACI_RETURN ret;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
188
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
189 TRACE_FUNCTION("tesatPercentCPNUMS()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
190
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
191 ret = tAT_PercentCPNUMS((T_ACI_CMD_SRC)srcId);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
192
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
193 if (ret NEQ AT_CMPL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
194 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
195 cmdCmeError(CME_ERR_Unknown);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
196 return(ATI_FAIL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
197 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
198 return(ATI_CMPL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
199 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
200
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
201 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
202 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
203 | PROJECT : GSM-F&D (8411) MODULE : ACI_RET |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
204 | STATE : code ROUTINE : rCI_PercentCPNUMS |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
205 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
206
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
207 PURPOSE : handles AT%CPNUMS call back
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
208 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
209 GLOBAL void rCI_PercentCPNUMS(UBYTE element_index,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
210 UBYTE index_level,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
211 CHAR *alpha_tag,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
212 CHAR *number,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
213 BOOL premium_flag,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
214 BOOL network_flag,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
215 UBYTE type_of_address)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
216 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
217 UBYTE srcId = srcId_cb;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
218 CHAR cvtd_text[4*CPHS_MAX_INF_ALPHA_TAG];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
219 USHORT len_cvtd=0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
220 USHORT pos=0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
221
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
222 TRACE_FUNCTION("rCI_PercentCPNUMS()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
223
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
224 utl_chsetFromSim(
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
225 (UBYTE *)alpha_tag,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
226 (USHORT)strlen(alpha_tag),
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
227 (UBYTE *)cvtd_text,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
228 sizeof(cvtd_text),
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
229 &len_cvtd,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
230 GSM_ALPHA_Def);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
231
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
232 pos=sprintf(g_sa,"%s%d,","%CPNUMS: ",element_index);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
233 pos+=sprints(g_sa+pos,cvtd_text,len_cvtd);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
234 pos+=sprintf(g_sa+pos,",\"%s\",%d,%d,%d,%d",number,index_level,premium_flag,network_flag,type_of_address);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
235
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
236 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
237 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
238
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
239 #ifndef MFW
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
240 #ifndef FF_MMI_RIV
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
241 /* dummy in case of SMI */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
242 GLOBAL void rAT_PercentCPNUMS(UBYTE element_index,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
243 UBYTE index_level,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
244 CHAR *alpha_tag,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
245 CHAR *number,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
246 BOOL premium_flag,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
247 BOOL network_flag,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
248 UBYTE type_of_address)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
249 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
250 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
251 #endif /*ndef FF_MMI_RIV */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
252 #endif /* ndef MFW */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
253
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
254 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
255 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
256 | PROJECT : GSM-F&D (8411) MODULE : ACI_RET |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
257 | STATE : code ROUTINE : rCI_PercentCPROAM |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
258 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
259
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
260 PURPOSE : handles %CPROAM indication
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
261 roam_status = 1 mobile entering roaming service // = 0 going back to home netwrok
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
262 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
263 GLOBAL void rCI_PercentCPROAM(UBYTE roam_status)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
264 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
265 UBYTE srcId = srcId_cb;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
266
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
267 TRACE_FUNCTION("rCI_PercentCPROAM()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
268
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
269 sprintf(g_sa, "%s: %d", "%CPROAM", roam_status);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
270
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
271 io_sendIndication(srcId, g_sa, ATI_NORMAL_OUTPUT);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
272 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
273
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
274 #ifndef MFW
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
275 #ifndef FF_MMI_RIV
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
276 /* dummy in case of SMI */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
277 GLOBAL void rAT_PercentCPROAM(UBYTE roam_status)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
278 {}
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
279 #endif /* ndef FF_MMI_RIV */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
280 #endif /* ndef MFW */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
281
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
282 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
283 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
284 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
285 | STATE : code ROUTINE : atPercentCPALS |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
286 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
287
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
288 PURPOSE : %CPALS: CPHS Alternate Line Service.
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
289 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
290
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
291 LOCAL T_ATI_RSLT proceed_CPALS(UBYTE srcId, UBYTE call_id)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
292 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
293 T_ACI_RETURN ret;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
294 T_CPHS_LINES active_line;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
295 CHAR *line_desc;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
296 UBYTE max_line_desc;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
297
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
298 max_line_desc = 30; /* should be enough ! */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
299 MALLOC(line_desc, max_line_desc);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
300
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
301 ret = qAT_PercentCPALS((T_ACI_CMD_SRC)srcId, call_id, &active_line, line_desc, &max_line_desc);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
302
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
303 if (ret EQ AT_EXCT)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
304 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
305 TRACE_EVENT_P1("Quite a line_desc !: %d", max_line_desc);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
306 MFREE(line_desc);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
307 MALLOC(line_desc, max_line_desc);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
308
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
309 /* retry */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
310 ret = qAT_PercentCPALS((T_ACI_CMD_SRC)srcId, call_id, &active_line, line_desc, &max_line_desc);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
311 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
312
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
313 if (ret NEQ AT_CMPL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
314 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
315 cmdCmeError(CME_ERR_OpNotAllow);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
316 MFREE(line_desc);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
317 return(ATI_FAIL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
318 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
319
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
320 sprintf(g_sa, "%s: %d,\"%s\"", "%CPALS", active_line, line_desc);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
321 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
322 MFREE(line_desc);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
323
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
324 return(ATI_CMPL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
325 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
326
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
327 GLOBAL T_ATI_RSLT setatPercentCPALS (CHAR *cl, UBYTE srcId)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
328 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
329 SHORT call_id;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
330
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
331 cl = parse(cl, "r", &call_id);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
332 if (cl EQ NULL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
333 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
334 cmdCmeError(CME_ERR_OpNotAllow);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
335 return ATI_FAIL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
336 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
337
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
338 #ifdef FF_ATI_BAT
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
339 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
340 T_BAT_cmd_send cmd;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
341 T_BAT_cmd_set_percent_cpals my_bat_set_percent_cpals;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
342
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
343 TRACE_FUNCTION("setatPercentCPALS() calls bat_send() <=== as APPLICATION");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
344
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
345 memset(&my_bat_set_percent_cpals, 0, sizeof(my_bat_set_percent_cpals));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
346 cmd.ctrl_params = BAT_CMD_SET_PERCENT_CPALS;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
347 cmd.params.ptr_set_percent_cpals = &my_bat_set_percent_cpals;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
348
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
349 my_bat_set_percent_cpals.call_id = (U8)call_id;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
350
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
351 bat_send(ati_bat_get_client(srcId), &cmd);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
352
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
353 return ATI_EXCT; /* executing, because response is passed by callback function */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
354 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
355 #else /* OLD FUNCTION BODY */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
356
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
357 TRACE_FUNCTION("setatPercentCPALS()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
358 return proceed_CPALS(srcId, (UBYTE)call_id);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
359
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
360 #endif /* no FF_ATI_BAT */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
361 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
362
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
363 GLOBAL T_ATI_RSLT queatPercentCPALS (CHAR *cl, UBYTE srcId)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
364 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
365 TRACE_FUNCTION("queatPercentCPALS()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
366
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
367 return(proceed_CPALS(srcId, NOT_PRESENT_8BIT));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
368 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
369
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
370 GLOBAL T_ATI_RSLT tesatPercentCPALS (CHAR *cl, UBYTE srcId)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
371 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
372 TRACE_FUNCTION("tesatPercentCPALS()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
373
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
374 return(ATI_CMPL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
375 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
376
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
377 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
378 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
379 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
380 | STATE : code ROUTINE : atPercentCPVWI |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
381 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
382
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
383 PURPOSE : %CPVWI: set/clear/query voice message waiting flags
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
384 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
385
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
386 GLOBAL T_ATI_RSLT setatPercentCPVWI(CHAR *cl, UBYTE srcId)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
387 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
388 T_CPHS_LINES i = 0,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
389 typed_lines = NOT_PRESENT_16BIT,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
390 line = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
391 SHORT action = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
392 T_ACI_RETURN ret = AT_FAIL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
393 T_ATI_SRC_PARAMS *src_params = find_element( ati_src_list, srcId, search_ati_src_id);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
394
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
395 cl = parse(cl,"rr", &action, &typed_lines);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
396 if (cl EQ NULL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
397 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
398 cmdCmeError(CME_ERR_OpNotAllow);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
399 return(ATI_FAIL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
400 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
401
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
402 if (typed_lines EQ NOT_PRESENT_16BIT)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
403 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
404 TRACE_EVENT("typed_lines omitted");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
405
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
406 typed_lines = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
407
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
408 /* lines parameter omitted: Provides VWI flags for all lines */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
409 for(i=0;i<8*sizeof(T_CPHS_LINES);i++)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
410 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
411 line = CPHS_LINE1 << i;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
412
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
413 if (cphs_line_makes_sense(line))
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
414 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
415 typed_lines |= line;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
416 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
417 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
418 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
419
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
420 TRACE_EVENT_P2("setatPercentCPVWI action: %d, lines: %d", action, typed_lines);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
421
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
422
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
423 #ifdef FF_ATI_BAT
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
424 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
425 T_BAT_cmd_send cmd;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
426 T_BAT_cmd_set_percent_cpvwi my_bat_set_percent_cpvwi;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
427
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
428 TRACE_FUNCTION("setatPercentCPVWI() calls bat_send() <=== as APPLICATION");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
429
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
430 memset(&my_bat_set_percent_cpvwi, 0, sizeof(my_bat_set_percent_cpvwi));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
431 cmd.ctrl_params = BAT_CMD_SET_PERCENT_CPVWI;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
432 cmd.params.ptr_set_percent_cpvwi = &my_bat_set_percent_cpvwi;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
433
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
434 my_bat_set_percent_cpvwi.mode = action;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
435 my_bat_set_percent_cpvwi.lines = typed_lines;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
436 src_params->curAtCmd = AT_CMD_CPVWI;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
437 bat_send(ati_bat_get_client(srcId), &cmd);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
438
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
439 return ATI_EXCT; /* executing, because response is passed by callback function */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
440 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
441 #else /* OLD FUNCTION BODY */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
442
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
443 /******* QUERY ********/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
444 if (action EQ CPHS_QUERY_WAITING_FLAG)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
445 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
446 return query_indicator_flags(srcId, typed_lines, AT_CMD_CPVWI);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
447 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
448
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
449 TRACE_FUNCTION("setatPercentCPVWI()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
450
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
451 /******* SETTING ********/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
452 ret = sAT_PercentCPVWI((T_ACI_CMD_SRC)srcId, (UBYTE)action, typed_lines);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
453
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
454 switch (ret)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
455 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
456 case (AT_EXCT):
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
457 src_params->curAtCmd = AT_CMD_CPVWI;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
458 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
459
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
460 case (AT_BUSY):
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
461 cmdCmeError(CME_ERR_SimBusy);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
462 return(ATI_FAIL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
463
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
464 case (AT_FAIL):
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
465 cmdCmeError(CME_ERR_Unknown);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
466 return(ATI_FAIL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
467 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
468
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
469 return(map_aci_2_ati_rslt(ret));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
470
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
471 #endif /* no FF_ATI_BAT*/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
472 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
473
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
474
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
475 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
476 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
477 | PROJECT : GSM-F&D (8411) MODULE : ATI_CPHS |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
478 | STATE : code ROUTINE : rCI_PercentCPVWI |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
479 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
480
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
481 PURPOSE : handles AT_PercentCPVWI call back
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
482
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
483 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
484
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
485 GLOBAL void rCI_PercentCPVWI (UBYTE flag_set,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
486 USHORT line)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
487 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
488 UBYTE srcId = srcId_cb;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
489
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
490 TRACE_FUNCTION("rCI_PercentCPVWI()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
491
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
492 sprintf(g_sa, "%s: %d,%d", "%CPVWI", flag_set, line);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
493 io_sendIndication((UBYTE)srcId, g_sa, ATI_NORMAL_OUTPUT);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
494 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
495
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
496 #ifndef MFW
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
497 #ifndef FF_MMI_RIV
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
498 /* dummy in case of SMI */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
499 GLOBAL void rAT_PercentCPVWI ( UBYTE flag_set,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
500 USHORT line)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
501 { }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
502 #endif /* FF_MMI_RIV */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
503 #endif /* MFW */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
504
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
505
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
506 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
507 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
508 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
509 | STATE : code ROUTINE : atPercentCPOPN |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
510 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
511
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
512 PURPOSE : %CPOPN: query operator name string
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
513 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
514
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
515 GLOBAL T_ATI_RSLT queatPercentCPOPN(CHAR *cl, UBYTE srcId)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
516 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
517 CHAR long_name[CPHS_MAX_OPER_LONG];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
518 CHAR short_name[CPHS_MAX_OPER_SHORT];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
519 UBYTE long_len;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
520 UBYTE short_len;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
521 T_ACI_RETURN ret;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
522
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
523 TRACE_FUNCTION("queatPercentCPOPN()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
524
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
525 long_len = CPHS_MAX_OPER_LONG;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
526 short_len = CPHS_MAX_OPER_SHORT;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
527 ret = qAT_PercentCPOPN((T_ACI_CMD_SRC)srcId, long_name, &long_len, short_name, &short_len);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
528
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
529 if (ret NEQ AT_CMPL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
530 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
531 if (short_len > 0 OR
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
532 long_len > 0)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
533 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
534 TRACE_EVENT_P2("Buffer for Long Name or Short Name too small needed: %d, %d", long_len, short_len);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
535 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
536
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
537 cmdCmeError(CME_ERR_Unknown);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
538 return(ATI_FAIL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
539 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
540
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
541 if ( short_len > 0 )
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
542 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
543 sprintf(g_sa, "%s: \"%s\",\"%s\"", "%CPOPN", long_name, short_name);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
544 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
545 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
546 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
547 sprintf(g_sa, "%s: \"%s\"", "%CPOPN", long_name);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
548 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
549 io_sendMessage((UBYTE)srcId, g_sa, ATI_NORMAL_OUTPUT);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
550
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
551 return(ATI_CMPL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
552 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
553
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
554
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
555 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
556 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
557 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
558 | STATE : code ROUTINE : setatPercentCPINF |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
559 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
560
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
561 PURPOSE : %CPINF: set customer service profile
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
562 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
563
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
564 GLOBAL T_ATI_RSLT setatPercentCPINF(CHAR *cl, UBYTE srcId)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
565 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
566 CHAR csp[CPHS_MAX_CSP*2 + 1];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
567 USHORT csp_size = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
568 UBYTE index; /* for parsing failure analysis */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
569 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
570
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
571 /* initialize the local varibles */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
572 memset(csp,0,sizeof(csp));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
573
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
574 cl = parse(cl, "z",
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
575 (LONG)sizeof (csp),
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
576 strlen(cl),
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
577 cl,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
578 &csp_size,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
579 csp);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
580
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
581 if (cl EQ NULL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
582 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
583 index = get_parse_index(); /* get the problematic component */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
584 TRACE_EVENT_P1("index %d",index);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
585 switch (index)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
586 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
587 case 1:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
588 cmdCmeError(CME_ERR_TxtToLong);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
589 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
590 default:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
591 cmdCmeError(CME_ERR_OpNotAllow);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
592 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
593 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
594 return ATI_FAIL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
595 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
596
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
597 #ifdef FF_ATI_BAT
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
598 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
599 T_BAT_cmd_send cmd;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
600 T_BAT_cmd_set_percent_cpinf cpinf;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
601 TRACE_FUNCTION("setatPercentCPINF() calls bat_send() <=== as APPLICATION");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
602
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
603 memset(&cpinf, 0, sizeof(cpinf));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
604 cmd.ctrl_params = BAT_CMD_SET_PERCENT_CPINF;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
605 cmd.params.ptr_set_percent_cpinf = &cpinf;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
606 cpinf.c_csp = (U8)csp_size;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
607 memcpy(cpinf.csp, csp, csp_size);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
608 src_params->curAtCmd = AT_CMD_CPINF;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
609 bat_send(ati_bat_get_client(srcId), &cmd);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
610
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
611 return ATI_EXCT;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
612 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
613 #else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
614 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
615 T_ACI_RETURN ret = AT_FAIL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
616 UBYTE serv_group[CPHS_MAX_CSP];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
617 UBYTE serv_len = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
618
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
619 TRACE_FUNCTION("setatPercentCPINF()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
620
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
621 memset(serv_group,0,sizeof(serv_group));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
622
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
623 serv_len = utl_HexStrToBin((UBYTE*)csp, csp_size, serv_group, CPHS_MAX_CSP);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
624
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
625 /* Odd length CSP or empty CSP display operation not allowed */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
626 if(((serv_len % 2) NEQ 0) OR (serv_len EQ 0))
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
627 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
628 cmdCmeError(CME_ERR_OpNotAllow);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
629 return ATI_FAIL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
630 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
631 /* write customer service profile (csp) */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
632 ret = sAT_PercentCPINF( (T_ACI_CMD_SRC)srcId,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
633 serv_group,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
634 serv_len);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
635
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
636 switch (ret)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
637 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
638 case (AT_EXCT):
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
639 src_params->curAtCmd = AT_CMD_CPINF;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
640 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
641 case (AT_CMPL):
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
642 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
643 default:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
644 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
645 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
646 return(map_aci_2_ati_rslt(ret));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
647 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
648 #endif /* no FF_ATI_BAT*/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
649 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
650
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
651 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
652 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
653 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
654 | STATE : code ROUTINE : atPercentCPINF |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
655 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
656
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
657 PURPOSE : %CPINF: query cphs information and customer service profile
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
658 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
659
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
660 GLOBAL T_ATI_RSLT queatPercentCPINF(CHAR *cl, UBYTE srcId)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
661 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
662 #ifdef FF_ATI_BAT
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
663 T_BAT_cmd_send cmd;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
664 T_BAT_no_parameter dummy;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
665
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
666 TRACE_FUNCTION("queatPercentCPINF() calls bat_send() <=== as APPLICATION");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
667
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
668 cmd.ctrl_params = BAT_CMD_QUE_PERCENT_CPINF;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
669 dummy.bat_dummy = 0xFF;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
670 cmd.params.ptr_que_percent_cpinf = &dummy;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
671
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
672 bat_send(ati_bat_get_client(srcId),&cmd);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
673
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
674 return ATI_EXCT; /* executing, because response is passed by callback function */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
675
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
676 #else /* FF_ATI_BAT */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
677
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
678 UBYTE phase;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
679 USHORT sst;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
680 CHAR csp[CPHS_MAX_CSP*2 + 1];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
681 CHAR csp2[CPHS_MAX_CSP*2 + 1]; /* Since the CPHS_MAX_CSP length has been updated to 22,then there is no need of CPHS_MAX_CSP2 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
682 UBYTE max_csp_size = CPHS_MAX_CSP*2 + 1;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
683 UBYTE max_csp2_size = CPHS_MAX_CSP*2 + 1;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
684 T_ACI_RETURN ret;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
685
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
686 TRACE_FUNCTION("queatPercentCPINF()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
687
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
688 ret = qAT_PercentCPINF ((T_ACI_CMD_SRC)srcId,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
689 &phase,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
690 &sst,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
691 csp,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
692 csp2,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
693 &max_csp_size,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
694 &max_csp2_size);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
695
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
696 if (ret NEQ AT_CMPL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
697 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
698 if (max_csp_size > 0)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
699 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
700 TRACE_EVENT_P1("Buffer for CSP is too small ! needed: %d", max_csp_size);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
701 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
702
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
703 if (max_csp2_size > 0)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
704 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
705 TRACE_EVENT_P1("Buffer for CSP2 is too small ! needed: %d", max_csp2_size);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
706 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
707 cmdCmeError(CME_ERR_Unknown);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
708 return(ATI_FAIL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
709 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
710
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
711 if ( max_csp_size > 0 )
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
712 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
713 if ( max_csp2_size > 0 )
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
714 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
715 sprintf(g_sa, "%s: %d,\"%04X\",\"%s\",\"%s\"", "%CPINF",phase, sst, csp, csp2);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
716 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
717 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
718 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
719 sprintf(g_sa, "%s: %d,\"%04X\",\"%s\"", "%CPINF",phase, sst, csp);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
720 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
721 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
722 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
723 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
724 sprintf(g_sa, "%s: %d,\"%04X\"", "%CPINF", phase, sst);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
725 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
726 io_sendMessage((UBYTE)srcId, g_sa, ATI_NORMAL_OUTPUT);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
727
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
728 return(ATI_CMPL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
729
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
730 #endif /* FF_ATI_BAT */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
731 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
732
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
733 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
734 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
735 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
736 | STATE : code ROUTINE : atPercentCPMB |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
737 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
738
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
739 PURPOSE : %CPMB: query mailbox numbers
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
740 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
741
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
742 GLOBAL T_ATI_RSLT setatPercentCPMB(CHAR *cl, UBYTE srcId)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
743 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
744 SHORT rec_id;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
745 T_ACI_RETURN ret = AT_FAIL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
746
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
747 cl = parse(cl, "r", &rec_id);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
748 if (cl EQ NULL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
749 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
750 cmdCmeError(CME_ERR_OpNotAllow);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
751 return ATI_FAIL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
752 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
753
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
754 #ifdef FF_ATI_BAT
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
755 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
756 T_BAT_cmd_send cmd;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
757 T_BAT_cmd_set_percent_cpmb my_bat_set_percent_cpmb;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
758
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
759 TRACE_FUNCTION("setatPercentCPMB() calls bat_send() <=== as APPLICATION");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
760
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
761 memset(&my_bat_set_percent_cpmb, 0, sizeof(my_bat_set_percent_cpmb));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
762 cmd.ctrl_params = BAT_CMD_SET_PERCENT_CPMB;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
763 cmd.params.ptr_set_percent_cpmb = &my_bat_set_percent_cpmb;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
764
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
765 my_bat_set_percent_cpmb.record_id = rec_id;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
766
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
767 bat_send(ati_bat_get_client(srcId), &cmd);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
768
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
769 return ATI_EXCT; /* executing, because response is passed by callback function */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
770 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
771 #else /* OLD FUNCTION BODY */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
772 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
773 T_CPHS_LINES line;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
774 CHAR number[CPHS_MAX_MB_NUMBER_LEN];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
775 CHAR alpha_id[CPHS_MAX_MB_ALPHA_LEN];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
776 T_ACI_TOA_TON ton;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
777 T_ACI_TOA_NPI npi;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
778 UBYTE toa;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
779 CHAR cvtd_text[4*CPHS_MAX_MB_ALPHA_LEN];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
780 USHORT len_cvtd=0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
781 USHORT pos=0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
782
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
783
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
784 TRACE_FUNCTION("setatPercentCPMB()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
785
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
786 ret = qAT_PercentCPMB((T_ACI_CMD_SRC)srcId, (UBYTE)rec_id, &line, number, &ton, &npi, alpha_id, NULL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
787
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
788 if (ret NEQ AT_CMPL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
789 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
790 cmdCmeError(CME_ERR_Unknown);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
791 return(ATI_FAIL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
792 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
793
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
794 /* check if empty mb entry */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
795 if (number[0] EQ '\0')
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
796 { /* do not send to ATI */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
797 cmdCmeError(CME_ERR_NotFound);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
798 return(ATI_FAIL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
799 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
800
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
801 toa = ( ( ( ton << 4 ) & 0xF0 ) + ( npi & 0x0F ) ) | 0x80;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
802
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
803 utl_chsetFromSim(
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
804 (UBYTE *)alpha_id,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
805 (USHORT)strlen(alpha_id),
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
806 (UBYTE *)cvtd_text,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
807 sizeof(cvtd_text),
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
808 &len_cvtd,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
809 GSM_ALPHA_Def);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
810
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
811 pos=sprintf(g_sa,"%s: %d,%d,\"%s\",%d,", "%CPMB", rec_id, line, number, toa);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
812 pos+=sprints(g_sa+pos,cvtd_text,len_cvtd);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
813
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
814 io_sendMessage((UBYTE)srcId, g_sa, ATI_NORMAL_OUTPUT);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
815
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
816 return(ATI_CMPL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
817 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
818 #endif /* no FF_ATI_BAT*/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
819 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
820
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
821
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
822 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
823 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
824 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
825 | STATE : code ROUTINE : queatPercentCPMB |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
826 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
827
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
828 PURPOSE : %CPMB?: query mailbox numbers
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
829 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
830 GLOBAL T_ATI_RSLT queatPercentCPMB(char *cl, UBYTE srcId)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
831 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
832 #ifdef FF_ATI_BAT
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
833 T_BAT_cmd_send cmd;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
834 T_BAT_no_parameter dummy;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
835
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
836 TRACE_FUNCTION("queatPercentCPMB() calls bat_send() <=== as APPLICATION");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
837
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
838 cmd.ctrl_params=BAT_CMD_QUE_PERCENT_CPMB;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
839 dummy.bat_dummy=0xFF;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
840 cmd.params.ptr_que_percent_cpmb=&dummy;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
841
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
842 bat_send(ati_bat_get_client(srcId),&cmd);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
843
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
844 return ATI_EXCT; /* executing, because response is passed by callback function */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
845
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
846 #else /* FF_ATI_BAT */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
847 char *me="%CPMB: ";
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
848 T_ACI_RETURN ret;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
849 UBYTE first;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
850
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
851 TRACE_FUNCTION("queatPercentCPMB()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
852
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
853 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
854 * Call the corresponding ACI function.
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
855 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
856 ret=qAT_PercentCPMB((T_ACI_CMD_SRC)srcId,(UBYTE)ACI_NumParmNotPresent,NULL,NULL,NULL,NULL,NULL,&first);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
857
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
858 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
859 * If the query completes successfully, build and send the
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
860 * answer.
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
861 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
862 if (ret EQ AT_CMPL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
863 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
864 sprintf(g_sa,"%s%d",me,first);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
865 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
866 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
867
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
868 return (map_aci_2_ati_rslt(ret));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
869 #endif /* FF_ATI_BAT */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
870 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
871
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
872
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
873 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
874 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
875 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
876 | STATE : code ROUTINE : atPercentCPMBW |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
877 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
878
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
879 PURPOSE : %CPMB: write mailbox numbers
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
880 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
881
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
882 GLOBAL T_ATI_RSLT setatPercentCPMBW(CHAR *cl, UBYTE srcId)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
883 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
884 CHAR number[CPHS_MAX_MB_NUMBER_LEN];
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
885
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
886 #ifndef FF_ATI_BAT
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
887 CHAR *p_number;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
888
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
889 T_CPHS_PB_TEXT cvtdText; /* holds text converted to SIM alpha */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
890 T_ACI_TOA toa; /* holds the type of record */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
891 T_ACI_RETURN ret;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
892 #endif
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
893
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
894 UBYTE index; /* for parsing failure analysis */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
895
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
896 CHAR alpha_id[CPHS_MAX_MB_ALPHA_LEN] = {0x00};
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
897 USHORT len_alpha_id = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
898 USHORT lenCvtd = 0; /* holds length of converted text */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
899 T_CPHS_PB_TEXT *p_text = NULL; /* holds pointer to converted text */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
900
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
901 SHORT toa_val = 0; /* holds type of record value */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
902 SHORT rec_id = -1; /* holds index of record */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
903
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
904 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
905
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
906 TRACE_FUNCTION("setatPercentCPMBW()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
907
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
908 /* initialize */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
909 memset(number,0,sizeof(number));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
910
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
911 /***********************************************/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
912 /*** prepare parameters and test their range ***/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
913 /***********************************************/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
914
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
915 /* parse command string */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
916 cl = parse(cl,"rsrz",
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
917 &rec_id,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
918 (LONG)CPHS_MAX_MB_NUMBER_LEN,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
919 number,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
920 &toa_val,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
921 (LONG)CPHS_MAX_MB_ALPHA_LEN,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
922 strlen(cl),
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
923 cl,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
924 &len_alpha_id,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
925 alpha_id);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
926
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
927 /* Throw error if parsing has been failed */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
928 if (!cl)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
929 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
930 TRACE_ERROR("ERROR: parsing failed !");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
931 /* analyse error component of input */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
932 index = get_parse_index(); /* get the problematic component */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
933 switch (index)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
934 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
935 case 3: /* component 2 is the number */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
936 cmdCmeError(CME_ERR_DialToLong);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
937 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
938 case 5: /* component 4 is the alpha tag */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
939 cmdCmeError(CME_ERR_TxtToLong);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
940 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
941 default:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
942 cmdCmeError(CME_ERR_OpNotAllow);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
943 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
944 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
945 return ATI_FAIL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
946 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
947
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
948 /* test if values are in correct ranges */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
949 if ( rec_id >= CPHS_MAX_MB_ENTRIES) /* phonebook index is greater than max. */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
950 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
951 TRACE_ERROR("ERROR: phonebook index is greater than max possible index of SIM");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
952 cmdCmeError(CME_ERR_InvIdx);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
953 return ATI_FAIL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
954 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
955
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
956 #ifdef FF_ATI_BAT
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
957
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
958 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
959 T_BAT_cmd_send cmd;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
960 T_BAT_cmd_set_percent_cpmbw cpmbw;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
961 int len;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
962
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
963 cmd.ctrl_params = BAT_CMD_SET_PERCENT_CPMBW;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
964 cmd.params.ptr_set_percent_cpmbw=&cpmbw;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
965
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
966 cpmbw.record_id=(T_BAT_record_id)rec_id;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
967
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
968 len=strlen(number);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
969
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
970 if ((len<0) OR (len>BAT_MAX_CPMBW_NUMBER_LEN))
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
971 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
972 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
973 * Either the number wasn't present, or it was too big to
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
974 * fit in the BAT message.
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
975 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
976 cpmbw.v_number=FALSE;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
977 cpmbw.type=-1;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
978 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
979 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
980 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
981 cpmbw.v_number=TRUE;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
982 cpmbw.c_number=(U8)len;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
983 memcpy(cpmbw.number,number,len);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
984 cpmbw.type=(toa_val>0) ? toa_val:-1;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
985 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
986
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
987 if ((len_alpha_id>0) AND (len_alpha_id<=BAT_MAX_CPMBW_TEXT_LEN))
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
988 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
989 cpmbw.v_text=TRUE;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
990 cpmbw.c_text=(U8)len_alpha_id;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
991 memcpy(cpmbw.text,alpha_id,len_alpha_id);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
992 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
993 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
994 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
995 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
996 * Either the alphanumeric data wasn't present, or it was
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
997 * too big to fit in the BAT message.
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
998 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
999 cpmbw.v_text=FALSE;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1000 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1001
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1002 bat_send(ati_bat_get_client(srcId),&cmd);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1003 return(ATI_EXCT);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1004 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1005
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1006 #else /* OLD FUNCTION BODY */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1007
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1008 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1009 * Initialise 'converted text'.
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1010 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1011 cvtdText.len = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1012 memset(cvtdText.data,0,sizeof(cvtdText.data));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1013
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1014 /* extract type structure from type value */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1015 if (toa_val > 0)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1016 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1017 toa = toa_demerge(toa_val);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1018 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1019 /* translate alpha text to SIM */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1020 if ( len_alpha_id NEQ 0 )
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1021 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1022 srcId_cb = srcId;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1023 utl_chsetToSim ((UBYTE*)alpha_id, len_alpha_id, (UBYTE*)cvtdText.data,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1024 &lenCvtd, GSM_ALPHA_Def);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1025 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1026
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1027 /* set pointer for number */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1028 if (number[0] EQ '\0') /* The number given is empty */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1029 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1030 p_number = NULL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1031 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1032 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1033 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1034 p_number = number;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1035 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1036
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1037 /* when the text and the number are both empty, set p_text to NULL */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1038 if (lenCvtd EQ 0 AND p_number EQ NULL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1039 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1040 p_text = NULL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1041 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1042 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1043 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1044 p_text = &cvtdText;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1045 cvtdText.len = (UBYTE)lenCvtd;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1046 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1047
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1048 /* write number into cphs mailbox number phonebook */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1049 ret = sAT_PercentCPMBW((T_ACI_CMD_SRC)srcId, rec_id, number, &toa, p_text);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1050
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1051 switch (ret)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1052 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1053 case (AT_CMPL): /*operation completed*/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1054 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1055 case (AT_EXCT):
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1056 src_params->curAtCmd = AT_CMD_CPMBW;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1057 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1058 default:
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1059 cmdCmeError(CME_ERR_Unknown); /*Command failed*/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1060 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1061 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1062
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1063 return (map_aci_2_ati_rslt(ret));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1064
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1065 #endif /* no FF_ATI_BAT*/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1066 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1067
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1068 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1069 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1070 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1071 | STATE : code ROUTINE : atPercentCPMBW |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1072 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1073
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1074 PURPOSE : %CPMB: test command
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1075 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1076
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1077 GLOBAL T_ATI_RSLT tesatPercentCPMBW(char *cl, UBYTE srcId)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1078 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1079 #ifndef FF_ATI_BAT
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1080 char *me = "%CPMBW: ";
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1081 SHORT first_idx = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1082 SHORT last_idx = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1083 UBYTE tlength = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1084 UBYTE nlength = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1085 T_ACI_RETURN ret = AT_FAIL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1086 #endif
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1087
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1088 TRACE_FUNCTION("tesatPercentCPMBW");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1089
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1090 #ifdef FF_ATI_BAT
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1091 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1092 T_BAT_cmd_send cmd;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1093 T_BAT_no_parameter dummy;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1094
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1095 cmd.ctrl_params = BAT_CMD_TST_PERCENT_CPMBW;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1096 dummy.bat_dummy = 0xFF;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1097 cmd.params.ptr_tst_percent_cpmbw = &dummy;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1098 bat_send(ati_bat_get_client(srcId), &cmd);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1099 return(ATI_EXCT);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1100 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1101 #else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1102 ret = tAT_PercentCPMBW((T_ACI_CMD_SRC)srcId,&first_idx,&last_idx,&nlength,&tlength);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1103
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1104 if (ret EQ AT_CMPL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1105 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1106 sprintf(g_sa,"%s(%d-%d),%d,%s,%d",me,first_idx,last_idx,nlength,"(128-201)",tlength);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1107 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1108 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1109 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1110 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1111 cmdCmeError(CME_ERR_Unknown);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1112 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1113 return (map_aci_2_ati_rslt(ret));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1114 #endif
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1115 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1116
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1117 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1118 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1119 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1120 | STATE : code ROUTINE : atPercentCPCFU |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1121 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1122
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1123 PURPOSE : %CPCFU: call diverted flag status
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1124 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1125 typedef T_ACI_RETURN T_QUERY_INDICATOR_CMH_CPHS_FNC (T_ACI_CMD_SRC srcId, UBYTE *cfu_set, T_CPHS_LINES line);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1126
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1127 LOCAL T_ATI_RSLT query_indicator_flags(UBYTE srcId, T_CPHS_LINES queried_lines, T_ACI_AT_CMD indicator_type)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1128 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1129 T_ACI_RETURN ret;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1130 UBYTE flag_set;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1131 T_CPHS_LINES line = CPHS_LINE_NULL,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1132 set_line_bitmask = CPHS_LINE_NULL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1133 USHORT i;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1134 T_QUERY_INDICATOR_CMH_CPHS_FNC *cmh_query_ind_fnc = NULL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1135 CHAR *cmd_name = NULL;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1136
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1137 switch(indicator_type)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1138 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1139 case(AT_CMD_CPCFU):
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1140 cmh_query_ind_fnc = qAT_PercentCPCFU;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1141 cmd_name = "%CPCFU";
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1142 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1143
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1144 case(AT_CMD_CPVWI):
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1145 cmh_query_ind_fnc = qAT_PercentCPVWI;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1146 cmd_name = "%CPVWI";
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1147 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1148 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1149
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1150 /* Provides flags for queried lines */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1151 for(i=0; i<8*sizeof(T_CPHS_LINES); i++)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1152 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1153 line = CPHS_LINE1 << i;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1154
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1155 if ((line & queried_lines) EQ 0x00)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1156 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1157 /* line has not been queried */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1158 continue;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1159 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1160
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1161 ret = cmh_query_ind_fnc((T_ACI_CMD_SRC)srcId, &flag_set, line)/*lint -e613*/;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1162
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1163 if (ret NEQ AT_CMPL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1164 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1165 TRACE_EVENT_P1("query_indicator_flags error: %d", ret);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1166 return(map_aci_2_ati_rslt(ret));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1167 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1168
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1169 if (flag_set EQ CPHS_FLAG_ACTIVATED)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1170 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1171 set_line_bitmask |= line;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1172 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1173 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1174
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1175 if (set_line_bitmask NEQ CPHS_LINE_NULL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1176 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1177 sprintf(g_sa, "%s: %d,%d", cmd_name, CPHS_FLAG_ACTIVATED, set_line_bitmask);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1178 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1179 else
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1180 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1181 sprintf(g_sa, "%s: %d",cmd_name, CPHS_FLAG_DEACTIVATED);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1182 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1183
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1184 io_sendMessage((UBYTE)srcId, g_sa, ATI_NORMAL_OUTPUT);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1185
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1186 return(ATI_CMPL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1187 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1188
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1189
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1190 /*
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1191 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1192 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1193 | STATE : code ROUTINE : atPercentCPCFU |
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1194 +--------------------------------------------------------------------+
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1195
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1196 PURPOSE : %CPVWI: set/clear/query CFU flags
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1197 */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1198
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1199 GLOBAL T_ATI_RSLT setatPercentCPCFU(CHAR *cl, UBYTE srcId)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1200 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1201 T_CPHS_LINES i,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1202 typed_lines = NOT_PRESENT_16BIT,
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1203 line;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1204 SHORT action;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1205 T_ACI_RETURN ret;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1206 T_ATI_SRC_PARAMS *src_params = find_element( ati_src_list, srcId, search_ati_src_id);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1207
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1208 cl = parse(cl,"rr", &action, &typed_lines);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1209 if (cl EQ NULL)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1210 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1211 cmdCmeError(CME_ERR_OpNotAllow);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1212 return(ATI_FAIL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1213 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1214
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1215 if (typed_lines EQ NOT_PRESENT_16BIT)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1216 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1217 TRACE_EVENT("typed_lines omitted");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1218
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1219 typed_lines = 0;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1220
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1221 /* lines parameter omitted: Provides CFU flags for all lines */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1222 for(i=0;i<8*sizeof(T_CPHS_LINES);i++)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1223 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1224 line = CPHS_LINE1 << i;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1225
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1226 if (cphs_line_makes_sense(line))
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1227 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1228 typed_lines |= line;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1229 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1230 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1231 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1232
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1233 TRACE_EVENT_P2("setatPercentCPCFU action: %d, lines: %d", action, typed_lines);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1234
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1235 #ifdef FF_ATI_BAT
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1236 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1237 T_BAT_cmd_send cmd;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1238 T_BAT_cmd_set_percent_cpcfu my_bat_set_percent_cpcfu;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1239
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1240 TRACE_FUNCTION("setatPercentCPCFU() calls bat_send() <=== as APPLICATION");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1241
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1242 memset(&my_bat_set_percent_cpcfu, 0, sizeof(my_bat_set_percent_cpcfu));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1243 cmd.ctrl_params = BAT_CMD_SET_PERCENT_CPCFU;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1244 cmd.params.ptr_set_percent_cpcfu = &my_bat_set_percent_cpcfu;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1245
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1246 my_bat_set_percent_cpcfu.mode = action;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1247 my_bat_set_percent_cpcfu.line = typed_lines;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1248 src_params->curAtCmd = AT_CMD_CPCFU;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1249 bat_send(ati_bat_get_client(srcId), &cmd);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1250
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1251 return ATI_EXCT; /* executing, because response is passed by callback function */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1252 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1253 #else /* OLD FUNCTION BODY */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1254
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1255 /******* QUERY ********/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1256 if (action EQ CPHS_QUERY_CFU_FLAG)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1257 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1258 return query_indicator_flags(srcId, typed_lines, AT_CMD_CPCFU);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1259 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1260
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1261 TRACE_FUNCTION("setatPercentCPCFU()");
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1262
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1263 /******* SETTING ********/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1264 ret = sAT_PercentCPCFU((T_ACI_CMD_SRC)srcId, (UBYTE)action, typed_lines);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1265
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1266 switch (ret)
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1267 {
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1268 case (AT_EXCT):
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1269 src_params->curAtCmd = AT_CMD_CPCFU;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1270 break;
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1271
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1272 case (AT_BUSY):
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1273 cmdCmeError(CME_ERR_SimBusy);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1274 return(ATI_FAIL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1275
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1276 case (AT_FAIL):
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1277 cmdCmeError(CME_ERR_Unknown);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1278 return(ATI_FAIL);
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1279 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1280
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1281 return(map_aci_2_ati_rslt(ret));
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1282
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1283 #endif /* no FF_ATI_BAT*/
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1284 }
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1285
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1286
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1287 #endif /* CPHS_C */
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1288
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1289
eedbf248bac0 gsm-fw/g23m-aci subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1290