aboutsummaryrefslogtreecommitdiffstats
path: root/mpm
diff options
context:
space:
mode:
Diffstat (limited to 'mpm')
-rw-r--r--mpm/python/usrp_mpm/periph_manager/base.py9
-rw-r--r--mpm/python/usrp_mpm/periph_manager/n3xx.py5
2 files changed, 13 insertions, 1 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py
index b698f661b..1206289b9 100644
--- a/mpm/python/usrp_mpm/periph_manager/base.py
+++ b/mpm/python/usrp_mpm/periph_manager/base.py
@@ -140,6 +140,15 @@ class PeriphManagerBase(object):
mboard_info -- Dictionary; motherboard info
device_args -- List of dictionaries; daughterboard info
"""
+ # Try to add the MPM Git hash and version
+ try:
+ from usrp_mpm import __version__, __githash__
+ version_string = __version__
+ if len(__githash__):
+ version_string += "-g" + __githash__
+ except ImportError:
+ version_string = ""
+ mboard_info["mpm_version"] = version_string
return mboard_info
@staticmethod
diff --git a/mpm/python/usrp_mpm/periph_manager/n3xx.py b/mpm/python/usrp_mpm/periph_manager/n3xx.py
index 72aa17b11..08ddf6e9e 100644
--- a/mpm/python/usrp_mpm/periph_manager/n3xx.py
+++ b/mpm/python/usrp_mpm/periph_manager/n3xx.py
@@ -155,12 +155,15 @@ class n3xx(ZynqComponents, PeriphManagerBase):
"""
Hard-code our product map
"""
+ # Add the default PeriphManagerBase information first
+ device_info = super().generate_device_info(
+ eeprom_md, mboard_info, dboard_infos)
+ # Then add N3xx-specific information
mb_pid = eeprom_md.get('pid')
lookup_key = (
n3xx.pids.get(mb_pid, 'unknown'),
tuple([x['pid'] for x in dboard_infos]),
)
- device_info = mboard_info
device_info['product'] = cls.product_map.get(lookup_key, 'unknown')
return device_info