FreeCalypso > hg > ice1-trau-tester
view ater/user_cmd.c @ 50:6ba4de500532
ater: implement edata switch for D144
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 24 Sep 2024 06:15:40 +0000 |
parents | 349fb785a414 |
children | db39e8855f3d |
line wrap: on
line source
/* * In this module we handle user-issued stdin commands during * itt-ater-16 running session. */ #include <stdint.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <osmocom/core/select.h> #include "globals.h" static struct cmdtab { char *cmd; void (*func)(int argc, char **argv); } cmdtab[] = { {"activ", cmd_activate}, {"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}, {"record", cmd_record_start}, {"record-stop", cmd_record_stop}, /* table search terminator */ {NULL, NULL} }; void handle_user_cmd(int argc, char **argv) { struct cmdtab *tp; for (tp = cmdtab; tp->cmd; tp++) if (!strcmp(tp->cmd, argv[0])) break; if (!tp->func) { printf("error: unknown or unimplemented command\n"); return; } tp->func(argc, argv); }