aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/vrt.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-03-17 17:55:20 -0800
committerJosh Blum <josh@joshknows.com>2010-03-17 17:55:20 -0800
commit69aaffa6d8d4614dbf6b751fe058e39fced68153 (patch)
tree1a3958527b79eeb0297146dccff7fd76b0f46a7f /host/lib/transport/vrt.cpp
parent83c463d09613b72817a837117c5f0b23975c8def (diff)
downloaduhd-69aaffa6d8d4614dbf6b751fe058e39fced68153.tar.gz
uhd-69aaffa6d8d4614dbf6b751fe058e39fced68153.tar.bz2
uhd-69aaffa6d8d4614dbf6b751fe058e39fced68153.zip
got uhd almost compiling in windowze. figured out special flags. also had to use boost stdint because its missing in visual c++, added a bunch of numeric casts to reduce warnings
Diffstat (limited to 'host/lib/transport/vrt.cpp')
-rw-r--r--host/lib/transport/vrt.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/host/lib/transport/vrt.cpp b/host/lib/transport/vrt.cpp
index 5029df217..a06b5bf21 100644
--- a/host/lib/transport/vrt.cpp
+++ b/host/lib/transport/vrt.cpp
@@ -16,20 +16,21 @@
//
#include <uhd/transport/vrt.hpp>
-#include <netinet/in.h>
+#include <boost/asio.hpp> //endianness conversion
#include <stdexcept>
+using namespace uhd;
using namespace uhd::transport;
void vrt::pack(
const tx_metadata_t &metadata, //input
- uint32_t *header_buff, //output
+ boost::uint32_t *header_buff, //output
size_t &num_header_words32, //output
size_t num_payload_words32, //input
size_t &num_packet_words32, //output
size_t packet_count //input
){
- uint32_t vrt_hdr_flags = 0;
+ boost::uint32_t vrt_hdr_flags = 0;
num_header_words32 = 1;
//load the vrt header and flags
@@ -58,18 +59,18 @@ void vrt::pack(
}
void vrt::unpack(
- rx_metadata_t &metadata, //output
- const uint32_t *header_buff, //input
- size_t &num_header_words32, //output
- size_t &num_payload_words32, //output
- size_t num_packet_words32, //input
- size_t &packet_count //output
+ rx_metadata_t &metadata, //output
+ const boost::uint32_t *header_buff, //input
+ size_t &num_header_words32, //output
+ size_t &num_payload_words32, //output
+ size_t num_packet_words32, //input
+ size_t &packet_count //output
){
//clear the metadata
metadata = rx_metadata_t();
//extract vrt header
- uint32_t vrt_hdr_word = ntohl(header_buff[0]);
+ boost::uint32_t vrt_hdr_word = ntohl(header_buff[0]);
size_t packet_words32 = vrt_hdr_word & 0xffff;
packet_count = (vrt_hdr_word >> 16) & 0xf;