annotate gsm-fw/g23m-aci/aci/ati_src_rvt.c @ 888:0590cfd5803f

gsm-fw/configs/pirelli-gsm added
author Space Falcon <falcon@ivan.Harhan.ORG>
date Sun, 28 Jun 2015 15:40:47 +0000
parents 346a15ea8222
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
878
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
2 * This module is a FreeCalypso addition. Here we are going to implement
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
3 * a mechanism for passing AT commands and responses over RVTMUX.
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
4 */
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
5
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
6 #include "config.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
7 #include "fixedconf.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
8 #include "condat-features.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
9 #include "aci_conf.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
10
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
11 /* includes copied from ati_cmd.c */
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
12
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
13 #undef DUMMY_ATI_STRINGS
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
14
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
15 #include "aci_all.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
16
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
17 #include "dti.h" /* functionality of the dti library */
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
18 #include "line_edit.h" /* SKA 2002-09-05 */
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
19 #include "aci_cmh.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
20 #include "ati_cmd.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
21 #include "aci_io.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
22 #include "aci_cmd.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
23 #include "l4_tim.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
24
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
25 #include <string.h>
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
26 #include <stdarg.h>
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
27 #include <stdio.h>
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
28
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
29 #include "psa.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
30 #include "cmh.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
31
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
32 #include "aci_lst.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
33 #include "dti_conn_mng.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
34 #ifdef UART
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
35 #include "psa_uart.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
36 #endif
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
37 #include "ati_io.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
38 #include "aci_mem.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
39
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
40 #ifdef SIM_TOOLKIT
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
41 #include "ati_src_sat.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
42 #include "psa_cc.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
43 #include "psa_sat.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
44 #endif /* SIM_TOOLKIT */
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
45
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
46 #ifdef GPRS
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
47 #include "gaci_cmh.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
48 #include "gaci_cmd.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
49 #endif /* GPRS */
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
50
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
51 #include "aci_prs.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
52
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
53
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
54 #ifndef _SIMULATION_
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
55 #ifdef UART
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
56 #include "cmh_uart.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
57 #endif
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
58 #endif
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
59
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
60 #include "psa_sms.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
61 #include "aci.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
62 #include "ati_ext_mech.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
63
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
64 #ifdef FF_ATI_BAT
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
65 #include "ati_bat.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
66 #include "aci_bat.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
67 #endif
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
68
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
69 EXTERN T_ACI_LIST *ati_src_list;
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
70
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
71 #include "../../riviera/rvt/rvt_gen.h"
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
72
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
73 static UBYTE rvt_src_id;
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
74 static T_RVT_USER_ID rvt_user_id;
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
75
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
76 /*
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
77 * The following function is the callback registered with RVT; it gets
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
78 * called in RVT HISR context. We allocate an ACI_CMD_REQ primitive,
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
79 * copy the received string into it and post it to ACI to be processed
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
80 * in our own task context.
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
81 */
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
82 GLOBAL void ati_src_rvt_input_callback (T_RVT_BUFFER in_str, UINT16 in_str_len)
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
83 {
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
84 PALLOC (aci_cmd_req, ACI_CMD_REQ);
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
85
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
86 aci_cmd_req->cmd_src = rvt_src_id;
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
87 aci_cmd_req->cmd_len = in_str_len;
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
88 bcopy(in_str, aci_cmd_req->cmd_seq, in_str_len);
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
89
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
90 PSENDX (ACI, aci_cmd_req);
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
91 }
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
92
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
93 /*
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
94 * The following function is called from aci_aci.c when an ACI_CMD_REQ
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
95 * primitive (sent by the previous function) has been received.
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
96 */
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
97 GLOBAL BOOL ati_src_rvt_proc_cmd (T_ACI_CMD_REQ *aci_cmd_req)
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
98 {
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
99 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, rvt_src_id,
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
100 search_ati_src_id);
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
101
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
102 ati_user_output_cfg[rvt_src_id].atE = 0;
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
103
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
104 if (src_params->text_mode EQ CMD_MODE)
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
105 {
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
106 TRACE_FUNCTION ("ati_src_rvt_proc_cmd () CMD MODE");
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
107
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
108 aci_cmd_req->cmd_seq[aci_cmd_req->cmd_len] = '\r'; /* make it V.25 ter compatible */
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
109 aci_cmd_req->cmd_seq[(aci_cmd_req->cmd_len) + 1] = '\0';
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
110 aci_cmd_req->cmd_len++;
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
111 }
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
112 else /* text has to be terminated by Ctrl-Z */
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
113 {
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
114 TRACE_FUNCTION ("ati_src_rvt_proc_cmd () TEXT MODE");
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
115
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
116 aci_cmd_req->cmd_seq[aci_cmd_req->cmd_len] = 0x1a; /* make it V.25 ter compatible */
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
117 aci_cmd_req->cmd_seq[(aci_cmd_req->cmd_len) + 1] = '\0';
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
118 aci_cmd_req->cmd_len++;
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
119 }
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
120
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
121 return (ati_execute (rvt_src_id,
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
122 aci_cmd_req->cmd_seq,
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
123 aci_cmd_req->cmd_len));
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
124 }
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
125
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
126 /*
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
127 * The following function is the callback registered with ATI; it gets
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
128 * called when ATI has something to send to the user.
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
129 */
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
130 GLOBAL void ati_src_rvt_result_cb (UBYTE src_id,
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
131 T_ATI_OUTPUT_TYPE output_type,
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
132 UBYTE *output,
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
133 USHORT output_len)
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
134 {
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
135 TRACE_FUNCTION ("ati_src_rvt_result_cb ()");
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
136 rvt_send_trace_cpy (output, rvt_user_id, output_len, RVT_ASCII_FORMAT);
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
137 }
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
138
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
139 /*
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
140 * The following function is the other callback registered with ATI.
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
141 */
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
142 GLOBAL void ati_src_rvt_line_state_cb (UBYTE src_id,
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
143 T_ATI_LINE_STATE_TYPE line_state_type,
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
144 ULONG line_state_param)
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
145 {
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
146 TRACE_FUNCTION ("ati_src_rvt_line_state_cb ()");
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
147
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
148 switch (line_state_type)
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
149 {
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
150 case ATI_LINE_STATE_OUTPUT_TYPE:
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
151 TRACE_EVENT_P1 ("[DBG] ati_src_rvt_line_state_cb (): ATI_LINE_STATE_OUTPUT_TYPE = %d", line_state_param);
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
152 break;
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
153
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
154 case ATI_LINE_STATE_DCD:
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
155 TRACE_EVENT_P1 ("[DBG] ati_src_rvt_line_state_cb (): ATI_LINE_STATE_DCD = %d", line_state_param);
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
156 break;
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
157
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
158 case ATI_LINE_STATE_RNG: /* TODO */
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
159 {
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
160 T_IO_RING_PARAMS rng_params;
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
161
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
162 memcpy (&rng_params, (T_IO_RING_PARAMS*)line_state_param,
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
163 sizeof(T_IO_RING_PARAMS));
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
164
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
165 TRACE_EVENT_P1 ("[DBG] ati_src_rvt_line_state_cb (): ATI_LINE_STATE_RNG = %d", rng_params.ring_stat);
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
166
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
167 break;
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
168 }
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
169
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
170 default:
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
171 TRACE_EVENT_P1 ("[WRN] ati_src_rvt_line_state_cb (): UNKNOWN line_state_type = %d", line_state_type);
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
172 break;
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
173 }
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
174 }
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
175
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
176 /*
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
177 * The following function is called from ati_cmd_init() in ati_cmd.c
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
178 * to register our mechanism.
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
179 */
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
180 GLOBAL void ati_src_rvt_register (void)
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
181 {
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
182 rvt_register_id ("AT", &rvt_user_id, ati_src_rvt_input_callback);
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
183 rvt_src_id = ati_init (ATI_SRC_TYPE_TST,
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
184 ati_src_rvt_result_cb,
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
185 ati_src_rvt_line_state_cb);
886
346a15ea8222 gsm-fw feature at-rvtmux: set ATI_CMD_MODE to make SMS notifications work
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 878
diff changeset
186 ati_switch_mode(rvt_src_id, ATI_CMD_MODE);
878
89c70b89dca5 gsm-fw: feature at-rvtmux implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
187 }