diff options
author | Martin Braun <martin.braun@ettus.com> | 2021-06-02 13:05:57 +0200 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-06-03 09:35:09 -0500 |
commit | d7ba6ae7c2d53d86a295117d0af8f97cacd03b3a (patch) | |
tree | 415f190cf58fa9b1fd64ef3cacee04961b07c3f3 /mpm/.gitignore | |
parent | 15b94c53edc86031c74b27cd3d824d2291c0c91f (diff) | |
download | uhd-d7ba6ae7c2d53d86a295117d0af8f97cacd03b3a.tar.gz uhd-d7ba6ae7c2d53d86a295117d0af8f97cacd03b3a.tar.bz2 uhd-d7ba6ae7c2d53d86a295117d0af8f97cacd03b3a.zip |
mpm: gpsd_iface: Make GPGGA generation more robust
The GPGGA string generation relies on TPV and SKY messages being
accurate, meaning they are a list of dictionaries. There have been cases
where this was inaccurate (an empty list was returned). MPM would show
errors as such:
[ERROR] [MPM.RPCServer] Uncaught exception in method get_mb_sensor :list
index out of range
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/usrp_mpm/rpc_server.py", line
184, in new_claimed_function
return function(*args)
File
"/usr/lib/python3.7/site-packages/usrp_mpm/periph_manager/base.py",
line 1000, in get_mb_sensor
self, self.mboard_sensor_callback_map.get(sensor_name)
File
"/usr/lib/python3.7/site-packages/usrp_mpm/gpsd_iface.py",
line 313, in get_gps_gpgga_sensor
tpv_sensor_data = gps_info.get('tpv', [{}])[0]
IndexError: list index out of range
This is a patch to check that the lists are not empty before directly
referencing index 0 therein.
Diffstat (limited to 'mpm/.gitignore')
0 files changed, 0 insertions, 0 deletions