mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-12 19:27:11 +01:00
Maybe fixed airspy and airspyhf crash
This commit is contained in:
parent
c846e0f400
commit
35d079beb1
@ -106,13 +106,20 @@ public:
|
|||||||
|
|
||||||
void selectBySerial(uint64_t serial) {
|
void selectBySerial(uint64_t serial) {
|
||||||
airspy_device* dev;
|
airspy_device* dev;
|
||||||
int err = airspy_open_sn(&dev, serial);
|
try {
|
||||||
if (err != 0) {
|
int err = airspy_open_sn(&dev, serial);
|
||||||
|
if (err != 0) {
|
||||||
|
char buf[1024];
|
||||||
|
sprintf(buf, "%016" PRIX64, serial);
|
||||||
|
spdlog::error("Could not open Airspy HF+ {0}", buf);
|
||||||
|
selectedSerial = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (std::exception e) {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
sprintf(buf, "%016" PRIX64, serial);
|
sprintf(buf, "%016" PRIX64, serial);
|
||||||
spdlog::error("Could not open Airspy HF+ {0}", buf);
|
spdlog::error("Could not open Airspy HF+ {0}", buf);
|
||||||
selectedSerial = 0;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
selectedSerial = serial;
|
selectedSerial = serial;
|
||||||
|
|
||||||
|
@ -109,15 +109,24 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void selectBySerial(uint64_t serial) {
|
void selectBySerial(uint64_t serial) {
|
||||||
selectedSerial = serial;
|
|
||||||
airspyhf_device_t* dev;
|
airspyhf_device_t* dev;
|
||||||
int err = airspyhf_open_sn(&dev, selectedSerial);
|
try {
|
||||||
if (err != 0) {
|
int err = airspyhf_open_sn(&dev, selectedSerial);
|
||||||
|
if (err != 0) {
|
||||||
|
char buf[1024];
|
||||||
|
sprintf(buf, "%016" PRIX64, selectedSerial);
|
||||||
|
spdlog::error("Could not open Airspy HF+ {0}", buf);
|
||||||
|
selectedSerial = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (std::exception e) {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
sprintf(buf, "%016" PRIX64, selectedSerial);
|
sprintf(buf, "%016" PRIX64, selectedSerial);
|
||||||
spdlog::error("Could not open Airspy HF+ {0}", buf);
|
spdlog::error("Could not open Airspy HF+ {0}", buf);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
selectedSerial = serial;
|
||||||
|
|
||||||
uint32_t sampleRates[256];
|
uint32_t sampleRates[256];
|
||||||
airspyhf_get_samplerates(dev, sampleRates, 0);
|
airspyhf_get_samplerates(dev, sampleRates, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user