From 77ad7e778d668a2bddc9bf431088b586707bd279 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 22 Sep 2009 11:17:29 -0700 Subject: made rxdspno a parameter for: start/stop streaming, and quadradio32fc --- gr-vrt/src/vrt_quadradio_source_32fc.cc | 20 ++++++++++++-------- gr-vrt/src/vrt_quadradio_source_32fc.h | 8 +++++--- 2 files changed, 17 insertions(+), 11 deletions(-) (limited to 'gr-vrt/src') diff --git a/gr-vrt/src/vrt_quadradio_source_32fc.cc b/gr-vrt/src/vrt_quadradio_source_32fc.cc index 0aac86991..03d75c78d 100644 --- a/gr-vrt/src/vrt_quadradio_source_32fc.cc +++ b/gr-vrt/src/vrt_quadradio_source_32fc.cc @@ -29,25 +29,29 @@ vrt_quadradio_source_32fc_sptr vrt_make_quadradio_source_32fc(const std::string &ip, size_t rx_bufsize, - size_t samples_per_pkt) + size_t samples_per_pkt, + int rxdspno) { return gnuradio::get_initial_sptr(new vrt_quadradio_source_32fc(ip, rx_bufsize, - samples_per_pkt)); + samples_per_pkt, + rxdspno)); } vrt_quadradio_source_32fc::vrt_quadradio_source_32fc(const std::string &ip, size_t rx_bufsize, - size_t samples_per_pkt) + size_t samples_per_pkt, + int rxdspno) : vrt_source_32fc("quadradio_source_32fc"), - d_samples_per_pkt(samples_per_pkt == 0 ? 800 : samples_per_pkt), - d_qr(vrt::quadradio::sptr(new vrt::quadradio(ip, rx_bufsize))) + d_samples_per_pkt(samples_per_pkt == 0 ? (rxdspno == 0 ? 800 : 200) : samples_per_pkt), + d_qr(vrt::quadradio::sptr(new vrt::quadradio(ip, rx_bufsize))), + d_rxdspno(rxdspno) { } vrt_quadradio_source_32fc::~vrt_quadradio_source_32fc() { - d_qr->stop_streaming(); + d_qr->stop_streaming(d_rxdspno); } vrt::rx::sptr @@ -64,13 +68,13 @@ vrt_quadradio_source_32fc::start() vrt_rx()->rx_packets(&nop, true); d_checker.resync(); - return d_qr->start_streaming(d_samples_per_pkt); + return d_qr->start_streaming(d_rxdspno, d_samples_per_pkt); } bool vrt_quadradio_source_32fc::stop() { - return d_qr->stop_streaming(); + return d_qr->stop_streaming(d_rxdspno); } bool diff --git a/gr-vrt/src/vrt_quadradio_source_32fc.h b/gr-vrt/src/vrt_quadradio_source_32fc.h index 6193efa10..eaf2741c1 100644 --- a/gr-vrt/src/vrt_quadradio_source_32fc.h +++ b/gr-vrt/src/vrt_quadradio_source_32fc.h @@ -33,19 +33,21 @@ typedef boost::shared_ptr vrt_quadradio_source_32fc_s vrt_quadradio_source_32fc_sptr vrt_make_quadradio_source_32fc(const std::string &ip, size_t rx_bufsize = 0, - size_t samples_per_pkt = 0); + size_t samples_per_pkt = 0, + int rxdspno = 0); class vrt_quadradio_source_32fc : public vrt_source_32fc { size_t d_samples_per_pkt; boost::shared_ptr d_qr; + int d_rxdspno; vrt_quadradio_source_32fc(const std::string &ip, size_t rx_bufsize, - size_t samples_per_pkt); + size_t samples_per_pkt, int rxdspno); friend vrt_quadradio_source_32fc_sptr vrt_make_quadradio_source_32fc(const std::string &ip, size_t rx_bufsize, - size_t samples_per_pkt); + size_t samples_per_pkt, int rxdspno); public: virtual ~vrt_quadradio_source_32fc(); -- cgit From 7e9c7be46de8329c1aa884197378246d54cf05cd Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Wed, 23 Sep 2009 04:53:58 -0700 Subject: fix white space --- gr-vrt/src/vrt_quadradio_source_32fc.cc | 4 ++-- gr-vrt/src/vrt_quadradio_source_32fc.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'gr-vrt/src') diff --git a/gr-vrt/src/vrt_quadradio_source_32fc.cc b/gr-vrt/src/vrt_quadradio_source_32fc.cc index 03d75c78d..cd779bdf5 100644 --- a/gr-vrt/src/vrt_quadradio_source_32fc.cc +++ b/gr-vrt/src/vrt_quadradio_source_32fc.cc @@ -30,12 +30,12 @@ vrt_quadradio_source_32fc_sptr vrt_make_quadradio_source_32fc(const std::string &ip, size_t rx_bufsize, size_t samples_per_pkt, - int rxdspno) + int rxdspno) { return gnuradio::get_initial_sptr(new vrt_quadradio_source_32fc(ip, rx_bufsize, samples_per_pkt, - rxdspno)); + rxdspno)); } vrt_quadradio_source_32fc::vrt_quadradio_source_32fc(const std::string &ip, diff --git a/gr-vrt/src/vrt_quadradio_source_32fc.h b/gr-vrt/src/vrt_quadradio_source_32fc.h index eaf2741c1..69384ca31 100644 --- a/gr-vrt/src/vrt_quadradio_source_32fc.h +++ b/gr-vrt/src/vrt_quadradio_source_32fc.h @@ -34,13 +34,13 @@ vrt_quadradio_source_32fc_sptr vrt_make_quadradio_source_32fc(const std::string &ip, size_t rx_bufsize = 0, size_t samples_per_pkt = 0, - int rxdspno = 0); + int rxdspno = 0); class vrt_quadradio_source_32fc : public vrt_source_32fc { size_t d_samples_per_pkt; boost::shared_ptr d_qr; - int d_rxdspno; + int d_rxdspno; vrt_quadradio_source_32fc(const std::string &ip, size_t rx_bufsize, size_t samples_per_pkt, int rxdspno); -- cgit From 6e71986985a157000cb41717cbce5b83e713e177 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Wed, 23 Sep 2009 05:46:44 -0700 Subject: Dump IF-Context packets in hex. --- gr-vrt/src/vrt_source_32fc.cc | 59 ++++++++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 21 deletions(-) (limited to 'gr-vrt/src') diff --git a/gr-vrt/src/vrt_source_32fc.cc b/gr-vrt/src/vrt_source_32fc.cc index beb5ef26d..e44902316 100644 --- a/gr-vrt/src/vrt_source_32fc.cc +++ b/gr-vrt/src/vrt_source_32fc.cc @@ -30,6 +30,9 @@ #include #include #include +#include +#include + #define VERBOSE 1 // define to 0 or 1 @@ -67,29 +70,43 @@ rx_32fc_handler::operator()(const uint32_t *payload, size_t n32_bit_words, const vrt::expanded_header *hdr) { - int nmissing = d_checker.check(hdr); - if (VERBOSE && nmissing != 0){ - std::cerr << "S" << nmissing; + if (hdr->if_data_p()){ + int nmissing = d_checker.check(hdr); + if (VERBOSE && nmissing != 0){ + std::cerr << "S" << nmissing; + } + + // copy as many as will fit into the output buffer. + + size_t n = std::min(n32_bit_words, (size_t)(d_noutput_items - *d_oo)); + vrt::copy_net_16sc_to_host_32fc(n, payload, &d_out[*d_oo]); + *d_oo += n; + + // if there are any left over, copy them into remainder and tell + // our caller we're had enough for now. + + size_t r = n32_bit_words - n; + if (r > 0){ + assert(d_remainder.size() == 0); + d_remainder.resize(r); + vrt::copy_net_16sc_to_host_32fc(r, &payload[n], &d_remainder[0]); + return false; // Stop calling us. + } + + return true; // Keep calling us, we've got more room } - - // copy as many as will fit into the output buffer. - - size_t n = std::min(n32_bit_words, (size_t)(d_noutput_items - *d_oo)); - vrt::copy_net_16sc_to_host_32fc(n, payload, &d_out[*d_oo]); - *d_oo += n; - - // if there are any left over, copy them into remainder and tell - // our caller we're had enough for now. - - size_t r = n32_bit_words - n; - if (r > 0){ - assert(d_remainder.size() == 0); - d_remainder.resize(r); - vrt::copy_net_16sc_to_host_32fc(r, &payload[n], &d_remainder[0]); - return false; // Stop calling us. + else if (hdr->if_context_p()){ + // FIXME 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])); + return true; + } + else { + // It's most likely an Extension Data or Extension Context packet + // (that we don't know how to interpret...) + return true; } - - return true; // Keep calling us, we've got more room } -- cgit From fd23d8e0b0f457b2b8b0db19bb74e6bac21189bb Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 25 Sep 2009 13:56:43 -0700 Subject: copied over vrt context and type headers, updated bits.h as well --- gr-vrt/src/vrt_source_32fc.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gr-vrt/src') diff --git a/gr-vrt/src/vrt_source_32fc.cc b/gr-vrt/src/vrt_source_32fc.cc index e44902316..6c3035b8f 100644 --- a/gr-vrt/src/vrt_source_32fc.cc +++ b/gr-vrt/src/vrt_source_32fc.cc @@ -105,6 +105,9 @@ rx_32fc_handler::operator()(const uint32_t *payload, else { // It's most likely an Extension Data or Extension Context packet // (that we don't know how to interpret...) + fprintf(stderr, "\nIF-Extension:\n"); + for (size_t i = 0; i < n32_bit_words; i++) + fprintf(stderr, "%04x: %08x\n", (unsigned int) i, ntohl(payload[i])); return true; } } -- cgit 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') 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 From 2532270b7db5be724c390bddde8b0e490f98fe6f Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 25 Sep 2009 16:54:50 -0700 Subject: checking for if context packets and setting up the payload pointer and size --- gr-vrt/src/vrt_source_32fc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gr-vrt/src') diff --git a/gr-vrt/src/vrt_source_32fc.cc b/gr-vrt/src/vrt_source_32fc.cc index 483b6c246..9164ab9d8 100644 --- a/gr-vrt/src/vrt_source_32fc.cc +++ b/gr-vrt/src/vrt_source_32fc.cc @@ -105,7 +105,7 @@ rx_32fc_handler::operator()(const uint32_t *payload, // 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 + 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)); -- cgit From e3902a9557e2a8c8bdd1e86fab30d754e909f843 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 25 Sep 2009 19:04:35 -0700 Subject: reading the lo back and storing it --- gr-vrt/src/vrt_quadradio_source_32fc.h | 3 +++ gr-vrt/src/vrt_source_32fc.cc | 27 ++++++++++++++++----------- gr-vrt/src/vrt_source_32fc.h | 3 ++- 3 files changed, 21 insertions(+), 12 deletions(-) (limited to 'gr-vrt/src') 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 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 > &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 > &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 > 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 */ -- cgit From 85a8e6cdb0fb05b12b071c81f9eb025b380fb155 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 28 Sep 2009 19:04:38 -0700 Subject: added access methods and parsing for caldiv if context --- gr-vrt/src/vrt_quadradio_source_32fc.h | 11 +++++++++-- gr-vrt/src/vrt_source_32fc.cc | 9 ++++++++- gr-vrt/src/vrt_source_32fc.h | 12 ++++++++++-- 3 files changed, 27 insertions(+), 5 deletions(-) (limited to 'gr-vrt/src') diff --git a/gr-vrt/src/vrt_quadradio_source_32fc.h b/gr-vrt/src/vrt_quadradio_source_32fc.h index 4589908f1..799b07e86 100644 --- a/gr-vrt/src/vrt_quadradio_source_32fc.h +++ b/gr-vrt/src/vrt_quadradio_source_32fc.h @@ -113,8 +113,15 @@ public: bool set_beamforming(std::vector 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;} + //caldiv public access methods + double get_cal_freq(void){return d_cal_freq;} + bool get_cal_locked(void){return d_cal_locked;} + bool get_cal_enabled(void){return d_cal_enabled;} + double get_lo_freq(void){return d_lo_freq;} + bool get_lo_locked(void){return d_lo_locked;} + double get_caldiv_temp(void){return d_caldiv_temp;} + int get_caldiv_ser_no(void){return d_caldiv_rev;} + int get_caldiv_rev_no(void){return d_caldiv_ser;} }; diff --git a/gr-vrt/src/vrt_source_32fc.cc b/gr-vrt/src/vrt_source_32fc.cc index 551ea9821..0091619ab 100644 --- a/gr-vrt/src/vrt_source_32fc.cc +++ b/gr-vrt/src/vrt_source_32fc.cc @@ -171,7 +171,14 @@ vrt_source_32fc::work(int noutput_items, //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)); + d_lo_freq = vrt_freq_to_double(ntohll(h.get_if_context()->caldiv.lo_freq)); + d_cal_freq = vrt_freq_to_double(ntohll(h.get_if_context()->caldiv.cal_freq)); + d_lo_locked = bool(ntohl(h.get_if_context()->caldiv.lo_locked)); + d_cal_locked = bool(ntohl(h.get_if_context()->caldiv.cal_locked)); + d_cal_enabled = bool(ntohl(h.get_if_context()->caldiv.cal_enabled)); + d_caldiv_temp = vrt_temp_to_double(ntohl(h.get_if_context()->caldiv.temp)); + d_caldiv_ser = ntohl(h.get_if_context()->caldiv.ser); + d_caldiv_rev = ntohl(h.get_if_context()->caldiv.rev); } return oo; diff --git a/gr-vrt/src/vrt_source_32fc.h b/gr-vrt/src/vrt_source_32fc.h index 96e9cac42..9d53fae33 100644 --- a/gr-vrt/src/vrt_source_32fc.h +++ b/gr-vrt/src/vrt_source_32fc.h @@ -33,8 +33,16 @@ protected: std::vector< std::complex > d_remainder; missing_pkt_checker d_checker; - double d_actual_lo_freq; - double d_actual_cal_freq; + + //caldiv settings parsed from if context + double d_cal_freq; + bool d_cal_locked; + bool d_cal_enabled; + double d_lo_freq; + bool d_lo_locked; + double d_caldiv_temp; + int d_caldiv_rev; + int d_caldiv_ser; public: ~vrt_source_32fc(); -- cgit From 57e810d3f07909947a9fb2daeb507b439d5f4f50 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 29 Sep 2009 15:34:58 -0700 Subject: added access methods for gps stuff --- gr-vrt/src/vrt_quadradio_source_32fc.h | 10 ++++++++-- gr-vrt/src/vrt_source_32fc.cc | 22 ++++++++++++++-------- gr-vrt/src/vrt_source_32fc.h | 6 ++++++ 3 files changed, 28 insertions(+), 10 deletions(-) (limited to 'gr-vrt/src') diff --git a/gr-vrt/src/vrt_quadradio_source_32fc.h b/gr-vrt/src/vrt_quadradio_source_32fc.h index 799b07e86..45dad1f89 100644 --- a/gr-vrt/src/vrt_quadradio_source_32fc.h +++ b/gr-vrt/src/vrt_quadradio_source_32fc.h @@ -120,8 +120,14 @@ public: double get_lo_freq(void){return d_lo_freq;} bool get_lo_locked(void){return d_lo_locked;} double get_caldiv_temp(void){return d_caldiv_temp;} - int get_caldiv_ser_no(void){return d_caldiv_rev;} - int get_caldiv_rev_no(void){return d_caldiv_ser;} + int get_caldiv_serial(void){return d_caldiv_rev;} + int get_caldiv_revision(void){return d_caldiv_ser;} + + //gps public access methods + int get_utc_time(void){return d_utc_time;} + double get_altitude(void){return d_altitude;} + double get_longitude(void){return d_longitude;} + double get_latitude(void){return d_latitude;} }; diff --git a/gr-vrt/src/vrt_source_32fc.cc b/gr-vrt/src/vrt_source_32fc.cc index 0091619ab..3035813cc 100644 --- a/gr-vrt/src/vrt_source_32fc.cc +++ b/gr-vrt/src/vrt_source_32fc.cc @@ -171,14 +171,20 @@ vrt_source_32fc::work(int noutput_items, //we have a context packet, grab its useful information... //remember that things are in network byte order! if (h.get_if_context()){ - d_lo_freq = vrt_freq_to_double(ntohll(h.get_if_context()->caldiv.lo_freq)); - d_cal_freq = vrt_freq_to_double(ntohll(h.get_if_context()->caldiv.cal_freq)); - d_lo_locked = bool(ntohl(h.get_if_context()->caldiv.lo_locked)); - d_cal_locked = bool(ntohl(h.get_if_context()->caldiv.cal_locked)); - d_cal_enabled = bool(ntohl(h.get_if_context()->caldiv.cal_enabled)); - d_caldiv_temp = vrt_temp_to_double(ntohl(h.get_if_context()->caldiv.temp)); - d_caldiv_ser = ntohl(h.get_if_context()->caldiv.ser); - d_caldiv_rev = ntohl(h.get_if_context()->caldiv.rev); + //extract caldiv stuff + d_lo_freq = vrt_freq_to_double(ntohx(h.get_if_context()->caldiv.lo_freq)); + d_cal_freq = vrt_freq_to_double(ntohx(h.get_if_context()->caldiv.cal_freq)); + d_lo_locked = bool(ntohx(h.get_if_context()->caldiv.lo_locked)); + d_cal_locked = bool(ntohx(h.get_if_context()->caldiv.cal_locked)); + d_cal_enabled = bool(ntohx(h.get_if_context()->caldiv.cal_enabled)); + d_caldiv_temp = vrt_temp_to_double(ntohx(h.get_if_context()->caldiv.temp)); + d_caldiv_ser = ntohx(h.get_if_context()->caldiv.ser); + d_caldiv_rev = ntohx(h.get_if_context()->caldiv.rev); + //extract gps stuff + d_utc_time = ntohx(h.get_if_context()->gps.formatted_gps.integer_secs); + d_altitude = vrt_altitude_to_double(ntohx(h.get_if_context()->gps.formatted_gps.altitude)); + d_longitude = vrt_geo_angle_to_double(ntohx(h.get_if_context()->gps.formatted_gps.longitude)); + d_latitude = vrt_geo_angle_to_double(ntohx(h.get_if_context()->gps.formatted_gps.latitude)); } return oo; diff --git a/gr-vrt/src/vrt_source_32fc.h b/gr-vrt/src/vrt_source_32fc.h index 9d53fae33..46d80f442 100644 --- a/gr-vrt/src/vrt_source_32fc.h +++ b/gr-vrt/src/vrt_source_32fc.h @@ -43,6 +43,12 @@ protected: double d_caldiv_temp; int d_caldiv_rev; int d_caldiv_ser; + + //gps settings parsed from if context + int d_utc_time; + double d_altitude; + double d_longitude; + double d_latitude; public: ~vrt_source_32fc(); -- cgit From 2875cf23fcb5d38866a42327cafa2b43abe2fbf4 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 21 Oct 2009 12:30:03 -0700 Subject: query the model number from the host --- gr-vrt/src/vrt_quadradio_source_32fc.h | 5 +++-- gr-vrt/src/vrt_source_32fc.cc | 3 ++- gr-vrt/src/vrt_source_32fc.h | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'gr-vrt/src') diff --git a/gr-vrt/src/vrt_quadradio_source_32fc.h b/gr-vrt/src/vrt_quadradio_source_32fc.h index 45dad1f89..bb3935c46 100644 --- a/gr-vrt/src/vrt_quadradio_source_32fc.h +++ b/gr-vrt/src/vrt_quadradio_source_32fc.h @@ -120,8 +120,9 @@ public: double get_lo_freq(void){return d_lo_freq;} bool get_lo_locked(void){return d_lo_locked;} double get_caldiv_temp(void){return d_caldiv_temp;} - int get_caldiv_serial(void){return d_caldiv_rev;} - int get_caldiv_revision(void){return d_caldiv_ser;} + int get_caldiv_revision(void){return d_caldiv_rev;} + int get_caldiv_serial(void){return d_caldiv_ser;} + int get_caldiv_model(void){return d_caldiv_mod;} //gps public access methods int get_utc_time(void){return d_utc_time;} diff --git a/gr-vrt/src/vrt_source_32fc.cc b/gr-vrt/src/vrt_source_32fc.cc index 3035813cc..e56e3f2ad 100644 --- a/gr-vrt/src/vrt_source_32fc.cc +++ b/gr-vrt/src/vrt_source_32fc.cc @@ -178,8 +178,9 @@ vrt_source_32fc::work(int noutput_items, d_cal_locked = bool(ntohx(h.get_if_context()->caldiv.cal_locked)); d_cal_enabled = bool(ntohx(h.get_if_context()->caldiv.cal_enabled)); d_caldiv_temp = vrt_temp_to_double(ntohx(h.get_if_context()->caldiv.temp)); - d_caldiv_ser = ntohx(h.get_if_context()->caldiv.ser); d_caldiv_rev = ntohx(h.get_if_context()->caldiv.rev); + d_caldiv_ser = ntohx(h.get_if_context()->caldiv.ser); + d_caldiv_mod = ntohx(h.get_if_context()->caldiv.mod); //extract gps stuff d_utc_time = ntohx(h.get_if_context()->gps.formatted_gps.integer_secs); d_altitude = vrt_altitude_to_double(ntohx(h.get_if_context()->gps.formatted_gps.altitude)); diff --git a/gr-vrt/src/vrt_source_32fc.h b/gr-vrt/src/vrt_source_32fc.h index 46d80f442..c43170e83 100644 --- a/gr-vrt/src/vrt_source_32fc.h +++ b/gr-vrt/src/vrt_source_32fc.h @@ -43,6 +43,7 @@ protected: double d_caldiv_temp; int d_caldiv_rev; int d_caldiv_ser; + int d_caldiv_mod; //gps settings parsed from if context int d_utc_time; -- cgit