aboutsummaryrefslogtreecommitdiffstats
path: root/mpm
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-01-23 12:06:35 -0800
committerMartin Braun <martin.braun@ettus.com>2018-01-23 15:21:28 -0800
commit4c81ed0a5dd01e65db560b9ed0db14407d14ce3e (patch)
tree29618b8a2e8f0275ff81520602cbd733dcfb6795 /mpm
parent28405e54056b52fcd04fc71c6c2d72f3dc8c31cf (diff)
downloaduhd-4c81ed0a5dd01e65db560b9ed0db14407d14ce3e.tar.gz
uhd-4c81ed0a5dd01e65db560b9ed0db14407d14ce3e.tar.bz2
uhd-4c81ed0a5dd01e65db560b9ed0db14407d14ce3e.zip
fixup! mpm: Log timeouts during API calls, reset timer on claimed calls
Diffstat (limited to 'mpm')
-rw-r--r--mpm/python/usrp_mpm/periph_manager/base.py6
-rw-r--r--mpm/python/usrp_mpm/rpc_server.py3
2 files changed, 8 insertions, 1 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py
index 93edb36ce..303f7e805 100644
--- a/mpm/python/usrp_mpm/periph_manager/base.py
+++ b/mpm/python/usrp_mpm/periph_manager/base.py
@@ -733,6 +733,9 @@ class PeriphManagerBase(object):
"""
This is called when the device is claimed, in case the device needs to
run any actions on claiming (e.g., light up an LED).
+
+ Consider this a "post claim hook", not a function to actually claim
+ this device (which happens outside of this class).
"""
self.log.debug("Device was claimed. No actions defined.")
@@ -740,6 +743,9 @@ class PeriphManagerBase(object):
"""
This is called when the device is unclaimed, in case the device needs
to run any actions on claiming (e.g., turn off an LED).
+
+ Consider this a "post unclaim hook", not a function to actually
+ unclaim this device (which happens outside of this class).
"""
self.log.debug("Device was unclaimed. No actions defined.")
diff --git a/mpm/python/usrp_mpm/rpc_server.py b/mpm/python/usrp_mpm/rpc_server.py
index d20796c52..4eed6b79b 100644
--- a/mpm/python/usrp_mpm/rpc_server.py
+++ b/mpm/python/usrp_mpm/rpc_server.py
@@ -186,7 +186,7 @@ class MPMServer(RPCServer):
self._last_error = str(ex)
raise
finally:
- if not self.periph_manager.claimed:
+ if not self._state.claim_status.value:
self.log.error("Lost claim during API call to `%s'!",
command)
new_claimed_function.__doc__ = function.__doc__
@@ -279,6 +279,7 @@ class MPMServer(RPCServer):
choice(ascii_letters + digits) for _ in range(TOKEN_LEN)
), 'ascii')
self._state.claim_status.value = True
+ self.periph_manager.claimed = True
self.periph_manager.claim()
self._state.lock.release()
self.session_id = session_id + " ({})".format(self.client_host)