-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation for return values in API #24
Comments
Hi @nocarryr , about the methods: In For
So for the possible LIBUSB errors you can check here: http://libusb.sourceforge.net/api-1.0/group__misc.html Most of the calls will either return -1 or a libusb error. Hope that can help you |
Thanks @racerxdl for the info. I am not quite as familiar with the lower-level and device-level stuff as I should be.
So in order to not break things in In light of all of this, I do see value in updating the comments in the header to make things less confusing for those wrapping the library. I could start a PR, but I am unsure of how well that would work out given my lack of experience in C and the related |
I will try to rewrite the doc sometime, if you want you can start a PR and then I can add the stuff that is missing. The |
After digging around in the source, it seems that the functions related to
Is it from the call to I don't want to turn this into a course in C, so there's no need to go into detail if it's not a quick answer. (Just always willing to learn things) Also Regarding When retrieving the tuner's current gain value, assume that its gain is set to 0db. Since 0 is the value indicating an error, how can we know whether we encountered an error or not? This one is more about altering the behavior than clarifying the documentation so we can save it for another time. I'll take a stab at the rewrite and see how far I can get. Thanks again |
Just checked, its using the return from |
I have an R820T. When initialized, stdout displays:
And Could there really be that much difference between the R820T and the R820T2? Edit: |
R820T and R820T2 tuner are identical in the source. |
Yeah, like @hayguen said, the R820T/2 differences are only hardware based. No software changes. So its weird. I will make some tests again just to make sure there is no bug there. |
|
@nocarryr would be good, if you (and others) have a look at the development branch! |
In an effort to build tests for error codes as returned by librtlsdr within the pyrtlsdr wrapper in this PR, I've found some of the functions in the header with either undocumented or possibly mis-documented return values.
rtlsdr_open
andrtlsdr_close
do not indicate a return value for errors. We all know from experience that -1 is returned on error withrtlsdr_open
, but since I have never encountered an error on close, I am unsure.rtlsdr_set_center_freq
indicates a return of 0 on error, but in working with a connected dongle, it appears to be returning 0 for success instead.rtlsdr_get_freq_correction
does not indicate a return value for an error. This would likely be the intended functionality since the values can be positive and negative integers as well as 0rtlsdr_get_tuner_gain
indicates a return of 0 on error, but it would seem that 0 is a valid gain value. I raised this as an issue in the original project here but it was never resolved.rtlsdr_reset_buffer
does not indicate a return value for errorsrtlsdr_read_sync
does not indicate a return value for errorsAny direction or clarification that can be given for any of those would be greatly appreciated. Thanks!
The text was updated successfully, but these errors were encountered: