updating code to work with gnuradio pre-release 3.7
This commit is contained in:
+15
-15
@@ -17,8 +17,8 @@
|
||||
#include <gnuradio/ieee802_11/ofdm_parse_mac.h>
|
||||
#include "ofdm_parse_mac_impl.h"
|
||||
|
||||
#include <gr_io_signature.h>
|
||||
#include <gr_block_detail.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <gnuradio/block_detail.h>
|
||||
#include <string>
|
||||
|
||||
using namespace gr::ieee802_11;
|
||||
@@ -30,9 +30,9 @@ class ofdm_parse_mac_impl : public ofdm_parse_mac {
|
||||
public:
|
||||
|
||||
ofdm_parse_mac_impl(bool debug) :
|
||||
gr_block("ofdm_parse_mac",
|
||||
gr_make_io_signature (0, 0, 0),
|
||||
gr_make_io_signature (0, 0, 0)),
|
||||
gr::block("ofdm_parse_mac",
|
||||
gr::io_signature::make (0, 0, 0),
|
||||
gr::io_signature::make (0, 0, 0)),
|
||||
d_debug(debug) {
|
||||
|
||||
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) {
|
||||
|
||||
if(pmt::pmt_is_eof_object(msg)) {
|
||||
if(pmt::is_eof_object(msg)) {
|
||||
message_port_pub(pmt::mp("out"), pmt::PMT_EOF);
|
||||
detail().get()->set_done(true);
|
||||
return;
|
||||
}
|
||||
|
||||
assert(pmt::pmt_is_blob(msg));
|
||||
assert(pmt::is_blob(msg));
|
||||
|
||||
int data_len = pmt::pmt_blob_length(msg);
|
||||
mac_header *h = (mac_header*)pmt::pmt_blob_data(msg);
|
||||
int data_len = pmt::blob_length(msg);
|
||||
mac_header *h = (mac_header*)pmt::blob_data(msg);
|
||||
|
||||
dout << std::endl << "new mac frame (length " << data_len << ")" << std::endl;
|
||||
dout << "=========================================" << std::endl;
|
||||
@@ -125,7 +125,7 @@ void parse(pmt::pmt_t msg) {
|
||||
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 ? "correct" : "wrong") << std::endl;
|
||||
|
||||
@@ -134,21 +134,21 @@ void parse(pmt::pmt_t msg) {
|
||||
return;
|
||||
}
|
||||
|
||||
char *frame = (char*)pmt::pmt_blob_data(msg);
|
||||
char *frame = (char*)pmt::blob_data(msg);
|
||||
frame[data_len - 4] = '\n';
|
||||
|
||||
// DATA
|
||||
if((((h->frame_control) >> 2) & 63) == 2) {
|
||||
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
|
||||
} else if((((h->frame_control) >> 2) & 63) == 34) {
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user