comparison rvinterf/tmsh/l1resp.c @ 155:f5a797c291be

fc-tmsh l1tm response handling: returned values can be signed or unsigned
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 17 Mar 2017 05:47:00 +0000
parents 79e71354ba7b
children
comparison
equal deleted inserted replaced
154:3c446058b5a6 155:f5a797c291be
82 sprintf(buf, "%s response wrong length", op); 82 sprintf(buf, "%s response wrong length", op);
83 print_etm_pkt_raw(buf); 83 print_etm_pkt_raw(buf);
84 return; 84 return;
85 } 85 }
86 val = rvi_msg[5] | (rvi_msg[6] << 8); 86 val = rvi_msg[5] | (rvi_msg[6] << 8);
87 sprintf(buf, "%s index %u (0x%02X): %u (0x%04X)", op, 87 if (val >= 0x8000)
88 rvi_msg[4], rvi_msg[4], val, val); 88 sprintf(buf, "%s index %u (0x%02X): 0x%04X (%u or %d)", op,
89 rvi_msg[4], rvi_msg[4], val, val, (int)val - 65536);
90 else
91 sprintf(buf, "%s index %u (0x%02X): 0x%04X (%u)", op,
92 rvi_msg[4], rvi_msg[4], val, val);
89 async_msg_output(buf); 93 async_msg_output(buf);
90 } 94 }
91 95
92 void 96 void
93 l1tm_rfe_response() 97 l1tm_rfe_response()