Closes #70 - airspy mini sample rates.

Change code to no longer assume that 10 MHz is an available default sample rate.  The mini is only capable of 6 and 3 MHz.

Note: only the 6 MHz sample rate option should be used at this time.  6 MHz can be decimated to 48 kHz using an integer decimator.  sdrtrunk doesn't support the 3 MHz option, because it can't decimate that rate to 48 kHz until the new channelizer is developed.
This commit is contained in:
Denny
2016-05-30 08:58:00 -04:00
parent 61d9698ca5
commit 3c53f864c4

View File

@@ -297,9 +297,16 @@ public class AirspyTunerController extends TunerController
AirspySampleRate rate = getSampleRate( sampleRate );
if( rate == null )
{
if( !mSampleRates.isEmpty() )
{
rate = mSampleRates.get( 0 );
}
else
{
rate = DEFAULT_SAMPLE_RATE;
}
}
try
{
@@ -359,6 +366,7 @@ public class AirspyTunerController extends TunerController
@Override
public void setTunedFrequency( long frequency ) throws SourceException
{
mLog.debug("Setting tuned frequency to: " + frequency );
if( FREQUENCY_MIN <= frequency && frequency <= FREQUENCY_MAX )
{
ByteBuffer buffer = ByteBuffer.allocateDirect( 4 );
@@ -635,8 +643,6 @@ public class AirspyTunerController extends TunerController
{
mSampleRates.clear();
mSampleRates.add( DEFAULT_SAMPLE_RATE );
//Get a count of available sample rates. If we get an exception, then
//we're using an older firmware revision and only the default 10 MHz
//rate is supported
@@ -644,7 +650,6 @@ public class AirspyTunerController extends TunerController
{
byte[] rawCount = readArray( Command.GET_SAMPLE_RATES, 0, 0, 4 );
if( rawCount != null )
{
int count = EndianUtils.readSwappedInteger( rawCount, 0 );
@@ -668,6 +673,11 @@ public class AirspyTunerController extends TunerController
{
//Press on, nothing else to do here ..
}
if( mSampleRates.isEmpty())
{
mSampleRates.add( DEFAULT_SAMPLE_RATE );
}
}
/**