summaryrefslogtreecommitdiff
path: root/gr-vrt/src/vrt_source_32fc.cc
diff options
context:
space:
mode:
authorJosh Blum2009-09-25 15:57:20 -0700
committerJosh Blum2009-09-25 15:57:20 -0700
commit4036435eeebee7e3653c5b8ad694c77515d5a3ea (patch)
treeb34c2df61c4513f5283c3800e5e54c9cb8d44f75 /gr-vrt/src/vrt_source_32fc.cc
parentfd23d8e0b0f457b2b8b0db19bb74e6bac21189bb (diff)
downloadgnuradio-4036435eeebee7e3653c5b8ad694c77515d5a3ea.tar.gz
gnuradio-4036435eeebee7e3653c5b8ad694c77515d5a3ea.tar.bz2
gnuradio-4036435eeebee7e3653c5b8ad694c77515d5a3ea.zip
Reading 64 bit freq out of chunk of context packet.
Where is the rest of my context packet? Added htonll and ntohll in gruel inet.h Fixed vrt/types.h freq cast
Diffstat (limited to 'gr-vrt/src/vrt_source_32fc.cc')
-rw-r--r--gr-vrt/src/vrt_source_32fc.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/gr-vrt/src/vrt_source_32fc.cc b/gr-vrt/src/vrt_source_32fc.cc
index 6c3035b8f..483b6c246 100644
--- a/gr-vrt/src/vrt_source_32fc.cc
+++ b/gr-vrt/src/vrt_source_32fc.cc
@@ -27,6 +27,8 @@
#include <vrt_source_32fc.h>
#include <vrt/expanded_header.h>
#include <vrt/copiers.h>
+#include <vrt/types.h>
+#include <vrt/if_context.h>
#include <gr_io_signature.h>
#include <missing_pkt_checker.h>
#include <iostream>
@@ -96,10 +98,17 @@ rx_32fc_handler::operator()(const uint32_t *payload,
return true; // Keep calling us, we've got more room
}
else if (hdr->if_context_p()){
- // FIXME print the IF-Context packet
+ // print the IF-Context packet
fprintf(stderr, "\nIF-Context:\n");
for (size_t i = 0; i < n32_bit_words; i++)
fprintf(stderr, "%04x: %08x\n", (unsigned int) i, ntohl(payload[i]));
+ // copy the context into struct so we cant reference bad memory
+ // print the components of the struct, prove that it works!
+ all_context_t if_context;
+ memcpy(((uint32_t*)&if_context) + 5, payload, sizeof(uint32_t)*n32_bit_words);//FIXME
+ fprintf(stderr, "\nIF-Context-Components:\n");
+ if_context.beamformer.rf_ref_freq = ntohll(if_context.beamformer.rf_ref_freq);
+ fprintf(stderr, "Ref Freq %f Hz\n", vrt_freq_to_double(if_context.beamformer.rf_ref_freq));
return true;
}
else {