FreeCalypso > hg > fc-magnetite
annotate src/g23m-aci/aci/ati_src_rvt.c @ 459:117bf0fb1e78
doc/Modem-configs: wording change for classic config targets
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 19 Mar 2018 08:26:10 +0000 |
parents | ab79cf3c29a5 |
children | f6f599aad453 |
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 #if 0 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include "config.h" |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include "fixedconf.h" |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include "condat-features.h" |
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_conf.h" |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 #endif |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 /* 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
|
14 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #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
|
16 |
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_all.h" |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 #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
|
20 #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
|
21 #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
|
22 #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
|
23 #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
|
24 #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
|
25 #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
|
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 <string.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 <stdarg.h> |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 #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
|
30 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 #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
|
32 #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
|
33 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 #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
|
35 #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
|
36 #ifdef UART |
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_uart.h" |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 #endif |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 #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
|
40 #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
|
41 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 #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
|
43 #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
|
44 #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
|
45 #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
|
46 #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
|
47 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 #ifdef GPRS |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 #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
|
50 #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
|
51 #endif /* GPRS */ |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 #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
|
54 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 #ifndef _SIMULATION_ |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 #ifdef UART |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 #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
|
59 #endif |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 #endif |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 #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
|
63 #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
|
64 #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
|
65 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 #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
|
67 #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
|
68 #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
|
69 #endif |
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 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
|
72 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 #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
|
74 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 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
|
76 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
|
77 |
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 * 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
|
80 * 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
|
81 * 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
|
82 * 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
|
83 */ |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 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
|
85 { |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 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
|
87 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 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
|
89 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
|
90 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
|
91 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 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
|
93 } |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 /* |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 * 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
|
97 * 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
|
98 */ |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 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
|
100 { |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 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
|
102 search_ati_src_id); |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 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
|
105 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 if (src_params->text_mode EQ CMD_MODE) |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 { |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 TRACE_FUNCTION ("ati_src_rvt_proc_cmd () CMD MODE"); |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 aci_cmd_req->cmd_seq[aci_cmd_req->cmd_len] = '\r'; /* make it V.25 ter compatible */ |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 aci_cmd_req->cmd_seq[(aci_cmd_req->cmd_len) + 1] = '\0'; |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 aci_cmd_req->cmd_len++; |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 } |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 else /* text has to be terminated by Ctrl-Z */ |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 { |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 TRACE_FUNCTION ("ati_src_rvt_proc_cmd () TEXT MODE"); |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 aci_cmd_req->cmd_seq[aci_cmd_req->cmd_len] = 0x1a; /* make it V.25 ter compatible */ |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 aci_cmd_req->cmd_seq[(aci_cmd_req->cmd_len) + 1] = '\0'; |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 aci_cmd_req->cmd_len++; |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 } |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 return (ati_execute (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
|
124 aci_cmd_req->cmd_seq, |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 aci_cmd_req->cmd_len)); |
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 /* |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 * 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
|
130 * 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
|
131 */ |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 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
|
133 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
|
134 UBYTE *output, |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 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
|
136 { |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 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
|
138 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
|
139 } |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 |
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 * 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
|
143 */ |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 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
|
145 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
|
146 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
|
147 { |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 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
|
149 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 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
|
151 { |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 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
|
153 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
|
154 break; |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 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
|
157 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
|
158 break; |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 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
|
161 { |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
162 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
|
163 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
164 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
|
165 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
|
166 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
167 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
|
168 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
169 break; |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
170 } |
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 default: |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
173 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
|
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 |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
178 /* |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
179 * 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
|
180 * 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
|
181 */ |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
182 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
|
183 { |
ab79cf3c29a5
AT-over-RVTMUX mechanism ported over to the TCS3.2 version of ACI
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
184 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
|
185 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
|
186 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
|
187 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
|
188 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
|
189 } |