コード例 #1
0
ファイル: sdrplayplugin.cpp プロジェクト: f4exb/sdrangel
PluginInterface::SamplingDevices SDRPlayPlugin::enumSampleSources()
{
	SamplingDevices result;
	int count = mirisdr_get_device_count();

	char vendor[256];
	char product[256];
	char serial[256];

	for(int i = 0; i < count; i++)
	{
		vendor[0] = '\0';
		product[0] = '\0';
		serial[0] = '\0';

		if (mirisdr_get_device_usb_strings((uint32_t)i, vendor, product, serial) != 0)
		{
			continue;
		}

		qDebug("SDRPlayPlugin::enumSampleSources: found %s:%s (%s)", vendor, product, serial);
		QString displayedName(QString("SDRPlay[%1] %2").arg(i).arg(serial));

		result.append(SamplingDevice(displayedName,
				m_deviceTypeID,
				QString(serial),
				i));
	}

    return result;
}
コード例 #2
0
PluginInterface::SamplingDevices PlutoSDROutputPlugin::enumSampleSinks()
{
    DevicePlutoSDR::instance().scan();
    std::vector<std::string> serials;
    DevicePlutoSDR::instance().getSerials(serials);

    std::vector<std::string>::const_iterator it = serials.begin();
    int i;
	SamplingDevices result;

	for (i = 0; it != serials.end(); ++it, ++i)
	{
	    QString serial_str = QString::fromLocal8Bit(it->c_str());
	    QString displayedName(QString("PlutoSDR[%1] %2").arg(i).arg(serial_str));

        result.append(SamplingDevice(displayedName,
                m_hardwareID,
                m_deviceTypeID,
                serial_str,
                i,
                PluginInterface::SamplingDevice::PhysicalDevice,
                false,
                1,
                0));

        qDebug("PlutoSDROutputPlugin::enumSampleSources: enumerated PlutoSDR device #%d", i);
	}

	return result;
}
コード例 #3
0
PluginInterface::SamplingDevices SoapySDRInputPlugin::enumSampleSources()
{
    SamplingDevices result;
    DeviceSoapySDR& deviceSoapySDR = DeviceSoapySDR::instance();
    const std::vector<DeviceSoapySDRScan::SoapySDRDeviceEnum>& devicesEnumeration = deviceSoapySDR.getDevicesEnumeration();
    qDebug("SoapySDRInputPlugin::enumSampleSources: %lu SoapySDR devices. Enumerate these with Rx channel(s):", devicesEnumeration.size());
    std::vector<DeviceSoapySDRScan::SoapySDRDeviceEnum>::const_iterator it = devicesEnumeration.begin();

    for (int idev = 0; it != devicesEnumeration.end(); ++it, idev++)
    {
        unsigned int nbRxChannels = it->m_nbRx;

        for (unsigned int ichan = 0; ichan < nbRxChannels; ichan++)
        {
            QString displayedName(QString("SoapySDR[%1:%2] %3").arg(idev).arg(ichan).arg(it->m_label));
            QString serial(QString("%1-%2").arg(it->m_driverName).arg(it->m_sequence));
            qDebug("SoapySDRInputPlugin::enumSampleSources: device #%d (%s) serial %s channel %u",
                    idev, it->m_label.toStdString().c_str(), serial.toStdString().c_str(), ichan);
            result.append(SamplingDevice(displayedName,
                    m_hardwareID,
                    m_deviceTypeID,
                    serial,
                    idev,
                    PluginInterface::SamplingDevice::PhysicalDevice,
                    true,
                    nbRxChannels,
                    ichan));
        }
    }

    return result;
}
コード例 #4
0
PluginInterface::SamplingDevices BladeRF2OutputPlugin::enumSampleSinks()
{
    SamplingDevices result;
    struct bladerf_devinfo *devinfo = 0;

    int count = bladerf_get_device_list(&devinfo);

    if (devinfo)
    {
        for(int i = 0; i < count; i++)
        {
            struct bladerf *dev;

            int status = bladerf_open_with_devinfo(&dev, &devinfo[i]);

            if (status == BLADERF_ERR_NODEV)
            {
                qCritical("Bladerf2OutputPlugin::enumSampleSinks: No device at index %d", i);
                continue;
            }
            else if (status != 0)
            {
                qCritical("Bladerf2OutputPlugin::enumSampleSinks: Failed to open device at index %d", i);
                continue;
            }

            const char *boardName = bladerf_get_board_name(dev);

            if (strcmp(boardName, "bladerf2") == 0)
            {
                unsigned int nbTxChannels = bladerf_get_channel_count(dev, BLADERF_TX);

                for (unsigned int j = 0; j < nbTxChannels; j++)
                {
                    qDebug("Blderf2InputPlugin::enumSampleSinks: device #%d (%s) channel %u", i, devinfo[i].serial, j);
                    QString displayedName(QString("BladeRF2[%1:%2] %3").arg(devinfo[i].instance).arg(j).arg(devinfo[i].serial));
                    result.append(SamplingDevice(displayedName,
                            m_hardwareID,
                            m_deviceTypeID,
                            QString(devinfo[i].serial),
                            i,
                            PluginInterface::SamplingDevice::PhysicalDevice,
                            false,
                            nbTxChannels,
                            j));
                }
            }

            bladerf_close(dev);
        }

        bladerf_free_device_list(devinfo); // Valgrind memcheck
    }

    return result;
}
コード例 #5
0
PluginInterface::SamplingDevices Blderf1InputPlugin::enumSampleSources()
{
	SamplingDevices result;
	struct bladerf_devinfo *devinfo = 0;

	int count = bladerf_get_device_list(&devinfo);

    if (devinfo)
    {
        for(int i = 0; i < count; i++)
        {
            struct bladerf *dev;

            int status = bladerf_open_with_devinfo(&dev, &devinfo[i]);

            if (status == BLADERF_ERR_NODEV)
            {
                qCritical("BlderfInputPlugin::enumSampleSources: No device at index %d", i);
                continue;
            }
            else if (status != 0)
            {
                qCritical("BlderfInputPlugin::enumSampleSources: Failed to open device at index %d", i);
                continue;
            }

            const char *boardName = bladerf_get_board_name(dev);

            if (strcmp(boardName, "bladerf1") == 0)
            {
                QString displayedName(QString("BladeRF1[%1] %2").arg(devinfo[i].instance).arg(devinfo[i].serial));

                result.append(SamplingDevice(displayedName,
                        m_hardwareID,
                        m_deviceTypeID,
                        QString(devinfo[i].serial),
                        i,
                        PluginInterface::SamplingDevice::PhysicalDevice,
                        true,
                        1,
                        0));
            }

            bladerf_close(dev);
        }

		bladerf_free_device_list(devinfo); // Valgrind memcheck
	}

	return result;
}
コード例 #6
0
PluginInterface::SamplingDevices FileSourcePlugin::enumSampleSources()
{
	SamplingDevices result;

    result.append(SamplingDevice(
            "FileSource",
            m_hardwareID,
            m_deviceTypeID,
            QString::null,
            0,
            PluginInterface::SamplingDevice::BuiltInDevice,
            true,
            1,
            0));

	return result;
}
コード例 #7
0
ファイル: filesinkplugin.cpp プロジェクト: f4exb/sdrangel
PluginInterface::SamplingDevices FileSinkPlugin::enumSampleSinks()
{
	SamplingDevices result;
	int count = 1;

	for(int i = 0; i < count; i++)
	{
		QString displayedName(QString("FileSink[%1]").arg(i));

		result.append(SamplingDevice(displayedName,
				m_deviceTypeID,
				QString::null,
				i));
	}

	return result;
}
コード例 #8
0
ファイル: bladerfplugin.cpp プロジェクト: f4exb/sdrangel
PluginInterface::SamplingDevices BlderfPlugin::enumSampleSources()
{
	SamplingDevices result;
	struct bladerf_devinfo *devinfo = 0;

	int count = bladerf_get_device_list(&devinfo);

	for(int i = 0; i < count; i++)
	{
		QString displayedName(QString("BladeRF[%1] %2").arg(devinfo[i].instance).arg(devinfo[i].serial));

		result.append(SamplingDevice(displayedName,
				m_deviceTypeID,
				QString(devinfo[i].serial),
				i));
	}

	if (devinfo)
	{
		bladerf_free_device_list(devinfo); // Valgrind memcheck
	}

	return result;
}