1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
#include <SoapySDR/Device.hpp>
#include <SoapySDR/Registry.hpp>
/***********************************************************************
* Device interface
**********************************************************************/
class MyDevice : public SoapySDR::Device
{
//Implement constructor with device specific arguments...
//Implement all applicable virtual methods from SoapySDR::Device
};
/***********************************************************************
* Find available devices
**********************************************************************/
SoapySDR::KwargsList findMyDevice(const SoapySDR::Kwargs &args)
{
//locate the device on the system...
//return a list of 0, 1, or more argument maps that each identify a device
}
/***********************************************************************
* Make device instance
**********************************************************************/
SoapySDR::Device *makeMyDevice(const SoapySDR::Kwargs &args)
{
//create an instance of the device object given the args
//here we will translate args into something used in the constructor
return new MyDevice(...);
}
/***********************************************************************
* Registration
**********************************************************************/
static SoapySDR::Registry registerMyDevice("my_device", &findMyDevice, &makeMyDevice, SOAPY_SDR_ABI_VERSION);
|