11 #include "LibCyberRadio/Driver/RadioHandler.h" 12 #include "LibCyberRadio/Common/Pythonesque.h" 13 #include <boost/format.hpp> 14 #include <boost/lexical_cast.hpp> 21 #include <arpa/inet.h> 29 const std::string& name,
39 int transmitterIndexBase,
43 int wbddcGroupIndexBase,
45 int nbddcGroupIndexBase,
47 int ddcGroupIndexBase,
49 int dataPortIndexBase,
50 int numSimpleIpSetups,
56 _tunerIndexBase(tunerIndexBase),
58 _wbddcIndexBase(wbddcIndexBase),
60 _nbddcIndexBase(nbddcIndexBase),
61 _numTunerBoards(numTunerBoards),
62 _maxTunerBw(maxTunerBw),
63 _numTransmitter(numTransmitter),
64 _transmitterIndexBase(transmitterIndexBase),
66 _ducIndexBase(ducIndexBase),
67 _numWbddcGroups(numWbddcGroups),
68 _wbddcGroupIndexBase(wbddcGroupIndexBase),
69 _numNbddcGroups(numNbddcGroups),
70 _nbddcGroupIndexBase(nbddcGroupIndexBase),
71 _numDdcGroups(numDdcGroups),
72 _ddcGroupIndexBase(ddcGroupIndexBase),
73 _numDataPorts(numDataPorts),
74 _dataPortIndexBase(dataPortIndexBase),
75 _numSimpleIpSetups(numSimpleIpSetups),
80 _freqNormalization(0),
83 _referenceTuningVoltage(0),
86 _lastCmdErrorInfo(
""),
90 _versionInfo[
"model"] =
"N/A";
91 _versionInfo[
"serialNumber"] =
"N/A";
92 _versionInfo[
"unitRevision"] =
"N/A";
93 _versionInfo[
"softwareVersion"] =
"N/A";
94 _versionInfo[
"firmwareVersion"] =
"N/A";
95 _versionInfo[
"firmwareDate"] =
"N/A";
96 _versionInfo[
"referenceVersion"] =
"N/A";
97 _versionInfo[
"hardwareVersion"] =
"N/A";
107 for ( TunerComponentDict::iterator it = _tuners.begin();
108 it != _tuners.end(); it++)
112 for ( WbddcComponentDict::iterator it = _wbddcs.begin();
113 it != _wbddcs.end(); it++)
117 for ( NbddcComponentDict::iterator it = _nbddcs.begin();
118 it != _nbddcs.end(); it++)
122 for ( TransmitterComponentDict::iterator it = _txs.begin();
123 it != _txs.end(); it++)
127 for ( DataPortDict::iterator it = _dataPorts.begin();
128 it != _dataPorts.end(); it++)
132 for ( DucComponentDict::iterator it = _ducs.begin();
133 it != _ducs.end(); it++)
137 for ( WbddcGroupComponentDict::iterator it = _wbddcGroups.begin();
138 it != _wbddcGroups.end(); it++)
142 for ( NbddcGroupComponentDict::iterator it = _nbddcGroups.begin();
143 it != _nbddcGroups.end(); it++)
147 for ( SimpleIpSetupDict::iterator it = _simpleIpSetups.begin();
148 it != _simpleIpSetups.end(); it++)
157 _connModesSupported = other._connModesSupported;
158 _numTuner = other._numTuner;
159 _tunerIndexBase = other._tunerIndexBase;
160 _numWbddc = other._numWbddc;
161 _wbddcIndexBase = other._wbddcIndexBase;
162 _numNbddc = other._numNbddc;
163 _nbddcIndexBase = other._nbddcIndexBase;
164 _numTunerBoards = other._numTunerBoards;
165 _maxTunerBw = other._maxTunerBw;
166 _numTransmitter = other._numTransmitter;
167 _transmitterIndexBase = other._transmitterIndexBase;
168 _numDuc = other._numDuc;
169 _ducIndexBase = other._ducIndexBase;
170 _numWbddcGroups = other._numWbddcGroups;
171 _wbddcGroupIndexBase = other._wbddcGroupIndexBase;
172 _numNbddcGroups = other._numNbddcGroups;
173 _nbddcGroupIndexBase = other._nbddcGroupIndexBase;
174 _numDdcGroups = other._numDdcGroups;
175 _ddcGroupIndexBase = other._ddcGroupIndexBase;
176 _numDataPorts = other._numDataPorts;
177 _dataPortIndexBase = other._dataPortIndexBase;
178 _numSimpleIpSetups = other._numSimpleIpSetups;
179 _adcRate = other._adcRate;
180 _ifSpec = other._ifSpec;
181 _configMode = other._configMode;
182 _coherentMode = other._coherentMode;
183 _freqNormalization = other._freqNormalization;
184 _gpsEnabled = other._gpsEnabled;
185 _referenceMode = other._referenceMode;
186 _referenceTuningVoltage = other._referenceTuningVoltage;
187 _referenceBypass = other._referenceBypass;
188 _calibFrequency = other._calibFrequency;
189 _lastCmdErrorInfo = other._lastCmdErrorInfo;
190 _transport = other._transport;
191 _versionInfo = other._versionInfo;
192 _connectionInfo = other._connectionInfo;
193 _defaultTimeout = other._defaultTimeout;
194 _defaultDeviceInfo = other._defaultDeviceInfo;
203 _connModesSupported = other._connModesSupported;
204 _numTuner = other._numTuner;
205 _tunerIndexBase = other._tunerIndexBase;
206 _numWbddc = other._numWbddc;
207 _wbddcIndexBase = other._wbddcIndexBase;
208 _numNbddc = other._numNbddc;
209 _nbddcIndexBase = other._nbddcIndexBase;
210 _numTunerBoards = other._numTunerBoards;
211 _maxTunerBw = other._maxTunerBw;
212 _numTransmitter = other._numTransmitter;
213 _transmitterIndexBase = other._transmitterIndexBase;
214 _numDuc = other._numDuc;
215 _ducIndexBase = other._ducIndexBase;
216 _numWbddcGroups = other._numWbddcGroups;
217 _wbddcGroupIndexBase = other._wbddcGroupIndexBase;
218 _numNbddcGroups = other._numNbddcGroups;
219 _nbddcGroupIndexBase = other._nbddcGroupIndexBase;
220 _numDdcGroups = other._numDdcGroups;
221 _ddcGroupIndexBase = other._ddcGroupIndexBase;
222 _numDataPorts = other._numDataPorts;
223 _dataPortIndexBase = other._dataPortIndexBase;
224 _numSimpleIpSetups = other._numSimpleIpSetups;
225 _adcRate = other._adcRate;
226 _ifSpec = other._ifSpec;
227 _configMode = other._configMode;
228 _coherentMode = other._coherentMode;
229 _freqNormalization = other._freqNormalization;
230 _gpsEnabled = other._gpsEnabled;
231 _referenceMode = other._referenceMode;
232 _referenceTuningVoltage = other._referenceTuningVoltage;
233 _referenceBypass = other._referenceBypass;
234 _calibFrequency = other._calibFrequency;
235 _lastCmdErrorInfo = other._lastCmdErrorInfo;
236 _transport = other._transport;
237 _versionInfo = other._versionInfo;
238 _connectionInfo = other._connectionInfo;
239 _defaultTimeout = other._defaultTimeout;
240 _defaultDeviceInfo = other._defaultDeviceInfo;
257 return _connectionInfo;
262 this->
debug(
"[RadioHandler::connect] Called; mode=\"%s\", HorD=\"%s\", PorB=%d\n", mode.c_str(), host_or_dev.c_str(), port_or_baudrate);
268 ret = _transport.
connect(mode, host_or_dev, port_or_baudrate);
269 this->
debug(
"[RadioHandler::connect] Connect result: %s\n",
debugBool(ret));
272 _connectionInfo[
"mode"] = mode;
273 if ( (mode ==
"tcp") or (mode ==
"udp") )
275 _connectionInfo[
"hostname"] = host_or_dev;
276 _connectionInfo[
"port"] = ( boost::format(
"%d") % port_or_baudrate ).str();
278 else if ( (mode ==
"tty") )
280 _connectionInfo[
"device"] = host_or_dev;
281 _connectionInfo[
"baudrate"] = ( boost::format(
"%d") % port_or_baudrate ).str();
283 this->
debug(
"[RadioHandler::connect] Querying configuration\n");
291 std::ostringstream oss;
292 oss <<
"Unsupported connection mode: " << mode;
293 _lastCmdErrorInfo = oss.str();
295 this->
debug(
"[RadioHandler::connect] Returning %s\n",
debugBool(ret));
301 this->
debug(
"[RadioHandler::disconnect] Called\n");
304 this->
debug(
"[RadioHandler::disconnect] Returning\n");
309 this->
debug(
"[RadioHandler::sendCommand] Called; cmd=\"%s\"\n",
312 _lastCmdErrorInfo =
"";
315 ret = _transport.
receive(timeout);
323 BasicStringList::iterator it;
324 for (it = ret.begin(); it != ret.end(); it++)
326 if ( it->find(
"ERROR") != std::string::npos )
334 ret.erase(ret.begin());
336 this->
debug(
"[RadioHandler::sendCommand] Returning %lu elements\n", ret.size());
337 for (it = ret.begin(); it != ret.end(); it++)
338 this->
debug(
"[RadioHandler::sendCommand] -- %s\n", it->c_str());
344 this->queryVersionInfo();
345 if ( this->queryRadioConfiguration() )
347 for ( TunerComponentDict::iterator it = _tuners.begin();
348 it != _tuners.end(); it++)
350 it->second->queryConfiguration();
352 for ( WbddcComponentDict::iterator it = _wbddcs.begin();
353 it != _wbddcs.end(); it++)
355 it->second->queryConfiguration();
357 for ( NbddcComponentDict::iterator it = _nbddcs.begin();
358 it != _nbddcs.end(); it++)
360 it->second->queryConfiguration();
362 for ( TransmitterComponentDict::iterator it = _txs.begin();
363 it != _txs.end(); it++)
365 it->second->queryConfiguration();
367 for ( DataPortDict::iterator it = _dataPorts.begin();
368 it != _dataPorts.end(); it++)
370 it->second->queryConfiguration();
372 for ( DucComponentDict::iterator it = _ducs.begin();
373 it != _ducs.end(); it++)
375 it->second->queryConfiguration();
377 for ( WbddcGroupComponentDict::iterator it = _wbddcGroups.begin();
378 it != _wbddcGroups.end(); it++)
380 it->second->queryConfiguration();
382 for ( NbddcGroupComponentDict::iterator it = _nbddcGroups.begin();
383 it != _nbddcGroups.end(); it++)
385 it->second->queryConfiguration();
387 for ( SimpleIpSetupDict::iterator it = _simpleIpSetups.begin();
388 it != _simpleIpSetups.end(); it++)
390 it->second->queryConfiguration();
396 this->
debug(
"[RadioHandler::setConfiguration] Called\n");
399 int adjCfg = _configMode;
400 int adjCoh = _coherentMode;
401 int adjFnr = _freqNormalization;
402 int adjGps = _gpsEnabled;
403 int adjRef = _referenceMode;
404 int adjRtv = _referenceTuningVoltage;
405 int adjByp = _referenceBypass;
406 double adjCal = _calibFrequency;
407 if ( cfg.find(
"configMode") != cfg.end() )
410 ret &= this->executeConfigModeCommand(adjCfg);
412 if ( cfg.find(
"coherentMode") != cfg.end() )
415 ret &= this->executeCoherentModeCommand(adjCoh);
417 if ( cfg.find(
"freqNormalization") != cfg.end() )
420 ret &= this->executeFreqNormalizationCommand(adjFnr);
422 if ( cfg.find(
"gpsEnabled") != cfg.end() )
425 ret &= this->executeGpsEnabledCommand(adjGps);
427 if ( cfg.find(
"referenceMode") != cfg.end() )
430 ret &= this->executeReferenceModeCommand(adjRef);
432 if ( cfg.find(
"referenceTuningVoltage") != cfg.end() )
435 ret &= this->executeReferenceVoltageCommand(adjRtv);
437 if ( cfg.find(
"bypassMode") != cfg.end() )
440 ret &= this->executeReferenceBypassCommand(adjByp);
442 if ( cfg.find(
"calibFrequency") != cfg.end() )
445 ret &= this->executeCalibFrequencyCommand(adjCal);
449 _configMode = adjCfg;
450 _coherentMode = adjCoh;
451 _freqNormalization = adjFnr;
452 _gpsEnabled = adjGps;
453 _referenceMode = adjRef;
454 _referenceTuningVoltage = adjRtv;
455 _referenceBypass = adjByp;
456 _calibFrequency = adjCal;
459 this->
debug(
"[RadioHandler::setConfiguration] Returning\n");
465 return _lastCmdErrorInfo;
470 return this->executeResetCommand(resetType);
475 return this->executePpsQuery();
480 bool ret = this->
getPps();
485 time_t targetTime = time(NULL) + 1;
491 ret = this->executeTimeCommand(adjTime);
496 adjTime = boost::lexical_cast<std::string>(targetTime);
497 ret = this->executeTimeCommand(adjTime);
504 ret = (radioUtc == targetTime);
519 this->
debug(
"[RadioHandler::getTimeNow] Executing time query\n");
520 if ( this->executeTimeQuery(adjTime) )
522 this->
debug(
"[RadioHandler::getTimeNow] -- query result: %s\n", adjTime.c_str());
523 ret = (time_t)boost::lexical_cast<unsigned int>(adjTime);
542 unsigned int ret = 0;
543 unsigned int stat = 0;
544 if ( this->executeStatusQuery(stat) )
553 unsigned int ret = 0;
554 unsigned int stat = 0;
555 if ( this->executeTstatusQuery(stat) )
565 cfg[
"referenceMode"] = mode;
572 cfg[
"bypassMode"] = mode;
579 TunerComponentDict::const_iterator it = _tuners.find(tunerIndex);
580 if ( it != _tuners.end() )
581 ret = it->second->setTimingAdjustment(timeAdjustValue);
590 if ( this->executeGpsPositionQuery(lat, lon) )
602 if ( this->executeTemperatureQuery(temp) )
611 return _numDataPorts;
618 if ( this->executeGpioStaticQuery(value) )
631 if ( this->executeGpioSequenceQuery(index, value, duration, loop) )
643 int adjValue = value;
644 if ( this->executeGpioStaticCommand(adjValue) )
650 int duration,
int loop,
int go)
653 int adjValue = value;
654 int adjDur = duration;
657 if ( this->executeGpioSequenceCommand(index, adjValue, adjDur, adjLoop, adjGo) )
664 return _calibFrequency;
670 if ( _config.find(
"calibFrequency") != _config.end() )
673 cfg[
"calibFrequency"] = freq;
682 for (
int num = _dataPortIndexBase; num < _dataPortIndexBase + _numDataPorts; num++)
690 DataPortDict::const_iterator it = _dataPorts.begin();
691 if ( it != _dataPorts.end() )
692 ret = it->second->getNumDestEntries();
699 DataPortDict::const_iterator it = _dataPorts.begin();
700 if ( it != _dataPorts.end() )
701 ret = it->second->getDestEntryIndexRange();
707 return _connModesSupported;
713 if (std::find(_connModesSupported.begin(), _connModesSupported.end(), mode) != _connModesSupported.end())
743 const char *ourByteOrder =
"little";
744 if ( htonl(0xDEAD) == 0xDEAD )
745 ourByteOrder =
"big";
747 return ( strcmp(ourByteOrder, _ifSpec.
byteOrder) != 0 );
767 return _numTunerBoards;
773 for (
int num = _tunerIndexBase; num < _tunerIndexBase + _numTuner; num++)
781 TunerComponentDict::const_iterator it = _tuners.begin();
782 if ( it != _tuners.end() )
783 ret = it->second->getFrequencyRange();
790 TunerComponentDict::const_iterator it = _tuners.begin();
791 if ( it != _tuners.end() )
792 ret = it->second->getFrequencyRes();
799 TunerComponentDict::const_iterator it = _tuners.begin();
800 if ( it != _tuners.end() )
801 ret = it->second->getFrequencyUnit();
808 TunerComponentDict::const_iterator it = _tuners.begin();
809 if ( it != _tuners.end() )
810 ret = it->second->getAttenuationRange();
817 TunerComponentDict::const_iterator it = _tuners.begin();
818 if ( it != _tuners.end() )
819 ret = it->second->getAttenuationRes();
826 TunerComponentDict::const_iterator it = _tuners.find(index);
827 if ( it != _tuners.end() )
828 ret = it->second->isEnabled();
835 TunerComponentDict::const_iterator it = _tuners.find(index);
836 if ( it != _tuners.end() )
837 ret = it->second->enable(enabled);
849 TunerComponentDict::const_iterator it = _tuners.find(index);
850 if ( it != _tuners.end() )
851 ret = it->second->getFrequency();
858 TunerComponentDict::const_iterator it = _tuners.find(index);
859 if ( it != _tuners.end() )
860 ret = it->second->setFrequency(freq);
867 TunerComponentDict::const_iterator it = _tuners.find(index);
868 if ( it != _tuners.end() )
869 ret = it->second->getAttenuation();
876 TunerComponentDict::const_iterator it = _tuners.find(index);
877 if ( it != _tuners.end() )
878 ret = it->second->setAttenuation(atten);
885 TunerComponentDict::const_iterator it = _tuners.find(index);
886 if ( it != _tuners.end() )
887 ret = it->second->getFilter();
894 TunerComponentDict::const_iterator it = _tuners.find(index);
895 if ( it != _tuners.end() )
896 ret = it->second->setFilter(filter);
903 TunerComponentDict::const_iterator it = _tuners.find(index);
904 if ( it != _tuners.end() )
905 ret = it->second->getConfiguration();
912 TunerComponentDict::const_iterator it = _tuners.find(index);
913 if ( it != _tuners.end() )
914 ret = it->second->setConfiguration(cfg);
926 for (
int num = _wbddcIndexBase; num < _wbddcIndexBase + _numWbddc; num++)
934 WbddcComponentDict::const_iterator it = _wbddcs.begin();
935 if ( it != _wbddcs.end() )
936 ret = it->second->isTunable();
943 WbddcComponentDict::const_iterator it = _wbddcs.begin();
944 if ( it != _wbddcs.end() )
945 ret = it->second->isSourceSelectable();
952 WbddcComponentDict::const_iterator it = _wbddcs.begin();
953 if ( it != _wbddcs.end() )
954 ret = it->second->getFrequencyRange();
961 WbddcComponentDict::const_iterator it = _wbddcs.begin();
962 if ( it != _wbddcs.end() )
963 ret = it->second->getFrequencyRes();
970 WbddcComponentDict::const_iterator it = _wbddcs.begin();
971 if ( it != _wbddcs.end() )
972 ret = it->second->getFrequencyUnit();
979 WbddcComponentDict::const_iterator it = _wbddcs.begin();
980 if ( it != _wbddcs.end() )
981 ret = it->second->getRateSet();
988 WbddcComponentDict::const_iterator it = _wbddcs.begin();
989 if ( it != _wbddcs.end() )
990 ret = it->second->getRateList();
997 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
998 if ( it != _wbddcs.end() )
999 ret = it->second->isEnabled();
1006 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1007 if ( it != _wbddcs.end() )
1008 ret = it->second->enable(enabled);
1020 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1021 if ( it != _wbddcs.end() )
1022 ret = it->second->getFrequency();
1029 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1030 if ( it != _wbddcs.end() )
1031 ret = it->second->setFrequency(freq);
1038 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1039 if ( it != _wbddcs.end() )
1040 ret = it->second->getSource();
1047 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1048 if ( it != _wbddcs.end() )
1049 ret = it->second->setSource(source);
1056 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1057 if ( it != _wbddcs.end() )
1058 ret = it->second->getRateIndex();
1065 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1066 if ( it != _wbddcs.end() )
1067 ret = it->second->setRateIndex(rateIndex);
1074 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1075 if ( it != _wbddcs.end() )
1076 ret = it->second->getUdpDestination();
1083 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1084 if ( it != _wbddcs.end() )
1085 ret = it->second->setUdpDestination(dest);
1092 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1093 if ( it != _wbddcs.end() )
1094 ret = it->second->getVitaEnable();
1101 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1102 if ( it != _wbddcs.end() )
1103 ret = it->second->setVitaEnable(enable);
1109 unsigned int ret = 0;
1110 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1111 if ( it != _wbddcs.end() )
1112 ret = it->second->getStreamId();
1119 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1120 if ( it != _wbddcs.end() )
1121 ret = it->second->setStreamId(sid);
1128 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1129 if ( it != _wbddcs.end() )
1130 ret = it->second->getDataPort();
1137 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1138 if ( it != _wbddcs.end() )
1139 ret = it->second->setDataPort(port);
1146 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1147 if ( it != _wbddcs.end() )
1148 ret = it->second->setRateSet(
set);
1155 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1156 if ( it != _wbddcs.end() )
1157 ret = it->second->getConfiguration();
1164 WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1165 if ( it != _wbddcs.end() )
1166 ret = it->second->setConfiguration(cfg);
1178 for (
int num = _nbddcIndexBase; num < _nbddcIndexBase + _numNbddc; num++)
1186 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1187 if ( it != _nbddcs.end() )
1188 ret = it->second->getFrequencyRange();
1195 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1196 if ( it != _nbddcs.end() )
1197 ret = it->second->getFrequencyRes();
1204 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1205 if ( it != _nbddcs.end() )
1206 ret = it->second->getFrequencyUnit();
1213 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1214 if ( it != _nbddcs.end() )
1215 ret = it->second->getRateSet();
1222 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1223 if ( it != _nbddcs.end() )
1224 ret = it->second->getRateList();
1231 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1232 if ( it != _nbddcs.end() )
1233 ret = it->second->isEnabled();
1240 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1241 if ( it != _nbddcs.end() )
1242 ret = it->second->enable(enabled);
1254 NbddcComponentDict::const_iterator it = _nbddcs.find(index);
1255 if ( it != _nbddcs.end() )
1256 ret = it->second->getConfiguration();
1263 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1264 if ( it != _nbddcs.end() )
1265 ret = it->second->setConfiguration(cfg);
1272 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1273 if ( it != _nbddcs.end() )
1274 ret = it->second->getFrequency();
1281 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1282 if ( it != _nbddcs.end() )
1283 ret = it->second->setFrequency(freq);
1290 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1291 if ( it != _nbddcs.end() )
1292 ret = it->second->getSource();
1299 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1300 if ( it != _nbddcs.end() )
1301 ret = it->second->setSource(source);
1308 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1309 if ( it != _nbddcs.end() )
1310 ret = it->second->getRateIndex();
1317 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1318 if ( it != _nbddcs.end() )
1319 ret = it->second->setRateIndex(rateIndex);
1326 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1327 if ( it != _nbddcs.end() )
1328 ret = it->second->getUdpDestination();
1335 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1336 if ( it != _nbddcs.end() )
1337 ret = it->second->setUdpDestination(dest);
1344 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1345 if ( it != _nbddcs.end() )
1346 ret = it->second->getVitaEnable();
1353 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1354 if ( it != _nbddcs.end() )
1355 ret = it->second->setVitaEnable(enable);
1362 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1363 if ( it != _nbddcs.end() )
1364 ret = it->second->getStreamId();
1371 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1372 if ( it != _nbddcs.end() )
1373 ret = it->second->setStreamId(sid);
1380 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1381 if ( it != _nbddcs.end() )
1382 ret = it->second->getDataPort();
1389 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1390 if ( it != _nbddcs.end() )
1391 ret = it->second->setDataPort(port);
1398 NbddcComponentDict::const_iterator it = _nbddcs.begin();
1399 if ( it != _nbddcs.end() )
1400 ret = it->second->setRateSet(
set);
1406 return _numTransmitter;
1412 for (
int num = _transmitterIndexBase; num < _transmitterIndexBase + _numTransmitter;
1421 TransmitterComponentDict::const_iterator it = _txs.begin();
1422 if ( it != _txs.end() )
1423 ret = it->second->getFrequencyRange();
1430 TransmitterComponentDict::const_iterator it = _txs.begin();
1431 if ( it != _txs.end() )
1432 ret = it->second->getFrequencyRes();
1439 TransmitterComponentDict::const_iterator it = _txs.begin();
1440 if ( it != _txs.end() )
1441 ret = it->second->getFrequencyUnit();
1448 TransmitterComponentDict::const_iterator it = _txs.begin();
1449 if ( it != _txs.end() )
1450 ret = it->second->getAttenuationRange();
1457 TransmitterComponentDict::const_iterator it = _txs.begin();
1458 if ( it != _txs.end() )
1459 ret = it->second->getAttenuationRes();
1466 TransmitterComponentDict::const_iterator it = _txs.find(index);
1467 if ( it != _txs.end() )
1468 ret = it->second->isEnabled();
1475 TransmitterComponentDict::const_iterator it = _txs.find(index);
1476 if ( it != _txs.end() )
1477 ret = it->second->enable(enabled);
1489 TransmitterComponentDict::const_iterator it = _txs.find(index);
1490 if ( it != _txs.end() )
1491 ret = it->second->getFrequency();
1498 TransmitterComponentDict::const_iterator it = _txs.find(index);
1499 if ( it != _txs.end() )
1500 ret = it->second->setFrequency(freq);
1507 TransmitterComponentDict::const_iterator it = _txs.find(index);
1508 if ( it != _txs.end() )
1509 ret = it->second->getAttenuation();
1516 TransmitterComponentDict::const_iterator it = _txs.find(index);
1517 if ( it != _txs.end() )
1518 ret = it->second->setAttenuation(atten);
1525 TransmitterComponentDict::const_iterator it = _txs.find(index);
1526 if ( it != _txs.end() )
1527 ret = it->second->getConfiguration();
1534 TransmitterComponentDict::const_iterator it = _txs.find(index);
1535 if ( it != _txs.end() )
1536 ret = it->second->setConfiguration(cfg);
1543 TransmitterComponentDict::const_iterator it = _txs.begin();
1544 if ( it != _txs.end() )
1545 ret = it->second->supportsCW();
1552 TransmitterComponentDict::const_iterator it = _txs.begin();
1553 if ( it != _txs.end() )
1554 ret = it->second->getCWNum();
1561 TransmitterComponentDict::const_iterator it = _txs.begin();
1562 if ( it != _txs.end() )
1563 ret = it->second->getCWIndexRange();
1570 TransmitterComponentDict::const_iterator it = _txs.begin();
1571 if ( it != _txs.end() )
1572 ret = it->second->getCWFrequencyRange();
1579 TransmitterComponentDict::const_iterator it = _txs.begin();
1580 if ( it != _txs.end() )
1581 ret = it->second->getCWFrequencyRes();
1588 TransmitterComponentDict::const_iterator it = _txs.begin();
1589 if ( it != _txs.end() )
1590 ret = it->second->getCWAmplitudeRange();
1597 TransmitterComponentDict::const_iterator it = _txs.begin();
1598 if ( it != _txs.end() )
1599 ret = it->second->getCWAmplitudeRes();
1606 TransmitterComponentDict::const_iterator it = _txs.begin();
1607 if ( it != _txs.end() )
1608 ret = it->second->getCWPhaseRange();
1615 TransmitterComponentDict::const_iterator it = _txs.begin();
1616 if ( it != _txs.end() )
1617 ret = it->second->getCWPhaseRes();
1624 TransmitterComponentDict::const_iterator it = _txs.begin();
1625 if ( it != _txs.end() )
1626 ret = it->second->supportsCWSweep();
1633 TransmitterComponentDict::const_iterator it = _txs.begin();
1634 if ( it != _txs.end() )
1635 ret = it->second->getCWSweepStartRange();
1642 TransmitterComponentDict::const_iterator it = _txs.begin();
1643 if ( it != _txs.end() )
1644 ret = it->second->getCWSweepStartRes();
1651 TransmitterComponentDict::const_iterator it = _txs.begin();
1652 if ( it != _txs.end() )
1653 ret = it->second->getCWSweepStopRange();
1660 TransmitterComponentDict::const_iterator it = _txs.begin();
1661 if ( it != _txs.end() )
1662 ret = it->second->getCWSweepStopRes();
1669 TransmitterComponentDict::const_iterator it = _txs.begin();
1670 if ( it != _txs.end() )
1671 ret = it->second->getCWSweepStepRange();
1678 TransmitterComponentDict::const_iterator it = _txs.begin();
1679 if ( it != _txs.end() )
1680 ret = it->second->getCWSweepStepRes();
1687 TransmitterComponentDict::const_iterator it = _txs.begin();
1688 if ( it != _txs.end() )
1689 ret = it->second->getCWSweepDwellRange();
1696 TransmitterComponentDict::const_iterator it = _txs.begin();
1697 if ( it != _txs.end() )
1698 ret = it->second->getCWSweepDwellRes();
1705 TransmitterComponentDict::const_iterator it = _txs.find(index);
1706 if ( it != _txs.end() )
1707 ret = it->second->enableCW(cwIndex);
1720 TransmitterComponentDict::const_iterator it = _txs.find(index);
1721 if ( it != _txs.end() )
1722 ret = it->second->getCWConfiguration(cwIndex);
1730 TransmitterComponentDict::const_iterator it = _txs.find(index);
1731 if ( it != _txs.end() )
1732 ret = it->second->setCWConfiguration(cwIndex, cfg);
1739 TransmitterComponentDict::const_iterator it = _txs.find(index);
1740 if ( it != _txs.end() )
1741 ret = it->second->getCWFrequency(cwIndex);
1748 TransmitterComponentDict::const_iterator it = _txs.find(index);
1749 if ( it != _txs.end() )
1750 ret = it->second->setCWFrequency(cwIndex, freq);
1757 TransmitterComponentDict::const_iterator it = _txs.find(index);
1758 if ( it != _txs.end() )
1759 ret = it->second->getCWAmplitude(cwIndex);
1766 TransmitterComponentDict::const_iterator it = _txs.find(index);
1767 if ( it != _txs.end() )
1768 ret = it->second->setCWAmplitude(cwIndex, amp);
1775 TransmitterComponentDict::const_iterator it = _txs.find(index);
1776 if ( it != _txs.end() )
1777 ret = it->second->getCWPhase(cwIndex);
1784 TransmitterComponentDict::const_iterator it = _txs.find(index);
1785 if ( it != _txs.end() )
1786 ret = it->second->setCWPhase(cwIndex, phase);
1793 TransmitterComponentDict::const_iterator it = _txs.find(index);
1794 if ( it != _txs.end() )
1795 ret = it->second->supportsCWSweep(cwIndex);
1802 TransmitterComponentDict::const_iterator it = _txs.find(index);
1803 if ( it != _txs.end() )
1804 ret = it->second->getCWSweepStartFrequency(cwIndex);
1811 TransmitterComponentDict::const_iterator it = _txs.find(index);
1812 if ( it != _txs.end() )
1813 ret = it->second->getCWSweepStopFrequency(cwIndex);
1820 TransmitterComponentDict::const_iterator it = _txs.find(index);
1821 if ( it != _txs.end() )
1822 ret = it->second->getCWSweepFrequencyStep(cwIndex);
1829 TransmitterComponentDict::const_iterator it = _txs.find(index);
1830 if ( it != _txs.end() )
1831 ret = it->second->getCWSweepDwellTime(cwIndex);
1836 double stop,
double step,
double dwell)
1839 TransmitterComponentDict::const_iterator it = _txs.find(index);
1840 if ( it != _txs.end() )
1841 ret = it->second->setCWFrequencySweep(cwIndex, start, stop, step, dwell);
1853 for (
int num = _ducIndexBase; num < _ducIndexBase + _numDuc; num++)
1861 DucComponentDict::const_iterator it = _ducs.begin();
1862 if ( it != _ducs.end() )
1863 ret = it->second->supportsSnapshotLoad();
1870 DucComponentDict::const_iterator it = _ducs.begin();
1871 if ( it != _ducs.end() )
1872 ret = it->second->supportsSnapshotTransmit();
1879 DucComponentDict::const_iterator it = _ducs.find(index);
1880 if ( it != _ducs.end() )
1881 ret = it->second->enable(enabled);
1893 DucComponentDict::const_iterator it = _ducs.find(index);
1894 if ( it != _ducs.end() )
1895 ret = it->second->getConfiguration();
1902 DucComponentDict::const_iterator it = _ducs.find(index);
1903 if ( it != _ducs.end() )
1904 ret = it->second->setConfiguration(cfg);
1911 DucComponentDict::const_iterator it = _ducs.find(index);
1912 if ( it != _ducs.end() )
1913 ret = it->second->getDataPort();
1920 DucComponentDict::const_iterator it = _ducs.find(index);
1921 if ( it != _ducs.end() )
1922 ret = it->second->setDataPort(port);
1929 DucComponentDict::const_iterator it = _ducs.find(index);
1930 if ( it != _ducs.end() )
1931 ret = it->second->getFrequency();
1938 DucComponentDict::const_iterator it = _ducs.find(index);
1939 if ( it != _ducs.end() )
1940 ret = it->second->setFrequency(freq);
1947 DucComponentDict::const_iterator it = _ducs.begin();
1948 if ( it != _ducs.end() )
1949 ret = it->second->getFrequencyRange();
1956 DucComponentDict::const_iterator it = _ducs.begin();
1957 if ( it != _ducs.end() )
1958 ret = it->second->getFrequencyRes();
1965 DucComponentDict::const_iterator it = _ducs.begin();
1966 if ( it != _ducs.end() )
1967 ret = it->second->getFrequencyUnit();
1974 DucComponentDict::const_iterator it = _ducs.find(index);
1975 if ( it != _ducs.end() )
1976 ret = it->second->getAttenuation();
1983 DucComponentDict::const_iterator it = _ducs.find(index);
1984 if ( it != _ducs.end() )
1985 ret = it->second->setAttenuation(atten);
1992 DucComponentDict::const_iterator it = _ducs.begin();
1993 if ( it != _ducs.end() )
1994 ret = it->second->getAttenuationRange();
2001 DucComponentDict::const_iterator it = _ducs.begin();
2002 if ( it != _ducs.end() )
2003 ret = it->second->getAttenuationRes();
2010 DucComponentDict::const_iterator it = _ducs.find(index);
2011 if ( it != _ducs.end() )
2012 ret = it->second->getRateIndex();
2019 DucComponentDict::const_iterator it = _ducs.find(index);
2020 if ( it != _ducs.end() )
2021 ret = it->second->setRateIndex(rateIndex);
2028 DucComponentDict::const_iterator it = _ducs.find(index);
2029 if ( it != _ducs.end() )
2030 ret = it->second->getTxChannelBitmap();
2037 DucComponentDict::const_iterator it = _ducs.find(index);
2038 if ( it != _ducs.end() )
2039 ret = it->second->setTxChannelBitmap(txChannels);
2046 DucComponentDict::const_iterator it = _ducs.find(index);
2047 if ( it != _ducs.end() )
2048 ret = it->second->getMode();
2055 DucComponentDict::const_iterator it = _ducs.find(index);
2056 if ( it != _ducs.end() )
2057 ret = it->second->setMode(mode);
2064 DucComponentDict::const_iterator it = _ducs.find(index);
2065 if ( it != _ducs.end() )
2066 ret = it->second->getStreamId();
2073 DucComponentDict::const_iterator it = _ducs.find(index);
2074 if ( it != _ducs.end() )
2075 ret = it->second->setStreamId(sid);
2080 const std::string& filename,
2081 unsigned int startSample,
2082 unsigned int samples)
2085 DucComponentDict::const_iterator it = _ducs.find(index);
2086 if ( it != _ducs.end() )
2087 if ( it->second->supportsSnapshotLoad() )
2088 ret = it->second->loadSnapshot(filename, startSample, samples);
2095 DucComponentDict::const_iterator it = _ducs.begin();
2096 if ( it != _ducs.end() )
2097 ret = it->second->getRateSet();
2104 DucComponentDict::const_iterator it = _ducs.begin();
2105 if ( it != _ducs.end() )
2106 ret = it->second->getRateList();
2112 return _numWbddcGroups;
2118 for (
int num = _wbddcGroupIndexBase; num < _wbddcGroupIndexBase + _numWbddcGroups; num++)
2126 WbddcGroupComponentDict::const_iterator it = _wbddcGroups.find(index);
2127 if ( it != _wbddcGroups.end() )
2128 ret = it->second->isEnabled();
2135 WbddcGroupComponentDict::const_iterator it = _wbddcGroups.find(index);
2136 if ( it != _wbddcGroups.end() )
2137 ret = it->second->enable(enabled);
2149 WbddcGroupComponentDict::const_iterator it = _wbddcGroups.find(index);
2150 if ( it != _wbddcGroups.end() )
2151 ret = it->second->getConfiguration();
2158 WbddcGroupComponentDict::const_iterator it = _wbddcGroups.find(index);
2159 if ( it != _wbddcGroups.end() )
2160 ret = it->second->setConfiguration(cfg);
2167 WbddcGroupComponentDict::const_iterator it = _wbddcGroups.find(index);
2168 if ( it != _wbddcGroups.end() )
2169 ret = it->second->getMembers();
2176 WbddcGroupComponentDict::const_iterator it = _wbddcGroups.find(index);
2177 if ( it != _wbddcGroups.end() )
2178 ret = it->second->setMembers(groupMembers);
2185 WbddcGroupComponentDict::const_iterator it = _wbddcGroups.find(index);
2186 if ( it != _wbddcGroups.end() )
2187 ret = it->second->addMember(member);
2194 WbddcGroupComponentDict::const_iterator it = _wbddcGroups.find(index);
2195 if ( it != _wbddcGroups.end() )
2196 ret = it->second->removeMember(member);
2202 return _numNbddcGroups;
2208 for (
int num = _nbddcGroupIndexBase; num < _nbddcGroupIndexBase + _numNbddcGroups; num++)
2216 NbddcGroupComponentDict::const_iterator it = _nbddcGroups.find(index);
2217 if ( it != _nbddcGroups.end() )
2218 ret = it->second->isEnabled();
2225 NbddcGroupComponentDict::const_iterator it = _nbddcGroups.find(index);
2226 if ( it != _nbddcGroups.end() )
2227 ret = it->second->enable(enabled);
2239 NbddcGroupComponentDict::const_iterator it = _nbddcGroups.find(index);
2240 if ( it != _nbddcGroups.end() )
2241 ret = it->second->getConfiguration();
2248 NbddcGroupComponentDict::const_iterator it = _nbddcGroups.find(index);
2249 if ( it != _nbddcGroups.end() )
2250 ret = it->second->setConfiguration(cfg);
2257 NbddcGroupComponentDict::const_iterator it = _nbddcGroups.find(index);
2258 if ( it != _nbddcGroups.end() )
2259 ret = it->second->getMembers();
2266 NbddcGroupComponentDict::const_iterator it = _nbddcGroups.find(index);
2267 if ( it != _nbddcGroups.end() )
2268 ret = it->second->setMembers(groupMembers);
2275 NbddcGroupComponentDict::const_iterator it = _nbddcGroups.find(index);
2276 if ( it != _nbddcGroups.end() )
2277 ret = it->second->addMember(member);
2284 NbddcGroupComponentDict::const_iterator it = _nbddcGroups.find(index);
2285 if ( it != _nbddcGroups.end() )
2286 ret = it->second->removeMember(member);
2303 for ( DataPortDict::const_iterator it = _dataPorts.begin();
2304 it != _dataPorts.end(); it++)
2306 ret &= it->second->enableFlowControl(enable);
2315 for ( DataPortDict::iterator it = _dataPorts.begin();
2316 it != _dataPorts.end(); it++)
2318 ret[it->first] = it->second->getConfigurationValueAsBool(
"flowControl");
2326 DataPortDict::const_iterator it = _dataPorts.find(index);
2327 if ( it != _dataPorts.end() )
2328 ret = it->second->getConfiguration();
2335 DataPortDict::const_iterator it = _dataPorts.find(index);
2336 if ( it != _dataPorts.end() )
2337 ret = it->second->setConfiguration(cfg);
2343 std::string ret =
"";
2344 DataPortDict::const_iterator it = _dataPorts.find(index);
2345 if ( it != _dataPorts.end() )
2346 ret = it->second->getSourceIP();
2353 DataPortDict::const_iterator it = _dataPorts.find(index);
2354 if ( it != _dataPorts.end() )
2355 ret = it->second->setSourceIP(ipAddr);
2362 DataPortDict::const_iterator it = _dataPorts.find(index);
2363 if ( it != _dataPorts.end() )
2364 ret = it->second->enableErrors(enabled);
2376 DataPortDict::const_iterator it = _dataPorts.find(index);
2377 if ( it != _dataPorts.end() )
2378 ret = it->second->enableFlowControl(enabled);
2389 std::string ret =
"";
2390 DataPortDict::const_iterator it = _dataPorts.find(index);
2391 if ( it != _dataPorts.end() )
2392 ret = it->second->getDestMACAddress(dipIndex);
2397 const std::string& macAddr)
2400 DataPortDict::const_iterator it = _dataPorts.find(index);
2401 if ( it != _dataPorts.end() )
2402 ret = it->second->setDestMACAddress(dipIndex, macAddr);
2408 std::string ret =
"";
2409 DataPortDict::const_iterator it = _dataPorts.find(index);
2410 if ( it != _dataPorts.end() )
2411 ret = it->second->getDestIPAddress(dipIndex);
2416 const std::string& ipAddr)
2419 DataPortDict::const_iterator it = _dataPorts.find(index);
2420 if ( it != _dataPorts.end() )
2421 ret = it->second->setDestIPAddress(dipIndex, ipAddr);
2427 unsigned int ret = 0;
2428 DataPortDict::const_iterator it = _dataPorts.find(index);
2429 if ( it != _dataPorts.end() )
2430 ret = it->second->getDestSourcePort(dipIndex);
2435 unsigned int sourcePort)
2438 DataPortDict::const_iterator it = _dataPorts.find(index);
2439 if ( it != _dataPorts.end() )
2440 ret = it->second->setDestSourcePort(dipIndex, sourcePort);
2446 unsigned int ret = 0;
2447 DataPortDict::const_iterator it = _dataPorts.find(index);
2448 if ( it != _dataPorts.end() )
2449 ret = it->second->getDestDestPort(dipIndex);
2454 unsigned int destPort)
2457 DataPortDict::const_iterator it = _dataPorts.find(index);
2458 if ( it != _dataPorts.end() )
2459 ret = it->second->setDestDestPort(dipIndex, destPort);
2465 const std::string& ipAddr,
2466 const std::string& macAddr,
2467 unsigned int sourcePort,
2468 unsigned int destPort)
2471 DataPortDict::const_iterator it = _dataPorts.find(index);
2472 if ( it != _dataPorts.end() )
2473 ret = it->second->setDestInfo(dipIndex, ipAddr, macAddr, sourcePort,
2481 if ( _numSimpleIpSetups > 0 )
2483 ret = _simpleIpSetups.at(0)->getConfiguration();
2491 if ( _numSimpleIpSetups > 0 )
2493 ret = _simpleIpSetups.at(0)->setConfiguration(cfg);
2500 std::string ret =
"";
2506 std::string ret =
"";
2518 std::string ret =
"";
2530 std::string ret =
"";
2542 return _defaultDeviceInfo;
2550 _config[
"calibFrequency"] = _calibFrequency;
2551 _config[
"coherentMode"] = _coherentMode;
2552 _config[
"configMode"] = _configMode;
2553 _config[
"referenceMode"] = _referenceMode;
2554 _config[
"bypassMode"] = _referenceBypass;
2555 _config[
"freqNormalization"] = _freqNormalization;
2556 _config[
"gpsEnable"] = _gpsEnabled;
2557 _config[
"referenceTuningVoltage"] = _referenceTuningVoltage;
2564 if ( _config.
hasKey(
"configMode") )
2566 _config[
"configMode"] = _configMode;
2568 if ( _config.
hasKey(
"coherentMode") )
2570 _config[
"coherentMode"] = _coherentMode;
2572 if ( _config.
hasKey(
"freqNormalization") )
2574 _config[
"freqNormalization"] = _freqNormalization;
2576 if ( _config.
hasKey(
"gpsEnable") )
2578 _config[
"gpsEnable"] = _gpsEnabled;
2580 if ( _config.
hasKey(
"referenceMode") )
2582 _config[
"referenceMode"] = _referenceMode;
2584 if ( _config.
hasKey(
"bypassMode") )
2586 _config[
"bypassMode"] = _referenceBypass;
2588 if ( _config.
hasKey(
"referenceTuningVoltage") )
2590 _config[
"referenceTuningVoltage"] = _referenceTuningVoltage;
2592 if ( _config.
hasKey(
"calibFrequency") )
2594 _config[
"calibFrequency"] = _calibFrequency;
2599 bool RadioHandler::queryVersionInfo()
2601 this->
debug(
"[RadioHandler::queryVersionInfo] Called\n");
2602 bool ret = executeQueryIDN(_versionInfo[
"model"], _versionInfo[
"serialNumber"]);
2605 ret = executeQueryVER(_versionInfo[
"softwareVersion"],
2606 _versionInfo[
"firmwareVersion"],
2607 _versionInfo[
"referenceVersion"],
2608 _versionInfo[
"firmwareDate"] );
2611 ret = executeQueryHREV(_versionInfo[
"hardwareVersion"]);
2614 this->
debug(
"[RadioHandler::queryVersionInfo] Returning %s\n",
debugBool(ret));
2617 for (BasicStringStringDict::iterator it = _versionInfo.begin(); it != _versionInfo.end(); it++)
2619 this->
debug(
"[RadioHandler::queryVersionInfo] %s = \"%s\"\n", it->first.c_str(), it->second.c_str());
2625 bool RadioHandler::queryRadioConfiguration()
2628 if ( _config.
hasKey(
"configMode") )
2630 ret &= this->executeConfigModeQuery(_configMode);
2632 if ( _config.
hasKey(
"coherentMode") )
2634 ret &= this->executeCoherentModeQuery(_coherentMode);
2636 if ( _config.
hasKey(
"freqNormalization") )
2638 ret &= this->executeFreqNormalizationQuery(_freqNormalization);
2640 if ( _config.
hasKey(
"gpsEnable") )
2642 ret &= this->executeGpsEnabledQuery(_gpsEnabled);
2644 if ( _config.
hasKey(
"referenceMode") )
2646 ret &= this->executeReferenceModeQuery(_referenceMode);
2648 if ( _config.
hasKey(
"bypassMode") )
2650 ret &= this->executeReferenceBypassQuery(_referenceBypass);
2652 if ( _config.
hasKey(
"referenceTuningVoltage") )
2654 ret &= this->executeReferenceVoltageQuery(_referenceTuningVoltage);
2656 if ( _config.
hasKey(
"calibFrequency") )
2658 ret &= this->executeCalibFrequencyQuery(_calibFrequency);
2667 bool RadioHandler::executeQueryIDN(std::string& model,
2668 std::string& serialNumber)
2675 BasicStringList::iterator it;
2676 for (it = rsp.begin(); it != rsp.end(); it++)
2678 if ( it->find(
" Receiver") != std::string::npos )
2680 else if ( it->find(
"NDR") != std::string::npos )
2682 if ( it->find(
"S/N ") != std::string::npos )
2697 bool RadioHandler::executeQueryVER(std::string& softwareVersion,
2698 std::string& firmwareVersion,
2699 std::string& referenceVersion,
2700 std::string& firmwareDate)
2707 BasicStringList::iterator it;
2708 for (it = rsp.begin(); it != rsp.end(); it++)
2710 if ( it->find(
" REV: ") != std::string::npos )
2712 if ( it->find(
" Date: ") != std::string::npos )
2714 if ( it->find(
"FPGA Rev: ") != std::string::npos )
2716 std::string::size_type pos = it->find(
"Digital Reference Code Version: ");
2717 if ( pos != std::string::npos )
2718 referenceVersion = it->substr(pos+32, std::string::npos);
2740 bool RadioHandler::executeQueryHREV(std::string& hardwareInfo)
2747 std::ostringstream oss;
2748 BasicStringList::iterator it;
2749 for (it = rsp.begin(); it != rsp.end(); it++)
2753 if ( oss.str() !=
"" )
2759 hardwareInfo = oss.str();
2767 bool RadioHandler::executeResetCommand(
int resetType)
2774 bool RadioHandler::executePpsQuery()
2787 bool RadioHandler::executeTimeQuery(std::string& timeStr)
2794 BasicStringList::iterator it;
2795 for (it = rsp.begin(); it != rsp.end(); it++)
2797 if ( it->find(
"UTC ") != std::string::npos )
2806 bool RadioHandler::executeTimeCommand(std::string& timeStr)
2813 BasicStringList::iterator it;
2814 for (it = rsp.begin(); it != rsp.end(); it++)
2816 if ( it->find(
"UTC ") != std::string::npos )
2825 bool RadioHandler::executeGpsTimeQuery(std::string& timeStr)
2832 BasicStringList::iterator it;
2833 for (it = rsp.begin(); it != rsp.end(); it++)
2835 if ( it->find(
"GUTC ") != std::string::npos )
2843 bool RadioHandler::executeConfigModeQuery(
int& configMode)
2845 this->
debug(
"[RadioHandler::executeConfigModeQuery] Called\n");
2849 std::ostringstream oss;
2850 oss <<
"CFG?" <<
"\n";
2858 configMode = boost::lexical_cast<
int>(vec[0]);
2862 this->
debug(
"[RadioHandler::executeConfigModeQuery] Returning %s\n",
2867 bool RadioHandler::executeConfigModeCommand(
int& configMode)
2869 this->
debug(
"[RadioHandler::executeConfigModeCommand] Called\n");
2873 std::ostringstream oss;
2874 oss <<
"CFG " << configMode <<
"\n";
2881 this->
debug(
"[RadioHandler::executeConfigModeCommand] Returning %s\n",
2886 bool RadioHandler::executeCoherentModeQuery(
int& coherentMode)
2888 this->
debug(
"[RadioHandler::executeCoherentModeQuery] Called\n");
2892 std::ostringstream oss;
2893 oss <<
"COH?" <<
"\n";
2903 std::istringstream iss(vec[0]);
2904 iss >> std::hex >> coherentMode;
2908 this->
debug(
"[RadioHandler::executeCoherentModeQuery] Returning %s\n",
2913 bool RadioHandler::executeCoherentModeCommand(
int& coherentMode)
2915 this->
debug(
"[RadioHandler::executeCoherentModeCommand] Called\n");
2919 std::ostringstream oss;
2920 oss <<
"COH " << coherentMode <<
"\n";
2927 this->
debug(
"[RadioHandler::executeCoherentModeCommand] Returning %s\n",
2932 bool RadioHandler::executeFreqNormalizationQuery(
int& fnrMode)
2934 this->
debug(
"[RadioHandler::executeFreqNormalizationQuery] Called\n");
2938 std::ostringstream oss;
2939 oss <<
"FNR?" <<
"\n";
2947 fnrMode = boost::lexical_cast<
int>(vec[0]);
2951 this->
debug(
"[RadioHandler::executeFreqNormalizationQuery] Returning %s\n",
2956 bool RadioHandler::executeFreqNormalizationCommand(
int& fnrMode)
2958 this->
debug(
"[RadioHandler::executeFreqNormalizationCommand] Called\n");
2962 std::ostringstream oss;
2963 oss <<
"FNR " << fnrMode <<
"\n";
2970 this->
debug(
"[RadioHandler::executeFreqNormalizationCommand] Returning %s\n",
2975 bool RadioHandler::executeGpsEnabledQuery(
int& enabled)
2977 this->
debug(
"[RadioHandler::executeGpsEnabledQuery] Called\n");
2981 std::ostringstream oss;
2982 oss <<
"GPS?" <<
"\n";
2990 enabled = boost::lexical_cast<
int>(vec[0]);
2994 this->
debug(
"[RadioHandler::executeGpsEnabledQuery] Returning %s\n",
2999 bool RadioHandler::executeGpsPositionQuery(
double& lat,
double& lon)
3001 this->
debug(
"[RadioHandler::executeGpsPositionQuery] Called\n");
3005 std::ostringstream oss;
3006 oss <<
"GPOS?" <<
"\n";
3015 lat = this->getDecimalDegreesFromNmea(coords[0]);
3016 lon = this->getDecimalDegreesFromNmea(coords[1]);
3020 this->
debug(
"[RadioHandler::executeGpsPositionQuery] Returning %s\n",
3025 bool RadioHandler::executeGpsEnabledCommand(
int& enabled)
3027 this->
debug(
"[RadioHandler::executeGpsEnabledCommand] Called\n");
3031 std::ostringstream oss;
3032 oss <<
"GPS " << enabled <<
"\n";
3039 this->
debug(
"[RadioHandler::executeGpsEnabledCommand] Returning %s\n",
3044 bool RadioHandler::executeReferenceModeQuery(
int& refMode)
3046 this->
debug(
"[RadioHandler::executeReferenceModeQuery] Called\n");
3050 std::ostringstream oss;
3051 oss <<
"REF?" <<
"\n";
3059 refMode = boost::lexical_cast<
int>(vec[0]);
3063 this->
debug(
"[RadioHandler::executeReferenceModeQuery] Returning %s\n",
3068 bool RadioHandler::executeReferenceModeCommand(
int& refMode)
3070 this->
debug(
"[RadioHandler::executeReferenceModeCommand] Called\n");
3074 std::ostringstream oss;
3075 oss <<
"REF " << refMode <<
"\n";
3082 this->
debug(
"[RadioHandler::executeReferenceModeCommand] Returning %s\n",
3087 bool RadioHandler::executeReferenceBypassQuery(
int& bypassMode)
3089 this->
debug(
"[RadioHandler::executeReferenceBypassQuery] Called\n");
3093 std::ostringstream oss;
3094 oss <<
"RBYP?" <<
"\n";
3102 bypassMode = boost::lexical_cast<
int>(vec[0]);
3106 this->
debug(
"[RadioHandler::executeReferenceBypassQuery] Returning %s\n",
3111 bool RadioHandler::executeReferenceBypassCommand(
int& bypassMode)
3113 this->
debug(
"[RadioHandler::executeReferenceBypassCommand] Called\n");
3117 std::ostringstream oss;
3118 oss <<
"RBYP " << bypassMode <<
"\n";
3125 this->
debug(
"[RadioHandler::executeReferenceBypassCommand] Returning %s\n",
3130 bool RadioHandler::executeReferenceVoltageQuery(
int& voltage)
3132 this->
debug(
"[RadioHandler::executeReferenceVoltageQuery] Called\n");
3136 std::ostringstream oss;
3137 oss <<
"RTV?" <<
"\n";
3145 voltage = boost::lexical_cast<
int>(vec[0]);
3149 this->
debug(
"[RadioHandler::executeReferenceVoltageQuery] Returning %s\n",
3154 bool RadioHandler::executeReferenceVoltageCommand(
int& voltage)
3156 this->
debug(
"[RadioHandler::executeReferenceVoltageCommand] Called\n");
3160 std::ostringstream oss;
3161 oss <<
"RTV " << voltage <<
"\n";
3168 this->
debug(
"[RadioHandler::executeReferenceVoltageCommand] Returning %s\n",
3173 bool RadioHandler::executeStatusQuery(
unsigned int& stat)
3175 this->
debug(
"[RadioHandler::executeStatusQuery] Called\n");
3179 std::ostringstream oss;
3180 oss <<
"STAT?" <<
"\n";
3189 std::istringstream iss(vec[0]);
3190 iss >> std::hex >> stat;
3194 this->
debug(
"[RadioHandler::executeStatusQuery] Returning %s\n",
3199 bool RadioHandler::executeTstatusQuery(
unsigned int& stat)
3201 this->
debug(
"[RadioHandler::executeTstatusQuery] Called\n");
3205 std::ostringstream oss;
3206 oss <<
"TSTAT?" <<
"\n";
3215 std::istringstream iss(vec[0]);
3216 iss >> std::hex >> stat;
3220 this->
debug(
"[RadioHandler::executeTstatusQuery] Returning %s\n",
3225 bool RadioHandler::executeTemperatureQuery(
int& temp)
3227 this->
debug(
"[RadioHandler::executeTemperatureQuery] Called\n");
3231 std::ostringstream oss;
3232 oss <<
"TEMP?" <<
"\n";
3240 temp = boost::lexical_cast<
int>(vec[0]);
3244 this->
debug(
"[RadioHandler::executeTemperatureQuery] Returning %s\n",
3249 bool RadioHandler::executeGpioStaticQuery(
int& value)
3251 this->
debug(
"[RadioHandler::executeGpioStaticQuery] Called\n");
3255 std::ostringstream oss;
3256 oss <<
"GPIO?" <<
"\n";
3265 std::istringstream iss(vec[0]);
3266 iss >> std::hex >> value;
3270 this->
debug(
"[RadioHandler::executeGpioStaticQuery] Returning %s\n",
3275 bool RadioHandler::executeGpioSequenceQuery(
int index,
int& value,
3276 int &duration,
int& loop)
3278 this->
debug(
"[RadioHandler::executeGpioSequenceQuery] Called\n");
3282 std::ostringstream oss;
3283 oss <<
"GPIO? " << index <<
"\n";
3293 std::istringstream iss(vec[1]);
3294 iss >> std::hex >> value;
3296 duration = boost::lexical_cast<
int>(vec[2]);
3298 loop = boost::lexical_cast<
int>(vec[3]);
3302 this->
debug(
"[RadioHandler::executeGpioSequenceQuery] Returning %s\n",
3307 bool RadioHandler::executeGpioStaticCommand(
int& value)
3309 this->
debug(
"[RadioHandler::executeGpioStaticCommand] Called\n");
3313 std::ostringstream oss;
3314 oss <<
"GPIO " << value <<
"\n";
3321 this->
debug(
"[RadioHandler::executeGpioStaticCommand] Returning %s\n",
3326 bool RadioHandler::executeGpioSequenceCommand(
int index,
int& value,
3327 int &duration,
int& loop,
3330 this->
debug(
"[RadioHandler::executeGpioSequenceCommand] Called\n");
3334 std::ostringstream oss;
3335 oss <<
"GPIO " << index
3347 this->
debug(
"[RadioHandler::executeGpioSequenceCommand] Returning %s\n",
3352 bool RadioHandler::executeCalibFrequencyQuery(
double& freq)
3354 this->
debug(
"[RadioHandler::executeCalibFrequencyQuery] Called\n");
3358 std::ostringstream oss;
3359 oss <<
"CALF?" <<
"\n";
3367 freq = boost::lexical_cast<
double>(vec[0]);
3371 this->
debug(
"[RadioHandler::executeCalibFrequencyQuery] Returning %s\n",
3376 bool RadioHandler::executeCalibFrequencyCommand(
double& freq)
3378 this->
debug(
"[RadioHandler::executeCalibFrequencyCommand] Called\n");
3382 std::ostringstream oss;
3383 oss <<
"CALF " << freq
3391 this->
debug(
"[RadioHandler::executeCalibFrequencyCommand] Returning %s\n",
3396 double RadioHandler::getDecimalDegreesFromNmea(
const std::string& coord)
3401 if ( (coord[0] ==
'W') || (coord[0] ==
'S') )
3404 std::string::size_type dotPos = coord.find(
'.');
3406 std::string degPart = coord.substr(1, dotPos - 3);
3407 double degs = boost::lexical_cast<
double>(degPart);
3409 std::string minPart = coord.substr(dotPos - 2, std::string::npos);
3410 double mins = boost::lexical_cast<
double>(minPart);
3412 ret = degs + mins / 60.0;
virtual BasicIntList getWbddcIndexRange() const
Gets the range of WBDDC indices on the radio.
virtual BasicDoubleList getTransmitterCWSweepStepRange() const
Gets the CW frequency step range.
virtual ~RadioHandler()
Destroys a RadioHandler object.
virtual BasicIntList getTransmitterCWIndexRange() const
Gets the range of indices for CW tone generators.
virtual bool disableTransmitterCW(int index, int cwIndex)
Disables a given CW tone generator.
virtual BasicDoubleList getTransmitterCWSweepStopRange() const
Gets the CW stop frequency range.
virtual WbddcRateSet getWbddcRateSet() const
Gets the WBDDC rate set.
virtual std::string getDataPortDestMACAddress(int index, int dipIndex) const
Gets the MAC address for a given entry in the destination IP table on a given data port...
virtual bool connect(const std::string &mode, const std::string &host_or_dev, const int port_or_baudrate)
Connects to the radio.
virtual bool setWbddcSource(int index, int source)
Sets the source (which tuner is supplying the signal) for a given WBDDC.
virtual bool setWbddcStreamId(int index, unsigned int sid)
Sets the VITA 49 stream ID for a given WBDDC.
virtual double getWbddcFrequency(int index) const
Gets the tuned frequency for a given WBDDC.
virtual int getNumDataPortDipEntries() const
Gets the number of UDP destination table entries for the 10GigE data ports on the radio...
virtual RadioHandler & operator=(const RadioHandler &other)
Assignment operator for RadioHandler objects.
virtual bool setNbddcGroupConfiguration(int index, ConfigurationDict &cfg)
Sets the configuration dictionary for a given NBDDC group.
virtual bool setReferenceMode(int mode)
Sets the reference mode on the radio.
virtual int getNumNbddc() const
Gets the number of NBDDCs on the radio.
virtual unsigned int getTstatus()
Gets the tuner status from the radio.
virtual BasicDoubleList getDucRateList() const
Gets the list of allowed DUC sample rates, based on the rate set.
virtual double getTransmitterAttenuation(int index) const
Gets the attenuation for a given transmitter.
virtual std::string getDataPortSourceIP(int index) const
Gets the source IP address for a given data port.
virtual bool setTimeAdjustment(int tunerIndex, int timeAdjustValue)
Sets the time adjustment for tuners on the radio.
virtual double getTunerFrequencyUnit() const
Gets the tuned frequency units for tuners.
bool iqSwapped
Whether the I/Q data in the payload are swapped.
virtual bool setWbddcGroupConfiguration(int index, ConfigurationDict &cfg)
Sets the configuration dictionary for a given WBDDC group.
virtual std::string getLastCommandErrorInfo() const
Gets the error information for the last command.
virtual int getNumDataPorts() const
Gets the number of 10GigE data ports on the radio.
virtual double getDucFrequencyRes() const
Gets the tuned frequency resolution for DUCs.
virtual int getWbddcDataPort(int index) const
Gets the data port for a given WBDDC.
virtual bool setNbddcUdpDestination(int index, int dest)
Sets the UDP destination for a given NBDDC.
virtual BasicIntList getNbddcGroupMembers(int index) const
Gets the list of group members for a given NBDDC group.
virtual bool enableTransmitterCW(int index, int cwIndex, bool enabled=true)
Enables a given CW tone generator.
virtual bool isWbddcSelectableSource() const
Gets whether the WBDDCs on this radio support selecting their tuner source.
virtual int getNumWbddc() const
Gets the number of WBDDCs on the radio.
virtual double getTransmitterCWSweepStepRes() const
Gets the CW frequency step resolution.
virtual bool removeWbddcGroupMember(int index, int member)
Removes a WBDDC from the given WBDDC group.
virtual int getDucDataPort(int index) const
Gets the data port for a given DUC.
virtual bool setWbddcVitaEnable(int index, int enable)
Sets the VITA 49 setting for a given WBDDC.
virtual bool setConfiguration(ConfigurationDict &cfg)
Sets the configuration dictionary for this object.
virtual ConfigurationDict getSimpleIPConfiguration() const
Gets the "simple" IP configuration dictionary for radios without 10Gig data ports.
static std::string Strip(const std::string &str, const std::string &chars=" \\\)
Strips both leading and trailing whitespace from the given string.
virtual bool setDucRateIndex(int index, int rateIndex)
Sets the rate index for a given DUC.
virtual double getTransmitterCWSweepDwellRes() const
Gets the CW dwell time resolution.
Class that defines the VITA interface specification for an NDR-class radio.
virtual bool setNbddcSource(int index, int source)
Sets the source (which tuner is supplying the signal) for a given NBDDC.
virtual ConfigurationDict getDucConfiguration(int index) const
Gets the configuration dictionary for a given DUC.
virtual bool setWbddcFrequency(int index, double freq)
Sets the tuned frequency for a given WBDDC.
virtual bool setTransmitterCWConfiguration(int index, int cwIndex, ConfigurationDict &cfg)
Sets the configuration dictionary for a given CW tone generator.
virtual bool hasKey(const std::string &key) const
Determines if the dictionary has the given key.
virtual bool disableTenGigFlowControl()
Disables flow control on all 10GigE data ports.
virtual double getDucFrequency(int index) const
Gets the tuned frequency for a given DUC.
virtual bool setTransmitterCWFrequency(int index, int cwIndex, double freq)
Sets the constant frequency for a given CW tone generator.
virtual bool disableWbddc(int index)
Disables a given WBDDC.
virtual bool setDataPortConfiguration(int index, ConfigurationDict &cfg)
Sets the configuration dictionary for a given data port.
virtual BasicDoubleList getTransmitterCWFrequencyRange() const
Gets the CW frequency range.
virtual bool disableWbddcGroup(int index)
Disables a given WBDDC group.
virtual bool setWbddcDataPort(int index, int port)
Sets the data port for a given WBDDC.
virtual bool setTenGigFlowControlStatus(bool enable)
Sets flow control status on all 10GigE data ports.
virtual bool setNbddcRateIndex(int index, int rateIndex)
Sets the rate index for a given NBDDC.
BASIC_LIST_CONTAINER< double > BasicDoubleList
Type representing a list of doubles.
virtual double getTransmitterCWAmplitudeRes() const
Gets the CW amplitude resolution.
const char * byteOrder
Byte order used by the radio.
virtual bool addWbddcGroupMember(int index, int member)
Adds a WBDDC to the given WBDDC group.
RadioHandler(const std::string &name="NDR", int numTuner=0, int tunerIndexBase=1, int numWbddc=0, int wbddcIndexBase=1, int numNbddc=0, int nbddcIndexBase=1, int numTunerBoards=1, int maxTunerBw=0, int numTransmitter=0, int transmitterIndexBase=1, int numDuc=0, int ducIndexBase=1, int numWbddcGroups=0, int wbddcGroupIndexBase=1, int numNbddcGroups=0, int nbddcGroupIndexBase=1, int numDdcGroups=0, int ddcGroupIndexBase=1, int numDataPorts=0, int dataPortIndexBase=1, int numSimpleIpSetups=0, double adcRate=102.4e6, VitaIfSpec ifSpec=VitaIfSpec(), bool debug=false)
Constructs a RadioHandler object.
virtual NbddcRateSet getNbddcRateSet() const
Gets the NBDDC rate set.
virtual bool setDucConfiguration(int index, ConfigurationDict &cfg)
Sets the configuration dictionary for a given DUC.
virtual ConfigurationDict getTunerConfiguration(int index) const
Gets the configuration dictionary for a given tuner.
virtual bool connect(const std::string &mode, const std::string &host_or_dev, const int port_or_baudrate)
Connects to the radio.
virtual bool isTunerEnabled(int index) const
Gets whether or not a given tuner is enabled.
virtual double getTransmitterFrequency(int index) const
Gets the frequency for a given transmitter.
virtual int getConfigurationValueAsInt(const std::string &key) const
Gets a named configuration value as an integer value.
virtual bool setSimpleSourceIPAddress(const std::string &ipAddr)
Sets the source IP address for radios without 10Gig data ports.
virtual bool setCalibrationFrequency(double freq)
Sets the calibration frequency.
virtual bool disableDataPortFlowControl(int index)
Disables flow control on the data port.
virtual bool setDataPortDestInfo(int index, int dipIndex, const std::string &ipAddr, const std::string &macAddr, unsigned int sourcePort, unsigned int destPort)
Sets the destination table information for a given entry in the DIP table on a given data port...
virtual bool setDucTxChannelBitmap(int index, int txChannels)
Sets the transmit channel bitmap for a given DUC.
virtual BasicDoubleList getDucAttenuationRange() const
Gets the DUC attenuation range.
BASIC_DICT_CONTAINER< int, double > NbddcRateSet
A rate set for a NBDDC.
virtual ConfigurationDict getWbddcConfiguration(int index) const
Gets the configuration dictionary for a given WBDDC.
virtual ConfigurationDict getDataPortConfiguration(int index) const
Gets the configuration dictionary for a given data port.
virtual double getTunerAttenuationRes() const
Gets the attenuation resolution.
virtual void disconnect()
Disconnects from the radio.
virtual bool isConnected() const
Gets whether or not the handler is connected.
virtual BasicDoubleList getTunerFrequencyRange() const
Gets the tunable frequency range.
virtual int getDucMode(int index) const
Gets the mode for a given DUC.
virtual int getDefaultDeviceInfo() const
Gets the default device information.
virtual double getDucAttenuationRes() const
Gets the DUC attenuation resolution.
static std::string Replace(const std::string &str, const std::string &oldstr, const std::string &newstr, int count=INT_MAX)
Replaces occurrences of one substring with another within the given string.
virtual time_t getTimeNow()
Gets the current radio time.
virtual bool setTunerAttenuation(int index, double atten)
Sets the attenuation for a given tuner.
virtual BasicIntBoolDict getTenGigFlowControlStatus()
Gets flow control status on all 10GigE data ports.
virtual double getTunerFrequencyRes() const
Gets the tuned frequency resolution.
virtual BasicIntList getNbddcIndexRange() const
Gets the range of NBDDC indices on the radio.
virtual bool transmitterSupportsCW() const
Gets whether transmitters support continuous-wave (CW) tone generation.
virtual bool isNbddcGroupEnabled(int index) const
Gets whether or not a given NBDDC group is enabled.
virtual int getNbddcSource(int index) const
Gets the source (which tuner is supplying the signal) for a given NBDDC.
virtual bool setTransmitterFrequency(int index, double freq)
Sets the frequency for a given transmitter.
virtual bool setDucFrequency(int index, double freq)
Sets the tuned frequency for a given DUC.
virtual BasicDoubleList getNbddcRateList() const
Gets the list of allowed NBDDC sample rates, based on the rate set.
virtual BasicDoubleList getTransmitterCWSweepStartRange() const
Gets the CW start frequency range.
virtual double getCalibrationFrequency() const
Gets the calibration frequency.
virtual void initConfigurationDict()
Initializes the configuration dictionary, defining the allowed keys.
virtual double getTransmitterCWSweepStopFrequency(int index, int cwIndex) const
Gets the stop frequency for a signal sweep for a given CW tone generator.
virtual double getTransmitterCWSweepStopRes() const
Gets the CW stop frequency resolution.
virtual bool enableDuc(int index, bool enabled)
Enables a given DUC.
virtual int getNbddcDataPort(int index) const
Gets the data port for a given NBDDC.
virtual double getTransmitterFrequencyUnit() const
Gets the frequency unit for transmitters on the radio.
virtual bool setNbddcStreamId(int index, unsigned int sid)
Sets the VITA 49 stream ID for a given NBDDC.
virtual bool ducSupportsSnapshotTransmit() const
Gets whether DUCs support transmitting snapshots.
virtual bool setDataPortDestDestPort(int index, int dipIndex, unsigned int destPort)
Sets the VITA stream ID for a given entry in the destination IP table on a given data port...
virtual bool setWbddcGroupMembers(int index, const BasicIntList &groupMembers)
Sets the list of group members for a given WBDDC group.
static BasicStringList Split(const std::string &str, const std::string &sep, int maxsplit=INT_MAX)
Splits the given string into a list of string tokens.
virtual BasicIntList getNbddcGroupIndexRange() const
Gets the range of NBDDC group indices on the radio.
virtual bool setTransmitterCWPhase(int index, int cwIndex, double phase)
Sets the signal phase for a given CW tone generator.
virtual unsigned int getNbddcStreamId(int index) const
Gets the VITA 49 stream ID for a given NBDDC.
virtual bool setTunerFilter(int index, int filter)
Sets the filter setting for a given tuner.
virtual bool setDataPortSourceIP(int index, const std::string &ipAddr)
Sets the source IP address for a given data port.
virtual bool setWbddcRateIndex(int index, int rateIndex)
Sets the rate index for a given WBDDC.
virtual bool disableDuc(int index)
Disables a given DUC.
virtual bool isNbddcEnabled(int index) const
Gets whether or not a given NBDDC is enabled.
virtual bool addNbddcGroupMember(int index, int member)
Adds a NBDDC to the given NBDDC group.
virtual int getNumTransmitters() const
Gets the number of transmitters on the radio.
virtual BasicDoubleList getTransmitterAttenuationRange() const
Gets the attenuation range for the transmitters on the radio.
virtual int getVitaTailSize() const
Gets the size of the VITA 49 tail.
virtual int getDucTxChannelBitmap(int index) const
Gets the transmit channel bitmap for a given DUC.
virtual std::string getSimpleSourceIPAddress() const
Gets the source IP address for radios without 10Gig data ports.
virtual bool setDucMode(int index, int mode)
Sets the mode for a given DUC.
virtual bool enableNbddcGroup(int index, bool enabled)
Enables a given NBDDC group.
virtual bool disableNbddcGroup(int index)
Disables a given NBDDC group.
virtual double getTransmitterCWSweepDwellTime(int index, int cwIndex) const
Gets the dwell time for a signal sweep for a given CW tone generator.
virtual BasicDoubleList getWbddcFrequencyRange() const
Gets the tunable frequency range for WBDDCs.
virtual int getVitaHeaderSize() const
Gets the size of the VITA 49 header.
Generic radio handler class.
virtual unsigned int getDataPortDestDestPort(int index, int dipIndex) const
Gets the destination UDP port number for a given entry in the destination IP table on a given data po...
virtual std::string getSimpleDestIPAddress() const
Gets the destination IP address for radios without 10Gig data ports.
virtual int getWbddcSource(int index) const
Gets the source (which tuner is supplying the signal) for a given WBDDC.
virtual int debug(const char *format,...)
Outputs debug information.
virtual double getTransmitterFrequencyRes() const
Gets the frequency resolution for transmitters on the radio.
BASIC_LIST_CONTAINER< std::string > BasicStringList
Type representing a list of strings.
virtual bool disableTransmitter(int index)
Disables a given transmitter.
virtual bool isTransmitterEnabled(int index) const
Gets whether a given transmitter is enabled.
virtual double getWbddcFrequencyRes() const
Gets the tuned frequency resolution for WBDDCs.
virtual bool setTransmitterAttenuation(int index, double atten)
Sets the attenuation for a given transmitter.
BASIC_DICT_CONTAINER< int, double > DucRateSet
A rate set for a DUC.
virtual double getTransmitterCWSweepFrequencyStep(int index, int cwIndex) const
Gets the frequency step for a signal sweep for a given CW tone generator.
virtual DucRateSet getDucRateSet() const
Gets the DUC's rate set.
virtual BasicIntList getWbddcGroupMembers(int index) const
Gets the list of group members for a given WBDDC group.
virtual BasicIntList getTunerIndexRange() const
Gets the tuner index range.
virtual int getWbddcRateIndex(int index) const
Gets the rate index for a given WBDDC.
virtual bool setNbddcFrequency(int index, double freq)
Sets the tuned frequency for a given NBDDC.
virtual double getTransmitterCWSweepStartRes() const
Gets the CW start frequency resolution.
virtual ConfigurationDict getNbddcGroupConfiguration(int index) const
Gets the configuration dictionary for a given NBDDC group.
BASIC_DICT_CONTAINER< int, bool > BasicIntBoolDict
Type representing a dictionary of Boolean values, keyed by integers.
Defines functionality for LibCyberRadio applications.
virtual bool ducSupportsSnapshotLoad() const
Gets whether DUCs support loading snapshot files.
virtual bool enableDataPortErrors(int index, bool enabled=true)
Enables errors on the data port.
virtual BasicDoubleList getTransmitterCWPhaseRange() const
Gets the CW phase range.
virtual bool setNbddcDataPort(int index, int port)
Sets the data port for a given NBDDC.
virtual BasicStringStringDict getVersionInfo()
Gets version information for the radio.
int payloadSizeWords
Size of the payload, in 32-byte words.
virtual double getTunerAttenuation(int index) const
Gets the attenuation for a given tuner.
virtual bool isWbddcEnabled(int index) const
Gets whether or not a given WBDDC is enabled.
virtual double getTransmitterCWFrequencyRes() const
Gets the CW frequency resolution.
virtual int getNumWbddcGroups() const
Gets the number of WBDDC groups on the radio.
A configuration dictionary.
virtual double getTransmitterCWSweepStartFrequency(int index, int cwIndex) const
Gets the start frequency for a signal sweep for a given CW tone generator.
BASIC_DICT_CONTAINER< std::string, std::string > BasicStringStringDict
Type representing a dictionary of strings, keyed by string values.
virtual BasicDoubleList getTransmitterCWAmplitudeRange() const
Gets the CW amplitude range.
virtual BasicDoubleList getDucFrequencyRange() const
Gets the tunable frequency range for DUCs.
virtual BasicDoubleList getTransmitterCWSweepDwellRange() const
Gets the CW dwell time range.
virtual bool setSimpleIPConfiguration(ConfigurationDict &cfg)
Sets the "simple" IP configuration dictionary for radios without 10Gig data ports.
virtual bool enableDataPortFlowControl(int index, bool enabled=true)
Enables flow control on the data port.
virtual bool setDataPortDestIPAddress(int index, int dipIndex, const std::string &ipAddr)
Sets the IP address for a given entry in the destination IP table on a given data port...
virtual double getNbddcFrequencyUnit() const
Gets the tuned frequency units for NBDDCs.
virtual std::string getLastCommandErrorInfo() const
Gets the error message from the last command attempted.
virtual double getTransmitterCWPhase(int index, int cwIndex) const
Gets the signal phase for a given CW tone generator.
virtual bool setSimpleDestMACAddress(const std::string &macAddr)
Sets the destination MAC address for radios without 10Gig data ports.
virtual BasicIntList getWbddcGroupIndexRange() const
Gets the range of WBDDC group indices on the radio.
virtual bool setDataPortDestMACAddress(int index, int dipIndex, const std::string &macAddr)
Sets the MAC address for a given entry in the destination IP table on a given data port...
virtual bool setTimeNextPps(bool checkTime=false, bool useGpsTime=false)
Sets the time for the next PPS rising edge on the radio.
virtual BasicIntList getGpioOutputByIndex(int index)
Gets the GPIO output settings for a given sequence index.
virtual bool setDucAttenuation(int index, double atten)
Sets the attenuation for a given DUC.
virtual int getVitaPayloadSize() const
Gets the size of the VITA 49 payload.
virtual int getNumTuner() const
Gets the number of tuners on the radio.
virtual std::string getSimpleDestMACAddress() const
Gets the destination MAC address for radios without 10Gig data ports.
virtual double getWbddcFrequencyUnit() const
Gets the tuned frequency units for WBDDCs.
virtual const char * debugBool(bool x)
Gets a debug output string for a Boolean value.
virtual int getNbddcRateIndex(int index) const
Gets the rate index for a given NBDDC.
virtual time_t getTimeNextPps()
Gets the time for the next PPS rising edge on the radio.
virtual bool setWbddcRateSet(int index, const WbddcRateSet &set)
Sets the rate set for a given WBDDC.
virtual bool disableDataPortErrors(int index)
Disables errors on the data port.
virtual BasicIntList getDataPortIndexRange() const
Gets the range of indices 10GigE data ports on the radio.
virtual bool setTunerFrequency(int index, double freq)
Sets the tuned frequency for a given tuner.
virtual bool setDucStreamId(int index, unsigned int sid)
Sets the VITA 49 stream ID for a given DUC.
virtual bool sendReset(int resetType=0)
Resets the radio.
int headerSizeWords
Size of the VITA 49 header, in 32-byte words.
virtual bool isWbddcGroupEnabled(int index) const
Gets whether or not a given WBDDC group is enabled.
virtual ConfigurationDict getTransmitterCWConfiguration(int index, int cwIndex) const
Gets the configuration for a given CW tone generator.
virtual int getGpioOutput()
Gets the current GPIO output bits.
virtual bool setTunerConfiguration(int index, ConfigurationDict &cfg)
Sets the configuration dictionary for a given tuner.
virtual int getTransmitterCWPhaseRes() const
Gets the CW phase resolution.
virtual ConfigurationDict getNbddcConfiguration(int index) const
Gets the configuration dictionary for a given NBDDC.
virtual Configurable & operator=(const Configurable &other)
Assignment operator for Configurable objects.
virtual int getWbddcVitaEnable(int index) const
Gets the VITA 49 setting for a given WBDDC.
virtual BasicIntList getTransmitterIndexRange() const
Gets the list of transmitter indices on the radio.
virtual bool getPps()
Gets the pulse-per-second (PPS) rising edge from the radio.
virtual void updateConfigurationDict()
Updates the configuration dictionary from object settings.
virtual bool setNbddcConfiguration(int index, ConfigurationDict &cfg)
Sets the configuration dictionary for a given NBDDC.
virtual const char * getByteOrder() const
Gets the byte order (endianness) of the VITA 49.
virtual bool setNbddcRateSet(int index, const NbddcRateSet &set)
Sets the rate set for a given NBDDC.
virtual bool setConfiguration(ConfigurationDict &cfg)
Sets the configuration dictionary for this object.
virtual bool isByteswapped() const
Gets whether the VITA 49 is byte-swapped with respect to the host operating system.
virtual BasicStringList sendCommand(const std::string &cmdString, double timeout=-1)
Sends a command to the radio.
BASIC_DICT_CONTAINER< int, double > WbddcRateSet
A rate set for a WBDDC.
virtual BasicStringStringDict getConnectionInfo()
Gets connection information for the radio.
virtual int getDucRateIndex(int index) const
Gets the rate index for a given DUC.
virtual BasicDoubleList getNbddcFrequencyRange() const
Gets the tunable frequency range for NBDDCs.
virtual bool enableWbddcGroup(int index, bool enabled)
Enables a given WBDDC group.
virtual ConfigurationDict getWbddcGroupConfiguration(int index) const
Gets the configuration dictionary for a given WBDDC group.
Base configurable object class.
virtual bool transmitterSupportsCWSweep() const
Gets whether the transmitter supports CW tone sweeping.
virtual bool setWbddcConfiguration(int index, ConfigurationDict &cfg)
Sets the configuration dictionary for a given WBDDC.
BASIC_LIST_CONTAINER< int > BasicIntList
Type representing a list of integers.
virtual bool setTransmitterConfiguration(int index, ConfigurationDict &cfg)
Sets the configuration dictionary for a given transmitter.
virtual bool enableTuner(int index, bool enabled=true)
Enables a given tuner.
virtual bool enableNbddc(int index, bool enabled=true)
Enables a given NBDDC.
virtual int getNbddcUdpDestination(int index) const
Gets the UDP destination for a given NBDDC.
virtual double getTunerFrequency(int index) const
Gets the tuned frequency for a given tuner.
virtual BasicIntList getDataPortDipEntryIndexRange() const
Gets the list of UDP destination table indices for the 10GigE data ports on the radio.
virtual bool sendCommand(const std::string &cmdString, bool clearRx=true)
Sends a command to the radio over the transport.
virtual unsigned int getWbddcStreamId(int index) const
Gets the VITA 49 stream ID for a given WBDDC.
virtual unsigned int getDataPortDestSourcePort(int index, int dipIndex) const
Gets the source UDP port number for a given entry in the destination IP table on a given data port...
virtual double getTransmitterCWFrequency(int index, int cwIndex) const
Gets the constant frequency for a given CW tone generator.
virtual BasicDoubleList getTransmitterFrequencyRange() const
Gets the frequency range for the transmitters on the radio.
virtual bool enableTransmitter(int index, bool enabled=true)
Enables a given transmitter.
virtual void disconnect()
Disconnects from the radio.
virtual double getDucAttenuation(int index) const
Gets the attenuation for a given DUC.
virtual bool setBypassMode(int mode)
Sets the reference bypass mode on the radio.
virtual BasicStringList receive(double timeout=-1)
Receives a command response from the radio.
virtual bool disableTuner(int index)
Disables a given tuner.
virtual bool setWbddcUdpDestination(int index, int dest)
Sets the UDP destination for a given WBDDC.
virtual int getTransmitterCWNum() const
Gets the number of CW tone generators associated with transmitters on this radio. ...
virtual unsigned int getDucStreamId(int index) const
Gets the VITA 49 stream ID for a given DUC.
virtual int getTemperature()
Gets the current radio temperature.
virtual double getNbddcFrequencyRes() const
Gets the tuned frequency resolution for NBDDCs.
virtual std::string getSimpleSourceMACAddress() const
Gets the source MAC address for radios without 10Gig data ports.
virtual bool isConnected() const
Gets whether the transport is connected.
virtual double getNbddcFrequency(int index) const
Gets the tuned frequency for a given NBDDC.
virtual bool disableNbddc(int index)
Disables a given NBDDC.
virtual int getNumTunerBoards() const
Gets the number of tuner boards on the radio.
virtual int getTunerFilter(int index) const
Gets the filter setting for a given tuner.
virtual int getWbddcUdpDestination(int index) const
Gets the UDP destination for a given WBDDC.
virtual std::string getDataPortDestIPAddress(int index, int dipIndex) const
Gets the IP address for a given entry in the destination IP table on a given data port...
virtual unsigned int getStatus()
Gets the status from the radio.
virtual bool setTransmitterCWAmplitude(int index, int cwIndex, double amp)
Sets the signal amplitude for a given CW tone generator.
virtual ConfigurationDict getTransmitterConfiguration(int index) const
Gets the configuration dictionary for a given transmitter.
virtual bool enableWbddc(int index, bool enabled=true)
Enables a given WBDDC.
virtual int getNbddcVitaEnable(int index) const
Gets the VITA 49 setting for a given NBDDC.
virtual void queryConfiguration()
Tells the radio to query its hardware configuration in order to create its configuration dictionary (...
virtual bool setGpioOutputByIndex(int index, int value, int duration, int loop, int go)
Sets the GPIO output settings for a given sequence index.
virtual int getNumNbddcGroups() const
Gets the number of NBDDC groups on the radio.
virtual bool enableTenGigFlowControl()
Enables flow control on all 10GigE data ports.
virtual bool isIqSwapped() const
Gets whether the VITA 49 format swaps real and imaginary (I and Q) portions of each sample...
virtual double getConfigurationValueAsDbl(const std::string &key) const
Gets a named configuration value as a double value.
int tailSizeWords
Size of the VITA 49 "tail", in 32-byte words.
virtual double getTransmitterAttenuationRes() const
Gets the attenuation resolution for transmitters on the radio.
virtual double getDucFrequencyUnit() const
Gets the tuned frequency units for DUCs.
virtual bool setGpioOutput(int value)
Sets the current GPIO output bits.
virtual bool setDucDataPort(int index, int port)
Sets the data port for a given DUC.
virtual bool setTransmitterCWFrequencySweep(int index, int cwIndex, double start, double stop, double step, double dwell)
Sets the parameters for a frequency sweep for a given CW tone generator.
virtual BasicDoubleList getGpsPosition()
Gets the current GPS position the radio.
virtual bool setDataPortDestSourcePort(int index, int dipIndex, unsigned int sourcePort)
Sets the UDP port number for a given entry in the destination IP table on a given data port...
virtual bool isConnectionModeSupported(const std::string &mode) const
Gets whether the radio supports the given connection mode.
virtual double getAdcRate() const
Gets the ADC sample rate.
virtual bool setNbddcVitaEnable(int index, int enable)
Sets the VITA 49 setting for a given NBDDC.
virtual bool removeNbddcGroupMember(int index, int member)
Removes a NBDDC from the given NBDDC group.
virtual bool loadDucSnapshot(int index, const std::string &filename, unsigned int startSample=0, unsigned int samples=0)
Load a snapshot file into a given DUC's memory block.
virtual bool setSimpleDestIPAddress(const std::string &ipAddr)
Sets the destination IP address for radios without 10Gig data ports.
virtual bool setNbddcGroupMembers(int index, const BasicIntList &groupMembers)
Sets the list of group members for a given NBDDC group.
virtual BasicIntList getDucIndexRange() const
Gets the range of DUC indices on the radio.
virtual BasicDoubleList getWbddcRateList() const
Gets the list of allowed WBDDC sample rates, based on the rate set.
virtual double getTransmitterCWAmplitude(int index, int cwIndex) const
Gets the signal amplitude for a given CW tone generator.
virtual BasicDoubleList getTunerAttenuationRange() const
Gets the tuner attenuation range.
virtual BasicStringList getConnectionModeList() const
Gets the list of connection methods that the radio supports.
virtual int getNumDuc() const
Gets the number of DUCs on the radio.
virtual uint32_t getMessageId(void)
Get a json Message ID.
virtual bool isWbddcTunable() const
Gets whether the WBDDCs on this radio are tunable.