comparison cmu200/signalgen.c @ 4:504d3cbb95b5

fc-cmu200d: signal-gen-setup implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 21 May 2017 07:21:17 +0000
parents
children 493987a4527e
comparison
equal deleted inserted replaced
3:b552e8d86474 4:504d3cbb95b5
1 /*
2 * This module implements the signal generator functionality.
3 */
4
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <string.h>
8 #include <strings.h>
9 #include "mode.h"
10 #include "secaddr.h"
11
12 extern char *client_cmd_fields[];
13 extern int client_cmd_nfields;
14
15 extern int current_mode;
16
17 cmd_signal_gen_setup()
18 {
19 int rc;
20 char cmdstr[32];
21
22 if (client_cmd_nfields != 2) {
23 send_socket_response("-Wrong number of arguments\n");
24 return(0);
25 }
26 stop_signal_gen();
27 current_mode = OP_MODE_UNDEF;
28 rc = find_named_band(client_cmd_fields[1]);
29 if (rc < 0) {
30 send_socket_response("-Invalid band argument\n");
31 return(0);
32 }
33 sprintf(cmdstr, "*SEC %d\n", SECADDR_RF_NSIG);
34 send_scpi_cmd(cmdstr);
35 current_mode = OP_MODE_SIGNAL_GEN;
36 send_socket_response("+OK\n");
37 return(0);
38 }