diff options
author | Brent Stapleton <brent.stapleton@ettus.com> | 2017-11-27 18:21:23 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:05:57 -0800 |
commit | 19cdfb4148338a94bdc75194e0fadad993c37758 (patch) | |
tree | b308cd3225fae0c68551c21ad19941d22b56176b /mpm/python/usrp_hwd.py | |
parent | 48d5d72fd76bbf615ea88fa9d5177471ed3d15a9 (diff) | |
download | uhd-19cdfb4148338a94bdc75194e0fadad993c37758.tar.gz uhd-19cdfb4148338a94bdc75194e0fadad993c37758.tar.bz2 uhd-19cdfb4148338a94bdc75194e0fadad993c37758.zip |
mpm: Reset periph manager on update
Upon updating certain components (the FPGA, for example), the
Peripheral Manager is restarted, and the overlay is reapplied. In order
to facilitate this, the RPC server intercepts and handles the
update_component function.
Tested on the RJ45 ethernet connection. It probably won't work as well
if the SFP connection goes down when the overlay is removed.
Diffstat (limited to 'mpm/python/usrp_hwd.py')
-rwxr-xr-x | mpm/python/usrp_hwd.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mpm/python/usrp_hwd.py b/mpm/python/usrp_hwd.py index fef02087a..d6e860a0c 100755 --- a/mpm/python/usrp_hwd.py +++ b/mpm/python/usrp_hwd.py @@ -137,7 +137,8 @@ def main(): # with cmake (-DMPM_DEVICE). # mgr is thus derived from PeriphManagerBase (see periph_manager/base.py) log.info("Spawning periph manager...") - mgr = periph_manager(args) + mgr_generator = lambda: periph_manager(args) + mgr = mgr_generator() discovery_info = { "type": mgr.get_device_info().get("type", "n/a"), "serial": mgr.get_device_info().get("serial", "n/a"), @@ -162,7 +163,7 @@ def main(): ) log.info("Spawning RPC process...") _PROCESSES.append( - mpm.spawn_rpc_process(mpm.mpmtypes.MPM_RPC_PORT, shared, mgr)) + mpm.spawn_rpc_process(mpm.mpmtypes.MPM_RPC_PORT, shared, mgr, mgr_generator)) log.info("Processes launched. Registering signal handlers.") signal.signal(signal.SIGTERM, kill_time) signal.signal(signal.SIGINT, kill_time) |