summaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-06-07 13:23:07 -0700
committerJosh Blum <josh@joshknows.com>2010-06-07 13:23:07 -0700
commit0f4eff49c820a8d2ccb38e191604eb86c81b30af (patch)
treec669bbfcd10e0911bcb4dcf10dbab1964d3af859 /host/include
parent330bb71edbefbaa5a2e6afd1e7d183fb15a0817c (diff)
downloaduhd-0f4eff49c820a8d2ccb38e191604eb86c81b30af.tar.gz
uhd-0f4eff49c820a8d2ccb38e191604eb86c81b30af.tar.bz2
uhd-0f4eff49c820a8d2ccb38e191604eb86c81b30af.zip
Replaced the vrt pack and unpack with a pack and unpack for big endian and a pack and unpack for little endian.
The vrt handler code was templatized to take the relevant packer/unpacker as an argument.
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/transport/vrt.hpp48
1 files changed, 44 insertions, 4 deletions
diff --git a/host/include/uhd/transport/vrt.hpp b/host/include/uhd/transport/vrt.hpp
index f2f42f9eb..fb6efc99c 100644
--- a/host/include/uhd/transport/vrt.hpp
+++ b/host/include/uhd/transport/vrt.hpp
@@ -29,7 +29,7 @@ namespace vrt{
static const size_t max_header_words32 = 5; //hdr+sid+tsi+tsf (no class id supported)
/*!
- * Pack a vrt header from metadata.
+ * Pack a vrt header from metadata (big endian format).
* \param metadata the tx metadata with flags and timestamps
* \param header_buff memory to write the packed vrt header
* \param num_header_words32 number of words in the vrt header
@@ -38,7 +38,7 @@ namespace vrt{
* \param packet_count the packet count sequence number
* \param tick_rate ticks per second used in time conversion
*/
- UHD_API void pack(
+ UHD_API void pack_be(
const tx_metadata_t &metadata, //input
boost::uint32_t *header_buff, //output
size_t &num_header_words32, //output
@@ -49,7 +49,7 @@ namespace vrt{
);
/*!
- * Unpack a vrt header to metadata.
+ * Unpack a vrt header to metadata (big endian format).
* \param metadata the rx metadata with flags and timestamps
* \param header_buff memory to read the packed vrt header
* \param num_header_words32 number of words in the vrt header
@@ -58,7 +58,47 @@ namespace vrt{
* \param packet_count the packet count sequence number
* \param tick_rate ticks per second used in time conversion
*/
- UHD_API void unpack(
+ UHD_API void unpack_be(
+ 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
+ double tick_rate //input
+ );
+
+ /*!
+ * Pack a vrt header from metadata (little endian format).
+ * \param metadata the tx metadata with flags and timestamps
+ * \param header_buff memory to write the packed vrt header
+ * \param num_header_words32 number of words in the vrt header
+ * \param num_payload_words32 the length of the payload
+ * \param num_packet_words32 the length of the packet
+ * \param packet_count the packet count sequence number
+ * \param tick_rate ticks per second used in time conversion
+ */
+ UHD_API void pack_le(
+ const tx_metadata_t &metadata, //input
+ 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
+ double tick_rate //input
+ );
+
+ /*!
+ * Unpack a vrt header to metadata (little endian format).
+ * \param metadata the rx metadata with flags and timestamps
+ * \param header_buff memory to read the packed vrt header
+ * \param num_header_words32 number of words in the vrt header
+ * \param num_payload_words32 the length of the payload
+ * \param num_packet_words32 the length of the packet
+ * \param packet_count the packet count sequence number
+ * \param tick_rate ticks per second used in time conversion
+ */
+ UHD_API void unpack_le(
rx_metadata_t &metadata, //output
const boost::uint32_t *header_buff, //input
size_t &num_header_words32, //output