forked from pothosware/SoapyAirspyHF
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Settings.cpp
684 lines (549 loc) · 21.3 KB
/
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
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Charles J. Cliffe
* Copyright (c) 2018 Corey Stotts
* Copyright (c) 2022 Albin Stigö
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "SoapyAirspyHF.hpp"
// Driver constructor
SoapyAirspyHF::SoapyAirspyHF(const SoapySDR::Kwargs &args)
: device_(nullptr), sampleRate_(0), frequencyCorrection_(0), iqBalance_(0)
{
int ret = 0;
SoapySDR_setLogLevel(SoapySDR::LogLevel::SOAPY_SDR_DEBUG);
if (args.count("serial")) {
// For storing serial as hex
std::stringstream serialstr;
try {
// Parse hex to serial number
serial_ = std::stoull(args.at("serial"), nullptr, 16);
SoapySDR::logf(SOAPY_SDR_INFO, "Serial number: %016llX", serial_);
} catch (const std::invalid_argument &) {
throw std::runtime_error("serial is not a hex number");
} catch (const std::out_of_range &) {
throw std::runtime_error("serial value of out range");
}
// Serial to hex
serialstr << std::hex << serial_;
// Open device
ret = airspyhf_open_sn(&device_, serial_);
if (ret != AIRSPYHF_SUCCESS) {
SoapySDR_logf(SOAPY_SDR_ERROR, "airspyhf_open_sn() failed: (%d)", ret);
throw std::runtime_error("Unable to open AirspyHF device with S/N " +
serialstr.str());
}
SoapySDR::logf(SOAPY_SDR_INFO, "Found AirspyHF device: serial = %s",
serialstr.str().c_str());
} else {
// No serial, open first device
ret = airspyhf_open(&device_);
if (ret != AIRSPYHF_SUCCESS) {
throw std::runtime_error("Unable to open AirspyHF device");
}
}
// Set first sample rate as default
auto const &rates = listSampleRates(SOAPY_SDR_RX, 0);
setSampleRate(SOAPY_SDR_RX, 0, rates.front());
setFrequency(SOAPY_SDR_RX, 0, "RF", 7000000);
// Default to no gain
setGain(SOAPY_SDR_RX, 0, 0);
// And no AGC
setGainMode(SOAPY_SDR_RX, 0, false);
// Enables/Disables the IQ Correction, IF shift and Fine Tuning.
ret = airspyhf_set_lib_dsp(device_, 1);
if (ret != AIRSPYHF_SUCCESS) {
SoapySDR_logf(SOAPY_SDR_ERROR, "airspyhf_set_lib_dsp() failed: (%d)", ret);
}
// Apply arguments to settings when they match
for (const auto &info : getSettingInfo()) {
const auto it = args.find(info.key);
if (it != args.end()) {
writeSetting(it->first, it->second);
}
}
}
SoapyAirspyHF::~SoapyAirspyHF(void) {
int ret;
ret = airspyhf_close(device_);
if (ret != AIRSPYHF_SUCCESS) {
SoapySDR_logf(SOAPY_SDR_ERROR, "airspyhf_close() failed: %d", ret);
}
}
/*******************************************************************
* Identification API
******************************************************************/
std::string SoapyAirspyHF::getDriverKey(void) const { return "AirspyHF"; }
std::string SoapyAirspyHF::getHardwareKey(void) const { return "AirspyHF"; }
SoapySDR::Kwargs SoapyAirspyHF::getHardwareInfo(void) const {
// key/value pairs for any useful information
// this also gets printed in --probe
SoapySDR::Kwargs args;
std::stringstream serialstr;
serialstr.str("");
serialstr << std::hex << serial_;
args["serial"] = serialstr.str();
return args;
}
/*******************************************************************
* Channels API
******************************************************************/
size_t SoapyAirspyHF::getNumChannels(const int dir) const {
return (dir == SOAPY_SDR_RX) ? 1 : 0;
}
/*******************************************************************
* Antenna API
******************************************************************/
std::vector<std::string>
SoapyAirspyHF::listAntennas(const int direction, const size_t channel) const {
std::vector<std::string> antennas;
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "listAntennas(%d, %d) not supported.",
direction, channel);
return antennas;
}
antennas.push_back("RX");
return antennas;
}
void SoapyAirspyHF::setAntenna(const int direction, const size_t channel,
const std::string &name) {
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "setAntenna(%d, %d, %s) not supported.",
direction, channel, name.c_str());
return;
}
SoapySDR_logf(SOAPY_SDR_DEBUG, "setAntenna(%d, %d, %s) ignored.", direction,
channel, name.c_str());
}
std::string SoapyAirspyHF::getAntenna(const int direction,
const size_t channel) const {
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "getAntenna(%d, %d) not supported.",
direction, channel);
return "";
}
return "RX";
}
/*******************************************************************
* Frontend corrections API
******************************************************************/
bool SoapyAirspyHF::hasDCOffsetMode(const int direction,
const size_t channel) const {
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "hasDCOffsetMode(%d, %d) not supported.",
direction, channel);
return false;
}
return false;
}
bool SoapyAirspyHF::hasIQBalance(const int direction,
const size_t channel) const {
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "hasIQBalance(%d, %d) not supported.",
direction, channel);
return false;
}
return true;
}
void SoapyAirspyHF::setIQBalance(const int direction, const size_t channel,
const std::complex<double> &balance) {
int ret = 0;
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "setIQBalance(%d, %d) not supported.",
direction, channel);
return;
}
if (iqBalance_ != balance) {
// TODO
ret = airspyhf_set_optimal_iq_correction_point(device_, 0);
if (ret != AIRSPYHF_SUCCESS) {
SoapySDR::logf(SOAPY_SDR_ERROR,
"airspyhf_set_optimal_iq_correction_point() failed: %d",
ret);
} else {
iqBalance_ = balance;
}
}
}
std::complex<double> SoapyAirspyHF::getIQBalance(const int direction,
const size_t channel) const {
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "getIQBalance(%d, %d) not supported.",
direction, channel);
return std::complex<double>(0, 0);
}
return iqBalance_;
}
bool SoapyAirspyHF::hasFrequencyCorrection(const int direction,
const size_t channel) const {
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR,
"hasFrequencyCorrection(%d, %d) not supported.", direction,
channel);
return false;
}
return true;
}
void SoapyAirspyHF::setFrequencyCorrection(const int direction,
const size_t channel,
const double value) {
SoapySDR::logf(SOAPY_SDR_DEBUG, "setFrequencyCorrection(%d, %d, %f).",
direction, channel, value);
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR,
"setFrequencyCorrection(%d, %d) not supported.", direction,
channel);
return;
}
// Convert from PPM to PPB
const int32_t correction_ppb = static_cast<int>(std::round(value * 1000));
if (frequencyCorrection_ != correction_ppb) {
int ret = airspyhf_set_calibration(device_, correction_ppb);
if (ret != AIRSPYHF_SUCCESS) {
SoapySDR::logf(SOAPY_SDR_ERROR, "airspyhf_set_calibration() failed: %d",
ret);
} else {
frequencyCorrection_ = correction_ppb;
}
}
}
double SoapyAirspyHF::getFrequencyCorrection(const int direction,
const size_t channel) const {
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR,
"getFrequencyCorrection(%d, %d) not supported.", direction,
channel);
return 0;
}
// Convert from PPB to PPM
return frequencyCorrection_ / 1000.0;
}
/*******************************************************************
* Gain API
******************************************************************/
std::vector<std::string> SoapyAirspyHF::listGains(const int direction,
const size_t channel) const {
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "listGains(%d, %d) not supported.",
direction, channel);
return {};
}
return {"LNA", "HF_ATT"};
}
bool SoapyAirspyHF::hasGainMode(const int direction,
const size_t channel) const {
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "hasGainMode(%d, %d) not supported.",
direction, channel);
return false;
}
// True means we have an automatic gain mode
return true;
}
void SoapyAirspyHF::setGainMode(const int direction, const size_t channel,
const bool automatic) {
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "setGainMode(%d, %d, %d) not supported.",
direction, channel, automatic);
return;
}
if (agcEnabled_ != automatic) {
SoapySDR::logf(SOAPY_SDR_DEBUG, "setGainMode(%d, %d, %d)", direction,
channel, automatic);
int ret = airspyhf_set_hf_agc(device_, automatic);
if (ret != AIRSPYHF_SUCCESS) {
SoapySDR::logf(SOAPY_SDR_ERROR, "airspyhf_set_hf_att() failed: %d", ret);
} else {
agcEnabled_ = automatic;
}
}
}
bool SoapyAirspyHF::getGainMode(const int direction,
const size_t channel) const {
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "getGainMode(%d, %d) not supported.",
direction, channel);
return false;
}
return agcEnabled_;
}
SoapySDR::Range SoapyAirspyHF::getGainRange(const int direction,
const size_t channel,
const std::string &name) const {
if (name == "LNA") {
return SoapySDR::Range(0, 6, 6);
} else if (name == "HF_ATT") {
// I think it makes more sense with negative values when it's an attenuator
// but I'm not sure it will work will all software.
return SoapySDR::Range(-48, 0, 6);
} else {
SoapySDR::logf(SOAPY_SDR_ERROR, "getGainRange(%d, %d, %s) not supported.",
direction, channel, name.c_str());
return SoapySDR::Range(0, 0);
}
}
double SoapyAirspyHF::getGain(const int direction, const size_t channel,
const std::string &name) const {
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "getGain(%d, %d, %s) not supported.",
direction, channel, name.c_str());
return 0;
}
if (name == "LNA") {
return lnaGain_;
} else if (name == "HF_ATT") {
return hfAttenuation_;
} else {
SoapySDR::logf(SOAPY_SDR_ERROR, "getGain(%d, %d, %s) not supported.",
direction, channel, name.c_str());
return 0;
}
}
void SoapyAirspyHF::setGain(const int direction, const size_t channel,
const double value) {
// I think the default implementation will try to distribute gain.
SoapySDR::Device::setGain(direction, channel, value);
}
void SoapyAirspyHF::setGain(const int direction, const size_t channel,
const std::string &name, const double value) {
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "setGain(%d, %d, %s, %f) not supported.",
direction, channel, name.c_str(), value);
return;
}
int ret = 0;
if (name == "LNA") {
ret = airspyhf_set_hf_lna(device_, value > 3 ? 1 : 0);
if (ret != AIRSPYHF_SUCCESS) {
SoapySDR::logf(SOAPY_SDR_ERROR, "airspyhf_set_hf_lna() failed: %d", ret);
} else {
lnaGain_ = value;
}
} else if (name == "HF_ATT") {
const uint8_t att = static_cast<uint8_t>(std::round(value / -6));
SoapySDR::logf(SOAPY_SDR_DEBUG, "setGain(%d, %d, %s, %f) -> %d", direction,
channel, name.c_str(), value, att);
ret = airspyhf_set_hf_att(device_, att);
if (ret != AIRSPYHF_SUCCESS) {
SoapySDR::logf(SOAPY_SDR_ERROR, "airspyhf_set_hf_att() failed: %d", ret);
} else {
hfAttenuation_ = value;
}
} else {
SoapySDR::logf(SOAPY_SDR_ERROR, "setGain(%d, %d, %s, %f) not supported.",
direction, channel, name.c_str(), value);
}
}
/*******************************************************************
* Frequency API
******************************************************************/
void SoapyAirspyHF::setFrequency(const int direction, const size_t channel,
const std::string &name,
const double frequency,
const SoapySDR::Kwargs &args) {
(void)args; // Currently unused. TODO.
int ret = 0;
if (direction != SOAPY_SDR_RX or name != "RF" or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR,
"setFrequency(%d, %d, %s, %f) not supported.", direction,
channel, name.c_str(), frequency);
return;
}
centerFrequency_ = (uint32_t)frequency;
SoapySDR::logf(SOAPY_SDR_DEBUG, "setFrequency(%d, %d, %s, %f)", direction,
channel, name.c_str(), frequency);
ret = airspyhf_set_freq(device_, centerFrequency_);
if (ret != AIRSPYHF_SUCCESS) {
SoapySDR::logf(SOAPY_SDR_ERROR, "airspyhf_set_freq() failed: %d", ret);
}
}
double SoapyAirspyHF::getFrequency(const int direction, const size_t channel,
const std::string &name) const {
if (name != "RF") {
SoapySDR::logf(SOAPY_SDR_ERROR, "getFrequency(%d, %d, %s) not supported.",
direction, channel, name.c_str());
return 0.0;
}
return centerFrequency_;
}
std::vector<std::string>
SoapyAirspyHF::listFrequencies(const int direction,
const size_t channel) const {
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "listFrequencies(%d, %d) not supported.",
direction, channel);
return {};
}
return {"RF"};
}
SoapySDR::RangeList
SoapyAirspyHF::getFrequencyRange(const int direction, const size_t channel,
const std::string &name) const {
SoapySDR::RangeList results;
if (direction != SOAPY_SDR_RX or name != "RF" or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR,
"getFrequencyRange(%d, %d, %s) not supported.", direction,
channel, name.c_str());
// Empty results
return results;
}
results.push_back(SoapySDR::Range(9'000, 31'000'000)); // 9kHz to 31MHz
results.push_back(
SoapySDR::Range(60'000'000, 260'000'000)); // 60MHz to 260MHz
return results;
}
SoapySDR::ArgInfoList
SoapyAirspyHF::getFrequencyArgsInfo(const int direction,
const size_t channel) const {
SoapySDR::ArgInfoList freqArgs;
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR,
"getFrequencyArgsInfo(%d, %d) not supported.", direction,
channel);
return freqArgs;
}
// TODO: frequency arguments
return freqArgs;
}
/*******************************************************************
* Sample Rate API
******************************************************************/
void SoapyAirspyHF::setSampleRate(const int direction, const size_t channel,
const double rate) {
int ret = 0;
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "setSampleRate(%d, %d, %f) not supported.",
direction, channel, rate);
return;
}
sampleRate_ = static_cast<uint32_t>(rate);
ret = airspyhf_set_samplerate(device_, sampleRate_);
if (ret != AIRSPYHF_SUCCESS) {
SoapySDR::logf(SOAPY_SDR_ERROR, "airspyhf_set_samplerate() failed: %d",
ret);
return;
}
}
double SoapyAirspyHF::getSampleRate(const int direction,
const size_t channel) const {
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "getSampleRate(%d, %d) not supported.",
direction, channel);
return 0;
}
return sampleRate_;
}
std::vector<double> SoapyAirspyHF::listSampleRates(const int direction,
const size_t channel) const {
int ret = 0;
std::vector<double> results;
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "listSampleRates(%d, %d) not supported.",
direction, channel);
return results;
}
uint32_t numRates = 0;
ret = airspyhf_get_samplerates(device_, &numRates, 0);
if (ret != AIRSPYHF_SUCCESS) {
SoapySDR::logf(SOAPY_SDR_ERROR, "airspyhf_get_samplerates() failed: %d",
ret);
return results;
}
std::vector<uint32_t> samplerates;
samplerates.resize(numRates);
ret = airspyhf_get_samplerates(device_, samplerates.data(), numRates);
if (ret != AIRSPYHF_SUCCESS) {
SoapySDR::logf(SOAPY_SDR_ERROR, "airspyhf_get_samplerates() failed: %d",
ret);
return results;
}
// Sort to make short they are in order
std::sort(samplerates.begin(), samplerates.end());
for (const auto &samplerate : samplerates) {
results.push_back(samplerate);
}
return results;
}
void SoapyAirspyHF::setBandwidth(const int direction, const size_t channel,
const double bw) {
SoapySDR::logf(SOAPY_SDR_DEBUG, "setBandwidth(%d, %d, %f) not supported.",
direction, channel, bw);
}
double SoapyAirspyHF::getBandwidth(const int direction,
const size_t channel) const {
if (direction != SOAPY_SDR_RX or channel != 0) {
SoapySDR::logf(SOAPY_SDR_ERROR, "getBandwidth(%d, %d) not supported.",
direction, channel);
return 0;
}
// TODO: this is just an estimate.
return 0.9 * sampleRate_;
}
std::vector<double> SoapyAirspyHF::listBandwidths(const int direction,
const size_t channel) const {
std::vector<double> results;
for (const auto &samplerate : listSampleRates(direction, channel)) {
// Reasoable estimate
// TODO: maybe cache sample rates?
results.push_back(0.9 * samplerate);
}
return results;
}
/*******************************************************************
* Settings API
******************************************************************/
SoapySDR::ArgInfoList SoapyAirspyHF::getSettingInfo(void) const {
SoapySDR::ArgInfoList setArgs;
// Enable DSP in library. TODO. make this optional
SoapySDR::ArgInfo enableDSPArg;
enableDSPArg.key = "dsp";
enableDSPArg.value = "true";
enableDSPArg.name = "DSP";
enableDSPArg.description = "Enable DSP";
enableDSPArg.type = SoapySDR::ArgInfo::BOOL;
return setArgs;
}
void SoapyAirspyHF::writeSetting(const std::string &key,
const std::string &value) {
int ret;
if (key == "dsp") {
bool enable = (value == "true");
// Enables/Disables the IQ Correction, IF shift and Fine Tuning.
ret = airspyhf_set_lib_dsp(device_, enable);
if (ret != AIRSPYHF_SUCCESS) {
SoapySDR::logf(SOAPY_SDR_ERROR, "airspyhf_set_lib_dsp() failed: (%d)",
ret);
} else {
SoapySDR::logf(SOAPY_SDR_DEBUG, "airspyhf_set_lib_dsp(%d)", enable);
}
} else {
SoapySDR::logf(SOAPY_SDR_ERROR, "writeSetting(%s, %s) not supported.",
key.c_str(), value.c_str());
}
SoapySDR::logf(SOAPY_SDR_DEBUG, "writeSetting(%s, %s)", key.c_str(),
value.c_str());
}
std::string SoapyAirspyHF::readSetting(const std::string &key) const {
if (key == "dsp") {
return enableDSP_ ? "true" : "false";
} else {
SoapySDR::logf(SOAPY_SDR_ERROR, "readSetting(%s) not supported.",
key.c_str());
return "";
}
}