-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyDeviceSupport.cpp
More file actions
44 lines (36 loc) · 1.43 KB
/
MyDeviceSupport.cpp
File metadata and controls
44 lines (36 loc) · 1.43 KB
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
37
38
39
40
41
42
43
44
// extern "C" {
// #include <iio/iio-debug.h>
// }
// #include <iio/iio.h>
#include <SoapySDR/Device.hpp>
#include <SoapySDR/Formats.hpp>
#include <SoapySDR/Logger.hpp>
#include <SoapySDR/Registry.hpp>
#include <chrono>
#include <iostream>
#include <string>
#include "IIODevice.hpp"
#define IIO_ENSURE(expr) \
{ \
if (!(expr)) { \
(void)fprintf(stderr, "assertion failed (%s:%d)\n", __FILE__, __LINE__); \
(void)abort(); \
} \
}
SoapySDR::KwargsList findMyDevice(const SoapySDR::Kwargs& args) {
std::vector<SoapySDR::Kwargs> results;
SoapySDR_logf(SOAPY_SDR_DEBUG, "findMyDevice");
(void)args;
SoapySDR::Kwargs options;
options["device"] = "MyDevice";
options["driver"] = "my_device";
options["label"] = "my_device";
results.push_back(options);
return results;
}
SoapySDR::Device* makeMyDevice(const SoapySDR::Kwargs& args) {
(void)args;
SoapySDR_logf(SOAPY_SDR_DEBUG, "makeMyDevice ");
return new IIODevice();
}
static SoapySDR::Registry registerMyDevice("my_device", &findMyDevice, &makeMyDevice, SOAPY_SDR_ABI_VERSION);