File: subdev_spec_python.hpp

package info (click to toggle)
uhd 4.3.0.0%2Bds1-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 175,384 kB
  • sloc: cpp: 271,145; ansic: 103,960; python: 95,906; vhdl: 55,838; tcl: 14,117; xml: 8,535; makefile: 2,706; sh: 2,432; pascal: 230; javascript: 120; csh: 94; asm: 20; perl: 11
file content (32 lines) | stat: -rw-r--r-- 1,038 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
28
29
30
31
32
//
// 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 */