diff options
Diffstat (limited to 'host/lib/usrp/e300/e300_network.cpp')
-rw-r--r-- | host/lib/usrp/e300/e300_network.cpp | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/host/lib/usrp/e300/e300_network.cpp b/host/lib/usrp/e300/e300_network.cpp index 408f9e62d..96387d6f7 100644 --- a/host/lib/usrp/e300/e300_network.cpp +++ b/host/lib/usrp/e300/e300_network.cpp @@ -230,6 +230,27 @@ static void e300_codec_ctrl_tunnel( case codec_xact_t::ACTION_GET_RSSI: out->rssi = _codec_ctrl->get_rssi(which_str).to_real(); break; + case codec_xact_t::ACTION_GET_TEMPERATURE: + out->temp = _codec_ctrl->get_temperature().to_real(); + break; + case codec_xact_t::ACTION_SET_DC_OFFSET_AUTO: + _codec_ctrl->set_dc_offset_auto(which_str, in->use_dc_correction == 1); + break; + case codec_xact_t::ACTION_SET_IQ_BALANCE_AUTO: + _codec_ctrl->set_iq_balance_auto(which_str, in->use_iq_correction == 1); + case codec_xact_t::ACTION_SET_AGC: + _codec_ctrl->set_agc(which_str, in->use_agc == 1); + break; + case codec_xact_t::ACTION_SET_AGC_MODE: + if(in->agc_mode == 0) { + _codec_ctrl->set_agc_mode(which_str, "slow"); + } else if (in->agc_mode == 1) { + _codec_ctrl->set_agc_mode(which_str, "fast"); + } + break; + case codec_xact_t::ACTION_SET_BW: + out->bw = _codec_ctrl->set_bw_filter(which_str, in->bw); + break; default: UHD_MSG(status) << "Got unknown request?!" << std::endl; //Zero out actions to fail this request on client @@ -328,19 +349,9 @@ static void e300_sensor_tunnel( // TODO: This is ugly ... use proper serialization in->value = uhd::htonx<boost::uint32_t>( e300_sensor_manager::pack_float_in_uint32_t(temp.to_real())); - } else if (uhd::ntohx(in->which) == GPS_FOUND) { - in->value = uhd::htonx<boost::uint32_t>( - sensor_manager->get_gps_found() ? 1 : 0); - - } else if (uhd::ntohx(in->which) == GPS_LOCK) { - in->value = uhd::htonx<boost::uint32_t>( - sensor_manager->get_gps_lock().to_bool() ? 1 : 0); } else if (uhd::ntohx(in->which) == REF_LOCK) { in->value = uhd::htonx<boost::uint32_t>( sensor_manager->get_ref_lock().to_bool() ? 1 : 0); - } else if (uhd::ntohx(in->which) == GPS_TIME) { - in->value = uhd::htonx<boost::uint32_t>( - sensor_manager->get_gps_time().to_int()); } else UHD_MSG(status) << "Got unknown request?!" << std::endl; @@ -627,8 +638,7 @@ network_server_impl::network_server_impl(const uhd::device_addr_t &device_addr) _codec_ctrl = ad9361_ctrl::make_spi(client_settings, spi::make(E300_SPIDEV_DEVICE), 1); // This is horrible ... why do I have to sleep here? boost::this_thread::sleep(boost::posix_time::milliseconds(100)); - _sensor_manager = e300_sensor_manager::make_local( - gps::ublox::ubx::control::make("/dev/ttyPS1", 9600), _global_regs); + _sensor_manager = e300_sensor_manager::make_local(_global_regs); } }}} // namespace |