FreeCalypso > hg > freecalypso-sw
changeset 184:4714fdfca39c
fc-tmsh compiles!
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sun, 24 Nov 2013 08:40:44 +0000 |
parents | 85222710dc92 |
children | ec040f521cc2 |
files | .hgignore rvinterf/etm/etmbasic.c rvinterf/etm/interf.c |
diffstat | 3 files changed, 40 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Sun Nov 24 08:03:27 2013 +0000 +++ b/.hgignore Sun Nov 24 08:40:44 2013 +0000 @@ -11,10 +11,11 @@ ^gsm-fw/finlink/.*\.map$ ^gsm-fw/include/config\. -^loadtools/fc-iram -^loadtools/fc-loadtool -^loadtools/fc-xram +^loadtools/fc-iram$ +^loadtools/fc-loadtool$ +^loadtools/fc-xram$ +^rvinterf/etm/fc-tmsh$ ^rvinterf/lowlevel/rvinterf$ ^rvinterf/lowlevel/rvtdump$ ^rvinterf/old/etmsend$
--- a/rvinterf/etm/etmbasic.c Sun Nov 24 08:03:27 2013 +0000 +++ b/rvinterf/etm/etmbasic.c Sun Nov 24 08:40:44 2013 +0000 @@ -7,6 +7,7 @@ #include <string.h> #include <strings.h> #include <stdlib.h> +#include "../pktmux.h" #include "../limits.h" extern u_char rvi_msg[]; @@ -33,3 +34,23 @@ sprintf(dp, " chksum %s", c ? "BAD" : "OK"); async_msg_output(buf); } + +void +cmd_etmpkt(argc, argv) + char **argv; +{ + u_char pkt[MAX_PKT_TO_TARGET]; + int di, c, b; + char **ap; + + pkt[0] = RVT_TM_HEADER; + di = 1; + c = 0; + for (ap = argv + 1; *ap; ap++) { + b = strtoul(*ap, 0, 16); + pkt[di++] = b; + c ^= b; + } + pkt[di++] = c; + send_pkt_to_target(pkt, di); +}
--- a/rvinterf/etm/interf.c Sun Nov 24 08:03:27 2013 +0000 +++ b/rvinterf/etm/interf.c Sun Nov 24 08:40:44 2013 +0000 @@ -89,3 +89,18 @@ prep_for_message_rx(); } } + +void +send_pkt_to_target(pkt, pktlen) + u_char *pkt; +{ + u_char hdrbuf[3]; + int len1; + + len1 = pktlen + 1; + hdrbuf[0] = len1 >> 8; + hdrbuf[1] = len1 & 0xFF; + hdrbuf[2] = CLI2RVI_PKT_TO_TARGET; + write(sock, hdrbuf, 3); + write(sock, pkt, pktlen); +}