annotate src/g23m-aci/aci/ati_src_rvt.c @ 623:df3649549840

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