uhd/host/lib/usrp/subdev_spec_python.hpp
Martin Braun 692ddc71b1 python: Replace Boost.Python with PyBind11
This does not change the Python API itself, but it is still
a significant change. Most importantly, it removes the dependency on
Boost.Python.
2019-02-22 16:56:52 -08:00

34 lines
1 KiB
C++

//
// Copyright 2017-2018 Ettus Research, a National Instruments Company
// Copyright 2019 Ettus Research, a National Instruments Brand
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#ifndef INCLUDED_UHD_USRP_SUBDEV_SPEC_PYTHON_HPP
#define INCLUDED_UHD_USRP_SUBDEV_SPEC_PYTHON_HPP
#include <uhd/usrp/subdev_spec.hpp>
void export_subdev_spec(py::module& m)
{
using subdev_spec_pair_t = uhd::usrp::subdev_spec_pair_t;
using subdev_spec_t = uhd::usrp::subdev_spec_t;
py::class_<subdev_spec_pair_t> (m, "subdev_spec_pair")
.def(py::init<const std::string&, const std::string &>())
// Properties
.def_readwrite("db_name", &subdev_spec_pair_t::db_name)
.def_readwrite("sd_name", &subdev_spec_pair_t::sd_name)
;
py::class_<subdev_spec_t>(m, "subdev_spec")
.def(py::init<const std::string &>())
// Methods
.def("__str__", &subdev_spec_t::to_pp_string)
.def("to_string", &subdev_spec_t::to_string)
;
}
#endif /* INCLUDED_UHD_USRP_SUBDEV_SPEC_PYTHON_HPP */