FreeCalypso > hg > freecalypso-tools
comparison rvinterf/tmsh/l1resp.c @ 133:4aa1c18c7a2f
fc-tmsh: RF_ENABLE response handled intelligently
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 19 Feb 2017 21:33:58 +0000 |
parents | 5380872923a6 |
children | 4c78649101f1 |
comparison
equal
deleted
inserted
replaced
132:5380872923a6 | 133:4aa1c18c7a2f |
---|---|
12 l1tm_response_nodata(op) | 12 l1tm_response_nodata(op) |
13 char *op; | 13 char *op; |
14 { | 14 { |
15 char buf[80]; | 15 char buf[80]; |
16 | 16 |
17 if (rvi_msg_len > 5) { | 17 if (rvi_msg_len != 5) { |
18 sprintf(buf, "%s response wrong length", op); | 18 sprintf(buf, "%s response wrong length", op); |
19 print_etm_pkt_raw(buf); | 19 print_etm_pkt_raw(buf); |
20 return; | 20 return; |
21 } | 21 } |
22 if (rvi_msg[3]) | 22 if (rvi_msg[3]) |
78 val = rvi_msg[5] | (rvi_msg[6] << 8); | 78 val = rvi_msg[5] | (rvi_msg[6] << 8); |
79 sprintf(buf, "%s index %u (0x%02X): %u (0x%04X)", op, | 79 sprintf(buf, "%s index %u (0x%02X): %u (0x%04X)", op, |
80 rvi_msg[4], rvi_msg[4], val, val); | 80 rvi_msg[4], rvi_msg[4], val, val); |
81 async_msg_output(buf); | 81 async_msg_output(buf); |
82 } | 82 } |
83 | |
84 void | |
85 l1tm_rfe_response() | |
86 { | |
87 char buf[80]; | |
88 | |
89 if (rvi_msg_len < 5 || rvi_msg_len > 6) { | |
90 print_etm_pkt_raw("RF_ENABLE response wrong length"); | |
91 return; | |
92 } | |
93 switch (rvi_msg[3]) { | |
94 case 0: | |
95 async_msg_output("rfe OK"); | |
96 return; | |
97 case 1: | |
98 async_msg_output("RF operation finished"); | |
99 return; | |
100 default: | |
101 sprintf(buf, "rfe error %u (0x%x)", rvi_msg[3], rvi_msg[3]); | |
102 async_msg_output(buf); | |
103 return; | |
104 } | |
105 } |