# HG changeset patch # User Mychaela Falconia # Date 1727158540 0 # Node ID 6ba4de5005321726ea9df83df86979199823ef35 # Parent 40f781efdbe1c5894a217a26146598e409459e60 ater: implement edata switch for D144 diff -r 40f781efdbe1 -r 6ba4de500532 ater/Makefile --- a/ater/Makefile Tue Sep 24 05:59:28 2024 +0000 +++ b/ater/Makefile Tue Sep 24 06:15:40 2024 +0000 @@ -1,6 +1,6 @@ PROG= itt-ater-16 -OBJS= activate.o dbits.o main.o out_frame.o play_cmd.o read_file.o read_ts.o \ - record_ctrl.o subslot_rx.o tx_func.o user_cmd.o +OBJS= activate.o d144.o dbits.o main.o out_frame.o play_cmd.o read_file.o \ + read_ts.o record_ctrl.o subslot_rx.o tx_func.o user_cmd.o HDRS= globals.h out_frame.h read_file.h submux.h LIBUTIL=../libutil/libutil.a diff -r 40f781efdbe1 -r 6ba4de500532 ater/d144.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ater/d144.c Tue Sep 24 06:15:40 2024 +0000 @@ -0,0 +1,43 @@ +/* + * Here we implement commands for exercising D144 mode. + */ + +#include +#include +#include +#include +#include + +#include + +#include "globals.h" +#include "submux.h" + +void cmd_set_edata(int argc, char **argv) +{ + int nr; + struct ater_subslot *at; + + if (argc != 3) { +usage: fprintf(stderr, "usage: %s 0|1|2|3 0|1\n", argv[0]); + return; + } + if (argv[1][0] < '0' || argv[1][0] > '3' || argv[1][1]) + goto usage; + nr = argv[1][0] - '0'; + at = &subslots[nr]; + if (!at->is_active) { + fprintf(stderr, "error: subslot %d is not active\n", nr); + return; + } + if (!at->is_data_144) { + fprintf(stderr, "error: subslot %d is not in D144 mode\n", nr); + return; + } + if (!strcmp(argv[2], "0")) + at->d144_edata = 0; + else if (!strcmp(argv[2], "1")) + at->d144_edata = 1; + else + goto usage; +} diff -r 40f781efdbe1 -r 6ba4de500532 ater/globals.h --- a/ater/globals.h Tue Sep 24 05:59:28 2024 +0000 +++ b/ater/globals.h Tue Sep 24 06:15:40 2024 +0000 @@ -22,3 +22,4 @@ void cmd_play_file(int argc, char **argv); void cmd_play_stop(int argc, char **argv); void cmd_set_dbits(int argc, char **argv); +void cmd_set_edata(int argc, char **argv); diff -r 40f781efdbe1 -r 6ba4de500532 ater/user_cmd.c --- a/ater/user_cmd.c Tue Sep 24 05:59:28 2024 +0000 +++ b/ater/user_cmd.c Tue Sep 24 06:15:40 2024 +0000 @@ -21,6 +21,7 @@ {"activ-d", cmd_activate_csd}, {"deact", cmd_deact}, {"dset", cmd_set_dbits}, + {"edata", cmd_set_edata}, {"play", cmd_play_file}, {"play-stop", cmd_play_stop}, {"print-rx", cmd_print_rx},