Skip to content

Commit

Permalink
Added detection for non-modded PlutoSDRs
Browse files Browse the repository at this point in the history
  • Loading branch information
Manawyrm committed Jan 31, 2019
1 parent 7b22484 commit b10de36
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
4 changes: 2 additions & 2 deletions PlutoSDR/PlutoSDRControllerDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions PlutoSDR/PlutoSDRDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public sealed class PlutoSDRDevice : IDisposable
{
private const uint DefaultFrequency = 405500000U;
private const int DefaultSamplerate = 1000000;
private const uint MinFrequency = 237500000;
private const uint MaxFrequency = 3800000000;
public long MinFrequency = 70000000L;
public long MaxFrequency = 6000000000L;
private const int MinBandwidth = 1500000;
private const int MaxBandwidth = 28000000;
private const uint SampleTimeoutMs = 1000;
Expand Down Expand Up @@ -314,6 +314,20 @@ public bool createContext()
if (_dev == null)
throw new ApplicationException("Cannot open device ad9361-phy");

// check if the frequency range was extended
try
{
// try to tune the LO to 100 MHz (outside of the AD9363 tuning range)
IIOHelper.SetAttribute(_dev, "altvoltage0", "frequency", "100000000", false);
IIOHelper.SetAttribute(_dev, "altvoltage0", "frequency", _centerFrequency.ToString(), false);
}
catch (Exception ex)
{
MinFrequency = 325000000L;
MaxFrequency = 3800000000L;
_centerFrequency = MinFrequency;
}

Utils.SaveSetting("PlutoSDRURI", _gui.deviceUriTextbox.Text);

_gui.receiverPanel.Enabled = true;
Expand Down
4 changes: 2 additions & 2 deletions PlutoSDR/PlutoSDRIO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,14 @@ long ITunableSource.MinimumTunableFrequency
{
get
{
return 70000000L;
return _PlutoSDRDevice.MinFrequency;
}
}
long ITunableSource.MaximumTunableFrequency
{
get
{
return 6000000000L;
return _PlutoSDRDevice.MaxFrequency;
}
}

Expand Down

0 comments on commit b10de36

Please sign in to comment.