Revision 476afe68 host/lib/usrp/usrp2/codec_impl.cpp

b/host/lib/usrp/usrp2/codec_impl.cpp
32 32
static const uhd::dict<std::string, gain_range_t> codec_rx_gain_ranges = map_list_of
33 33
                                  ("analog", gain_range_t(0, 3.5, 3.5))
34 34
                                  ("digital", gain_range_t(0, 6.0, 0.5))
35
				  ("digital-fine", gain_range_t(0, 0.5, 0.05));
35
                                  ("digital-fine", gain_range_t(0, 0.5, 0.05));
36 36

  
37 37

  
38 38
/***********************************************************************
......
67 67
        return;
68 68

  
69 69
    case CODEC_PROP_GAIN_NAMES:
70
        if(_iface->is_usrp2p()) {
71
          val = prop_names_t(codec_rx_gain_ranges.keys());
72
        } else val = prop_names_t();
70
        switch(_iface->get_rev()){
71
        case usrp2_iface::USRP_N200:
72
        case usrp2_iface::USRP_N210:
73
            val = prop_names_t(codec_rx_gain_ranges.keys());
74
            return;
75

  
76
        default: val = prop_names_t();
77
        }
73 78
        return;
74 79

  
75 80
    case CODEC_PROP_GAIN_I:
......
89 94

  
90 95
void usrp2_mboard_impl::rx_codec_set(const wax::obj &key_, const wax::obj &val){
91 96
    named_prop_t key = named_prop_t::extract(key_);
92
    float gain;
93 97

  
94
  switch(key.as<codec_prop_t>()) {
98
    switch(key.as<codec_prop_t>()) {
95 99
    case CODEC_PROP_GAIN_I:
96 100
    case CODEC_PROP_GAIN_Q:
97
      if(!_iface->is_usrp2p()) UHD_THROW_PROP_SET_ERROR();//this capability is only found in USRP2P
98

  
99
      gain = val.as<float>();
100
      this->rx_codec_set_gain(gain, key.name);
101
      return;
101
        this->rx_codec_set_gain(val.as<float>(), key.name);
102
        return;
102 103

  
103
    default:
104
      UHD_THROW_PROP_SET_ERROR();
104
    default: UHD_THROW_PROP_SET_ERROR();
105 105
  }
106 106
}
107 107

  

Also available in: Unified diff