summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-core/src/lib')
-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
5 files changed, 21 insertions, 14 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)