FreeCalypso > hg > ice1-trau-tester
comparison pcm/user_cmd.c @ 6:631f2db08538
pcm: implement print-rx and record commands
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 23 Jun 2024 18:53:01 +0000 |
parents | 7233c10af3ad |
children | 70aa8cbdbde9 |
comparison
equal
deleted
inserted
replaced
5:7233c10af3ad | 6:631f2db08538 |
---|---|
11 | 11 |
12 #include <osmocom/core/select.h> | 12 #include <osmocom/core/select.h> |
13 | 13 |
14 #include "globals.h" | 14 #include "globals.h" |
15 | 15 |
16 static struct cmdtab { | |
17 char *cmd; | |
18 void (*func)(int argc, char **argv); | |
19 } cmdtab[] = { | |
20 {"print-rx", cmd_print_rx}, | |
21 {"record", cmd_record_start}, | |
22 {"record-stop", cmd_record_stop}, | |
23 /* table search terminator */ | |
24 {NULL, NULL} | |
25 }; | |
26 | |
16 void handle_user_cmd(int argc, char **argv) | 27 void handle_user_cmd(int argc, char **argv) |
17 { | 28 { |
18 /* to be filled */ | 29 struct cmdtab *tp; |
30 | |
31 for (tp = cmdtab; tp->cmd; tp++) | |
32 if (!strcmp(tp->cmd, argv[0])) | |
33 break; | |
34 if (!tp->func) { | |
35 printf("error: unknown or unimplemented command\n"); | |
36 return; | |
37 } | |
38 tp->func(argc, argv); | |
19 } | 39 } |