uhd/host/docs/identification.rst

131 lines
4.5 KiB
ReStructuredText
Raw Normal View History

2014-02-04 19:04:07 +00:00
=================================
UHD - Device Identification Notes
2014-02-04 19:04:07 +00:00
=================================
.. contents:: Table of Contents
2014-02-04 19:04:07 +00:00
------------------------
2012-12-18 23:47:17 +00:00
Identifying USRP Devices
2014-02-04 19:04:07 +00:00
------------------------
Devices are addressed through key/value string pairs.
These string pairs can be used to narrow down the search for a specific device or group of devices.
Most UHD utility applications and examples have an **--args** parameter that takes a device address, which is expressed as a delimited string.
See the documentation in **types/device_addr.hpp** for reference.
2014-02-04 19:04:07 +00:00
^^^^^^^^^^^^^^^^^^^^^^^^^
Common device identifiers
2014-02-04 19:04:07 +00:00
^^^^^^^^^^^^^^^^^^^^^^^^^
Every device has several ways of identifying it on the host system:
2014-02-04 19:04:07 +00:00
+------------+----------+-----------------------------------------------------------+-------------------------------
| Identifier | Key | Notes | Example
+============+==========+===========================================================+===============================
| Serial | serial | globally unique identifier | 12345678
+------------+----------+-----------------------------------------------------------+----------------------------
| Address | addr | unique identifier on a network | 192.168.10.2
+------------+----------+-----------------------------------------------------------+-------------------------------
| Resource | resource | unique identifier for USRP RIO devices (over PCI Express) | RIO0
+------------+----------+-----------------------------------------------------------+-------------------------------
| Name | name | optional user-set identifier | my_usrp1 (User-defined value)
+------------+----------+-----------------------------------------------------------+----------------------------
| Type | type | hardware series identifier | usrp1, usrp2,
+------------+----------+-----------------------------------------------------------+----------------------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Device discovery via command line
2014-02-04 19:04:07 +00:00
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Devices attached to your system can be discovered using the **uhd_find_devices** program.
This program scans your system for supported devices and prints
out an enumerated list of discovered devices and their addresses.
The list of discovered devices can be narrowed down by specifying device address args.
::
uhd_find_devices
Device address arguments can be supplied to narrow the scope of the search.
::
uhd_find_devices --args="type=usrp1"
-- OR --
uhd_find_devices --args="serial=12345678"
2014-02-04 19:04:07 +00:00
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Device discovery through the API
2014-02-04 19:04:07 +00:00
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The **device::find()** API call searches for devices and returns a list of discovered devices.
::
uhd::device_addr_t hint; //an empty hint discovers all devices
uhd::device_addrs_t dev_addrs = uhd::device::find(hint);
The **hint** argument can be populated to narrow the scope of the search.
::
uhd::device_addr_t hint;
hint["type"] = "usrp1";
uhd::device_addrs_t dev_addrs = uhd::device::find(hint);
-- OR --
uhd::device_addr_t hint;
hint["serial"] = "12345678";
uhd::device_addrs_t dev_addrs = uhd::device::find(hint);
2014-02-04 19:04:07 +00:00
^^^^^^^^^^^^^^^^^
Device properties
2014-02-04 19:04:07 +00:00
^^^^^^^^^^^^^^^^^
Properties of devices attached to your system can be probed with the **uhd_usrp_probe** program.
This program constructs an instance of the device and prints out its properties,
such as detected daughterboards, frequency range, gain ranges, etc...
**Usage:**
2014-02-04 19:04:07 +00:00
::
uhd_usrp_probe --args <device-specific-address-args>
2014-02-04 19:04:07 +00:00
--------------------
2012-12-18 23:47:17 +00:00
Naming a USRP Device
2014-02-04 19:04:07 +00:00
--------------------
2012-12-18 23:47:17 +00:00
For convenience purposes, users may assign a custom name to their USRP device.
The USRP device can then be identified via name, rather than a difficult to remember serial or address.
A name has the following properties:
* is composed of ASCII characters
* is 0-20 characters
* is not required to be unique
2014-02-04 19:04:07 +00:00
^^^^^^^^^^^^^^^^^
Set a custom name
2014-02-04 19:04:07 +00:00
^^^^^^^^^^^^^^^^^
Run the following commands:
2014-02-04 19:04:07 +00:00
::
2014-02-04 19:04:07 +00:00
cd <install-path>/lib/uhd/utils
./usrp_burn_mb_eeprom --args=<optional device args> --values="name=lab1_xcvr"
2014-02-04 19:04:07 +00:00
^^^^^^^^^^^^^^^^^^
Discovery via name
2014-02-04 19:04:07 +00:00
^^^^^^^^^^^^^^^^^^
The keyword **name** can be used to narrow the scope of the search.
Example with the find devices utility:
2014-02-04 19:04:07 +00:00
::
uhd_find_devices --args="name=lab1_xcvr"
-- OR --
uhd_find_devices --args="type=usrp1, name=lab1_xcvr"