FreeCalypso > hg > freecalypso-tools
changeset 125:ca4fa5681f08
fc-tmsh: rxpw and rxpr implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 19 Feb 2017 09:41:40 +0000 |
parents | 8e37317f5de0 |
children | 777172bcea3c |
files | rvinterf/tmsh/l1cmd.c rvinterf/tmsh/usercmd.c |
diffstat | 2 files changed, 52 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/rvinterf/tmsh/l1cmd.c Sun Feb 19 09:13:59 2017 +0000 +++ b/rvinterf/tmsh/l1cmd.c Sun Feb 19 09:41:40 2017 +0000 @@ -345,3 +345,51 @@ send_etm_cmd(cmdpkt, 2); return(0); } + +static struct kwtab rx_param_arg[] = { + {"agc-gain", RX_AGC_GAIN}, + {"timeslot", RX_TIMESLOT}, + {"agc-enable", RX_AGC_ENA_FLAG}, + {"pm-enable", RX_PM_ENABLE}, + {"front-delay", RX_FRONT_DELAY}, + {"flags-cal", RX_FLAGS_CAL}, + {"flags-platform", RX_FLAGS_PLATFORM}, + {"flags-iq-swap", RX_FLAGS_IQ_SWAP}, + {"flags-all", RX_FLAGS_ALL}, + {"gprs-slots", RX_GPRS_SLOTS}, + {"gprs-coding", RX_GPRS_CODING}, + {0, 0} +}; + +cmd_rxpw(argc, argv) + char **argv; +{ + u16 index, value; + u_char cmdpkt[7]; + + if (keyword_or_num(argv[1], rx_param_arg, &index)) + return(ERROR_USAGE); + value = strtol(argv[2], 0, 0); + cmdpkt[1] = RX_PARAM_WRITE; + cmdpkt[2] = index; + cmdpkt[3] = index >> 8; + cmdpkt[4] = value; + cmdpkt[5] = value >> 8; + send_etm_cmd(cmdpkt, 5); + return(0); +} + +cmd_rxpr(argc, argv) + char **argv; +{ + u16 index; + u_char cmdpkt[5]; + + if (keyword_or_num(argv[1], rx_param_arg, &index)) + return(ERROR_USAGE); + cmdpkt[1] = RX_PARAM_READ; + cmdpkt[2] = index; + cmdpkt[3] = index >> 8; + send_etm_cmd(cmdpkt, 3); + return(0); +}
--- a/rvinterf/tmsh/usercmd.c Sun Feb 19 09:13:59 2017 +0000 +++ b/rvinterf/tmsh/usercmd.c Sun Feb 19 09:41:40 2017 +0000 @@ -28,6 +28,8 @@ extern int cmd_rfpw(); extern int cmd_rftr(); extern int cmd_rftw(); +extern int cmd_rxpr(); +extern int cmd_rxpw(); extern int cmd_scr(); extern int cmd_scw(); extern int cmd_sr(); @@ -72,6 +74,8 @@ {"rfpw", 2, 3, cmd_rfpw}, {"rftr", 1, 1, cmd_rftr}, {"rftw", 2, 3, cmd_rftw}, + {"rxpr", 1, 1, cmd_rxpr}, + {"rxpw", 2, 2, cmd_rxpw}, {"scr", 1, 1, cmd_scr}, {"scw", 2, 2, cmd_scw}, {"sr", 2, 2, cmd_sr},