FreeCalypso > hg > freecalypso-sw
comparison rvinterf/lowlevel/format.c @ 880:136fa1ccd591
rvtdump & rvinterf: print and log ATI responses in ASCII
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 01:20:33 +0000 |
parents | d527ac304ad5 |
children | 4423039aeb4b |
comparison
equal
deleted
inserted
replaced
879:4661b84260a0 | 880:136fa1ccd591 |
---|---|
119 *dp = '\0'; | 119 *dp = '\0'; |
120 output_line(fmtbuf); | 120 output_line(fmtbuf); |
121 } | 121 } |
122 | 122 |
123 void | 123 void |
124 print_ati_output() | |
125 { | |
126 int i, c; | |
127 char *dp; | |
128 | |
129 dp = fmtbuf; | |
130 strcpy(dp, "ATI: "); | |
131 dp += 5; | |
132 for (i = 1; i < rxpkt_len; i++) { | |
133 c = rxpkt[i]; | |
134 if (c & 0x80) { | |
135 *dp++ = 'M'; | |
136 *dp++ = '-'; | |
137 c &= 0x7F; | |
138 } | |
139 if (c < 0x20) { | |
140 *dp++ = '^'; | |
141 *dp++ = c + '@'; | |
142 } else if (c == 0x7F) { | |
143 *dp++ = '^'; | |
144 *dp++ = '?'; | |
145 } else | |
146 *dp++ = c; | |
147 } | |
148 *dp = '\0'; | |
149 output_line(fmtbuf); | |
150 } | |
151 | |
152 void | |
124 print_fc_lld_msg() | 153 print_fc_lld_msg() |
125 { | 154 { |
126 int i, c; | 155 int i, c; |
127 char *dp; | 156 char *dp; |
128 | 157 |