diff options
author | Thomas Tsou <tom@tsou.cc> | 2013-09-05 05:32:23 -0400 |
---|---|---|
committer | Thomas Tsou <tom@tsou.cc> | 2013-09-05 06:07:50 -0400 |
commit | 44389b80d50392862e436258ca8595b6c5a4503f (patch) | |
tree | 7c7ab0e1269026609dbae34dbaa03bd48dc4c329 | |
parent | 3e24f791dd37b3205c394100268bfe5629d7e66f (diff) |
Transceiver52M: Add command line device args passing
Signed-off-by: Thomas Tsou <tom@tsou.cc>
-rw-r--r-- | Transceiver52M/multiTRX.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Transceiver52M/multiTRX.cpp b/Transceiver52M/multiTRX.cpp index 34d7a75..f23ca36 100644 --- a/Transceiver52M/multiTRX.cpp +++ b/Transceiver52M/multiTRX.cpp @@ -57,14 +57,23 @@ static int setupSignals() int main(int argc, char *argv[]) { int numARFCN = 1; + std::string deviceArgs = ""; - if (argc > 1) { + switch (argc) { + case 3: + deviceArgs = std::string(argv[2]); + case 2: numARFCN = atoi(argv[1]); if (numARFCN > CHAN_MAX) { LOG(ALERT) << numARFCN << " channels not supported " << " with with current build"; exit(-1); } + case 1: + break; + default: + std::cout << argv[0] << " <chans> <device args>" << std::endl; + return -1; } gLogInit("transceiver", gConfig.getStr("Log.Level").c_str(), LOG_LOCAL7); @@ -76,7 +85,7 @@ int main(int argc, char *argv[]) } RadioDevice *device = RadioDevice::make(SAMPSPERSYM); - int radioType = device->open(""); + int radioType = device->open(deviceArgs); if (radioType < 0) { LOG(ALERT) << "Failed to open device, exiting..."; return EXIT_FAILURE; |