1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 17:28:50 -05:00

Recognize SDRplay RSP1A but do not support it effectively

This commit is contained in:
f4exb 2017-12-19 22:46:17 +01:00
parent da4884d1a0
commit 934af70c74
3 changed files with 26 additions and 4 deletions

View File

@ -39,6 +39,7 @@ MESSAGE_CLASS_DEFINITION(SDRPlayInput::MsgStartStop, Message)
SDRPlayInput::SDRPlayInput(DeviceSourceAPI *deviceAPI) :
m_deviceAPI(deviceAPI),
m_variant(SDRPlayUndef),
m_settings(),
m_dev(0),
m_sdrPlayThread(0),
@ -81,13 +82,13 @@ bool SDRPlayInput::openDevice()
if (!m_sampleFifo.setSize(96000 * 4))
{
qCritical("SDRPlayInput::start: could not allocate SampleFifo");
qCritical("SDRPlayInput::openDevice: could not allocate SampleFifo");
return false;
}
if ((res = mirisdr_open(&m_dev, MIRISDR_HW_SDRPLAY, m_devNumber)) < 0)
{
qCritical("SDRPlayInput::start: could not open SDRPlay #%d: %s", m_devNumber, strerror(errno));
qCritical("SDRPlayInput::openDevice: could not open SDRPlay #%d: %s", m_devNumber, strerror(errno));
return false;
}
@ -101,14 +102,22 @@ bool SDRPlayInput::openDevice()
if ((res = mirisdr_get_device_usb_strings(m_devNumber, vendor, product, serial)) < 0)
{
qCritical("SDRPlayInput::start: error accessing USB device");
qCritical("SDRPlayInput::openDevice: error accessing USB device");
stop();
return false;
}
qWarning("SDRPlayInput::start: open: %s %s, SN: %s", vendor, product, serial);
qWarning("SDRPlayInput::openDevice: %s %s, SN: %s", vendor, product, serial);
m_deviceDescription = QString("%1 (SN %2)").arg(product).arg(serial);
if (QString(product) == "RSP1A") {
m_variant = SDRPlayRSP1A;
} else {
m_variant = SDRPlayRSP1;
}
qDebug("SDRPlayInput::openDevice: m_variant: %d", (int) m_variant);
return true;
}

View File

@ -30,6 +30,13 @@ class FileRecord;
class SDRPlayInput : public DeviceSampleSource {
public:
enum SDRPlayVariant
{
SDRPlayUndef,
SDRPlayRSP1,
SDRPlayRSP1A
};
class MsgConfigureSDRPlay : public Message {
MESSAGE_CLASS_DECLARATION
@ -142,6 +149,8 @@ public:
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage);
SDRPlayVariant getVariant() const { return m_variant; }
private:
bool openDevice();
void closeDevice();
@ -150,6 +159,7 @@ private:
DeviceSourceAPI *m_deviceAPI;
QMutex m_mutex;
SDRPlayVariant m_variant;
SDRPlaySettings m_settings;
mirisdr_dev_t* m_dev;
SDRPlayThread* m_sdrPlayThread;

View File

@ -20,3 +20,6 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="1df7", ATTRS{idProduct}=="2500", MODE:="066
# IO-DATA GV-TV100 stick
SUBSYSTEMS=="usb", ATTRS{idVendor}=="04bb", ATTRS{idProduct}=="0537", MODE:="0666"
# SDRplay RSP1A
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1df7", ATTRS{idProduct}=="3000", MODE:="0666"