File: device_python.cc

package info (click to toggle)
gr-osmosdr 0.2.6-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,184 kB
  • sloc: cpp: 16,440; python: 11,368; xml: 42; ansic: 34; makefile: 16
file content (27 lines) | stat: -rw-r--r-- 637 bytes parent folder | download | duplicates (2)
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
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

namespace py = pybind11;

#include <osmosdr/device.h>

void bind_device(py::module& m)
{
    using device_t = ::osmosdr::device_t;

    py::class_<device_t>(m, "device_t")
        .def(py::init<std::string&>(), py::arg("args") = "")
        .def("to_pp_string", &device_t::to_pp_string)
        .def("to_string", &device_t::to_string);


    using devices_t = ::osmosdr::devices_t;

    py::class_<devices_t>(m, "devices_t");


    using device = ::osmosdr::device;

    py::class_<device>(m, "device")
        .def_static("find", &device::find, py::arg("hint") = device_t());
}