Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* -*- c++ -*- */
- /*
- * Copyright 2016 <+YOU OR YOUR COMPANY+>.
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
- #ifdef HAVE_CONFIG_H
- #include "config.h"
- #endif
- #include <gnuradio/io_signature.h>
- #include "cptest_impl.h"
- namespace gr {
- namespace ccsds {
- cptest::sptr
- cptest::make()
- {
- return gnuradio::get_initial_sptr(new cptest_impl());
- }
- /*
- * The private constructor
- */
- cptest_impl::cptest_impl()
- : gr::sync_block("cptest",
- gr::io_signature::make(0, 0, 0),
- gr::io_signature::make(0, 0, 0))
- {
- printf("constructor()\n");
- // register input
- message_port_register_in(pmt::mp("in"));
- set_msg_handler(pmt::mp("in"), boost::bind(&cptest_impl::process_frame, this, _1));
- }
- void cptest_impl::process_frame(pmt::pmt_t msg_in) {
- printf("process frame()\n");
- }
- /*
- * Our virtual destructor.
- */
- cptest_impl::~cptest_impl() { }
- int cptest_impl::work(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
- {
- // Do nothing here and return 0 samples processed
- return 0;
- }
- void cptest_impl::setup_rpc()
- {
- printf("setup_rpc()\n");
- #ifdef GR_CTRLPORT
- add_rpc_variable(
- rpcbasic_sptr(new rpcbasic_register_get<cptest, float>(
- alias(), "testval",
- &cptest::get_testf,
- pmt::mp(-2.0f), pmt::mp(2.0f), pmt::mp(0.0f),
- "1", "Test value", RPC_PRIVLVL_MIN,
- DISPTIME | DISPOPTSTRIP))
- );
- #endif
- }
- } /* namespace ccsds */
- } /* namespace gr */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement