From 8893dac5a8cdad95775cd4387bb55f243bb5af8a Mon Sep 17 00:00:00 2001 From: japm48 Date: Mon, 21 Sep 2020 14:58:33 +0200 Subject: [PATCH 1/2] lora_receive_file_nogui: respect bandwidth choice --- apps/lora_receive_file_nogui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/lora_receive_file_nogui.py b/apps/lora_receive_file_nogui.py index 0f55f29..8f1ad79 100755 --- a/apps/lora_receive_file_nogui.py +++ b/apps/lora_receive_file_nogui.py @@ -28,7 +28,7 @@ class lora_receive_file_nogui(gr.top_block): # Blocks ################################################## self.message_socket_sink = lora.message_socket_sink('127.0.0.1', 40868, 1) - self.lora_receiver = lora.lora_receiver(sample_rate, capture_freq, ([lc.freq]), 125000, lc.sf, lc.implicit, lc.cr_num, lc.crc, reduced_rate=False, decimation=self.decimation) + self.lora_receiver = lora.lora_receiver(sample_rate, capture_freq, ([lc.freq]), lc.bw, lc.sf, lc.implicit, lc.cr_num, lc.crc, reduced_rate=False, decimation=self.decimation) self.blocks_throttle = blocks.throttle(gr.sizeof_gr_complex, sample_rate, True) self.blocks_file_source = blocks.file_source(gr.sizeof_gr_complex, sample_file, False) From 0101ec36df8c24ae2dd602c8f1d7449733a42922 Mon Sep 17 00:00:00 2001 From: Weixuan XIAO Date: Thu, 7 Jan 2021 11:46:25 +0100 Subject: [PATCH 2/2] Add boost::placeholders namespace to _1 Placeholders are not exported to global namespace since boost 1.73. See [boost/bind.hpp](https://github.com/boostorg/bind/blob/e3cf787dff2684e7bc45bb84dfa390514656b110/include/boost/bind.hpp#L36): ```cpp BOOST_PRAGMA_MESSAGE( "The practice of declaring the Bind placeholders (_1, _2, ...) " "in the global namespace is deprecated. Please use " " + using namespace boost::placeholders, " "or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior." ) ``` The placeholders are always defined in boost::placeholders namesapce. And they were exported to the global namespace before 1.73. So, adding the namespace will not affect the compilation with earlier version. --- lib/controller_impl.cc | 2 +- lib/message_file_sink_impl.cc | 2 +- lib/message_socket_sink_impl.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/controller_impl.cc b/lib/controller_impl.cc index 8e40524..bd19216 100644 --- a/lib/controller_impl.cc +++ b/lib/controller_impl.cc @@ -46,7 +46,7 @@ namespace gr { d_parent = parent; d_port = pmt::intern("control"); message_port_register_in(d_port); - set_msg_handler(d_port, boost::bind(&controller_impl::handle_control, this, _1)); + set_msg_handler(d_port, boost::bind(&controller_impl::handle_control, this, boost::placeholders::_1)); } void controller_impl::handle_control(pmt::pmt_t msg){ diff --git a/lib/message_file_sink_impl.cc b/lib/message_file_sink_impl.cc index 6193e2c..af603b7 100644 --- a/lib/message_file_sink_impl.cc +++ b/lib/message_file_sink_impl.cc @@ -699,7 +699,7 @@ namespace gr { gr::io_signature::make(0, 0, 0)) { message_port_register_in(pmt::mp("in")); - set_msg_handler(pmt::mp("in"), boost::bind(&message_file_sink_impl::msg_handler, this, _1)); + set_msg_handler(pmt::mp("in"), boost::bind(&message_file_sink_impl::msg_handler, this, boost::placeholders::_1)); d_file.open(path.c_str(), std::ios::out | std::ios::binary); } diff --git a/lib/message_socket_sink_impl.cc b/lib/message_socket_sink_impl.cc index e3b38fb..df9183c 100644 --- a/lib/message_socket_sink_impl.cc +++ b/lib/message_socket_sink_impl.cc @@ -47,7 +47,7 @@ namespace gr { d_layer(layer) { message_port_register_in(pmt::mp("in")); - set_msg_handler(pmt::mp("in"), boost::bind(&message_socket_sink_impl::handle, this, _1)); + set_msg_handler(pmt::mp("in"), boost::bind(&message_socket_sink_impl::handle, this, boost::placeholders::_1)); d_socket = socket(AF_INET, SOCK_DGRAM, 0);