Skip to content

Commit 737c3fa

Browse files
DSheirersheirerd
andauthored
#1916 SDRPlay API 3.15 and RSPdxR2 support. (#1921)
Co-authored-by: sheirerd <[email protected]>
1 parent 03792b0 commit 737c3fa

File tree

8 files changed

+26
-8
lines changed

8 files changed

+26
-8
lines changed

src/main/java/io/github/dsheirer/source/tuner/TunerFactory.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ public static List<DiscoveredRspTuner> getRspTuners(DeviceInfo deviceInfo, Chann
162162
tuners.add(new DiscoveredRsp2Tuner(deviceInfo, channelizerType));
163163
break;
164164
case RSPdx:
165+
case RSPdxR2:
165166
tuners.add(new DiscoveredRspDxTuner(deviceInfo, channelizerType));
166167
break;
167168
case RSPduo:
@@ -255,6 +256,7 @@ public static RspTuner getRspTuner(DeviceInfo deviceInfo, ChannelizerType channe
255256
}
256257
break;
257258
case RSPdx:
259+
case RSPdxR2:
258260
if(device instanceof RspDxDevice rspDxDevice)
259261
{
260262
IControlRspDx controlRspDx = new ControlRspDx(rspDxDevice);
@@ -476,6 +478,7 @@ public static TunerEditor getEditor(UserPreferences userPreferences, DiscoveredT
476478
case RSP2:
477479
return new Rsp2TunerEditor(userPreferences, tunerManager, discoveredRspTuner);
478480
case RSPdx:
481+
case RSPdxR2:
479482
return new RspDxTunerEditor(userPreferences, tunerManager, discoveredRspTuner);
480483
case RSPduo:
481484
if(discoveredRspTuner instanceof DiscoveredRspDuoTuner1 duoTuner1)

src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/Version.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ public enum Version
3535
V3_11(3.11f, true),
3636
V3_12(3.12f, true),
3737
V3_13(3.13f, true), //No changes - OSX build only.
38-
V3_14(3.14f, true);
38+
V3_14(3.14f, true),
39+
V3_15(3.15f, true);
3940

4041
private float mValue;
4142
private boolean mSupported;
@@ -57,6 +58,7 @@ public boolean isSupported()
5758

5859
/**
5960
* Indicates if this version is greater than or equal to the specified version.
61+
*
6062
* @param version to compare
6163
* @return true if this version is greater than or equal to
6264
*/
@@ -75,13 +77,14 @@ public float getVersion()
7577

7678
/**
7779
* Lookup the version from the specified value.
80+
*
7881
* @param value to lookup
7982
* @return version or UNKNOWN
8083
*/
8184
public static Version fromValue(float value)
8285
{
8386

84-
for(Version version: values())
87+
for(Version version : values())
8588
{
8689
if(version.mValue == value)
8790
{

src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/DeviceFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public static Device createDevice(SDRplay sdrPlay, IDeviceStruct deviceStruct)
134134
case RSPduo -> {
135135
return new RspDuoDevice(sdrPlay, deviceStruct);
136136
}
137-
case RSPdx -> {
137+
case RSPdx, RSPdxR2 -> {
138138
return new RspDxDevice(sdrPlay, deviceStruct);
139139
}
140140
default -> {

src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/DeviceType.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
package io.github.dsheirer.source.tuner.sdrplay.api.device;
2121

22-
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_h;
22+
import io.github.dsheirer.source.tuner.sdrplay.api.v3_14.sdrplay_api_h;
2323

2424
/**
2525
* RSP Device type
@@ -28,10 +28,11 @@ public enum DeviceType
2828
{
2929
RSP1(sdrplay_api_h.SDRPLAY_RSP1_ID(), "RSP1"),
3030
RSP1A(sdrplay_api_h.SDRPLAY_RSP1A_ID(), "RSP1A"),
31-
RSP1B(io.github.dsheirer.source.tuner.sdrplay.api.v3_14.sdrplay_api_h.SDRPLAY_RSP1B_ID(), "RSP1B"),
31+
RSP1B(sdrplay_api_h.SDRPLAY_RSP1B_ID(), "RSP1B"),
3232
RSP2(sdrplay_api_h.SDRPLAY_RSP2_ID(), "RSP2"),
3333
RSPduo(sdrplay_api_h.SDRPLAY_RSPduo_ID(), "RSPduo"),
3434
RSPdx(sdrplay_api_h.SDRPLAY_RSPdx_ID(), "RSPdx"),
35+
RSPdxR2(sdrplay_api_h.SDRPLAY_RSPdx_R2_ID(), "RSPdxR2"),
3536
UNKNOWN(Integer.MIN_VALUE, "UNKNOWN");
3637

3738
private int mValue;

src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/composite/CompositeParametersFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static CompositeParameters create(Version version, DeviceType deviceType,
5757
case RSPduo -> {
5858
return new RspDuoCompositeParameters(version, memorySegment, arena);
5959
}
60-
case RSPdx -> {
60+
case RSPdx, RSPdxR2 -> {
6161
return new RspDxCompositeParameters(version, memorySegment, arena);
6262
}
6363
}

src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/device/DeviceParametersFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static DeviceParameters create(DeviceType deviceType, MemorySegment memor
5050
case RSPduo -> {
5151
return new RspDuoDeviceParameters(memorySegment);
5252
}
53-
case RSPdx -> {
53+
case RSPdx, RSPdxR2 -> {
5454
return new RspDxDeviceParameters(memorySegment);
5555
}
5656
}

src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/TunerParametersFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ else if(version.gte(Version.V3_07))
6969
throw new IllegalArgumentException("Unrecognized API version: " + version);
7070
}
7171
}
72-
case RSPdx -> {
72+
case RSPdx, RSPdxR2 -> {
7373
MemorySegment rspDxMemorySegment = sdrplay_api_RxChannelParamsT.rspDxTunerParams$slice(memorySegment);
7474
return new RspDxTunerParameters(memorySegment, rspDxMemorySegment);
7575
}

src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_h.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,6 +1719,17 @@ public static int SDRPLAY_RSPdx_ID() {
17191719
public static int SDRPLAY_RSP1B_ID() {
17201720
return (int)6L;
17211721
}
1722+
1723+
//Note: RSPdx_R2 manually edited for API version 3.15
1724+
1725+
/**
1726+
* {@snippet :
1727+
* #define SDRPLAY_RSPdx_R2_ID 7
1728+
* }
1729+
*/
1730+
public static int SDRPLAY_RSPdx_R2_ID() {
1731+
return (int)7L;
1732+
}
17221733
}
17231734

17241735

0 commit comments

Comments
 (0)