pothosware / SoapyRTLSDR

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

Splitting up device args - tune and stream args #10

Closed guruofquality closed 9 years ago

guruofquality commented 9 years ago

We have some device arguments which I think are more or less inherited from the Osmo code, but there may be more fitting ways to deal with them in the API.

Stream args

These are device args that could be passed to setupStream()

These are device args that could be passed to setFrequency()

cjcliffe commented 9 years ago

The device args were mostly there as I hadn't really thought about their usage and was getting familiar with the order-of-operations -- I've moved the relevant ones over to stream args now and offset_tune to the setFrequency() which makes sense.

I've removed corr from device/stream init since it doesn't make sense to have in two places. I was considering this as an alternate at first since the BladeRF driver throws an invalid name error when corr is specified: if (name != "RF") throw std::runtime_error("setFrequency("+name+") unknown name"); -- so I assumed this is default behaviour.. For now I've just filtered it's availability by driver name.

guruofquality commented 9 years ago

Just in case this was missed, sid you see the call std::vector<std::string> listFrequencies(const int direction, const size_t channel) const (awkwardish name). But it should be a list of all available tunable components. Blade RF would only have "RF". Many devices with CORDICs in the digital baseband have "RF" and "BB".

cjcliffe commented 9 years ago

Thanks, I missed that one -- I think I expected a "getFrequencyNames" or something like that -- will implement that instead of my module name checking.

guruofquality commented 9 years ago

FWIW, I like that name better. I churned these functions out really quickly, and going back the naming is clearly a little awkward. Everything that returns a string vector should probably be getSomethingNames(). It might be good to rename them for the next round of changes -- just in a way that keeps prior client code and modules operating.