summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnuradio-core/src/lib/io/gr_pdu.cc24
-rw-r--r--gnuradio-core/src/lib/io/gr_pdu.h2
-rw-r--r--gnuradio-core/src/lib/io/gr_pdu.i2
-rw-r--r--gnuradio-core/src/lib/io/gr_socket_pdu.h1
-rw-r--r--gnuradio-core/src/lib/io/gr_stream_pdu_base.cc6
-rwxr-xr-xgnuradio-core/src/python/gnuradio/gr/qa_pdu.py4
6 files changed, 23 insertions, 16 deletions
diff --git a/gnuradio-core/src/lib/io/gr_pdu.cc b/gnuradio-core/src/lib/io/gr_pdu.cc
index b2757c307..302fd7b9b 100644
--- a/gnuradio-core/src/lib/io/gr_pdu.cc
+++ b/gnuradio-core/src/lib/io/gr_pdu.cc
@@ -29,11 +29,11 @@
size_t
gr_pdu_itemsize(gr_pdu_vector_type type){
switch(type){
- case BYTE:
+ case pdu_byte:
return 1;
- case FLOAT:
+ case pdu_float:
return sizeof(float);
- case COMPLEX:
+ case pdu_complex:
return sizeof(gr_complex);
default:
throw std::runtime_error("bad type!");
@@ -43,11 +43,11 @@ gr_pdu_itemsize(gr_pdu_vector_type type){
bool
gr_pdu_type_matches(gr_pdu_vector_type type, pmt::pmt_t v){
switch(type){
- case BYTE:
+ case pdu_byte:
return pmt::pmt_is_u8vector(v);
- case FLOAT:
+ case pdu_float:
return pmt::pmt_is_f32vector(v);
- case COMPLEX:
+ case pdu_complex:
return pmt::pmt_is_c32vector(v);
default:
throw std::runtime_error("bad type!");
@@ -57,11 +57,11 @@ gr_pdu_type_matches(gr_pdu_vector_type type, pmt::pmt_t v){
pmt::pmt_t
gr_pdu_make_vector(gr_pdu_vector_type type, const uint8_t* buf, size_t items){
switch(type){
- case BYTE:
+ case pdu_byte:
return pmt::pmt_init_u8vector(items, buf);
- case FLOAT:
+ case pdu_float:
return pmt::pmt_init_f32vector(items, (const float*)buf);
- case COMPLEX:
+ case pdu_complex:
return pmt::pmt_init_c32vector(items, (const gr_complex*)buf);
default:
throw std::runtime_error("bad type!");
@@ -70,10 +70,10 @@ gr_pdu_make_vector(gr_pdu_vector_type type, const uint8_t* buf, size_t items){
gr_pdu_vector_type type_from_pmt(pmt::pmt_t vector){
if(pmt_is_u8vector(vector))
- return BYTE;
+ return pdu_byte;
if(pmt_is_f32vector(vector))
- return FLOAT;
+ return pdu_float;
if(pmt_is_c32vector(vector))
- return COMPLEX;
+ return pdu_complex;
throw std::runtime_error("bad type!");
}
diff --git a/gnuradio-core/src/lib/io/gr_pdu.h b/gnuradio-core/src/lib/io/gr_pdu.h
index 5ed9cdded..a5ae87db7 100644
--- a/gnuradio-core/src/lib/io/gr_pdu.h
+++ b/gnuradio-core/src/lib/io/gr_pdu.h
@@ -29,7 +29,7 @@
#define pdu_port_id pmt::mp("pdus")
#define pdu_length_tag pmt::mp("pdu_length")
-enum gr_pdu_vector_type { BYTE, FLOAT, COMPLEX };
+enum gr_pdu_vector_type { pdu_byte, pdu_float, pdu_complex };
size_t gr_pdu_itemsize(gr_pdu_vector_type type);
bool gr_pdu_type_matches(gr_pdu_vector_type type, pmt::pmt_t v);
diff --git a/gnuradio-core/src/lib/io/gr_pdu.i b/gnuradio-core/src/lib/io/gr_pdu.i
index 7cb3c62c7..ada3a63a7 100644
--- a/gnuradio-core/src/lib/io/gr_pdu.i
+++ b/gnuradio-core/src/lib/io/gr_pdu.i
@@ -24,7 +24,7 @@
#include <gr_pdu.h>
%}
-enum gr_pdu_vector_type { BYTE, FLOAT, COMPLEX };
+enum gr_pdu_vector_type { pdu_byte, pdu_float, pdu_complex };
diff --git a/gnuradio-core/src/lib/io/gr_socket_pdu.h b/gnuradio-core/src/lib/io/gr_socket_pdu.h
index f554febdc..e30a4cc6c 100644
--- a/gnuradio-core/src/lib/io/gr_socket_pdu.h
+++ b/gnuradio-core/src/lib/io/gr_socket_pdu.h
@@ -28,6 +28,7 @@
#include <gr_message.h>
#include <gr_msg_queue.h>
#include <gr_stream_pdu_base.h>
+#include <boost/array.hpp>
#include <boost/asio.hpp>
class gr_socket_pdu;
diff --git a/gnuradio-core/src/lib/io/gr_stream_pdu_base.cc b/gnuradio-core/src/lib/io/gr_stream_pdu_base.cc
index cff7296cb..7250c33e5 100644
--- a/gnuradio-core/src/lib/io/gr_stream_pdu_base.cc
+++ b/gnuradio-core/src/lib/io/gr_stream_pdu_base.cc
@@ -24,6 +24,7 @@
#include "config.h"
#endif
+#include <ciso646>
#include <gr_stream_pdu_base.h>
#include <gr_io_signature.h>
#include <cstdio>
@@ -35,8 +36,13 @@
#include <string.h>
#include <iostream>
#include <gr_pdu.h>
+#include <boost/asio.hpp>
#include <boost/format.hpp>
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+
static const long timeout_us = 100*1000; //100ms
gr_stream_pdu_base::gr_stream_pdu_base (int MTU)
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_pdu.py b/gnuradio-core/src/python/gnuradio/gr/qa_pdu.py
index ebc365b61..572d8b186 100755
--- a/gnuradio-core/src/python/gnuradio/gr/qa_pdu.py
+++ b/gnuradio-core/src/python/gnuradio/gr/qa_pdu.py
@@ -36,8 +36,8 @@ class test_pdu(gr_unittest.TestCase):
# Just run some data through and make sure it doesn't puke.
src_data = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
- src = gr.pdu_to_tagged_stream(gr.BYTE)
- snk3 = gr.tagged_stream_to_pdu(gr.BYTE)
+ src = gr.pdu_to_tagged_stream(gr.pdu_byte)
+ snk3 = gr.tagged_stream_to_pdu(gr.pdu_byte)
snk2 = gr.vector_sink_b()
snk = gr.tag_debug(1, "test")