From 4036435eeebee7e3653c5b8ad694c77515d5a3ea Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 25 Sep 2009 15:57:20 -0700 Subject: 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 --- gr-vrt/src/vrt_source_32fc.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gr-vrt/src/vrt_source_32fc.cc') 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 #include #include +#include +#include #include #include #include @@ -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 { -- cgit