File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
source_modules/hydrasdr_source/src Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments