FreeCalypso > hg > freecalypso-sw
comparison rvinterf/lowlevel/format.c @ 856:d527ac304ad5
rvinterf & rvtdump: handle low level debug messages from FC firmwares
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Thu, 30 Apr 2015 07:40:30 +0000 |
parents | 2ac2f6d88bb2 |
children | 136fa1ccd591 |
comparison
equal
deleted
inserted
replaced
855:cbd91f807141 | 856:d527ac304ad5 |
---|---|
119 *dp = '\0'; | 119 *dp = '\0'; |
120 output_line(fmtbuf); | 120 output_line(fmtbuf); |
121 } | 121 } |
122 | 122 |
123 void | 123 void |
124 print_fc_lld_msg() | |
125 { | |
126 int i, c; | |
127 char *dp; | |
128 | |
129 dp = fmtbuf; | |
130 strcpy(dp, "LLD: "); | |
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_unknown_packet() | 153 print_unknown_packet() |
125 { | 154 { |
126 int i; | 155 int i; |
127 char *dp; | 156 char *dp; |
128 | 157 |