diff options
author | Josh Blum | 2009-09-28 19:04:38 -0700 |
---|---|---|
committer | Josh Blum | 2009-09-28 19:04:38 -0700 |
commit | 85a8e6cdb0fb05b12b071c81f9eb025b380fb155 (patch) | |
tree | 0274c77165b411d15eac444d088fec76c2c2e6f1 | |
parent | 1c528febdac158b3fe898a8cb37ac37f8f4fee61 (diff) | |
download | gnuradio-85a8e6cdb0fb05b12b071c81f9eb025b380fb155.tar.gz gnuradio-85a8e6cdb0fb05b12b071c81f9eb025b380fb155.tar.bz2 gnuradio-85a8e6cdb0fb05b12b071c81f9eb025b380fb155.zip |
added access methods and parsing for caldiv if context
-rw-r--r-- | gr-vrt/src/vrt_quadradio_source_32fc.h | 11 | ||||
-rw-r--r-- | gr-vrt/src/vrt_source_32fc.cc | 9 | ||||
-rw-r--r-- | gr-vrt/src/vrt_source_32fc.h | 12 | ||||
-rw-r--r-- | gruel/src/include/gruel/inet.h.in | 2 | ||||
-rw-r--r-- | vrt/include/vrt/if_context.h | 14 |
5 files changed, 42 insertions, 6 deletions
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<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;} + //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<float> > 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(); diff --git a/gruel/src/include/gruel/inet.h.in b/gruel/src/include/gruel/inet.h.in index 320270727..7ac01eb56 100644 --- a/gruel/src/include/gruel/inet.h.in +++ b/gruel/src/include/gruel/inet.h.in @@ -19,6 +19,8 @@ #ifndef INCLUDED_INET_H #define INCLUDED_INET_H +#include <stdint.h> + #if 1 /* missing htonll or ntohll */ #if @GR_ARCH_BIGENDIAN@ /* GR_ARCH_BIGENDIAN */ // Nothing to do... diff --git a/vrt/include/vrt/if_context.h b/vrt/include/vrt/if_context.h index e51a7df6e..b1d542459 100644 --- a/vrt/include/vrt/if_context.h +++ b/vrt/include/vrt/if_context.h @@ -206,19 +206,31 @@ typedef struct gain_if_cntx_tag { uint32_t gain; } __attribute__((packed)) gain_if_cntx_t; +typedef struct caldiv_if_cntx_tag { + if_context_hdr_t cntx_hdr; + uint64_t lo_freq; + uint32_t lo_locked; + uint64_t cal_freq; + uint32_t cal_locked; + uint32_t cal_enabled; + uint32_t temp; + uint32_t rev; + uint32_t ser; +} __attribute__((packed)) caldiv_if_cntx_t; // FIXME the rest... // ------------------------------------------------------------------------ // All of them concatenated -#define NCONTEXT_PKTS 6 // number of context pkts aggregated here +#define NCONTEXT_PKTS 7 // number of context pkts aggregated here typedef struct all_context_tag { beamformer_if_cntx_t beamformer; gain_if_cntx_t db[4]; // FIXME add Extension Context for board types, revs, serial numbers, temps + caldiv_if_cntx_t caldiv; gps_if_cntx_t gps; // must be last } __attribute__((packed)) all_context_t; |