# HG changeset patch # User Mychaela Falconia # Date 1487540038 0 # Node ID 4aa1c18c7a2fd18b5002ed8afaedc2fc364e8773 # Parent 5380872923a6eaabad748fb25794c66f8a943917 fc-tmsh: RF_ENABLE response handled intelligently diff -r 5380872923a6 -r 4aa1c18c7a2f rvinterf/tmsh/etmbasic.c --- a/rvinterf/tmsh/etmbasic.c Sun Feb 19 20:53:41 2017 +0000 +++ b/rvinterf/tmsh/etmbasic.c Sun Feb 19 21:33:58 2017 +0000 @@ -70,13 +70,9 @@ return; /* L1TM */ case TM_INIT: - if (rvi_msg_len < 5) - goto runt; l1tm_response_nodata("tminit"); return; case TM_MODE_SET: - if (rvi_msg_len < 5) - goto runt; l1tm_response_nodata("tms"); return; case VERSION_GET: @@ -85,7 +81,7 @@ l1tm_response_index_val("tm3ver"); return; case RF_ENABLE: - print_etm_pkt_raw("RF_ENABLE response"); + l1tm_rfe_response(); return; case STATS_READ: print_etm_pkt_raw("STATS_READ response"); diff -r 5380872923a6 -r 4aa1c18c7a2f rvinterf/tmsh/l1resp.c --- a/rvinterf/tmsh/l1resp.c Sun Feb 19 20:53:41 2017 +0000 +++ b/rvinterf/tmsh/l1resp.c Sun Feb 19 21:33:58 2017 +0000 @@ -14,7 +14,7 @@ { char buf[80]; - if (rvi_msg_len > 5) { + if (rvi_msg_len != 5) { sprintf(buf, "%s response wrong length", op); print_etm_pkt_raw(buf); return; @@ -80,3 +80,26 @@ rvi_msg[4], rvi_msg[4], val, val); async_msg_output(buf); } + +void +l1tm_rfe_response() +{ + char buf[80]; + + if (rvi_msg_len < 5 || rvi_msg_len > 6) { + print_etm_pkt_raw("RF_ENABLE response wrong length"); + return; + } + switch (rvi_msg[3]) { + case 0: + async_msg_output("rfe OK"); + return; + case 1: + async_msg_output("RF operation finished"); + return; + default: + sprintf(buf, "rfe error %u (0x%x)", rvi_msg[3], rvi_msg[3]); + async_msg_output(buf); + return; + } +}