added access methods and parsing for caldiv if context
authorJosh Blum <josh@joshknows.com>
Tue, 29 Sep 2009 02:04:38 +0000 (19:04 -0700)
committerJosh Blum <josh@joshknows.com>
Tue, 29 Sep 2009 02:04:38 +0000 (19:04 -0700)
gr-vrt/src/vrt_quadradio_source_32fc.h
gr-vrt/src/vrt_source_32fc.cc
gr-vrt/src/vrt_source_32fc.h
gruel/src/include/gruel/inet.h.in
vrt/include/vrt/if_context.h

index 4589908f1e451aeeecb703fc6c3019c913b12c6a..799b07e86b929af119957db63754a36eaff8a823 100644 (file)
@@ -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;}
 };
 
 
index 551ea98212615be739d8d51c483bdcc025f1bfae..0091619ab0fa7d6509b47f9fab04c7a0fb154eab 100644 (file)
@@ -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;
index 96e9cac427528c57af779acd5154c854977ce00c..9d53fae33bcc42e341115739f8be7aa7fb415105 100644 (file)
@@ -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();
index 3202707270df3e22bc765fda1b743cd6f168b3da..7ac01eb56df44114b2f17e5f771bf5cc7ee9be37 100644 (file)
@@ -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...
index e51a7df6eccb18edbfaae1f69ae42c3a2b24d49b..b1d5424597a54664141d5002429b5ca1e649a314 100644 (file)
@@ -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;