Skip to content
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

Generic way to set gains for any SDR hardware #53

Closed
ha7ilm opened this issue Sep 8, 2017 · 2 comments
Closed

Generic way to set gains for any SDR hardware #53

ha7ilm opened this issue Sep 8, 2017 · 2 comments

Comments

@ha7ilm
Copy link

ha7ilm commented Sep 8, 2017

Currently it is hardwired for HackRF and RTL-SDR.

See also: ha7ilm/openwebrx#94

@ha7ilm ha7ilm changed the title Generic way to set gains Generic way to set gains for any SDR hardware Sep 8, 2017
@guruofquality
Copy link
Collaborator

I sure that nobody want to parse strings, but if we made the --gain option take a string, we could use the same markup used for device arguments to get a dictionary of gains. We can use an existing call SOAPY_SDR_API SoapySDRKwargs SoapySDRKwargs_fromString(const char *markup); to parse something like -g "AMPL=12, VGA=4" (for example). Its easy to iterate through a SoapySDRKwargs in C and apply each gain in the dictionary.

For the automatic/overall gain use case, --gain=16 will result in a SoapySDRKwargs with one entry with a key set to that string and an empty value -- so in this case we could know to use the setGain() with no named elements.

@guruofquality
Copy link
Collaborator

this is the -g option in rx_fm (for example) it parses a gain string for key/value pairs of gain settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants