aboutsummaryrefslogtreecommitdiffstats
path: root/mpm
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-01-11 17:09:37 -0800
committerMartin Braun <martin.braun@ettus.com>2018-01-12 16:18:01 -0800
commit1821168103e8354ecf56ed823147e712e3af32dd (patch)
treeb13f72aaf65d3a938b588c2b6d720ffc7b7fab4e /mpm
parentbd16ba767279880e7c78f26f3c827cefb0d60581 (diff)
downloaduhd-1821168103e8354ecf56ed823147e712e3af32dd.tar.gz
uhd-1821168103e8354ecf56ed823147e712e3af32dd.tar.bz2
uhd-1821168103e8354ecf56ed823147e712e3af32dd.zip
mpm: n310: Fix various bugs in sensor API
Diffstat (limited to 'mpm')
-rw-r--r--mpm/python/usrp_mpm/dboard_manager/base.py2
-rw-r--r--mpm/python/usrp_mpm/periph_manager/n310.py7
2 files changed, 3 insertions, 6 deletions
diff --git a/mpm/python/usrp_mpm/dboard_manager/base.py b/mpm/python/usrp_mpm/dboard_manager/base.py
index c56fb54e3..3bc0bdcff 100644
--- a/mpm/python/usrp_mpm/dboard_manager/base.py
+++ b/mpm/python/usrp_mpm/dboard_manager/base.py
@@ -136,6 +136,6 @@ class DboardManagerBase(object):
self.log.error(error_msg)
raise RuntimeError(error_msg)
return getattr(
- self, callback_map.get('sensor_name')
+ self, callback_map.get(sensor_name)
)(chan)
diff --git a/mpm/python/usrp_mpm/periph_manager/n310.py b/mpm/python/usrp_mpm/periph_manager/n310.py
index 91389ffc5..f16dbc2b6 100644
--- a/mpm/python/usrp_mpm/periph_manager/n310.py
+++ b/mpm/python/usrp_mpm/periph_manager/n310.py
@@ -858,7 +858,7 @@ class n310(PeriphManagerBase):
self.log.warning("Can't read temp on fpga-thermal-zone")
return {
'name': 'temperature',
- 'type': 'DOUBLE',
+ 'type': 'REALNUM',
'unit': 'C',
'value': return_val
}
@@ -910,8 +910,6 @@ class n310(PeriphManagerBase):
gps_info = gps_iface.get_gps_info(resp_class='tpv', timeout=15)
self.log.trace("GPS info: {}".format(gps_info))
response_mode = gps_info.get("mode", 0)
-
- import datetime
time_str = gps_info.get("time", "")
self.log.trace("GPS time string: {}".format(time_str))
time_dt = datetime.datetime.strptime(time_str, "%Y-%m-%dT%H:%M:%S.%fZ")
@@ -922,7 +920,7 @@ class n310(PeriphManagerBase):
'name': 'gps_time',
'type': 'INTEGER',
'unit': 'seconds',
- 'value': gps_time,
+ 'value': str(gps_time),
}
def get_gps_tpv_sensor(self):
@@ -937,7 +935,6 @@ class n310(PeriphManagerBase):
gps_info = gps_iface.get_gps_info(resp_class='tpv', timeout=15)
self.log.trace("GPS info: {}".format(gps_info))
response_mode = gps_info.get("mode", 0)
-
# Return the JSON'd results
gps_tpv = json.dumps(gps_info)
return {