From fb5e10a8e4cff12182403dc6af6f5d8bf7a469c0 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 9 Nov 2017 18:13:16 -0800 Subject: mpm: Cache connection type in PeriphManagerBase Now, when claiming a device, the connection type will be stored as a string in PeriphManagerBase. This way we can read out the current connection type even when not currently inside an RPC call. --- mpm/python/usrp_mpm/periph_manager/base.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mpm/python/usrp_mpm/periph_manager/base.py') diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py index 3f456fc96..100a8852a 100644 --- a/mpm/python/usrp_mpm/periph_manager/base.py +++ b/mpm/python/usrp_mpm/periph_manager/base.py @@ -394,6 +394,19 @@ class PeriphManagerBase(object): result.update(self.mboard_info) return result + @no_rpc + def set_connection_type(self, conn_type): + """ + Specify how the RPC client has connected to this MPM instance. Valid + values are "remote", "local", or None. When None is given, the value + is reset. + """ + assert conn_type in ('remote', 'local', None) + if conn_type is None: + self.mboard_info.pop('rpc_connection', None) + else: + self.mboard_info['rpc_connection'] = conn_type + @no_claim def get_dboard_info(self): """ -- cgit v1.2.3