Merge pull request #1 from osh/master

updates for 3.7
This commit is contained in:
Bastian Bloessl
2013-05-31 13:51:56 -07:00
17 changed files with 195 additions and 198 deletions
+6 -10
View File
@@ -82,15 +82,11 @@ set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks)
######################################################################## ########################################################################
# Find gnuradio build dependencies # Find gnuradio build dependencies
######################################################################## ########################################################################
find_package(Gruel) set(GR_REQUIRED_COMPONENTS RUNTIME BLOCKS PMT FILTER FFT)
find_package(GnuradioCore) find_package(Gnuradio)
if(NOT GRUEL_FOUND) if(NOT GNURADIO_RUNTIME_FOUND)
message(FATAL_ERROR "Gruel required to compile IEEE802-15-4") message(FATAL_ERROR "GnuRadio Runtime required to compile IEEE802-15-4")
endif()
if(NOT GNURADIO_CORE_FOUND)
message(FATAL_ERROR "GnuRadio Core required to compile IEEE802-15-4")
endif() endif()
######################################################################## ########################################################################
@@ -101,13 +97,13 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/lib ${CMAKE_CURRENT_SOURCE_DIR}/lib
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${GRUEL_INCLUDE_DIRS} ${GRUEL_INCLUDE_DIRS}
${GNURADIO_CORE_INCLUDE_DIRS} ${GNURADIO_RUNTIME_INCLUDE_DIRS}
) )
link_directories( link_directories(
${Boost_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS}
${GRUEL_LIBRARY_DIRS} ${GRUEL_LIBRARY_DIRS}
${GNURADIO_CORE_LIBRARY_DIRS} ${GNURADIO_RUNTIME_LIBRARY_DIRS}
) )
set(GR_IEEE802_11_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include) set(GR_IEEE802_11_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include)
+110 -110
View File
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='ASCII'?> <?xml version='1.0' encoding='ASCII'?>
<flow_graph> <flow_graph>
<timestamp>Fri May 3 14:41:28 2013</timestamp> <timestamp>Fri May 31 10:55:49 2013</timestamp>
<block> <block>
<key>options</key> <key>options</key>
<param> <param>
@@ -779,7 +779,7 @@
</param> </param>
</block> </block>
<block> <block>
<key>gr_skiphead</key> <key>blocks_skiphead</key>
<param> <param>
<key>id</key> <key>id</key>
<value>gr_skiphead_0</value> <value>gr_skiphead_0</value>
@@ -841,7 +841,7 @@
</param> </param>
</block> </block>
<block> <block>
<key>gr_multiply_xx</key> <key>blocks_multiply_xx</key>
<param> <param>
<key>id</key> <key>id</key>
<value>gr_multiply_xx_0</value> <value>gr_multiply_xx_0</value>
@@ -872,7 +872,7 @@
</param> </param>
</block> </block>
<block> <block>
<key>gr_complex_to_mag</key> <key>blocks_complex_to_mag</key>
<param> <param>
<key>id</key> <key>id</key>
<value>gr_complex_to_mag_0</value> <value>gr_complex_to_mag_0</value>
@@ -895,7 +895,7 @@
</param> </param>
</block> </block>
<block> <block>
<key>gr_file_sink</key> <key>blocks_file_sink</key>
<param> <param>
<key>id</key> <key>id</key>
<value>gr_file_sink_0_1_0</value> <value>gr_file_sink_0_1_0</value>
@@ -930,7 +930,7 @@
</param> </param>
</block> </block>
<block> <block>
<key>gr_vector_to_stream</key> <key>blocks_vector_to_stream</key>
<param> <param>
<key>id</key> <key>id</key>
<value>gr_vector_to_stream_0_0</value> <value>gr_vector_to_stream_0_0</value>
@@ -961,7 +961,7 @@
</param> </param>
</block> </block>
<block> <block>
<key>gr_file_sink</key> <key>blocks_file_sink</key>
<param> <param>
<key>id</key> <key>id</key>
<value>gr_file_sink_0_1</value> <value>gr_file_sink_0_1</value>
@@ -996,7 +996,7 @@
</param> </param>
</block> </block>
<block> <block>
<key>gr_vector_to_stream</key> <key>blocks_vector_to_stream</key>
<param> <param>
<key>id</key> <key>id</key>
<value>gr_vector_to_stream_0</value> <value>gr_vector_to_stream_0</value>
@@ -1070,7 +1070,7 @@
</param> </param>
</block> </block>
<block> <block>
<key>gr_file_sink</key> <key>blocks_file_sink</key>
<param> <param>
<key>id</key> <key>id</key>
<value>gr_file_sink_0</value> <value>gr_file_sink_0</value>
@@ -1105,7 +1105,7 @@
</param> </param>
</block> </block>
<block> <block>
<key>gr_complex_to_mag_squared</key> <key>blocks_complex_to_mag_squared</key>
<param> <param>
<key>id</key> <key>id</key>
<value>gr_complex_to_mag_squared_0</value> <value>gr_complex_to_mag_squared_0</value>
@@ -1159,7 +1159,7 @@
</param> </param>
</block> </block>
<block> <block>
<key>gr_tag_debug</key> <key>blocks_tag_debug</key>
<param> <param>
<key>id</key> <key>id</key>
<value>gr_tag_debug_0</value> <value>gr_tag_debug_0</value>
@@ -1198,7 +1198,7 @@
</param> </param>
</block> </block>
<block> <block>
<key>gr_file_sink</key> <key>blocks_file_sink</key>
<param> <param>
<key>id</key> <key>id</key>
<value>gr_file_sink_0_0</value> <value>gr_file_sink_0_0</value>
@@ -1284,7 +1284,7 @@
</param> </param>
</block> </block>
<block> <block>
<key>gr_divide_xx</key> <key>blocks_divide_xx</key>
<param> <param>
<key>id</key> <key>id</key>
<value>gr_divide_xx_0</value> <value>gr_divide_xx_0</value>
@@ -1315,7 +1315,7 @@
</param> </param>
</block> </block>
<block> <block>
<key>gr_stream_to_vector</key> <key>blocks_stream_to_vector</key>
<param> <param>
<key>id</key> <key>id</key>
<value>gr_stream_to_vector_0</value> <value>gr_stream_to_vector_0</value>
@@ -1346,7 +1346,7 @@
</param> </param>
</block> </block>
<block> <block>
<key>gr_conjugate_cc</key> <key>blocks_conjugate_cc</key>
<param> <param>
<key>id</key> <key>id</key>
<value>gr_conjugate_cc_0</value> <value>gr_conjugate_cc_0</value>
@@ -1396,7 +1396,7 @@
</param> </param>
</block> </block>
<block> <block>
<key>gr_delay</key> <key>blocks_delay</key>
<param> <param>
<key>id</key> <key>id</key>
<value>gr_delay_0_0</value> <value>gr_delay_0_0</value>
@@ -1431,7 +1431,7 @@
</param> </param>
</block> </block>
<block> <block>
<key>gr_delay</key> <key>blocks_delay</key>
<param> <param>
<key>id</key> <key>id</key>
<value>gr_delay_0</value> <value>gr_delay_0</value>
@@ -1562,64 +1562,6 @@
<value>0</value> <value>0</value>
</param> </param>
</block> </block>
<block>
<key>ieee802_11_ofdm_parse_mac</key>
<param>
<key>id</key>
<value>ieee802_11_ofdm_parse_mac_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>debug</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(1030, 857)</value>
</param>
<param>
<key>_rotation</key>
<value>180</value>
</param>
</block>
<block>
<key>gr_socket_pdu</key>
<param>
<key>id</key>
<value>gr_socket_pdu_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>type</key>
<value>"UDP_SERVER"</value>
</param>
<param>
<key>host</key>
<value></value>
</param>
<param>
<key>port</key>
<value>12345</value>
</param>
<param>
<key>mtu</key>
<value>10000</value>
</param>
<param>
<key>_coordinate</key>
<value>(771, 833)</value>
</param>
<param>
<key>_rotation</key>
<value>180</value>
</param>
</block>
<block> <block>
<key>ieee802_1_ofdm_equalize_symbols</key> <key>ieee802_1_ofdm_equalize_symbols</key>
<param> <param>
@@ -1666,29 +1608,6 @@
<value>0</value> <value>0</value>
</param> </param>
</block> </block>
<block>
<key>ieee802_1_ofdm_decode_mac</key>
<param>
<key>id</key>
<value>ieee802_1_ofdm_decode_mac_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>debug</key>
<value>False</value>
</param>
<param>
<key>_coordinate</key>
<value>(1069, 729)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
</block>
<block> <block>
<key>ieee802_1_ofdm_sync_short</key> <key>ieee802_1_ofdm_sync_short</key>
<param> <param>
@@ -1724,6 +1643,87 @@
<value>0</value> <value>0</value>
</param> </param>
</block> </block>
<block>
<key>ieee802_1_ofdm_decode_mac</key>
<param>
<key>id</key>
<value>ieee802_1_ofdm_decode_mac_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>debug</key>
<value>False</value>
</param>
<param>
<key>_coordinate</key>
<value>(1069, 729)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
</block>
<block>
<key>ieee802_11_ofdm_parse_mac</key>
<param>
<key>id</key>
<value>ieee802_11_ofdm_parse_mac_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>debug</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(1030, 857)</value>
</param>
<param>
<key>_rotation</key>
<value>180</value>
</param>
</block>
<block>
<key>blocks_socket_pdu</key>
<param>
<key>id</key>
<value>gr_socket_pdu_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>type</key>
<value>"UDP_SERVER"</value>
</param>
<param>
<key>host</key>
<value></value>
</param>
<param>
<key>port</key>
<value>12345</value>
</param>
<param>
<key>mtu</key>
<value>10000</value>
</param>
<param>
<key>_coordinate</key>
<value>(771, 839)</value>
</param>
<param>
<key>_rotation</key>
<value>180</value>
</param>
</block>
<connection> <connection>
<source_block_id>uhd_usrp_source_0</source_block_id> <source_block_id>uhd_usrp_source_0</source_block_id>
<sink_block_id>gr_skiphead_0</sink_block_id> <sink_block_id>gr_skiphead_0</sink_block_id>
@@ -1874,22 +1874,22 @@
<source_key>0</source_key> <source_key>0</source_key>
<sink_key>0</sink_key> <sink_key>0</sink_key>
</connection> </connection>
<connection>
<source_block_id>ieee802_1_ofdm_decode_mac_0</source_block_id>
<sink_block_id>ieee802_11_ofdm_parse_mac_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>ieee802_11_ofdm_parse_mac_0</source_block_id>
<sink_block_id>gr_socket_pdu_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection> <connection>
<source_block_id>gr_divide_xx_0</source_block_id> <source_block_id>gr_divide_xx_0</source_block_id>
<sink_block_id>ieee802_1_ofdm_sync_short_0</sink_block_id> <sink_block_id>ieee802_1_ofdm_sync_short_0</sink_block_id>
<source_key>0</source_key> <source_key>0</source_key>
<sink_key>1</sink_key> <sink_key>1</sink_key>
</connection> </connection>
<connection>
<source_block_id>ieee802_1_ofdm_decode_mac_0</source_block_id>
<sink_block_id>ieee802_11_ofdm_parse_mac_0</sink_block_id>
<source_key>out</source_key>
<sink_key>in</sink_key>
</connection>
<connection>
<source_block_id>ieee802_11_ofdm_parse_mac_0</source_block_id>
<sink_block_id>gr_socket_pdu_0</sink_block_id>
<source_key>out</source_key>
<sink_key>pdus</sink_key>
</connection>
</flow_graph> </flow_graph>
@@ -18,12 +18,12 @@
#define INCLUDED_GR_IEEE802_11_OFDM_DECODE_MAC_H #define INCLUDED_GR_IEEE802_11_OFDM_DECODE_MAC_H
#include <gnuradio/ieee802_11/api.h> #include <gnuradio/ieee802_11/api.h>
#include <gnuradio/gr_block.h> #include <gnuradio/block.h>
namespace gr { namespace gr {
namespace ieee802_11 { namespace ieee802_11 {
class GR_IEEE802_11_API ofdm_decode_mac : virtual public gr_block class GR_IEEE802_11_API ofdm_decode_mac : virtual public gr::block
{ {
public: public:
@@ -18,12 +18,12 @@
#define INCLUDED_GR_IEEE802_11_OFDM_DECODE_SIGNAL_H #define INCLUDED_GR_IEEE802_11_OFDM_DECODE_SIGNAL_H
#include <gnuradio/ieee802_11/api.h> #include <gnuradio/ieee802_11/api.h>
#include <gnuradio/gr_block.h> #include <gnuradio/block.h>
namespace gr { namespace gr {
namespace ieee802_11 { namespace ieee802_11 {
class GR_IEEE802_11_API ofdm_decode_signal : virtual public gr_block class GR_IEEE802_11_API ofdm_decode_signal : virtual public gr::block
{ {
public: public:
@@ -18,12 +18,12 @@
#define INCLUDED_GR_IEEE802_11_OFDM_EQUALIZE_SYMBOLS_H #define INCLUDED_GR_IEEE802_11_OFDM_EQUALIZE_SYMBOLS_H
#include <gnuradio/ieee802_11/api.h> #include <gnuradio/ieee802_11/api.h>
#include <gnuradio/gr_block.h> #include <gnuradio/block.h>
namespace gr { namespace gr {
namespace ieee802_11 { namespace ieee802_11 {
class GR_IEEE802_11_API ofdm_equalize_symbols : virtual public gr_block class GR_IEEE802_11_API ofdm_equalize_symbols : virtual public gr::block
{ {
public: public:
+2 -2
View File
@@ -18,12 +18,12 @@
#define INCLUDED_GR_IEEE802_11_OFDM_PARSE_MAC_H #define INCLUDED_GR_IEEE802_11_OFDM_PARSE_MAC_H
#include <gnuradio/ieee802_11/api.h> #include <gnuradio/ieee802_11/api.h>
#include <gnuradio/gr_block.h> #include <gnuradio/block.h>
namespace gr { namespace gr {
namespace ieee802_11 { namespace ieee802_11 {
class GR_IEEE802_11_API ofdm_parse_mac : virtual public gr_block class GR_IEEE802_11_API ofdm_parse_mac : virtual public gr::block
{ {
public: public:
+2 -2
View File
@@ -18,12 +18,12 @@
#define INCLUDED_GR_IEEE802_11_OFDM_SYNC_LONG_H #define INCLUDED_GR_IEEE802_11_OFDM_SYNC_LONG_H
#include <gnuradio/ieee802_11/api.h> #include <gnuradio/ieee802_11/api.h>
#include <gnuradio/gr_block.h> #include <gnuradio/block.h>
namespace gr { namespace gr {
namespace ieee802_11 { namespace ieee802_11 {
class GR_IEEE802_11_API ofdm_sync_long : virtual public gr_block class GR_IEEE802_11_API ofdm_sync_long : virtual public gr::block
{ {
public: public:
@@ -18,12 +18,12 @@
#define INCLUDED_GR_IEEE802_11_OFDM_SYNC_SHORT_H #define INCLUDED_GR_IEEE802_11_OFDM_SYNC_SHORT_H
#include <gnuradio/ieee802_11/api.h> #include <gnuradio/ieee802_11/api.h>
#include <gnuradio/gr_block.h> #include <gnuradio/block.h>
namespace gr { namespace gr {
namespace ieee802_11 { namespace ieee802_11 {
class GR_IEEE802_11_API ofdm_sync_short : virtual public gr_block class GR_IEEE802_11_API ofdm_sync_short : virtual public gr::block
{ {
public: public:
+4 -3
View File
@@ -31,12 +31,13 @@ list(APPEND gr_ieee802_11_sources
list(APPEND gr_ieee802_11_libs list(APPEND gr_ieee802_11_libs
${Boost_LIBRARIES} ${Boost_LIBRARIES}
${GRUEL_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES}
${GNURADIO_CORE_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES}
${GNURADIO_FFT_LIBRARIES}
) )
add_library(gnuradio-ieee802_11 SHARED ${gr_ieee802_11_sources}) add_library(gnuradio-ieee802_11 SHARED ${gr_ieee802_11_sources})
target_link_libraries(gnuradio-ieee802_11 ${gr_ieee802_11_libs} itpp gnuradio-fft gnuradio-filter) target_link_libraries(gnuradio-ieee802_11 ${gr_ieee802_11_libs} itpp)
set_target_properties(gnuradio-ieee802_11 PROPERTIES DEFINE_SYMBOL "gnuradio_ieee802_11_EXPORTS") set_target_properties(gnuradio-ieee802_11 PROPERTIES DEFINE_SYMBOL "gnuradio_ieee802_11_EXPORTS")
######################################################################## ########################################################################
+9 -9
View File
@@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <gnuradio/ieee802_11/ofdm_decode_mac.h> #include <gnuradio/ieee802_11/ofdm_decode_mac.h>
#include <gnuradio/gr_io_signature.h> #include <gnuradio/io_signature.h>
#include <itpp/itcomm.h> #include <itpp/itcomm.h>
#include <iostream> #include <iostream>
@@ -173,9 +173,9 @@ class ofdm_decode_mac_impl : public ofdm_decode_mac {
#define dout d_debug && std::cout #define dout d_debug && std::cout
public: public:
ofdm_decode_mac_impl(bool debug) : gr_block("ofdm_decode_mac", ofdm_decode_mac_impl(bool debug) : gr::block("ofdm_decode_mac",
gr_make_io_signature(1, 1, 48 * sizeof(gr_complex)), gr::io_signature::make(1, 1, 48 * sizeof(gr_complex)),
gr_make_io_signature(0, 0, 0)), gr::io_signature::make(0, 0, 0)),
d_debug(debug), d_debug(debug),
ofdm(BPSK_1_2), ofdm(BPSK_1_2),
tx(ofdm, 0) { tx(ofdm, 0) {
@@ -194,7 +194,7 @@ int general_work (int noutput_items, gr_vector_int& ninput_items,
int i = 0; int i = 0;
std::vector<gr_tag_t> tags; std::vector<gr::tag_t> tags;
const uint64_t nread = this->nitems_read(0); const uint64_t nread = this->nitems_read(0);
dout << "Decode MAC: input " << ninput_items[0] << std::endl; dout << "Decode MAC: input " << ninput_items[0] << std::endl;
@@ -202,12 +202,12 @@ int general_work (int noutput_items, gr_vector_int& ninput_items,
while(i < ninput_items[0]) { while(i < ninput_items[0]) {
get_tags_in_range(tags, 0, nread + i * 48, nread + (i + 1) * 48 - 1, get_tags_in_range(tags, 0, nread + i * 48, nread + (i + 1) * 48 - 1,
pmt::pmt_string_to_symbol("ofdm_start")); pmt::string_to_symbol("ofdm_start"));
if(tags.size()) { if(tags.size()) {
pmt::pmt_t tuple = tags[0].value; pmt::pmt_t tuple = tags[0].value;
int len_data = pmt::pmt_to_uint64(pmt::pmt_car(tuple)); int len_data = pmt::to_uint64(pmt::car(tuple));
int encoding = pmt::pmt_to_uint64(pmt::pmt_cdr(tuple)); int encoding = pmt::to_uint64(pmt::cdr(tuple));
ofdm = ofdm_param((ENCODING)encoding); ofdm = ofdm_param((ENCODING)encoding);
tx = tx_param(ofdm, len_data); tx = tx_param(ofdm, len_data);
@@ -251,7 +251,7 @@ void decode() {
print_output(); print_output();
// skip service field // skip service field
pmt::pmt_t blob = pmt::pmt_make_blob(out_bytes + 2, tx.psdu_size); pmt::pmt_t blob = pmt::make_blob(out_bytes + 2, tx.psdu_size);
message_port_pub(pmt::mp("out"), blob); message_port_pub(pmt::mp("out"), blob);
} }
+11 -11
View File
@@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <gnuradio/ieee802_11/ofdm_decode_signal.h> #include <gnuradio/ieee802_11/ofdm_decode_signal.h>
#include <gnuradio/gr_io_signature.h> #include <gnuradio/io_signature.h>
#include <iostream> #include <iostream>
#include <itpp/itcomm.h> #include <itpp/itcomm.h>
@@ -29,15 +29,15 @@ class ofdm_decode_signal_impl : public ofdm_decode_signal {
#define dout d_debug && std::cout #define dout d_debug && std::cout
public: public:
ofdm_decode_signal_impl(bool debug) : gr_block("ofdm_decode_signal", ofdm_decode_signal_impl(bool debug) : gr::block("ofdm_decode_signal",
gr_make_io_signature(1, 1, 48 * sizeof(gr_complex)), gr::io_signature::make(1, 1, 48 * sizeof(gr_complex)),
gr_make_io_signature(1, 1, 48 * sizeof(gr_complex))), gr::io_signature::make(1, 1, 48 * sizeof(gr_complex))),
d_debug(debug), d_debug(debug),
d_copy_symbols(0) { d_copy_symbols(0) {
decoded_bits.set_size(24); decoded_bits.set_size(24);
set_relative_rate(1); set_relative_rate(1);
set_tag_propagation_policy(gr_block::TPP_DONT); set_tag_propagation_policy(gr::block::TPP_DONT);
} }
~ofdm_decode_signal_impl(){ ~ofdm_decode_signal_impl(){
@@ -53,7 +53,7 @@ int general_work (int noutput_items, gr_vector_int& ninput_items,
int i = 0; int i = 0;
int o = 0; int o = 0;
std::vector<gr_tag_t> tags; std::vector<gr::tag_t> tags;
const uint64_t nread = nitems_read(0); const uint64_t nread = nitems_read(0);
dout << "Decode Signal: input " << ninput_items[0] dout << "Decode Signal: input " << ninput_items[0]
@@ -62,7 +62,7 @@ int general_work (int noutput_items, gr_vector_int& ninput_items,
while((i < ninput_items[0]) && (o < noutput_items)) { while((i < ninput_items[0]) && (o < noutput_items)) {
get_tags_in_range(tags, 0, nread + i * 48, nread + (i + 1) * 48 - 1, get_tags_in_range(tags, 0, nread + i * 48, nread + (i + 1) * 48 - 1,
pmt::pmt_string_to_symbol("ofdm_start")); pmt::string_to_symbol("ofdm_start"));
if(tags.size()) { if(tags.size()) {
for(int n = 0; n < 48; n++) { for(int n = 0; n < 48; n++) {
@@ -76,10 +76,10 @@ int general_work (int noutput_items, gr_vector_int& ninput_items,
if(print_signal()) { if(print_signal()) {
add_item_tag(0, nitems_written(0) + o * 48, add_item_tag(0, nitems_written(0) + o * 48,
pmt::pmt_string_to_symbol("ofdm_start"), pmt::string_to_symbol("ofdm_start"),
pmt::pmt_cons(pmt::pmt_from_uint64(d_len), pmt::cons(pmt::from_uint64(d_len),
pmt::pmt_from_uint64(d_encoding)), pmt::from_uint64(d_encoding)),
pmt::pmt_string_to_symbol(name())); pmt::string_to_symbol(name()));
} }
} else if(d_copy_symbols) { } else if(d_copy_symbols) {
+6 -6
View File
@@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <gnuradio/ieee802_11/ofdm_equalize_symbols.h> #include <gnuradio/ieee802_11/ofdm_equalize_symbols.h>
#include <gnuradio/gr_io_signature.h> #include <gnuradio/io_signature.h>
#include <iostream> #include <iostream>
@@ -27,9 +27,9 @@ class ofdm_equalize_symbols_impl : public ofdm_equalize_symbols {
#define dout d_debug && std::cout #define dout d_debug && std::cout
public: public:
ofdm_equalize_symbols_impl(bool debug) : gr_block("ofdm_equalize_symbols", ofdm_equalize_symbols_impl(bool debug) : gr::block("ofdm_equalize_symbols",
gr_make_io_signature(1, 1, 64 * sizeof(gr_complex)), gr::io_signature::make(1, 1, 64 * sizeof(gr_complex)),
gr_make_io_signature(1, 1, 48 * sizeof(gr_complex))), gr::io_signature::make(1, 1, 48 * sizeof(gr_complex))),
d_debug(debug) { d_debug(debug) {
set_relative_rate(1); set_relative_rate(1);
@@ -48,7 +48,7 @@ int general_work (int noutput_items, gr_vector_int& ninput_items,
int noutput = noutput_items; int noutput = noutput_items;
int i = 0; int i = 0;
std::vector<gr_tag_t> tags; std::vector<gr::tag_t> tags;
const uint64_t nread = nitems_read(0); const uint64_t nread = nitems_read(0);
dout << "SYMBOLS: input " << ninput_items[0] << " output " << noutput_items << std::endl; dout << "SYMBOLS: input " << ninput_items[0] << " output " << noutput_items << std::endl;
@@ -56,7 +56,7 @@ int general_work (int noutput_items, gr_vector_int& ninput_items,
while((i < ninput_items[0]) && (i < noutput)) { while((i < ninput_items[0]) && (i < noutput)) {
get_tags_in_range(tags, 0, nread + i * 64, nread + (i + 1) * 64 - 1, get_tags_in_range(tags, 0, nread + i * 64, nread + (i + 1) * 64 - 1,
pmt::pmt_string_to_symbol("ofdm_start")); pmt::string_to_symbol("ofdm_start"));
if(tags.size()) { if(tags.size()) {
index = 0; index = 0;
+15 -15
View File
@@ -17,8 +17,8 @@
#include <gnuradio/ieee802_11/ofdm_parse_mac.h> #include <gnuradio/ieee802_11/ofdm_parse_mac.h>
#include "ofdm_parse_mac_impl.h" #include "ofdm_parse_mac_impl.h"
#include <gr_io_signature.h> #include <gnuradio/io_signature.h>
#include <gr_block_detail.h> #include <gnuradio/block_detail.h>
#include <string> #include <string>
using namespace gr::ieee802_11; using namespace gr::ieee802_11;
@@ -30,9 +30,9 @@ class ofdm_parse_mac_impl : public ofdm_parse_mac {
public: public:
ofdm_parse_mac_impl(bool debug) : ofdm_parse_mac_impl(bool debug) :
gr_block("ofdm_parse_mac", gr::block("ofdm_parse_mac",
gr_make_io_signature (0, 0, 0), gr::io_signature::make (0, 0, 0),
gr_make_io_signature (0, 0, 0)), gr::io_signature::make (0, 0, 0)),
d_debug(debug) { d_debug(debug) {
message_port_register_out(pmt::mp("out")); message_port_register_out(pmt::mp("out"));
@@ -82,16 +82,16 @@ unsigned int crc32(const char *buf, int len) {
void parse(pmt::pmt_t msg) { void parse(pmt::pmt_t msg) {
if(pmt::pmt_is_eof_object(msg)) { if(pmt::is_eof_object(msg)) {
message_port_pub(pmt::mp("out"), pmt::PMT_EOF); message_port_pub(pmt::mp("out"), pmt::PMT_EOF);
detail().get()->set_done(true); detail().get()->set_done(true);
return; return;
} }
assert(pmt::pmt_is_blob(msg)); assert(pmt::is_blob(msg));
int data_len = pmt::pmt_blob_length(msg); int data_len = pmt::blob_length(msg);
mac_header *h = (mac_header*)pmt::pmt_blob_data(msg); mac_header *h = (mac_header*)pmt::blob_data(msg);
dout << std::endl << "new mac frame (length " << data_len << ")" << std::endl; dout << std::endl << "new mac frame (length " << data_len << ")" << std::endl;
dout << "=========================================" << std::endl; dout << "=========================================" << std::endl;
@@ -125,7 +125,7 @@ void parse(pmt::pmt_t msg) {
break; break;
} }
bool crc = check_crc((char*)pmt::pmt_blob_data(msg), data_len); bool crc = check_crc((char*)pmt::blob_data(msg), data_len);
dout << "crc "; dout << "crc ";
dout << (crc ? "correct" : "wrong") << std::endl; dout << (crc ? "correct" : "wrong") << std::endl;
@@ -134,21 +134,21 @@ void parse(pmt::pmt_t msg) {
return; return;
} }
char *frame = (char*)pmt::pmt_blob_data(msg); char *frame = (char*)pmt::blob_data(msg);
frame[data_len - 4] = '\n'; frame[data_len - 4] = '\n';
// DATA // DATA
if((((h->frame_control) >> 2) & 63) == 2) { if((((h->frame_control) >> 2) & 63) == 2) {
print_ascii(frame + 24, data_len - 24 - 4); print_ascii(frame + 24, data_len - 24 - 4);
pmt::pmt_t payload = pmt::pmt_make_blob(frame + 24, data_len - 24 - 3); pmt::pmt_t payload = pmt::make_blob(frame + 24, data_len - 24 - 3);
message_port_pub(pmt::mp("out"), pmt::pmt_cons(pmt::PMT_NIL, payload)); message_port_pub(pmt::mp("out"), pmt::cons(pmt::PMT_NIL, payload));
// QoS Data // QoS Data
} else if((((h->frame_control) >> 2) & 63) == 34) { } else if((((h->frame_control) >> 2) & 63) == 34) {
print_ascii(frame + 26, data_len - 26 - 4); print_ascii(frame + 26, data_len - 26 - 4);
pmt::pmt_t payload = pmt::pmt_make_blob(frame + 26, data_len - 26 - 3); pmt::pmt_t payload = pmt::make_blob(frame + 26, data_len - 26 - 3);
message_port_pub(pmt::mp("out"), pmt::pmt_cons(pmt::PMT_NIL, payload)); message_port_pub(pmt::mp("out"), pmt::cons(pmt::PMT_NIL, payload));
} }
} }
+12 -12
View File
@@ -15,9 +15,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <gnuradio/ieee802_11/ofdm_sync_long.h> #include <gnuradio/ieee802_11/ofdm_sync_long.h>
#include <gnuradio/gr_io_signature.h> #include <gnuradio/io_signature.h>
#include <filter/fir_filter.h> #include <gnuradio/filter/fir_filter.h>
#include <fft/fft.h> #include <gnuradio/fft/fft.h>
#include <list> #include <list>
#include <tuple> #include <tuple>
@@ -31,9 +31,9 @@ class ofdm_sync_long_impl : public ofdm_sync_long {
#define dout d_debug && std::cout #define dout d_debug && std::cout
public: public:
ofdm_sync_long_impl(unsigned int sync_lenght, unsigned int freq_est, bool debug) : gr_block("ofdm_sync_long", ofdm_sync_long_impl(unsigned int sync_lenght, unsigned int freq_est, bool debug) : gr::block("ofdm_sync_long",
gr_make_io_signature2(2, 2, sizeof(gr_complex), sizeof(gr_complex)), gr::io_signature::make2(2, 2, sizeof(gr_complex), sizeof(gr_complex)),
gr_make_io_signature(1, 1, sizeof(gr_complex))), gr::io_signature::make(1, 1, sizeof(gr_complex))),
d_debug(debug), d_debug(debug),
d_offset(0), d_offset(0),
d_freq_est(0), d_freq_est(0),
@@ -41,7 +41,7 @@ ofdm_sync_long_impl(unsigned int sync_lenght, unsigned int freq_est, bool debug)
SYNC_LENGTH(sync_lenght), SYNC_LENGTH(sync_lenght),
FREQ_EST(freq_est) { FREQ_EST(freq_est) {
set_tag_propagation_policy(gr_block::TPP_DONT); set_tag_propagation_policy(gr::block::TPP_DONT);
d_fir = new gr::filter::kernel::fir_filter_ccc(1, LONG); d_fir = new gr::filter::kernel::fir_filter_ccc(1, LONG);
d_correlation = gr::fft::malloc_complex(8192); d_correlation = gr::fft::malloc_complex(8192);
} }
@@ -68,9 +68,9 @@ int general_work (int noutput, gr_vector_int& ninput_items,
const unsigned int nread = nitems_read(0); const unsigned int nread = nitems_read(0);
get_tags_in_range(d_tags, 0, nread, nread + ninput); get_tags_in_range(d_tags, 0, nread, nread + ninput);
if (d_tags.size()) { if (d_tags.size()) {
std::sort(d_tags.begin(), d_tags.end(), gr_tag_t::offset_compare); std::sort(d_tags.begin(), d_tags.end(), gr::tag_t::offset_compare);
const gr_tag_t &tag = d_tags.front(); const gr::tag_t &tag = d_tags.front();
const uint64_t offset = tag.offset; const uint64_t offset = tag.offset;
if(offset > nread) { if(offset > nread) {
@@ -125,9 +125,9 @@ int general_work (int noutput, gr_vector_int& ninput_items,
if(rel == 16) { if(rel == 16) {
assert(o == 0); assert(o == 0);
add_item_tag(0, nitems_written(0) + o, add_item_tag(0, nitems_written(0) + o,
pmt::pmt_string_to_symbol("ofdm_start"), pmt::string_to_symbol("ofdm_start"),
pmt::PMT_T, pmt::PMT_T,
pmt::pmt_string_to_symbol(name())); pmt::string_to_symbol(name()));
} }
out[o] = in_delayed[i] * exp(gr_complex(0, d_offset * arg(d_freq_est) / 16)); out[o] = in_delayed[i] * exp(gr_complex(0, d_offset * arg(d_freq_est) / 16));
@@ -223,7 +223,7 @@ private:
gr_complex d_freq_est; gr_complex d_freq_est;
gr_complex *d_correlation; gr_complex *d_correlation;
std::list<std::tuple<double, int>> d_cor; std::list<std::tuple<double, int>> d_cor;
std::vector<gr_tag_t> d_tags; std::vector<gr::tag_t> d_tags;
gr::filter::kernel::fir_filter_ccc *d_fir; gr::filter::kernel::fir_filter_ccc *d_fir;
const bool d_debug; const bool d_debug;
+7 -7
View File
@@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <gnuradio/ieee802_11/ofdm_sync_short.h> #include <gnuradio/ieee802_11/ofdm_sync_short.h>
#include <gnuradio/gr_io_signature.h> #include <gnuradio/io_signature.h>
#include <iostream> #include <iostream>
@@ -27,9 +27,9 @@ class ofdm_sync_short_impl : public ofdm_sync_short {
public: public:
ofdm_sync_short_impl(double threshold, unsigned int max_samples, ofdm_sync_short_impl(double threshold, unsigned int max_samples,
unsigned int min_plateau, bool debug) : gr_block("ofdm_sync_short", unsigned int min_plateau, bool debug) : gr::block("ofdm_sync_short",
gr_make_io_signature2(2, 2, sizeof(gr_complex), sizeof(float)), gr::io_signature::make2(2, 2, sizeof(gr_complex), sizeof(float)),
gr_make_io_signature(1, 1, sizeof(gr_complex))), gr::io_signature::make(1, 1, sizeof(gr_complex))),
d_debug(debug), d_debug(debug),
d_state(SEARCH), d_state(SEARCH),
d_plateau(0), d_plateau(0),
@@ -37,7 +37,7 @@ ofdm_sync_short_impl(double threshold, unsigned int max_samples,
MIN_PLATEAU(min_plateau), MIN_PLATEAU(min_plateau),
d_threshold(threshold) { d_threshold(threshold) {
set_tag_propagation_policy(gr_block::TPP_DONT); set_tag_propagation_policy(gr::block::TPP_DONT);
} }
~ofdm_sync_short_impl(){ ~ofdm_sync_short_impl(){
@@ -110,9 +110,9 @@ int general_work (int noutput_items, gr_vector_int& ninput_items,
void insert_tag(uint64_t item) { void insert_tag(uint64_t item) {
dout << "SYNC SHORT: insert ofdm_start at: " << item << std::endl; dout << "SYNC SHORT: insert ofdm_start at: " << item << std::endl;
const pmt::pmt_t key = pmt::pmt_string_to_symbol("ofdm_start"); const pmt::pmt_t key = pmt::string_to_symbol("ofdm_start");
const pmt::pmt_t value = pmt::PMT_T; const pmt::pmt_t value = pmt::PMT_T;
const pmt::pmt_t srcid = pmt::pmt_string_to_symbol(name()); const pmt::pmt_t srcid = pmt::string_to_symbol(name());
add_item_tag(0, item, key, value, srcid); add_item_tag(0, item, key, value, srcid);
} }
+2 -2
View File
@@ -34,8 +34,8 @@ set(GR_SWIG_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
) )
foreach(incdir ${GNURADIO_CORE_INCLUDE_DIRS}) foreach(incdir ${GNURADIO_RUNTIME_INCLUDE_DIRS})
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/swig) list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gnuradio/swig)
endforeach(incdir) endforeach(incdir)
foreach(incdir ${GRUEL_INCLUDE_DIRS}) foreach(incdir ${GRUEL_INCLUDE_DIRS})
+1 -1
View File
@@ -17,7 +17,7 @@
%define GR_IEEE802_11_BLOCK_MAGIC2(PKG, BASE_NAME) %define GR_IEEE802_11_BLOCK_MAGIC2(PKG, BASE_NAME)
%template(BASE_NAME ## _sptr) boost::shared_ptr<gr:: ## PKG ## :: ## BASE_NAME>; %template(BASE_NAME ## _sptr) boost::shared_ptr<gr:: ## PKG ## :: ## BASE_NAME>;
%pythoncode %{ %pythoncode %{
BASE_NAME ## _sptr.__repr__ = lambda self: "<gr_block %s (%d)>" % (self.name(), self.unique_id()) BASE_NAME ## _sptr.__repr__ = lambda self: "<gr::block %s (%d)>" % (self.name(), self.unique_id())
BASE_NAME = BASE_NAME.make; BASE_NAME = BASE_NAME.make;
%} %}
%enddef %enddef