aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/periph_manager/base.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-01-08 14:16:05 -0800
committerMartin Braun <martin.braun@ettus.com>2018-01-10 17:31:21 -0800
commit410e87e2828616e8e02627b60c9af5344b9249e1 (patch)
tree92b90b8cf8eb3c13ba13f81bded21b74b01dc860 /mpm/python/usrp_mpm/periph_manager/base.py
parent0691c5ea752139e44605004a3c2d8a5fe493934d (diff)
downloaduhd-410e87e2828616e8e02627b60c9af5344b9249e1.tar.gz
uhd-410e87e2828616e8e02627b60c9af5344b9249e1.tar.bz2
uhd-410e87e2828616e8e02627b60c9af5344b9249e1.zip
mpm: Add API call for claim and unclaim
These are hooks that the RPC server calls into when claiming a device, and allow the device implementation to trigger user-definable actions on claiming/unclaiming.
Diffstat (limited to 'mpm/python/usrp_mpm/periph_manager/base.py')
-rw-r--r--mpm/python/usrp_mpm/periph_manager/base.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py
index beba6fef0..474180c31 100644
--- a/mpm/python/usrp_mpm/periph_manager/base.py
+++ b/mpm/python/usrp_mpm/periph_manager/base.py
@@ -685,3 +685,21 @@ class PeriphManagerBase(object):
- src_port: IP port the connection is coming from.
"""
raise NotImplementedError("commit_xport() not implemented.")
+
+ #######################################################################
+ # Claimer API
+ #######################################################################
+ def claim(self):
+ """
+ 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).
+ """
+ self.log.debug("Device was claimed. No actions defined.")
+
+ def unclaim(self):
+ """
+ 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).
+ """
+ self.log.debug("Device was unclaimed. No actions defined.")
+