Skip to content

Commit b10de36

Browse files
committed
Added detection for non-modded PlutoSDRs
1 parent 7b22484 commit b10de36

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

PlutoSDR/PlutoSDRControllerDialog.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PlutoSDR/PlutoSDRDevice.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ public sealed class PlutoSDRDevice : IDisposable
1212
{
1313
private const uint DefaultFrequency = 405500000U;
1414
private const int DefaultSamplerate = 1000000;
15-
private const uint MinFrequency = 237500000;
16-
private const uint MaxFrequency = 3800000000;
15+
public long MinFrequency = 70000000L;
16+
public long MaxFrequency = 6000000000L;
1717
private const int MinBandwidth = 1500000;
1818
private const int MaxBandwidth = 28000000;
1919
private const uint SampleTimeoutMs = 1000;
@@ -314,6 +314,20 @@ public bool createContext()
314314
if (_dev == null)
315315
throw new ApplicationException("Cannot open device ad9361-phy");
316316

317+
// check if the frequency range was extended
318+
try
319+
{
320+
// try to tune the LO to 100 MHz (outside of the AD9363 tuning range)
321+
IIOHelper.SetAttribute(_dev, "altvoltage0", "frequency", "100000000", false);
322+
IIOHelper.SetAttribute(_dev, "altvoltage0", "frequency", _centerFrequency.ToString(), false);
323+
}
324+
catch (Exception ex)
325+
{
326+
MinFrequency = 325000000L;
327+
MaxFrequency = 3800000000L;
328+
_centerFrequency = MinFrequency;
329+
}
330+
317331
Utils.SaveSetting("PlutoSDRURI", _gui.deviceUriTextbox.Text);
318332

319333
_gui.receiverPanel.Enabled = true;

PlutoSDR/PlutoSDRIO.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,14 @@ long ITunableSource.MinimumTunableFrequency
192192
{
193193
get
194194
{
195-
return 70000000L;
195+
return _PlutoSDRDevice.MinFrequency;
196196
}
197197
}
198198
long ITunableSource.MaximumTunableFrequency
199199
{
200200
get
201201
{
202-
return 6000000000L;
202+
return _PlutoSDRDevice.MaxFrequency;
203203
}
204204
}
205205

0 commit comments

Comments
 (0)