Skip to content

Commit 00a313a

Browse files
committed
Android hydrasdr_source fix refresh()
1 parent d778770 commit 00a313a

File tree

1 file changed

+7
-4
lines changed
  • source_modules/hydrasdr_source/src

1 file changed

+7
-4
lines changed

source_modules/hydrasdr_source/src/main.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ class HydraSDRSourceModule : public ModuleManager::Instance {
142142
devFd = backend::getDeviceFD(vid, pid, backend::HYDRASDR_VIDPIDS);
143143
if (devFd < 0) { return; }
144144

145-
// Get device info (use non-zero fake serial so start() guard passes)
145+
// Get device info
146146
std::string fakeName = "HydraSDR USB";
147-
devices.define(fakeName, (uint64_t)1);
147+
devices.define(fakeName, 0);
148148
#endif
149149
}
150150

@@ -523,14 +523,17 @@ class HydraSDRSourceModule : public ModuleManager::Instance {
523523
static void start(void* ctx) {
524524
HydraSDRSourceModule* _this = (HydraSDRSourceModule*)ctx;
525525
if (_this->running) { return; }
526+
#ifndef __ANDROID__
526527
if (_this->selectedSerial == 0) {
527528
flog::error("Tried to start HydraSDR source with null serial");
528529
return;
529530
}
530-
531-
#ifndef __ANDROID__
532531
int err = hydrasdr_open_sn(&_this->openDev, _this->selectedSerial);
533532
#else
533+
if (_this->devFd < 0) {
534+
flog::error("Tried to start HydraSDR source with invalid fd");
535+
return;
536+
}
534537
int err = hydrasdr_open_fd(&_this->openDev, _this->devFd);
535538
#endif
536539
if (err != 0) {

0 commit comments

Comments
 (0)