summaryrefslogtreecommitdiff
path: root/vrt/lib/expanded_header.cc
diff options
context:
space:
mode:
authorEric Blossom2010-09-27 14:36:18 -0700
committerEric Blossom2010-09-27 14:56:44 -0700
commitf4e9ba2d94c9ae3340a79cce985560aeb48b526b (patch)
tree020a1495c0414ccacac7310066af2948abb314fa /vrt/lib/expanded_header.cc
parent424bca3bb914213fe3449d1d3462d5992bf5007c (diff)
downloadgnuradio-f4e9ba2d94c9ae3340a79cce985560aeb48b526b.tar.gz
gnuradio-f4e9ba2d94c9ae3340a79cce985560aeb48b526b.tar.bz2
gnuradio-f4e9ba2d94c9ae3340a79cce985560aeb48b526b.zip
Additional packet formatting
Diffstat (limited to 'vrt/lib/expanded_header.cc')
-rw-r--r--vrt/lib/expanded_header.cc46
1 files changed, 38 insertions, 8 deletions
diff --git a/vrt/lib/expanded_header.cc b/vrt/lib/expanded_header.cc
index 06056551e..bc6a6190c 100644
--- a/vrt/lib/expanded_header.cc
+++ b/vrt/lib/expanded_header.cc
@@ -154,14 +154,44 @@ namespace vrt {
return "<unknown pkt type>";
}
- static void wr_name(std::ostream &os, const std::string &x)
- {
- os << format(" %-19s ") % (x + ":");
- }
-
- static void wr_uint32(std::ostream &os, uint32_t x)
+ static void wr_header(std::ostream &os, uint32_t x)
{
os << format("%#10x") % x;
+
+ uint32_t t = (x >> 22) & 0x3;
+ switch(t){
+ case 0x0: os << " TSI=NONE"; break;
+ case 0x1: os << " TSI=UTC"; break;
+ case 0x2: os << " TSI=GPS"; break;
+ case 0x3: os << " TSI=OTHER"; break;
+ }
+
+ t = (x >> 20) & 0x3;
+ switch(t){
+ case 0x0: os << " TSF=NONE"; break;
+ case 0x1: os << " TSF=SAMPLE_CNT";break;
+ case 0x2: os << " TSI=PICOSECS"; break;
+ case 0x3: os << " TSI=FREE_RUN"; break;
+ }
+
+ uint32_t pt = x & VRTH_PT_MASK;
+ if (pt == VRTH_PT_IF_CONTEXT || pt == VRTH_PT_EXT_CONTEXT){
+ if (x & VRTH_TSM)
+ os << " TSM=GENERAL";
+ else
+ os << " TSM=EXACT";
+ }
+ else if (0
+ || pt == VRTH_PT_IF_DATA_WITH_SID
+ || pt == VRTH_PT_IF_DATA_NO_SID
+ || pt == VRTH_PT_EXT_DATA_WITH_SID
+ || pt == VRTH_PT_EXT_DATA_NO_SID){
+ if (x & VRTH_START_OF_BURST)
+ os << " SOB";
+ if (x & VRTH_END_OF_BURST)
+ os << " EOB";
+ }
+
os << std::endl;
}
@@ -171,12 +201,12 @@ namespace vrt {
port << format("%s:\n") % pkt_type_name(this);
if (1){
wr_name(port, "header");
- wr_uint32(port, header);
+ wr_header(port, header);
}
if (stream_id_p()){
wr_name(port, "stream_id");
- wr_uint32(port, stream_id);
+ wr_uint32_hex(port, stream_id);
}
if (class_id_p()){