pothosware / SoapyRTLSDR

SoapySDR RTL-SDR Support Module
https://github.com/pothosware/SoapyRTLSDR/wiki
MIT License
124 stars 29 forks source link

Handle when rtlsdr_open fails #13

Closed xloem closed 8 years ago

xloem commented 8 years ago

(fixes #14) I had rtl_power running, and SoapyRTLSDR segfaulted because rtlsdr_get_device_usb_strings() succeeded but rtlsdr_open returned an error code

guruofquality commented 8 years ago

@cjcliffe It looks like the device is only opened in find to read the gain bounds and to call rtlsdr_get_tuner_type for debug purposes. Would anything be broken by reading the gain as a non-static class member when the device is opened? Ideally we don't have to open the device during enumeration().

cjcliffe commented 8 years ago

@guruofquality I don't see any reason it has to open it there except to report gains; we could just return the default gains for 820T or something until the device is actually used.

Edit: it also can't distinguish differences in gain range with multiple devices as it is; I'll fix that up.