From 6e2a65e700de05a0da557dd9d5125b9867cb029b Mon Sep 17 00:00:00 2001 From: Lars Amsel Date: Fri, 4 Feb 2022 08:37:28 +0100 Subject: 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: name: product: x410 type: x4xx --- mpm/python/usrp_mpm/discovery.py | 1 + mpm/python/usrp_mpm/mpmtypes.py | 1 + mpm/python/usrp_mpm/rpc_server.py | 2 ++ 3 files changed, 4 insertions(+) (limited to 'mpm') 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 = [] -- cgit v1.2.3