aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-05-15 12:18:37 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:03:53 -0800
commitc0a528394d44d2e4792e801908e005a1dd73d6b2 (patch)
treebd69c1f97efa3fd12196e595361918a3517d4d51
parent8b111dd123110907c257365ec298b195f95c4833 (diff)
downloaduhd-c0a528394d44d2e4792e801908e005a1dd73d6b2.tar.gz
uhd-c0a528394d44d2e4792e801908e005a1dd73d6b2.tar.bz2
uhd-c0a528394d44d2e4792e801908e005a1dd73d6b2.zip
mpm: Guaranteed stringification of mboard_info values
-rw-r--r--mpm/python/usrp_mpm/periph_manager/base.py4
-rw-r--r--mpm/python/usrp_mpm/periph_manager/n310.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py
index ec0e4ed79..62e461db8 100644
--- a/mpm/python/usrp_mpm/periph_manager/base.py
+++ b/mpm/python/usrp_mpm/periph_manager/base.py
@@ -262,7 +262,9 @@ class PeriphManagerBase(object):
self.log.trace("Found EEPROM metadata: `{}'".format(str(self._eeprom_head)))
self.log.trace("Read {} bytes of EEPROM data.".format(len(self._eeprom_rawdata)))
for key in ('pid', 'serial', 'rev'):
- self.mboard_info[key] = self._eeprom_head.get(key, '')
+ # In C++, we can only handle dicts if all the values are of the
+ # same type. So we must convert them all to strings here:
+ self.mboard_info[key] = str(self._eeprom_head.get(key, ''))
if self._eeprom_head.has_key('pid') and not self._eeprom_head['pid'] in self.pids:
self.log.error("Found invalid PID in EEPROM: 0x{:04X}. Valid PIDs are: {}".format(
self._eeprom_head['pid'],
diff --git a/mpm/python/usrp_mpm/periph_manager/n310.py b/mpm/python/usrp_mpm/periph_manager/n310.py
index 1d2e23b91..470d1c84d 100644
--- a/mpm/python/usrp_mpm/periph_manager/n310.py
+++ b/mpm/python/usrp_mpm/periph_manager/n310.py
@@ -125,11 +125,10 @@ class n310(PeriphManagerBase):
self._clock_source = None # Gets set in set_clock_source()
self.set_clock_source(N3XX_DEFAULT_CLOCK_SOURCE)
-
- self.mboard_info["serial"] = '123' # some format
with open("/sys/class/rfnoc_crossbar/crossbar0/local_addr", "w") as xbar:
xbar.write("0x2")
# if header.get("dataversion", 0) == 1:
+ self.log.info("mboard info: {}".format(self.mboard_info))
def get_interfaces(self):