diff options
author | Michael Dickens <michael.dickens@ettus.com> | 2021-05-14 11:15:34 -0400 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-05-20 14:57:47 -0500 |
commit | 93bed45f48c78863428c82cf242f5a147fba699c (patch) | |
tree | 3eb79c057349d5b30c41605969b8dbe05e9a980b /mpm/python | |
parent | 97bd72438ca31a1e482e8b345bd5b697870fd907 (diff) | |
download | uhd-93bed45f48c78863428c82cf242f5a147fba699c.tar.gz uhd-93bed45f48c78863428c82cf242f5a147fba699c.tar.bz2 uhd-93bed45f48c78863428c82cf242f5a147fba699c.zip |
mpm: add FPGA type to the info returned during discovery
Also update this info upon server reset, such as when a new FPGA image is loaded
Diffstat (limited to 'mpm/python')
-rw-r--r-- | mpm/python/usrp_mpm/discovery.py | 1 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/mpmtypes.py | 1 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/rpc_server.py | 6 |
3 files changed, 8 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/discovery.py b/mpm/python/usrp_mpm/discovery.py index a225bd1db..91fb8f590 100644 --- a/mpm/python/usrp_mpm/discovery.py +++ b/mpm/python/usrp_mpm/discovery.py @@ -55,6 +55,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"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 5eab23e3d..600ebcd0b 100644 --- a/mpm/python/usrp_mpm/mpmtypes.py +++ b/mpm/python/usrp_mpm/mpmtypes.py @@ -30,3 +30,4 @@ class SharedState: self.dev_type = Array(ctypes.c_char, 16, lock=self.lock) self.dev_serial = Array(ctypes.c_char, 8, 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 95078a2d6..63302b23f 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_fpga_type.value = \ + to_binary_str(device_info.get("fpga", "n/a")) self._db_methods = [] self._mb_methods = [] self.claimed_methods = copy.copy(self.default_claimed_methods) @@ -503,6 +505,10 @@ class MPMServer(RPCServer): # Clear the method cache in order to remove stale references to # methods from the old peripheral manager (the one before reset) self.clear_method_registry() + # update the FPGA type information in the state + device_info = self.periph_manager.get_device_info() + self._state.dev_fpga_type.value = \ + to_binary_str(device_info.get("fpga", "n/a")) def reset_timer_and_mgr(self, token): """ |