FreeCalypso > hg > freecalypso-tools
comparison rvinterf/tmsh/audioresp.c @ 162:ce7479d28b02
fc-tmsh: aur response handling implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 17 Mar 2017 08:28:21 +0000 |
parents | da6950e936bf |
children |
comparison
equal
deleted
inserted
replaced
161:da6950e936bf | 162:ce7479d28b02 |
---|---|
35 } | 35 } |
36 | 36 |
37 static void | 37 static void |
38 aur_response() | 38 aur_response() |
39 { | 39 { |
40 print_etm_pkt_raw("aur response"); | 40 char buf[80], *dp; |
41 unsigned i, j, l, size; | |
42 | |
43 if (rvi_msg_len < 7) { | |
44 tooshort: print_etm_pkt_raw("aur response too short"); | |
45 return; | |
46 } | |
47 if (rvi_msg[3]) { | |
48 if (rvi_msg_len == 7) { | |
49 sprintf(buf, "aur %u error %u (0x%02X)", rvi_msg[5], | |
50 rvi_msg[3], rvi_msg[3]); | |
51 async_msg_output(buf); | |
52 } else | |
53 print_etm_pkt_raw("aur long error response"); | |
54 return; | |
55 } | |
56 if (rvi_msg_len < 8) | |
57 goto tooshort; | |
58 size = rvi_msg_len - 7; | |
59 sprintf(buf, "aur %u: %u byte%s", rvi_msg[5], size, | |
60 size != 1 ? "s" : ""); | |
61 async_msg_output(buf); | |
62 for (i = 0; i < size; ) { | |
63 l = size - i; | |
64 if (l > 16) | |
65 l = 16; | |
66 sprintf(buf, "offset %02X:", i); | |
67 dp = index(buf, '\0'); | |
68 for (j = 0; j < l; j++) { | |
69 if (j == 0 || j == 8) | |
70 *dp++ = ' '; | |
71 sprintf(dp, " %02X", rvi_msg[i + 6]); | |
72 i++; | |
73 dp += 3; | |
74 } | |
75 async_msg_output(buf); | |
76 } | |
41 } | 77 } |
42 | 78 |
43 static void | 79 static void |
44 auw_response() | 80 auw_response() |
45 { | 81 { |