#include <cstdlib>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#include "halcyon.h"
#include "hdcontrol.h"
#include "hdcommands.h"
#include "hdlisten.h"
#include "hdcmd.h"
Functions | |
void | printval (string valkey) |
void | parsecmd (string cmdline) |
void | getcommands () |
int | main (const int argc, char *argv[]) |
Variables | |
vector< string > | defkeys |
HDControl | hdc |
ConfigFile * | mainConfig |
void getcommands | ( | ) |
Get commands from the keyboard and process them. We handle "exit" and "show" and everything else is passed on to the HD Radio Controller for processing. Exit will leave the program (and shut the radio off). Show will display variable values. If no arguments are given, all variables currently stored are displayed. If "def" is given a set of default variables is displayed instead of all. If the name of a variable is given, that variable's value is displayed.
int main | ( | const int | argc, | |
char * | argv[] | |||
) |
This is a command line interface to the HDControl object for controlling HD radios from Linux through a serial port. It's mainly for testing so to get a command list, you'll have to look at commands that we parse in parsecmd() and in the command() functions in HDControl (note there are 3 different ones, divided up by the number of arguments).
It is also possible to pass commands from the command line. A "," as an argument by itself is the default command separator so commands of multiple argumengs can be passed with spaces between args.
Pass on the command line arguments to the config file for parsing. Also get commands back from config file and pass them on to the HDRadio control object for processing. Then set up to get commands from the console.
void parsecmd | ( | string | cmdline | ) |
Parse a command typed in or given on the command line.
cmdline | a command with arguments separated by spaces to be parsed. |
void printval | ( | string | valkey | ) |
Display the name of a variable and its value.
valkey | the key of the variable we're going to display |
vector<string> defkeys |