FreeCalypso > hg > freecalypso-tools
changeset 160:e4c98a2c1673
fc-tmsh: implemented proper handling of aul and aus responses
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 17 Mar 2017 07:49:12 +0000 |
parents | 8fac4aaec230 |
children | da6950e936bf |
files | rvinterf/tmsh/audioresp.c |
diffstat | 1 files changed, 16 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/rvinterf/tmsh/audioresp.c Fri Mar 17 07:34:29 2017 +0000 +++ b/rvinterf/tmsh/audioresp.c Fri Mar 17 07:49:12 2017 +0000 @@ -16,15 +16,22 @@ extern int rvi_msg_len; static void -aul_response() +aul_aus_response(op) + char *op; { - print_etm_pkt_raw("aul response"); -} + char buf[80]; -static void -aus_response() -{ - print_etm_pkt_raw("aus response"); + if (rvi_msg_len != 6) { + sprintf(buf, "%s response wrong length", op); + print_etm_pkt_raw(buf); + return; + } + if (rvi_msg[3]) + sprintf(buf, "%s error %u (0x%02X)", op, + rvi_msg[3], rvi_msg[3]); + else + sprintf(buf, "%s OK", op); + async_msg_output(buf); } static void @@ -44,10 +51,10 @@ { switch (rvi_msg[4]) { case 'L': - aul_response(); + aul_aus_response("aul"); return; case 'S': - aus_response(); + aul_aus_response("aus"); return; case 'R': aur_response();