summaryrefslogtreecommitdiff
path: root/gr-vrt
diff options
context:
space:
mode:
authorJosh Blum2009-09-25 19:04:35 -0700
committerJosh Blum2009-09-25 19:04:35 -0700
commite3902a9557e2a8c8bdd1e86fab30d754e909f843 (patch)
treeed9ab4fc541b71ad48243ada3f30c4f43f7f201a /gr-vrt
parent3cb87bce0f8f20912a16f54e03d37f9fef4e0c3f (diff)
downloadgnuradio-e3902a9557e2a8c8bdd1e86fab30d754e909f843.tar.gz
gnuradio-e3902a9557e2a8c8bdd1e86fab30d754e909f843.tar.bz2
gnuradio-e3902a9557e2a8c8bdd1e86fab30d754e909f843.zip
reading the lo back and storing it
Diffstat (limited to 'gr-vrt')
-rw-r--r--gr-vrt/src/vrt_quadradio_source_32fc.h3
-rw-r--r--gr-vrt/src/vrt_source_32fc.cc27
-rw-r--r--gr-vrt/src/vrt_source_32fc.h3
3 files changed, 21 insertions, 12 deletions
diff --git a/gr-vrt/src/vrt_quadradio_source_32fc.h b/gr-vrt/src/vrt_quadradio_source_32fc.h
index 69384ca31..4589908f1 100644
--- a/gr-vrt/src/vrt_quadradio_source_32fc.h
+++ b/gr-vrt/src/vrt_quadradio_source_32fc.h
@@ -112,6 +112,9 @@ public:
bool set_cal_freq(double freq);
bool set_beamforming(std::vector<gr_complex> gains);
bool set_cal_enb(bool enb);
+
+ double get_cal_freq(void){return d_actual_cal_freq;}
+ double get_lo_freq(void){return d_actual_lo_freq;}
};
diff --git a/gr-vrt/src/vrt_source_32fc.cc b/gr-vrt/src/vrt_source_32fc.cc
index 9164ab9d8..551ea9821 100644
--- a/gr-vrt/src/vrt_source_32fc.cc
+++ b/gr-vrt/src/vrt_source_32fc.cc
@@ -46,7 +46,8 @@ class rx_32fc_handler : public vrt::rx_packet_handler
int *d_oo; // output index
std::vector< std::complex<float> > &d_remainder;
missing_pkt_checker &d_checker;
-
+ all_context_t d_if_context;
+ size_t d_if_context_n32_bit_words;
public:
@@ -54,13 +55,16 @@ public:
int *oo, std::vector< std::complex<float> > &remainder,
missing_pkt_checker &checker)
: d_noutput_items(noutput_items), d_out(out),
- d_oo(oo), d_remainder(remainder), d_checker(checker) {}
+ d_oo(oo), d_remainder(remainder), d_checker(checker),
+ d_if_context_n32_bit_words(0) {}
~rx_32fc_handler();
bool operator()(const uint32_t *payload,
size_t n32_bit_words,
const vrt::expanded_header *hdr);
+ all_context_t* get_if_context(void){
+ return d_if_context_n32_bit_words? &d_if_context : NULL;};
};
rx_32fc_handler::~rx_32fc_handler()
@@ -100,15 +104,10 @@ rx_32fc_handler::operator()(const uint32_t *payload,
else if (hdr->if_context_p()){
// 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(&if_context, 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));
+ //for (size_t i = 0; i < n32_bit_words; i++)
+ // fprintf(stderr, "%04x: %08x\n", (unsigned int) i, ntohl(payload[i]));
+ memcpy(&d_if_context, payload, sizeof(uint32_t)*n32_bit_words);
+ d_if_context_n32_bit_words = n32_bit_words;
return true;
}
else {
@@ -169,5 +168,11 @@ vrt_source_32fc::work(int noutput_items,
return -1; // say we're done
}
+ //we have a context packet, grab its useful information...
+ //remember that things are in network byte order!
+ if (h.get_if_context()){
+ d_actual_lo_freq = vrt_freq_to_double(ntohll(h.get_if_context()->beamformer.rf_ref_freq));
+ }
+
return oo;
}
diff --git a/gr-vrt/src/vrt_source_32fc.h b/gr-vrt/src/vrt_source_32fc.h
index 7ca3e5fe2..96e9cac42 100644
--- a/gr-vrt/src/vrt_source_32fc.h
+++ b/gr-vrt/src/vrt_source_32fc.h
@@ -33,6 +33,8 @@ protected:
std::vector< std::complex<float> > d_remainder;
missing_pkt_checker d_checker;
+ double d_actual_lo_freq;
+ double d_actual_cal_freq;
public:
~vrt_source_32fc();
@@ -42,7 +44,6 @@ public:
gr_vector_void_star &output_items);
void reset() { d_remainder.clear(); }
-
};
#endif /* INCLUDED_VRT_SOURCE_32FC_H */