aboutsummaryrefslogtreecommitdiffstats
path: root/mpm
diff options
context:
space:
mode:
authorLars Amsel <lars.amsel@ni.com>2022-02-04 08:37:28 +0100
committerAaron Rossetto <aaron.rossetto@ni.com>2022-02-08 13:55:35 -0600
commit6e2a65e700de05a0da557dd9d5125b9867cb029b (patch)
tree656528ab03e9f8705e8e2bd0d0f26324919cb76a /mpm
parent02152fd7a652444cd5a41709f1139ff1b3d42e8d (diff)
downloaduhd-6e2a65e700de05a0da557dd9d5125b9867cb029b.tar.gz
uhd-6e2a65e700de05a0da557dd9d5125b9867cb029b.tar.bz2
uhd-6e2a65e700de05a0da557dd9d5125b9867cb029b.zip
mpm: add device name to discovery process
MPM devices currently do not report their device name in the discovery process. This adds the device name. After the change the device name is reported, e.g. when using uhd_find_devices, like so: $> uhd_find_devices -------------------------------------------------- -- UHD Device 0 -------------------------------------------------- Device Address: serial: DEADBEEF claimed: False fpga: X4_200 mgmt_addr: <mpm device ip> name: <mpm device host name> product: x410 type: x4xx
Diffstat (limited to 'mpm')
-rw-r--r--mpm/python/usrp_mpm/discovery.py1
-rw-r--r--mpm/python/usrp_mpm/mpmtypes.py1
-rw-r--r--mpm/python/usrp_mpm/rpc_server.py2
3 files changed, 4 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/discovery.py b/mpm/python/usrp_mpm/discovery.py
index c33f1e3c4..a9f165ed3 100644
--- a/mpm/python/usrp_mpm/discovery.py
+++ b/mpm/python/usrp_mpm/discovery.py
@@ -53,6 +53,7 @@ def _discovery_process(state, discovery_addr):
[b"type="+state.dev_type.value] + \
[b"product="+state.dev_product.value] + \
[b"serial="+state.dev_serial.value] + \
+ [b"name="+state.dev_name.value] + \
[b"fpga="+state.dev_fpga_type.value] + \
[RESPONSE_CLAIMED_KEY+to_binary_str("={}".format(state.claim_status.value))]
)
diff --git a/mpm/python/usrp_mpm/mpmtypes.py b/mpm/python/usrp_mpm/mpmtypes.py
index 600ebcd0b..25fa410c2 100644
--- a/mpm/python/usrp_mpm/mpmtypes.py
+++ b/mpm/python/usrp_mpm/mpmtypes.py
@@ -29,5 +29,6 @@ class SharedState:
self.claim_token = Array(ctypes.c_char, 256, lock=self.lock)
self.dev_type = Array(ctypes.c_char, 16, lock=self.lock)
self.dev_serial = Array(ctypes.c_char, 8, lock=self.lock)
+ self.dev_name = Array(ctypes.c_char, 21, lock=self.lock)
self.dev_product = Array(ctypes.c_char, 16, lock=self.lock)
self.dev_fpga_type = Array(ctypes.c_char, 8, lock=self.lock)
diff --git a/mpm/python/usrp_mpm/rpc_server.py b/mpm/python/usrp_mpm/rpc_server.py
index 37469a4a7..77b4d5a15 100644
--- a/mpm/python/usrp_mpm/rpc_server.py
+++ b/mpm/python/usrp_mpm/rpc_server.py
@@ -87,6 +87,8 @@ class MPMServer(RPCServer):
to_binary_str(device_info.get("product", "n/a"))
self._state.dev_serial.value = \
to_binary_str(device_info.get("serial", "n/a"))
+ self._state.dev_name.value = \
+ to_binary_str(device_info.get("name", "n/a"))
self._state.dev_fpga_type.value = \
to_binary_str(device_info.get("fpga", "n/a"))
self._db_methods = []