Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dennis Sheirer
committed
Feb 19, 2023
1 parent
75347f9
commit 279004d
Showing
6 changed files
with
263 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
src/main/java/io/github/dsheirer/source/tuner/airspy/hf/AirspyHfTuner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* | ||
* ***************************************************************************** | ||
* Copyright (C) 2014-2023 Dennis Sheirer | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* **************************************************************************** | ||
*/ | ||
package io.github.dsheirer.source.tuner.airspy.hf; | ||
|
||
import io.github.dsheirer.preference.source.ChannelizerType; | ||
import io.github.dsheirer.source.tuner.ITunerErrorListener; | ||
import io.github.dsheirer.source.tuner.Tuner; | ||
import io.github.dsheirer.source.tuner.TunerClass; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* Airspy HF+Tuner | ||
*/ | ||
public class AirspyHfTuner extends Tuner | ||
{ | ||
private final static Logger mLog = LoggerFactory.getLogger(AirspyHfTuner.class); | ||
|
||
/** | ||
* Constructs an instance | ||
* @param controller for the Airspy HF | ||
* @param tunerErrorListener to listen for errors from this tuner | ||
* @param channelizerType for the channelizer | ||
*/ | ||
public AirspyHfTuner(AirspyHfTunerController controller, ITunerErrorListener tunerErrorListener, | ||
ChannelizerType channelizerType) | ||
{ | ||
super(controller, tunerErrorListener, channelizerType); | ||
} | ||
|
||
@Override | ||
public String getPreferredName() | ||
{ | ||
// return "Airspy HF+ " + getController().getDeviceInfo().getSerialNumber(); | ||
return "Airspy HF+"; | ||
} | ||
|
||
/** | ||
* Airspy tuner controller | ||
*/ | ||
public AirspyHfTunerController getController() | ||
{ | ||
return (AirspyHfTunerController)getTunerController(); | ||
} | ||
|
||
@Override | ||
public String getUniqueID() | ||
{ | ||
return "Unique ID"; | ||
// try | ||
// { | ||
// return getController().getDeviceInfo().getSerialNumber(); | ||
// } | ||
// catch(Exception e) | ||
// { | ||
// mLog.error("error getting serial number", e); | ||
// } | ||
// | ||
// return BoardID.AIRSPY.getLabel(); | ||
} | ||
|
||
@Override | ||
public TunerClass getTunerClass() | ||
{ | ||
return TunerClass.AIRSPY_HF; | ||
} | ||
|
||
@Override | ||
public double getSampleSize() | ||
{ | ||
return 13.0; | ||
} | ||
|
||
@Override | ||
public int getMaximumUSBBitsPerSecond() | ||
{ | ||
//4-bytes per sample = 32 bits times 10 MSps = 320,000,000 bits per second | ||
return 320000000; | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/main/java/io/github/dsheirer/source/tuner/airspy/hf/AirspyHfTunerConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* ***************************************************************************** | ||
* Copyright (C) 2014-2023 Dennis Sheirer | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* **************************************************************************** | ||
*/ | ||
package io.github.dsheirer.source.tuner.airspy.hf; | ||
|
||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; | ||
import io.github.dsheirer.source.tuner.TunerType; | ||
import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; | ||
|
||
public class AirspyHfTunerConfiguration extends TunerConfiguration | ||
{ | ||
/** | ||
* Default constructor for JAXB | ||
*/ | ||
public AirspyHfTunerConfiguration() | ||
{ | ||
} | ||
|
||
/** | ||
* Constructs an instance for the unique ID. | ||
* @param uniqueID of the tuner (ie serial number) | ||
*/ | ||
public AirspyHfTunerConfiguration(String uniqueID) | ||
{ | ||
super(uniqueID); | ||
} | ||
|
||
@Override | ||
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") | ||
public TunerType getTunerType() | ||
{ | ||
return TunerType.AIRSPY_HF_PLUS; | ||
} | ||
} |
104 changes: 104 additions & 0 deletions
104
src/main/java/io/github/dsheirer/source/tuner/airspy/hf/AirspyHfTunerController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/* | ||
* ***************************************************************************** | ||
* Copyright (C) 2014-2023 Dennis Sheirer | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* **************************************************************************** | ||
*/ | ||
|
||
package io.github.dsheirer.source.tuner.airspy.hf; | ||
|
||
import io.github.dsheirer.buffer.INativeBufferFactory; | ||
import io.github.dsheirer.source.SourceException; | ||
import io.github.dsheirer.source.tuner.ITunerErrorListener; | ||
import io.github.dsheirer.source.tuner.TunerType; | ||
import io.github.dsheirer.source.tuner.usb.USBTunerController; | ||
|
||
/** | ||
* Airspy HF+ and Discovery tuner controller. | ||
*/ | ||
public class AirspyHfTunerController extends USBTunerController | ||
{ | ||
private static final long MINIMUM_FREQUENCY_HZ = 500_000; | ||
private static final long MAXIMUM_FREQUENCY_HZ = 260_000_000; | ||
|
||
public AirspyHfTunerController(int bus, String portAddress, ITunerErrorListener tunerErrorListener) | ||
{ | ||
super(bus, portAddress, tunerErrorListener); | ||
setMinimumFrequency(MINIMUM_FREQUENCY_HZ); | ||
setMaximumFrequency(MAXIMUM_FREQUENCY_HZ); | ||
setUsableBandwidthPercentage(1.00); | ||
setMiddleUnusableHalfBandwidth(0); | ||
} | ||
|
||
@Override | ||
public int getBufferSampleCount() | ||
{ | ||
//TODO: | ||
return 0; | ||
} | ||
|
||
@Override | ||
public long getTunedFrequency() throws SourceException | ||
{ | ||
//TODO: | ||
return 0; | ||
} | ||
|
||
@Override | ||
public void setTunedFrequency(long frequency) throws SourceException | ||
{ | ||
//TODO: | ||
|
||
} | ||
|
||
@Override | ||
public double getCurrentSampleRate() throws SourceException | ||
{ | ||
//TODO: | ||
return 0; | ||
} | ||
|
||
@Override | ||
public TunerType getTunerType() | ||
{ | ||
return TunerType.AIRSPY_HF_PLUS; | ||
} | ||
|
||
@Override | ||
protected INativeBufferFactory getNativeBufferFactory() | ||
{ | ||
//TODO: | ||
return null; | ||
} | ||
|
||
@Override | ||
protected int getTransferBufferSize() | ||
{ | ||
//TODO: | ||
return 0; | ||
} | ||
|
||
@Override | ||
protected void deviceStart() throws SourceException | ||
{ | ||
//TODO: | ||
} | ||
|
||
@Override | ||
protected void deviceStop() | ||
{ | ||
//TODO: | ||
} | ||
} |