-
Notifications
You must be signed in to change notification settings - Fork 23
/
PlutoSDR_Settings.cpp
719 lines (549 loc) · 19.5 KB
/
PlutoSDR_Settings.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
#include "SoapyPlutoSDR.hpp"
#ifdef HAS_AD9361_IIO
#include <ad9361.h>
#endif
static iio_context *ctx = nullptr;
SoapyPlutoSDR::SoapyPlutoSDR( const SoapySDR::Kwargs &args ):
dev(nullptr), rx_dev(nullptr),tx_dev(nullptr), decimation(false), interpolation(false), rx_stream(nullptr)
{
gainMode = false;
if (args.count("label") != 0)
SoapySDR_logf( SOAPY_SDR_INFO, "Opening %s...", args.at("label").c_str());
if(ctx == nullptr)
{
if(args.count("uri") != 0) {
ctx = iio_create_context_from_uri(args.at("uri").c_str());
}else if(args.count("hostname")!=0){
ctx = iio_create_network_context(args.at("hostname").c_str());
}else{
ctx = iio_create_default_context();
}
}
if (ctx == nullptr) {
SoapySDR_logf(SOAPY_SDR_ERROR, "no device context found.");
throw std::runtime_error("no device context found");
}
dev = iio_context_find_device(ctx, "ad9361-phy");
rx_dev = iio_context_find_device(ctx, "cf-ad9361-lpc");
tx_dev = iio_context_find_device(ctx, "cf-ad9361-dds-core-lpc");
if (dev == nullptr || rx_dev == nullptr || tx_dev == nullptr) {
SoapySDR_logf(SOAPY_SDR_ERROR, "no device found in this context.");
throw std::runtime_error("no device found in this context");
}
this->setAntenna(SOAPY_SDR_RX, 0, "A_BALANCED");
this->setGainMode(SOAPY_SDR_RX, 0, false);
this->setAntenna(SOAPY_SDR_TX, 0, "A");
}
SoapyPlutoSDR::~SoapyPlutoSDR(void){
long long samplerate=0;
if(decimation){
iio_channel_attr_read_longlong(iio_device_find_channel(dev, "voltage0", false),"sampling_frequency",&samplerate);
iio_channel_attr_write_longlong(iio_device_find_channel(rx_dev, "voltage0", false),"sampling_frequency", samplerate);
}
if(interpolation){
iio_channel_attr_read_longlong(iio_device_find_channel(dev, "voltage0", true),"sampling_frequency",&samplerate);
iio_channel_attr_write_longlong(iio_device_find_channel(tx_dev, "voltage0", true),"sampling_frequency", samplerate);
}
if(ctx)
{
iio_context_destroy(ctx);
ctx = nullptr;
}
}
/*******************************************************************
* Identification API
******************************************************************/
std::string SoapyPlutoSDR::getDriverKey( void ) const
{
return "PlutoSDR";
}
std::string SoapyPlutoSDR::getHardwareKey( void ) const
{
return "ADALM-PLUTO";
}
SoapySDR::Kwargs SoapyPlutoSDR::getHardwareInfo( void ) const
{
SoapySDR::Kwargs info;
unsigned int major, minor;
char git_tag[8];
iio_library_get_version(&major, &minor, git_tag);
char lib_ver[100];
snprintf(lib_ver, 100, "%u.%u (git tag: %s)", major, minor, git_tag);
info["library_version"] = lib_ver;
iio_context_get_version(ctx, &major, &minor, git_tag);
char backend_ver[100];
snprintf(backend_ver, 100, "%u.%u (git tag: %s)", major, minor, git_tag);
info["backend_version"] = backend_ver;
unsigned int nb_ctx_attrs = iio_context_get_attrs_count(ctx);
for (unsigned int i = 0; i < nb_ctx_attrs; i++) {
const char *key, *value;
iio_context_get_attr(ctx, i, &key, &value);
info[key] = value;
}
return info;
}
/*******************************************************************
* Channels API
******************************************************************/
size_t SoapyPlutoSDR::getNumChannels( const int dir ) const
{
return(1);
}
bool SoapyPlutoSDR::getFullDuplex( const int direction, const size_t channel ) const
{
return(true);
}
/*******************************************************************
* Sensor API
******************************************************************/
bool SoapyPlutoSDR::is_sensor_channel(struct iio_channel *chn) const
{
return (!iio_channel_is_output(chn) &&
(iio_channel_find_attr(chn, "raw") ||
iio_channel_find_attr(chn, "input")));
}
double SoapyPlutoSDR::double_from_buf(const char *buf) const
{
std::istringstream val_as_string(buf);
val_as_string.imbue(std::locale::classic()); // ignore global C++ locale
double val = 0.0;
val_as_string >> val;
return val;
}
double SoapyPlutoSDR::get_sensor_value(struct iio_channel *chn) const
{
char buf[32];
double val = 0.0;
if (iio_channel_find_attr(chn, "input")) {
if (iio_channel_attr_read(chn, "input", buf, sizeof(buf)) > 0) {
val = double_from_buf(buf);
}
} else {
if (iio_channel_attr_read(chn, "raw", buf, sizeof(buf)) > 0) {
val = double_from_buf(buf);
}
if (iio_channel_find_attr(chn, "offset")) {
if (iio_channel_attr_read(chn, "offset", buf, sizeof(buf)) > 0) {
val += double_from_buf(buf);
}
}
if (iio_channel_find_attr(chn, "scale")) {
if (iio_channel_attr_read(chn, "scale", buf, sizeof(buf)) > 0) {
val *= double_from_buf(buf);
}
}
}
return val / 1000.0;
}
std::string SoapyPlutoSDR::id_to_unit(const std::string& id) const
{
static std::map<std::string, std::string> id_to_unit_table = {
{ "current", "A" },
{ "power", "W" },
{ "temp", "C" },
{ "voltage", "V" },
};
for (auto it_match : id_to_unit_table) {
//if the id starts with a known prefix, retreive its unit.
if (id.substr(0, it_match.first.size()) == it_match.first) {
return it_match.second;
}
}
return std::string();
}
std::vector<std::string> SoapyPlutoSDR::listSensors(void) const
{
/*
iio:device2: xadc
10 channels found:
temp0: (input)
voltage0: vccint (input)
voltage1: vccaux (input)
voltage2: vccbram (input)
voltage3: vccpint (input)
voltage4: vccpaux (input)
voltage5: vccoddr (input)
voltage6: vrefp (input)
voltage7: vrefn (input)
voltage8: (input)
iio:device0: adm1177
2 channels found:
current0: (input)
voltage0: (input)
iio:device1: ad9361-phy
9 channels found:
temp0: (input)
voltage2: (input)
*/
std::vector<std::string> sensors;
sensors.push_back("xadc_temp0");
sensors.push_back("xadc_voltage0");
sensors.push_back("xadc_voltage1");
sensors.push_back("xadc_voltage2");
sensors.push_back("xadc_voltage3");
sensors.push_back("xadc_voltage4");
sensors.push_back("xadc_voltage5");
sensors.push_back("xadc_voltage6");
sensors.push_back("xadc_voltage7");
sensors.push_back("xadc_voltage8");
sensors.push_back("adm1177_current0");
sensors.push_back("adm1177_voltage0");
sensors.push_back("ad9361-phy_temp0");
sensors.push_back("ad9361-phy_voltage2");
return sensors;
}
SoapySDR::ArgInfo SoapyPlutoSDR::getSensorInfo(const std::string &key) const
{
SoapySDR::ArgInfo info;
std::size_t dash = key.find("_");
if (dash < std::string::npos)
{
std::string deviceStr = key.substr(0, dash);
std::string channelStr = key.substr(dash + 1);
iio_device *dev = iio_context_find_device(ctx, deviceStr.c_str());
if (!dev)
return info;
iio_channel *chn = iio_device_find_channel(dev, channelStr.c_str(), false);
if (!chn)
return info;
const char *name = iio_channel_get_name(chn);
info.key = key;
if (name)
info.name = name;
info.type = SoapySDR::ArgInfo::FLOAT;
info.value = "0.0";
info.units = id_to_unit(channelStr);
}
return info;
}
std::string SoapyPlutoSDR::readSensor(const std::string &key) const
{
std::string sensorValue;
std::size_t dash = key.find("_");
if (dash < std::string::npos)
{
std::string deviceStr = key.substr(0, dash);
std::string channelStr = key.substr(dash + 1);
iio_device *dev = iio_context_find_device(ctx, deviceStr.c_str());
if (!dev)
return sensorValue;
iio_channel *chn = iio_device_find_channel(dev, channelStr.c_str(), false);
if (!chn)
return sensorValue;
double value = get_sensor_value(chn);
sensorValue.assign(std::to_string(value));
}
return sensorValue;
}
/*******************************************************************
* Settings API
******************************************************************/
SoapySDR::ArgInfoList SoapyPlutoSDR::getSettingInfo(void) const
{
SoapySDR::ArgInfoList setArgs;
return setArgs;
}
void SoapyPlutoSDR::writeSetting(const std::string &key, const std::string &value)
{
}
std::string SoapyPlutoSDR::readSetting(const std::string &key) const
{
std::string info;
return info;
}
/*******************************************************************
* Antenna API
******************************************************************/
std::vector<std::string> SoapyPlutoSDR::listAntennas( const int direction, const size_t channel ) const
{
std::vector<std::string> options;
if(direction == SOAPY_SDR_RX) options.push_back( "A_BALANCED" );
if(direction == SOAPY_SDR_TX) options.push_back( "A" );
return(options);
}
void SoapyPlutoSDR::setAntenna( const int direction, const size_t channel, const std::string &name )
{
if (direction == SOAPY_SDR_RX) {
std::lock_guard<pluto_spin_mutex> lock(rx_device_mutex);
iio_channel_attr_write(iio_device_find_channel(dev, "voltage0", false), "rf_port_select", name.c_str());
}
else if (direction == SOAPY_SDR_TX) {
std::lock_guard<pluto_spin_mutex> lock(tx_device_mutex);
iio_channel_attr_write(iio_device_find_channel(dev, "voltage0", true), "rf_port_select", name.c_str());
}
}
std::string SoapyPlutoSDR::getAntenna( const int direction, const size_t channel ) const
{
std::string options;
if (direction == SOAPY_SDR_RX) {
options = "A_BALANCED";
}
else if (direction == SOAPY_SDR_TX) {
options = "A";
}
return options;
}
/*******************************************************************
* Frontend corrections API
******************************************************************/
bool SoapyPlutoSDR::hasDCOffsetMode( const int direction, const size_t channel ) const
{
return(false);
}
/*******************************************************************
* Gain API
******************************************************************/
std::vector<std::string> SoapyPlutoSDR::listGains( const int direction, const size_t channel ) const
{
std::vector<std::string> options;
options.push_back("PGA");
return(options);
}
bool SoapyPlutoSDR::hasGainMode(const int direction, const size_t channel) const
{
if (direction == SOAPY_SDR_RX)
return true;
return false;
}
void SoapyPlutoSDR::setGainMode( const int direction, const size_t channel, const bool automatic )
{
gainMode = automatic;
if(direction==SOAPY_SDR_RX){
std::lock_guard<pluto_spin_mutex> lock(rx_device_mutex);
if (gainMode) {
iio_channel_attr_write(iio_device_find_channel(dev, "voltage0", false), "gain_control_mode", "slow_attack");
}else{
iio_channel_attr_write(iio_device_find_channel(dev, "voltage0", false), "gain_control_mode", "manual");
}
}
}
bool SoapyPlutoSDR::getGainMode(const int direction, const size_t channel) const
{
return gainMode;
}
void SoapyPlutoSDR::setGain( const int direction, const size_t channel, const double value )
{
long long gain = (long long) value;
if(direction==SOAPY_SDR_RX){
std::lock_guard<pluto_spin_mutex> lock(rx_device_mutex);
iio_channel_attr_write_longlong(iio_device_find_channel(dev, "voltage0", false),"hardwaregain", gain);
}
else if(direction==SOAPY_SDR_TX){
std::lock_guard<pluto_spin_mutex> lock(tx_device_mutex);
gain = gain - 89;
iio_channel_attr_write_longlong(iio_device_find_channel(dev, "voltage0", true),"hardwaregain", gain);
}
}
void SoapyPlutoSDR::setGain( const int direction, const size_t channel, const std::string &name, const double value )
{
this->setGain(direction,channel,value);
}
double SoapyPlutoSDR::getGain( const int direction, const size_t channel, const std::string &name ) const
{
long long gain = 0;
if(direction==SOAPY_SDR_RX){
std::lock_guard<pluto_spin_mutex> lock(rx_device_mutex);
if(iio_channel_attr_read_longlong(iio_device_find_channel(dev, "voltage0", false),"hardwaregain",&gain )!=0)
return 0;
}
else if(direction==SOAPY_SDR_TX){
std::lock_guard<pluto_spin_mutex> lock(tx_device_mutex);
if(iio_channel_attr_read_longlong(iio_device_find_channel(dev, "voltage0", true),"hardwaregain",&gain )!=0)
return 0;
gain = gain + 89;
}
return double(gain);
}
SoapySDR::Range SoapyPlutoSDR::getGainRange( const int direction, const size_t channel, const std::string &name ) const
{
if(direction==SOAPY_SDR_RX)
return(SoapySDR::Range(0, 73));
return(SoapySDR::Range(0,89));
}
/*******************************************************************
* Frequency API
******************************************************************/
void SoapyPlutoSDR::setFrequency( const int direction, const size_t channel, const std::string &name, const double frequency, const SoapySDR::Kwargs &args )
{
long long freq = (long long)frequency;
if(direction==SOAPY_SDR_RX){
std::lock_guard<pluto_spin_mutex> lock(rx_device_mutex);
iio_channel_attr_write_longlong(iio_device_find_channel(dev, "altvoltage0", true),"frequency", freq);
}
else if(direction==SOAPY_SDR_TX){
std::lock_guard<pluto_spin_mutex> lock(tx_device_mutex);
iio_channel_attr_write_longlong(iio_device_find_channel(dev, "altvoltage1", true),"frequency", freq);
}
}
double SoapyPlutoSDR::getFrequency( const int direction, const size_t channel, const std::string &name ) const
{
long long freq = 0;
if(direction==SOAPY_SDR_RX){
std::lock_guard<pluto_spin_mutex> lock(rx_device_mutex);
if(iio_channel_attr_read_longlong(iio_device_find_channel(dev, "altvoltage0", true),"frequency",&freq )!=0)
return 0;
}
else if(direction==SOAPY_SDR_TX){
std::lock_guard<pluto_spin_mutex> lock(tx_device_mutex);
if(iio_channel_attr_read_longlong(iio_device_find_channel(dev, "altvoltage1", true),"frequency",&freq )!=0)
return 0;
}
return double(freq);
}
SoapySDR::ArgInfoList SoapyPlutoSDR::getFrequencyArgsInfo(const int direction, const size_t channel) const
{
SoapySDR::ArgInfoList freqArgs;
return freqArgs;
}
std::vector<std::string> SoapyPlutoSDR::listFrequencies( const int direction, const size_t channel ) const
{
std::vector<std::string> names;
names.push_back( "RF" );
return(names);
}
SoapySDR::RangeList SoapyPlutoSDR::getFrequencyRange( const int direction, const size_t channel, const std::string &name ) const
{
return(SoapySDR::RangeList( 1, SoapySDR::Range( 70000000, 6000000000ull ) ) );
}
/*******************************************************************
* Sample Rate API
******************************************************************/
void SoapyPlutoSDR::setSampleRate( const int direction, const size_t channel, const double rate )
{
long long samplerate =(long long) rate;
#ifdef HAS_AD9361_IIO
int const fir = 4; // assume ad9361_set_bb_rate() will load x4 FIR if needed
#else
int const fir = 1;
#endif
// note: sample rates below 25e6/12 need x8 decimation/interpolation or x4 FIR to 25e6/48,
// below 25e6/96 need x8 decimation/interpolation and x4 FIR, minimum is 25e6/384
// if libad9361 is available it will load an approporiate FIR.
if(direction==SOAPY_SDR_RX){
std::lock_guard<pluto_spin_mutex> lock(rx_device_mutex);
decimation = false;
if (samplerate < (25e6 / (12 * fir))) {
if (samplerate * 8 < (25e6 / 48)) {
SoapySDR_logf(SOAPY_SDR_CRITICAL, "sample rate is not supported.");
}
else if (samplerate * 8 < (25e6 / 12)) {
SoapySDR_logf(SOAPY_SDR_NOTICE, "sample rate needs a FIR setting loaded.");
}
decimation = true;
samplerate = samplerate * 8;
}
iio_channel_attr_write_longlong(iio_device_find_channel(dev, "voltage0", false),"sampling_frequency", samplerate);
iio_channel_attr_write_longlong(iio_device_find_channel(rx_dev, "voltage0", false), "sampling_frequency", decimation?samplerate/8:samplerate);
if(rx_stream)
rx_stream->set_buffer_size_by_samplerate(decimation ? samplerate / 8 : samplerate);
}
else if(direction==SOAPY_SDR_TX){
std::lock_guard<pluto_spin_mutex> lock(tx_device_mutex);
interpolation = false;
if (samplerate < (25e6 / (12 * fir))) {
if (samplerate * 8 < (25e6 / 48)) {
SoapySDR_logf(SOAPY_SDR_CRITICAL, "sample rate is not supported.");
}
else if (samplerate * 8 < (25e6 / 12)) {
SoapySDR_logf(SOAPY_SDR_NOTICE, "sample rate needs a FIR setting loaded.");
}
interpolation = true;
samplerate = samplerate * 8;
}
iio_channel_attr_write_longlong(iio_device_find_channel(dev, "voltage0", true),"sampling_frequency", samplerate);
iio_channel_attr_write_longlong(iio_device_find_channel(tx_dev, "voltage0", true), "sampling_frequency", interpolation?samplerate / 8:samplerate);
}
#ifdef HAS_AD9361_IIO
if(ad9361_set_bb_rate(dev,(unsigned long)samplerate))
SoapySDR_logf(SOAPY_SDR_ERROR, "Unable to set BB rate.");
#endif
}
double SoapyPlutoSDR::getSampleRate( const int direction, const size_t channel ) const
{
long long samplerate = 0;
if(direction==SOAPY_SDR_RX){
std::lock_guard<pluto_spin_mutex> lock(rx_device_mutex);
if(iio_channel_attr_read_longlong(iio_device_find_channel(rx_dev, "voltage0", false),"sampling_frequency",&samplerate )!=0)
return 0;
}
else if(direction==SOAPY_SDR_TX){
std::lock_guard<pluto_spin_mutex> lock(tx_device_mutex);
if(iio_channel_attr_read_longlong(iio_device_find_channel(tx_dev, "voltage0", true),"sampling_frequency",&samplerate)!=0)
return 0;
}
return double(samplerate);
}
std::vector<double> SoapyPlutoSDR::listSampleRates( const int direction, const size_t channel ) const
{
std::vector<double> options;
options.push_back(65105);//25M/48/8+1
options.push_back(1e6);
options.push_back(2e6);
options.push_back(3e6);
options.push_back(4e6);
options.push_back(5e6);
options.push_back(6e6);
options.push_back(7e6);
options.push_back(8e6);
options.push_back(9e6);
options.push_back(10e6);
return(options);
}
SoapySDR::RangeList SoapyPlutoSDR::getSampleRateRange( const int direction, const size_t channel ) const
{
SoapySDR::RangeList results;
// note that there are some gaps and rounding errors since we get truncated values form IIO
// e.g. 25e6/12 = 2083333.333 is read as 2083333 but written as 2083334
#ifdef HAS_AD9361_IIO
// assume ad9361_set_bb_rate(), if available, will load x4 FIR as needed
// below 25e6/96 needs x8 decimation/interpolation and x4 FIR, minimum is 25e6/384
results.push_back(SoapySDR::Range(25e6 / 384, 61440000));
#else
// sample rates below 25e6/12 need x8 decimation/interpolation (or x4 FIR to 25e6/48)
results.push_back(SoapySDR::Range(25e6 / 96, 61440000));
#endif
return results;
}
void SoapyPlutoSDR::setBandwidth( const int direction, const size_t channel, const double bw )
{
long long bandwidth = (long long) bw;
if(direction==SOAPY_SDR_RX){
std::lock_guard<pluto_spin_mutex> lock(rx_device_mutex);
iio_channel_attr_write_longlong(iio_device_find_channel(dev, "voltage0", false),"rf_bandwidth", bandwidth);
}
else if(direction==SOAPY_SDR_TX){
std::lock_guard<pluto_spin_mutex> lock(tx_device_mutex);
iio_channel_attr_write_longlong(iio_device_find_channel(dev, "voltage0", true),"rf_bandwidth", bandwidth);
}
}
double SoapyPlutoSDR::getBandwidth( const int direction, const size_t channel ) const
{
long long bandwidth = 0;
if(direction==SOAPY_SDR_RX){
std::lock_guard<pluto_spin_mutex> lock(rx_device_mutex);
if(iio_channel_attr_read_longlong(iio_device_find_channel(dev, "voltage0", false),"rf_bandwidth",&bandwidth )!=0)
return 0;
}
else if(direction==SOAPY_SDR_TX){
std::lock_guard<pluto_spin_mutex> lock(tx_device_mutex);
if(iio_channel_attr_read_longlong(iio_device_find_channel(dev, "voltage0", true),"rf_bandwidth",&bandwidth )!=0)
return 0;
}
return double(bandwidth);
}
std::vector<double> SoapyPlutoSDR::listBandwidths( const int direction, const size_t channel ) const
{
std::vector<double> options;
options.push_back(0.2e6);
options.push_back(1e6);
options.push_back(2e6);
options.push_back(3e6);
options.push_back(4e6);
options.push_back(5e6);
options.push_back(6e6);
options.push_back(7e6);
options.push_back(8e6);
options.push_back(9e6);
options.push_back(10e6);
return(options);
}