FreeCalypso > hg > fc-selenite
comparison src/g23m-aci/aci/ati_src_rvt.c @ 137:6b94853890cf
AT-over-RVT enhancement from Magnetite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 09 Jan 2019 07:54:47 +0000 |
parents | d393cd9bb723 |
children |
comparison
equal
deleted
inserted
replaced
136:7d5b412ffb6c | 137:6b94853890cf |
---|---|
1 /* | 1 /* |
2 * This module is a FreeCalypso addition. Here we are going to implement | 2 * This module is a FreeCalypso addition. Here we are going to implement |
3 * a mechanism for passing AT commands and responses over RVTMUX. | 3 * a mechanism for passing AT commands and responses over RVTMUX. |
4 */ | 4 */ |
5 | |
6 #if 0 | |
7 #include "config.h" | |
8 #include "fixedconf.h" | |
9 #include "condat-features.h" | |
10 #include "aci_conf.h" | |
11 #endif | |
12 | 5 |
13 /* includes copied from ati_cmd.c */ | 6 /* includes copied from ati_cmd.c */ |
14 | 7 |
15 #undef DUMMY_ATI_STRINGS | 8 #undef DUMMY_ATI_STRINGS |
16 | 9 |
98 */ | 91 */ |
99 GLOBAL BOOL ati_src_rvt_proc_cmd (T_ACI_CMD_REQ *aci_cmd_req) | 92 GLOBAL BOOL ati_src_rvt_proc_cmd (T_ACI_CMD_REQ *aci_cmd_req) |
100 { | 93 { |
101 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, rvt_src_id, | 94 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, rvt_src_id, |
102 search_ati_src_id); | 95 search_ati_src_id); |
96 USHORT offset; | |
103 | 97 |
104 ati_user_output_cfg[rvt_src_id].atE = 0; | 98 ati_user_output_cfg[rvt_src_id].atE = 0; |
105 | 99 |
106 if (src_params->text_mode EQ CMD_MODE) | 100 if (aci_cmd_req->cmd_len && aci_cmd_req->cmd_seq[0] == 0x01) |
107 { | 101 { |
108 TRACE_FUNCTION ("ati_src_rvt_proc_cmd () CMD MODE"); | 102 TRACE_FUNCTION ("ati_src_rvt_proc_cmd () unterminated"); |
109 | 103 |
110 aci_cmd_req->cmd_seq[aci_cmd_req->cmd_len] = '\r'; /* make it V.25 ter compatible */ | 104 aci_cmd_req->cmd_seq[aci_cmd_req->cmd_len] = '\0'; |
111 aci_cmd_req->cmd_seq[(aci_cmd_req->cmd_len) + 1] = '\0'; | 105 offset = 1; |
112 aci_cmd_req->cmd_len++; | |
113 } | 106 } |
114 else /* text has to be terminated by Ctrl-Z */ | 107 else |
115 { | 108 { |
116 TRACE_FUNCTION ("ati_src_rvt_proc_cmd () TEXT MODE"); | 109 offset = 0; |
110 if (src_params->text_mode EQ CMD_MODE) | |
111 { | |
112 TRACE_FUNCTION ("ati_src_rvt_proc_cmd () CMD MODE"); | |
117 | 113 |
118 aci_cmd_req->cmd_seq[aci_cmd_req->cmd_len] = 0x1a; /* make it V.25 ter compatible */ | 114 aci_cmd_req->cmd_seq[aci_cmd_req->cmd_len] = '\r'; /* make it V.25 ter compatible */ |
119 aci_cmd_req->cmd_seq[(aci_cmd_req->cmd_len) + 1] = '\0'; | 115 aci_cmd_req->cmd_seq[(aci_cmd_req->cmd_len) + 1] = '\0'; |
120 aci_cmd_req->cmd_len++; | 116 aci_cmd_req->cmd_len++; |
117 } | |
118 else /* text has to be terminated by Ctrl-Z */ | |
119 { | |
120 TRACE_FUNCTION ("ati_src_rvt_proc_cmd () TEXT MODE"); | |
121 | |
122 aci_cmd_req->cmd_seq[aci_cmd_req->cmd_len] = 0x1a; /* make it V.25 ter compatible */ | |
123 aci_cmd_req->cmd_seq[(aci_cmd_req->cmd_len) + 1] = '\0'; | |
124 aci_cmd_req->cmd_len++; | |
125 } | |
121 } | 126 } |
122 | 127 |
123 return (ati_execute (rvt_src_id, | 128 return (ati_execute (rvt_src_id, |
124 aci_cmd_req->cmd_seq, | 129 aci_cmd_req->cmd_seq + offset, |
125 aci_cmd_req->cmd_len)); | 130 aci_cmd_req->cmd_len - offset)); |
126 } | 131 } |
127 | 132 |
128 /* | 133 /* |
129 * The following function is the callback registered with ATI; it gets | 134 * The following function is the callback registered with ATI; it gets |
130 * called when ATI has something to send to the user. | 135 * called when ATI has something to send to the user. |