aboutsummaryrefslogtreecommitdiffstats
path: root/python/bindings/device_python.cc
blob: f82a48fa15c8084c6d579b55b3e79e7c01c319d5 (plain)
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());
}