mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
HackRF - final check-in. Changed all tuners to use the low-level API of the usb4java library to resolve limitation in high-level API that constrains maximum sample rate to ~2.0 MHz. Added console logging to logback.
This commit is contained in:
@@ -20,10 +20,10 @@ package source.tuner.rtl;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
import javax.usb.UsbException;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.usb4java.LibUsbException;
|
||||
|
||||
import sample.Listener;
|
||||
import source.SourceException;
|
||||
@@ -59,6 +59,11 @@ public class RTL2832Tuner extends Tuner
|
||||
mController.addListener( (FrequencyChangeListener)this );
|
||||
}
|
||||
|
||||
public void dispose()
|
||||
{
|
||||
//TODO: dispose of something here
|
||||
}
|
||||
|
||||
public RTL2832TunerController getController()
|
||||
{
|
||||
return mController;
|
||||
@@ -115,7 +120,7 @@ public class RTL2832Tuner extends Tuner
|
||||
{
|
||||
mController.setSampleRate( sampleRate );
|
||||
}
|
||||
catch( UsbException e )
|
||||
catch( LibUsbException e )
|
||||
{
|
||||
throw new SourceException( "RTL2832 Tuner - error setting "
|
||||
+ "sample rate", e );
|
||||
@@ -139,7 +144,18 @@ public class RTL2832Tuner extends Tuner
|
||||
throws RejectedExecutionException,
|
||||
SourceException
|
||||
{
|
||||
return mController.getChannel( threadPoolManager, this, channel );
|
||||
TunerChannelSource source = null;
|
||||
|
||||
try
|
||||
{
|
||||
source = mController.getChannel( threadPoolManager, this, channel );
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
mLog.error( "couldn't provide source channel", e );
|
||||
}
|
||||
|
||||
return source;
|
||||
}
|
||||
/**
|
||||
* Releases the tuned channel so that the tuner controller can tune to
|
||||
|
||||
Reference in New Issue
Block a user