From 9fda11ad1f7630e0c64cfe3a2203ca1f24525512 Mon Sep 17 00:00:00 2001 From: Marcus Müller Date: Sun, 25 Oct 2015 11:25:33 +0100 Subject: docs: Install info updates - fixed win boost bin link - formatting - added detailed Win Build instructions --- host/docs/build.dox | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/host/docs/build.dox b/host/docs/build.dox index 0e722e376..05e4ff788 100644 --- a/host/docs/build.dox +++ b/host/docs/build.dox @@ -28,7 +28,7 @@ The following compilers are known to work and officially supported: - GCC >= 4.4 - Clang >= 3.1 -- MSVC >= 2012 +- MSVC >= 2012; the free Visual Studio Express Edition for Desktop works. Other compilers (or lower versions) may work, but are unsupported. @@ -45,7 +45,7 @@ Other compilers (or lower versions) may work, but are unsupported. - **Minimum Version:** 1.46 - **Usage:** build time + runtime (required) - **Download URL:** http://www.boost.org/users/download/ -- **Download URL (Windows installer):** http://www.boostpro.com/download +- **Download URL (Windows installer):** http://sourceforge.net/projects/boost/files/boost-binaries/ ### LibUSB @@ -68,9 +68,7 @@ Other compilers (or lower versions) may work, but are unsupported. - **Minimum Version:** 0.5.0 - **Usage:** build time (required) - **Download URL:** http://www.makotemplates.org/download.html - -**Alternative method:** -You can use `pip` or `easy_install` to install Mako from PyPi. +- **Alternative method:** You can use `pip` or `easy_install` to install Mako from PyPi. ### Doxygen @@ -78,10 +76,7 @@ You can use `pip` or `easy_install` to install Mako from PyPi. - **Minimum Recommended Version:** 1.8 - **Usage:** build time (optional) - **Download URL:** http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc - -**Alternate method:** -Install **setuptools**, and use the **easy_install** command to install Docutils. -http://pypi.python.org/pypi/setuptools +- **Alternate method:** Install **setuptools**, and use the **easy_install** command to install Docutils. http://pypi.python.org/pypi/setuptools ### Git @@ -180,9 +175,17 @@ or add it to `/etc/ld.so.conf` and make sure to run: - Set the path to the build directory: `/host/build`. - Make sure that the paths do not contain spaces. - Click "Configure" and select "Microsoft Visual Studio 10". -- Set the build variables and click "Configure" again. +- Set the build variables + - `Boost_INCLUDE_DIR` should point to the `PATH` where the Boost .hpp files are, e.g. `C:\local\boost_version\boost` + - `Boost_LIBRARY_DIR` should point to the pre-built libraries, e.g. `C:\local\boost_version\lib64-msvc-14.0`) + . - Click "Generate", and a project file will be created in the build directory. +\subsection msvc_generate Compile and Install with Visual Studio +- Open the `\\host\\build\\ALL_BUILD.vcxproj` in visual studio, generate the project. Watch the output console for errors. +- If you did not specify a `CMAKE_INSTALL_PREFIX` where your user has write privileges, you must close Visual Studio, run it again with Administrator Privileges, and open `ALL_BUILD.vcxproj`. +- Right click on the **INSTALL** project in the project explorer, generate it. Watch the output console for errors. + \subsection libusb_notes LibUSB notes On Windows, CMake does not have the advantage of `pkg-config`, -- cgit v1.2.3 From eebbc01d280b81b3d99948eeef2008f9f10c04c9 Mon Sep 17 00:00:00 2001 From: Philip Balister Date: Wed, 28 Oct 2015 10:45:27 -0700 Subject: If we are cross compiling, do not test for build machine distro. UHD would use the result of the REDHAT test to decide if UHD installed in lib64. So if you did a build for a 64 bit machine on a FEDORA box with OE, it decided to install uhd in /usr/lib64. This is not always the right thing to do. Eventually, we will need to deal with OE builds that use lib64, but we can figure that out when we hit the problem. Signed-off-by: Philip Balister --- host/cmake/Modules/UHDPackage.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/host/cmake/Modules/UHDPackage.cmake b/host/cmake/Modules/UHDPackage.cmake index 640935830..08c2a6c53 100644 --- a/host/cmake/Modules/UHDPackage.cmake +++ b/host/cmake/Modules/UHDPackage.cmake @@ -27,11 +27,11 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") SET(LINUX TRUE) ENDIF() -IF(LINUX AND EXISTS "/etc/debian_version") +IF(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/debian_version") SET(DEBIAN TRUE) ENDIF() -IF(LINUX AND EXISTS "/etc/redhat-release") +IF(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/redhat-release") SET(REDHAT TRUE) ENDIF() -- cgit v1.2.3 From 7d6dad268d0dee0a29b40c69c40868e0dcdff34b Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 2 Nov 2015 14:08:15 -0800 Subject: docs: Remove some doxygen warnings by minor refactorings --- host/include/uhd/utils/byteswap.ipp | 12 ++++++++---- host/include/uhd/utils/math.hpp | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/host/include/uhd/utils/byteswap.ipp b/host/include/uhd/utils/byteswap.ipp index 5b2a7252f..f6c9407b6 100644 --- a/host/include/uhd/utils/byteswap.ipp +++ b/host/include/uhd/utils/byteswap.ipp @@ -101,7 +101,9 @@ **********************************************************************/ #include -template UHD_INLINE T uhd::ntohx(T num){ +namespace uhd { + +template UHD_INLINE T ntohx(T num){ #ifdef BOOST_BIG_ENDIAN return num; #else @@ -109,7 +111,7 @@ template UHD_INLINE T uhd::ntohx(T num){ #endif } -template UHD_INLINE T uhd::htonx(T num){ +template UHD_INLINE T htonx(T num){ #ifdef BOOST_BIG_ENDIAN return num; #else @@ -117,7 +119,7 @@ template UHD_INLINE T uhd::htonx(T num){ #endif } -template UHD_INLINE T uhd::wtohx(T num){ +template UHD_INLINE T wtohx(T num){ #ifdef BOOST_BIG_ENDIAN return uhd::byteswap(num); #else @@ -125,7 +127,7 @@ template UHD_INLINE T uhd::wtohx(T num){ #endif } -template UHD_INLINE T uhd::htowx(T num){ +template UHD_INLINE T htowx(T num){ #ifdef BOOST_BIG_ENDIAN return uhd::byteswap(num); #else @@ -133,4 +135,6 @@ template UHD_INLINE T uhd::htowx(T num){ #endif } +} /* namespace uhd */ + #endif /* INCLUDED_UHD_UTILS_BYTESWAP_IPP */ diff --git a/host/include/uhd/utils/math.hpp b/host/include/uhd/utils/math.hpp index ef7bfb6b7..088983167 100644 --- a/host/include/uhd/utils/math.hpp +++ b/host/include/uhd/utils/math.hpp @@ -34,8 +34,8 @@ namespace math { /*! * Numeric limits of certain types. * - * There are many sources for getting these, including std::numeric_limts, - * , , and Boost. The option is preferable as it + * There are many sources for getting these, including std::numeric_limits, + * ``, ``, and Boost. The `` option is preferable as it * gives us fixed-width constants, but unfortunately is new as of C++11. * Since this isn't available on many systems, we need to use one of the * other options. We will use the Boost option, here, since we use Boost -- cgit v1.2.3 From 788948b97edb61f637bb5905306dd01d3461ce01 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 9 Nov 2015 12:53:36 -0600 Subject: Updated top-level README. --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9de2690b9..2b7f5d3f4 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,12 @@ Started"-type guides. For technical documentation related to USRP™ hardware or UHD system design, check out the [UHD and USRP Manual](http://files.ettus.com/manual/). +That is where you can find +[Installation Instructions](http://files.ettus.com/manual/page_install.html), +help on how to +[build UHD from source](http://files.ettus.com/manual/page_build_guide.html) on +different platforms, development guidelines and reference documentation as well +as device usage guidance. Additionally, be sure to check out the Ettus Research [FAQ](http://www.ettus.com/kb/detail/frequently-asked-questions), and the @@ -40,7 +46,7 @@ supported. UHD can be used to build stand-alone applications with USRP™ hardware, or with third-party applications. Some common toolkits / frameworks are: -* [GNURadio](http://code.ettus.com/redmine/ettus/projects/uhd/wiki/GNU_Radio_UHD) +* [GNU Radio](http://gnuradio.org/) * [LabVIEW](http://www.ni.com/download/ni-usrp-1.3/4711/en/) * [Simulink](http://www.mathworks.com/discovery/sdr/usrp.html) * [OpenBTS](http://wush.net/trac/rangepublic/wiki/BuildInstallRun) -- cgit v1.2.3 From 36c8e0f81addfc38441dad6bbd56e8f60574ba4d Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 17 Nov 2015 09:17:02 -0800 Subject: examples: Fixed error code variable in rx_samples_c --- host/examples/rx_samples_c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host/examples/rx_samples_c.c b/host/examples/rx_samples_c.c index abea812fe..0ecb89153 100644 --- a/host/examples/rx_samples_c.c +++ b/host/examples/rx_samples_c.c @@ -222,7 +222,7 @@ int main(int argc, char* argv[]) EXECUTE_OR_GOTO(close_file, uhd_rx_metadata_error_code(md, &error_code) ) - if(return_code != UHD_RX_METADATA_ERROR_CODE_NONE){ + if(error_code != UHD_RX_METADATA_ERROR_CODE_NONE){ fprintf(stderr, "Error code 0x%x was returned during streaming. Aborting.\n", return_code); goto close_file; } -- cgit v1.2.3 From f0171cbd5e3ea235ec6fb424ac93106a9a3b22fa Mon Sep 17 00:00:00 2001 From: Marcus Müller Date: Tue, 8 Dec 2015 09:27:37 -0800 Subject: docs: Fixed many typos, recompressed and cropped images --- host/docs/calibration.dox | 10 ++++++---- host/docs/dboards.dox | 21 +++++++++++---------- host/docs/res/N2xx-JTAG.jpg | Bin 534084 -> 83425 bytes host/docs/res/TRRS.png | Bin 2955 -> 1280 bytes host/docs/res/e3x0_fp_overlay.png | Bin 28114 -> 6320 bytes host/docs/res/e3x0_imu_demo.png | Bin 85901 -> 15469 bytes host/docs/res/e3x0_rp_overlay.png | Bin 19780 -> 4993 bytes host/docs/res/e3xx_conn_photo.jpg | Bin 0 -> 8963 bytes host/docs/res/e3xx_conn_photo.png | Bin 62566 -> 0 bytes host/docs/res/e3xx_conn_render.png | Bin 25154 -> 24350 bytes host/docs/res/x3x0_gpio_conn.png | Bin 13651 -> 2586 bytes host/docs/res/x3x0_rp_overlay.png | Bin 32965 -> 5679 bytes host/docs/sync.dox | 2 +- host/docs/transport.dox | 8 ++++---- host/docs/usrp1.dox | 2 +- host/docs/usrp_b100.dox | 2 +- host/docs/usrp_b200.dox | 2 +- host/docs/usrp_e3x0.dox | 2 +- 18 files changed, 26 insertions(+), 23 deletions(-) create mode 100644 host/docs/res/e3xx_conn_photo.jpg delete mode 100644 host/docs/res/e3xx_conn_photo.png diff --git a/host/docs/calibration.dox b/host/docs/calibration.dox index eecb7af5c..02ad41699 100644 --- a/host/docs/calibration.dox +++ b/host/docs/calibration.dox @@ -39,19 +39,19 @@ utilities: UHD software installs the calibration utilities into `/bin`. **Disconnect** any external hardware from the RF antenna ports, and run the following from the command line. Each -utility will take several minutes to complete. : +utility will take several minutes to complete: uhd_cal_rx_iq_balance --verbose --args= uhd_cal_tx_iq_balance --verbose --args= uhd_cal_tx_dc_offset --verbose --args= -See the output given by --help for more advanced options, such as: +See the output given by `--help` for more advanced options, such as manually choosing the frequency range and step size for the sweeps. Note: Your daughterboard needs a serial number to run a calibration utility. Some older daughterboards may not have a serial number. If this is the case, run the following command to burn a serial number into the -daughterboard's EEPROM: : +daughterboard's EEPROM: /lib/uhd/utils/usrp_burn_db_eeprom --ser= --args= @@ -76,7 +76,9 @@ recovered by the user. \subsection ignore_cal_file Ignoring Calibration Files -At runtime, the user can choose to ignore a daughterboard's calibration file by adding "ignore-cal-file" to the arguments. With the UHD API, it can be done as follows: +At runtime, the user can choose to ignore a daughterboard's calibration file by +adding "ignore-cal-file" to the arguments. With the UHD API, it can be done as +follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp} uhd::device_addr_t hint; diff --git a/host/docs/dboards.dox b/host/docs/dboards.dox index a0188b25c..99314b105 100644 --- a/host/docs/dboards.dox +++ b/host/docs/dboards.dox @@ -80,7 +80,7 @@ Sensors: \subsection dboards_dbsrx2 DBSRX2 The DBSRX2 board has 1 quadrature frontend. It defaults to direct -conversion, but can use a low IF through lo_offset in uhd::tune_request_t. +conversion, but can use a low IF through `lo_offset` in uhd::tune_request_t. Receive Antennas: **J3** @@ -387,13 +387,14 @@ the standard daughterboard clock lines. \subsubsection dboards_dbsrxmod_1 Step 1: Move the clock configuration resistor -Remove **R193** (which is 10 Ohms, 0603 size), and put it on **R194**, -which is empty. This is made somewhat more complicated by the fact that -the silkscreen is not clear in that area. **R193** is on the back, -immediately below the large beige connector, **J2**. **R194** is just -below, and to the left of **R193**. The silkscreen for **R193** is ok, -but for **R194**, it is upside down, and partially cut off. If you lose -**R193**, you can use anything from 0 to 10 Ohms there. +Remove **R193** (which is 10 Ohms, 0603 size), and put it on **R194**, which is +empty. This is made somewhat more complicated by the fact that the silkscreen +is not clear in that area. **R193** is on the back, immediately below the large +beige connector, **J2**. **R194** is just below, and to the left of **R193**. + +The silkscreen for **R193** is ok, but for **R194**, it is upside down, and +partially cut off. If you lose **R193**, you can use anything from 0 to 10 Ohms +there. \subsubsection dboards_dbsrxmod_2 Step 2: Burn a new daughterboard id into the EEPROM @@ -402,9 +403,9 @@ With the daughterboard plugged-in, run the following commands: cd /lib/uhd/utils ./usrp_burn_db_eeprom --id=0x000d --unit=RX --args= --slot= -- **\** are device address arguments (optional if only one USRP +- `` are device address arguments (optional if only one USRP device is on your machine) -- **\** is the name of the daughterboard slot (optional if the +- `` is the name of the daughterboard slot (optional if the USRP device has only one slot) \subsection dboards_rfxmod RFX - Modify to use motherboard oscillator diff --git a/host/docs/res/N2xx-JTAG.jpg b/host/docs/res/N2xx-JTAG.jpg index acecc0592..64cc43242 100644 Binary files a/host/docs/res/N2xx-JTAG.jpg and b/host/docs/res/N2xx-JTAG.jpg differ diff --git a/host/docs/res/TRRS.png b/host/docs/res/TRRS.png index 78619c869..8dc9bf9eb 100755 Binary files a/host/docs/res/TRRS.png and b/host/docs/res/TRRS.png differ diff --git a/host/docs/res/e3x0_fp_overlay.png b/host/docs/res/e3x0_fp_overlay.png index c8f1af1be..416a75e9b 100644 Binary files a/host/docs/res/e3x0_fp_overlay.png and b/host/docs/res/e3x0_fp_overlay.png differ diff --git a/host/docs/res/e3x0_imu_demo.png b/host/docs/res/e3x0_imu_demo.png index cbf156224..72be046b1 100644 Binary files a/host/docs/res/e3x0_imu_demo.png and b/host/docs/res/e3x0_imu_demo.png differ diff --git a/host/docs/res/e3x0_rp_overlay.png b/host/docs/res/e3x0_rp_overlay.png index f351ffc24..e7dc24098 100644 Binary files a/host/docs/res/e3x0_rp_overlay.png and b/host/docs/res/e3x0_rp_overlay.png differ diff --git a/host/docs/res/e3xx_conn_photo.jpg b/host/docs/res/e3xx_conn_photo.jpg new file mode 100644 index 000000000..a63a1c67c Binary files /dev/null and b/host/docs/res/e3xx_conn_photo.jpg differ diff --git a/host/docs/res/e3xx_conn_photo.png b/host/docs/res/e3xx_conn_photo.png deleted file mode 100644 index dd12f5ac2..000000000 Binary files a/host/docs/res/e3xx_conn_photo.png and /dev/null differ diff --git a/host/docs/res/e3xx_conn_render.png b/host/docs/res/e3xx_conn_render.png index 52e6ce5d9..c37024ce8 100644 Binary files a/host/docs/res/e3xx_conn_render.png and b/host/docs/res/e3xx_conn_render.png differ diff --git a/host/docs/res/x3x0_gpio_conn.png b/host/docs/res/x3x0_gpio_conn.png index 0147bf422..f09363dea 100644 Binary files a/host/docs/res/x3x0_gpio_conn.png and b/host/docs/res/x3x0_gpio_conn.png differ diff --git a/host/docs/res/x3x0_rp_overlay.png b/host/docs/res/x3x0_rp_overlay.png index c34936ac3..4665dc88b 100644 Binary files a/host/docs/res/x3x0_rp_overlay.png and b/host/docs/res/x3x0_rp_overlay.png differ diff --git a/host/docs/sync.dox b/host/docs/sync.dox index 59f849e1a..1789a70a9 100644 --- a/host/docs/sync.dox +++ b/host/docs/sync.dox @@ -166,7 +166,7 @@ chains will remain constant after each re-tune. See notes below: - This phase offset will drift over time due to thermal and other characteristics - Periodic calibration will be necessary for phase-coherent applications -Code snippet example, tuning with timed commands: : +Code snippet example, tuning with timed commands: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp} //we will tune the frontends in 100ms from now diff --git a/host/docs/transport.dox b/host/docs/transport.dox index eb7232f36..72d59fb2a 100644 --- a/host/docs/transport.dox +++ b/host/docs/transport.dox @@ -16,7 +16,7 @@ for the various transports in the UHD software: \section transport_udp UDP Transport (Sockets) The UDP transport is implemented with user-space sockets. This means -standard Berkeley sockets API using send()/recv(). +standard Berkeley sockets API using `send()`/`recv()`. \subsection transport_udp_params Transport parameters @@ -97,12 +97,12 @@ Set the values permanently by editing `/etc/sysctl.conf`. \subsection transport_udp_windows Windows specific notes -**UDP send fast-path:** It is important to change the default UDP +UDP send fast-path: It is important to change the default UDP behavior such that 1500 byte packets still travel through the fast path of the sockets stack. This can be adjusted with the -FastSendDatagramThreshold registry key: +`FastSendDatagramThreshold` registry key: -- FastSendDatagramThreshold registry key documented here: +- `FastSendDatagramThreshold` registry key documented here: - diff --git a/host/docs/usrp1.dox b/host/docs/usrp1.dox index e82df0a7b..2f7b26e05 100644 --- a/host/docs/usrp1.dox +++ b/host/docs/usrp1.dox @@ -87,7 +87,7 @@ Run the following commands to record the setting into the EEPROM: ./usrp_burn_mb_eeprom --args= --values="mcr=" The user may override the clock rate specified in the EEPROM by using a -device address: Example: +device address. Example: uhd_usrp_probe --args="mcr=52e6" diff --git a/host/docs/usrp_b100.dox b/host/docs/usrp_b100.dox index a7d67f50f..89bc6ea64 100644 --- a/host/docs/usrp_b100.dox +++ b/host/docs/usrp_b100.dox @@ -64,7 +64,7 @@ position. To communicate the desired clock rate into UHD software, specify the special device address argument, where the key is -**master_clock_rate** and the value is a rate in Hz. Example: : +`master_clock_rate` and the value is a rate in Hz. Example: uhd_usrp_probe --args="master_clock_rate=52e6" diff --git a/host/docs/usrp_b200.dox b/host/docs/usrp_b200.dox index 0afcf99da..be63b8fe8 100644 --- a/host/docs/usrp_b200.dox +++ b/host/docs/usrp_b200.dox @@ -20,7 +20,7 @@ \section b200_power Power In most cases, USB 3.0 bus power will be sufficient to power the device. -If using USB 2.0 or a internal GPSDO, an external power supply or a cable designed +If using USB 2.0 or an internal GPSDO, an external power supply or a cable designed to pull power from 2 USB ports (USB 3.0 dual A to micro-B or B) must be used. \section b200_imgs Specifying a Non-standard Image diff --git a/host/docs/usrp_e3x0.dox b/host/docs/usrp_e3x0.dox index 807d82e4d..bdcfe8bfb 100644 --- a/host/docs/usrp_e3x0.dox +++ b/host/docs/usrp_e3x0.dox @@ -443,7 +443,7 @@ The USRP E312 (and with upgraded firmware E310) supports LiIon Battery packs (e. The connector J1 on E312's motherboard is a Molex 53014-6310. The corresponding mating connector is a Molex 51004-0300. -\image html e3xx_conn_photo.png "Battery pack connector" +\image html e3xx_conn_photo.jpg "Battery pack connector" The pins are as follows: - Pin 1 (Red): VBat -- cgit v1.2.3 From 7be0c9facb42554283820e9189195c93f146930b Mon Sep 17 00:00:00 2001 From: Marcus Müller Date: Mon, 7 Dec 2015 18:05:22 +0100 Subject: docs: GPSDO no longer autoset as time and clock src Also added instructions to safely set device time. --- host/docs/gpsdo_x3x0.dox | 57 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 8 deletions(-) diff --git a/host/docs/gpsdo_x3x0.dox b/host/docs/gpsdo_x3x0.dox index 24997d50b..9577b930d 100644 --- a/host/docs/gpsdo_x3x0.dox +++ b/host/docs/gpsdo_x3x0.dox @@ -46,12 +46,22 @@ pins. \section gpsdox_using Using the GPSDO in Your Application -By default, if a GPSDO is detected at startup, the USRP will be -configured to use it as a frequency and time reference. The internal -VITA timestamp will be initialized to the GPS time, and the internal -oscillator will be phase-locked to the 10MHz GPSDO reference. If the -GPSDO is not locked to satellites, the VITA time will not be -initialized. +If a GPSDO is detected at startup, the USRP will have `gpsdo` clock and time +source options. + +Select these by using UHD's + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp} + usrp->set_clock_source("gpsdo"); + usrp->set_time_source("gpsdo"); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +That will lock the reference clock to the disciplined 10MHz oscillator, and +will make the USRP listen for time signal pulses coming from the GPSDO. + +However, you will still need to explicitly set the device time on such a PPS +edge, using the `set_time_next_pps` or `set_time_unknown_pps` +calls. GPS data is obtained through the **mboard_sensors** interface. To retrieve the current GPS time, use the **gps_time** sensor: @@ -65,12 +75,43 @@ January 1, 1970. This value is readily converted into human-readable format using the **time.h** library in C, **boost::posix_time** in C++, etc. +\subsection Setting Device Time to GPS time + +If you want to set the device time to GPS time, the following procedure makes +sure you don't encounter timing problems while doing so: + +1. Wait for GPS lock, and then set the time source to GPSDO, +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp} + while(! (usrp->get_mboard_sensor("gps_locked",0).to_bool()) ) { + boost::this_thread::sleep(boost::posix_time::seconds(2)); + } + usrp->set_time_source("gpsdo"); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +2. poll on `usrp->get_time_last_pps()` until a change is seen, and then sleep 200ms to allow new time data coming from the GPSDO to propagate through the system, +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp} + uhd::time_spec_t last = usrp->get_time_last_pps(); + uhd::time_spec_t next = usrp->get_time_last_pps(); + while(next == last) { + boost::this_thread::sleep(boost::posix_time::seconds(0.05)); + last = next; + next = usrp->get_time_last_pps(); + } + boost::this_thread::sleep(boost::posix_time::seconds(0.2)); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +3. use +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp} +usrp->set_time_next_pps(uhd::time_spec_t(usrp->get_mboard_sensor("gps_time").to_int()+1)); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +to set the time, +4. poll on `usrp->get_time_last_pps()` until a change is seen and sleep 200ms (allow NMEA string to propagate), +5. Verify that `usrp->get_time_last_pps()` and `usrp->get_mboard_sensor("gps_time")` return the same time. + +\subsection Further GPS sensors + Other information can be fetched as well. You can query the lock status with the **gps_locked** sensor, as well as obtain raw NMEA sentences using the **gps_gprmc**, and **gps_gpgga** sensors. Location information can be parsed out of the **gps_gpgga** sensor by using **gpsd** or another NMEA parser. - - */ // vim:ft=doxygen: -- cgit v1.2.3 From 21df150ec873f15c4e85f9564b56586e3fe2afcf Mon Sep 17 00:00:00 2001 From: Nicholas Corgan Date: Tue, 8 Dec 2015 14:31:02 -0800 Subject: e300: added virtual destructor to e300_sensor_manager class --- host/lib/usrp/e300/e300_sensor_manager.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/host/lib/usrp/e300/e300_sensor_manager.hpp b/host/lib/usrp/e300/e300_sensor_manager.hpp index bfaf8e90c..1252e07b9 100644 --- a/host/lib/usrp/e300/e300_sensor_manager.hpp +++ b/host/lib/usrp/e300/e300_sensor_manager.hpp @@ -1,5 +1,5 @@ // -// Copyright 2014 Ettus Research LLC +// Copyright 2014-2015 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -46,6 +46,8 @@ class e300_sensor_manager : boost::noncopyable public: typedef boost::shared_ptr sptr; + virtual ~e300_sensor_manager() {}; + virtual uhd::sensor_value_t get_sensor(const std::string &key) = 0; virtual std::vector get_sensors(void) = 0; -- cgit v1.2.3