From 19cdfb4148338a94bdc75194e0fadad993c37758 Mon Sep 17 00:00:00 2001 From: Brent Stapleton Date: Mon, 27 Nov 2017 18:21:23 -0800 Subject: 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. --- mpm/python/usrp_hwd.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mpm/python/usrp_hwd.py') 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) -- cgit v1.2.3