Skip to content

Commit

Permalink
#2102 Log Unknown Tuners From SDRPlay API (#2102)
Browse files Browse the repository at this point in the history
Co-authored-by: Dennis Sheirer <dsheirer@github.com>
  • Loading branch information
DSheirer and Dennis Sheirer authored Dec 3, 2024
1 parent db83d51 commit 4cf5140
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
# tag name, specifically the dashes inserted before and after the alpha/beta labels.
# See: https://github.com/DSheirer/sdrtrunk/issues/1651

projectVersion=0.6.1
projectVersion=0.6.2-beta-1
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ public static List<DiscoveredRspTuner> getRspTuners(DeviceInfo deviceInfo, Chann
break;
}
break;
default:
mLog.warn("SDRPlay API returned an unknown tuner type [" + deviceInfo.getDeviceType() +
"] with serial number [" + deviceInfo.getSerialNumber() + "]");
}

return tuners;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@

import io.github.dsheirer.source.tuner.sdrplay.api.v3_08.sdrplay_api_DeviceT;
import java.lang.foreign.MemorySegment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* sdrplay_api_DeviceT structure parser for API version 3.07
* sdrplay_api_DeviceT structure parser for API version 3.08+
*/
public class DeviceStruct_v3_08 implements IDeviceStruct
{
private static final Logger LOGGER = LoggerFactory.getLogger(DeviceStruct_v3_08.class);
private final MemorySegment mDeviceMemorySegment;
private final DeviceType mDeviceType;
private final String mSerialNumber;
Expand All @@ -38,9 +41,17 @@ public class DeviceStruct_v3_08 implements IDeviceStruct
public DeviceStruct_v3_08(MemorySegment deviceMemorySegment)
{
mDeviceMemorySegment = deviceMemorySegment;
mDeviceType = DeviceType.fromValue(0xFF & sdrplay_api_DeviceT.hwVer(mDeviceMemorySegment));
int deviceTypeValue = 0xFF & sdrplay_api_DeviceT.hwVer(mDeviceMemorySegment);
mDeviceType = DeviceType.fromValue(deviceTypeValue);

MemorySegment serialSegment = sdrplay_api_DeviceT.SerNo(mDeviceMemorySegment);
mSerialNumber = serialSegment.getString(0);

if(mDeviceType == DeviceType.UNKNOWN)
{
LOGGER.warn("Unrecognized RSP tuner device type value [" + deviceTypeValue + "] with serial number [" +
mSerialNumber + "]");
}
}

@Override public MemorySegment getDeviceMemorySegment()
Expand Down

0 comments on commit 4cf5140

Please sign in to comment.