python bindings

This commit is contained in:
Bastian Bloessl
2021-07-19 09:36:07 +02:00
parent eeca8906ba
commit a1bbd2b44b
22 changed files with 1151 additions and 2 deletions
@@ -0,0 +1,109 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited */
/* The following lines can be configured to regenerate this file during cmake */
/* If manual edits are made, the following tags should be modified accordingly. */
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(random_periodic_msg_source.h) */
/* BINDTOOL_HEADER_FILE_HASH(0a96820144211e87383cb24fd175ffdf) */
/***********************************************************************************/
#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <foo/random_periodic_msg_source.h>
// pydoc.h is automatically generated in the build directory
#include <random_periodic_msg_source_pydoc.h>
void bind_random_periodic_msg_source(py::module& m)
{
using random_periodic_msg_source = ::gr::foo::random_periodic_msg_source;
py::class_<random_periodic_msg_source, gr::block, gr::basic_block,
std::shared_ptr<random_periodic_msg_source>>(m, "random_periodic_msg_source", D(random_periodic_msg_source))
.def(py::init(&random_periodic_msg_source::make),
py::arg("msg_len"),
py::arg("interval"),
py::arg("num_msg") = 1,
py::arg("quit") = true,
py::arg("debug") = false,
py::arg("seed") = 0,
D(random_periodic_msg_source,make)
)
.def("set_nmsg",&random_periodic_msg_source::set_nmsg,
py::arg("nmsg"),
D(random_periodic_msg_source,set_nmsg)
)
.def("get_nmsg",&random_periodic_msg_source::get_nmsg,
D(random_periodic_msg_source,get_nmsg)
)
.def("set_delay",&random_periodic_msg_source::set_delay,
py::arg("delay"),
D(random_periodic_msg_source,set_delay)
)
.def("get_delay",&random_periodic_msg_source::get_delay,
D(random_periodic_msg_source,get_delay)
)
.def("start_tx",&random_periodic_msg_source::start_tx,
D(random_periodic_msg_source,start_tx)
)
.def("stop_tx",&random_periodic_msg_source::stop_tx,
D(random_periodic_msg_source,stop_tx)
)
.def("is_running",&random_periodic_msg_source::is_running,
D(random_periodic_msg_source,is_running)
)
;
}