FreeCalypso > hg > freecalypso-sw
annotate rvinterf/lowlevel/format.c @ 595:3b4dce7dac06
gsm-fw/finlink/Makefile: link L1 when enabled
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sun, 17 Aug 2014 04:36:14 +0000 |
parents | 2ac2f6d88bb2 |
children | d527ac304ad5 |
rev | line source |
---|---|
126
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /* |
174
3256dc6e84ae
rvinterf: refactored rvtdump compiles and works
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
173
diff
changeset
|
2 * This module implements the decoding of Rx packets |
3256dc6e84ae
rvinterf: refactored rvtdump compiles and works
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
173
diff
changeset
|
3 * into human-readable form. |
126
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 */ |
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 |
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 #include <sys/types.h> |
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 #include <stdio.h> |
133
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
8 #include <string.h> |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
9 #include <strings.h> |
256
2f285f20d617
rvinterf: *.h moved into include subdir
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
175
diff
changeset
|
10 #include "../include/pktmux.h" |
2f285f20d617
rvinterf: *.h moved into include subdir
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
175
diff
changeset
|
11 #include "../include/limits.h" |
126
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 |
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 extern u_char rxpkt[]; |
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 extern size_t rxpkt_len; |
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 |
333
2ac2f6d88bb2
rvinterf & rvtdump: use the new libg23 for G23 packet decoding
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
327
diff
changeset
|
16 static char fmtbuf[MAX_PKT_FROM_TARGET*8]; /* size it generously */ |
327
05874f1ddacb
rvinterf & rvtdump: new decoding of G23/GPF packets
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
256
diff
changeset
|
17 |
126
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 void |
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 print_rv_trace() |
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 { |
133
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
21 int i, c; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
22 char *dp; |
126
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 |
327
05874f1ddacb
rvinterf & rvtdump: new decoding of G23/GPF packets
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
256
diff
changeset
|
24 dp = fmtbuf; |
133
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
25 strcpy(dp, "RV "); |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
26 dp += 3; |
126
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
27 /* the SWE static ID is sent MSB first */ |
133
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
28 for (i = 1; i <= 4; i++) { |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
29 sprintf(dp, "%02X", rxpkt[i]); |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
30 dp += 2; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
31 } |
126
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
32 /* severity level */ |
133
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
33 sprintf(dp, " %d ", rxpkt[5]); |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
34 dp = index(dp, '\0'); |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
35 for (i = 6; i < rxpkt_len; i++) { |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
36 c = rxpkt[i]; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
37 if (c & 0x80) { |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
38 *dp++ = 'M'; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
39 *dp++ = '-'; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
40 c &= 0x7F; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
41 } |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
42 if (c < 0x20) { |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
43 *dp++ = '^'; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
44 *dp++ = c + '@'; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
45 } else if (c == 0x7F) { |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
46 *dp++ = '^'; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
47 *dp++ = '?'; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
48 } else |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
49 *dp++ = c; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
50 } |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
51 *dp = '\0'; |
327
05874f1ddacb
rvinterf & rvtdump: new decoding of G23/GPF packets
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
256
diff
changeset
|
52 output_line(fmtbuf); |
126
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
53 } |
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
54 |
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
55 void |
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
56 print_l1_trace() |
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
57 { |
133
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
58 int i, c; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
59 char *dp; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
60 |
327
05874f1ddacb
rvinterf & rvtdump: new decoding of G23/GPF packets
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
256
diff
changeset
|
61 dp = fmtbuf; |
133
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
62 strcpy(dp, "L1: "); |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
63 dp += 4; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
64 for (i = 1; i < rxpkt_len; i++) { |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
65 if ((i+1 < rxpkt_len) && |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
66 (rxpkt[i] == '\r' && rxpkt[i+1] == '\n' || |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
67 rxpkt[i] == '\n' && rxpkt[i+1] == '\r')) { |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
68 *dp = '\0'; |
327
05874f1ddacb
rvinterf & rvtdump: new decoding of G23/GPF packets
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
256
diff
changeset
|
69 output_line(fmtbuf); |
133
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
70 if (i+2 == rxpkt_len) |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
71 return; |
327
05874f1ddacb
rvinterf & rvtdump: new decoding of G23/GPF packets
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
256
diff
changeset
|
72 dp = fmtbuf; |
133
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
73 *dp++ = '+'; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
74 *dp++ = ' '; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
75 i++; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
76 continue; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
77 } |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
78 c = rxpkt[i]; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
79 if (c & 0x80) { |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
80 *dp++ = 'M'; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
81 *dp++ = '-'; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
82 c &= 0x7F; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
83 } |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
84 if (c < 0x20) { |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
85 *dp++ = '^'; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
86 *dp++ = c + '@'; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
87 } else if (c == 0x7F) { |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
88 *dp++ = '^'; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
89 *dp++ = '?'; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
90 } else |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
91 *dp++ = c; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
92 } |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
93 /* will get here only if no newline sequence at the end */ |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
94 *dp = '\0'; |
327
05874f1ddacb
rvinterf & rvtdump: new decoding of G23/GPF packets
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
256
diff
changeset
|
95 output_line(fmtbuf); |
126
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
96 } |
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
97 |
811b138f1bed
rvtdump utility written, compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
98 void |
333
2ac2f6d88bb2
rvinterf & rvtdump: use the new libg23 for G23 packet decoding
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
327
diff
changeset
|
99 print_g23_trace() |
2ac2f6d88bb2
rvinterf & rvtdump: use the new libg23 for G23 packet decoding
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
327
diff
changeset
|
100 { |
2ac2f6d88bb2
rvinterf & rvtdump: use the new libg23 for G23 packet decoding
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
327
diff
changeset
|
101 /* messy logic factored out into libg23 */ |
2ac2f6d88bb2
rvinterf & rvtdump: use the new libg23 for G23 packet decoding
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
327
diff
changeset
|
102 format_g23_packet(rxpkt, (int)rxpkt_len, fmtbuf); |
2ac2f6d88bb2
rvinterf & rvtdump: use the new libg23 for G23 packet decoding
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
327
diff
changeset
|
103 output_line(fmtbuf); |
2ac2f6d88bb2
rvinterf & rvtdump: use the new libg23 for G23 packet decoding
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
327
diff
changeset
|
104 } |
2ac2f6d88bb2
rvinterf & rvtdump: use the new libg23 for G23 packet decoding
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
327
diff
changeset
|
105 |
2ac2f6d88bb2
rvinterf & rvtdump: use the new libg23 for G23 packet decoding
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
327
diff
changeset
|
106 void |
169
e01e3a60c858
rvinterf: background mode implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
133
diff
changeset
|
107 print_etm_output_raw() |
e01e3a60c858
rvinterf: background mode implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
133
diff
changeset
|
108 { |
e01e3a60c858
rvinterf: background mode implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
133
diff
changeset
|
109 int i; |
e01e3a60c858
rvinterf: background mode implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
133
diff
changeset
|
110 char *dp; |
e01e3a60c858
rvinterf: background mode implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
133
diff
changeset
|
111 |
327
05874f1ddacb
rvinterf & rvtdump: new decoding of G23/GPF packets
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
256
diff
changeset
|
112 dp = fmtbuf; |
169
e01e3a60c858
rvinterf: background mode implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
133
diff
changeset
|
113 strcpy(dp, "ETM:"); |
e01e3a60c858
rvinterf: background mode implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
133
diff
changeset
|
114 dp += 4; |
e01e3a60c858
rvinterf: background mode implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
133
diff
changeset
|
115 for (i = 1; i < rxpkt_len; i++) { |
e01e3a60c858
rvinterf: background mode implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
133
diff
changeset
|
116 sprintf(dp, " %02X", rxpkt[i]); |
e01e3a60c858
rvinterf: background mode implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
133
diff
changeset
|
117 dp += 3; |
e01e3a60c858
rvinterf: background mode implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
133
diff
changeset
|
118 } |
e01e3a60c858
rvinterf: background mode implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
133
diff
changeset
|
119 *dp = '\0'; |
327
05874f1ddacb
rvinterf & rvtdump: new decoding of G23/GPF packets
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
256
diff
changeset
|
120 output_line(fmtbuf); |
169
e01e3a60c858
rvinterf: background mode implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
133
diff
changeset
|
121 } |
e01e3a60c858
rvinterf: background mode implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
133
diff
changeset
|
122 |
e01e3a60c858
rvinterf: background mode implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
133
diff
changeset
|
123 void |
133
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
124 print_unknown_packet() |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
125 { |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
126 int i; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
127 char *dp; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
128 |
327
05874f1ddacb
rvinterf & rvtdump: new decoding of G23/GPF packets
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
256
diff
changeset
|
129 dp = fmtbuf; |
133
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
130 strcpy(dp, "UNK:"); |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
131 dp += 4; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
132 for (i = 0; i < rxpkt_len; i++) { |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
133 sprintf(dp, " %02X", rxpkt[i]); |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
134 dp += 3; |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
135 } |
56b53c289785
rvtdump: some restructuring
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
127
diff
changeset
|
136 *dp = '\0'; |
327
05874f1ddacb
rvinterf & rvtdump: new decoding of G23/GPF packets
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
256
diff
changeset
|
137 output_line(fmtbuf); |
127
f4f0c8738dcb
rvtdump: satisfactory handling of output from Pirelli's fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
126
diff
changeset
|
138 } |