File: MyDeviceSupport.cpp

package info (click to toggle)
soapysdr 0.5.4-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 768 kB
  • ctags: 612
  • sloc: cpp: 3,401; ansic: 416; python: 219; makefile: 18; sh: 11
file content (36 lines) | stat: -rw-r--r-- 1,443 bytes parent folder | download | duplicates (6)
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);