diff options
author | Fred Wright <fw@fwright.net> | 2019-03-27 15:34:38 -0700 |
---|---|---|
committer | Fred Wright <fw@fwright.net> | 2019-03-27 20:26:53 -0700 |
commit | 4b80866539305242d6fe96bf385efd30d95da6a7 (patch) | |
tree | c4426119ed2c636000511b39dc85957ff1c80945 | |
parent | f44ab4824d2a2cb6580d1eb8c91f3ff821e6cb37 (diff) | |
download | gpsd-4b80866539305242d6fe96bf385efd30d95da6a7.tar.gz |
ubxtool: Fixes SAVE/RESET/CFG-CFG bugs.
The masks for SAVE and RESET were not defined as intended by the
comments, including having one of the bits in the wrong byte.
Two conditionals (only one actually effective) were checking the
value of 'type' rather than the 'save_clear' argument, probably
due to an incomplete rename. This rendered SAVE inoperative,
and due to the implied load, it had the effect of resetting the
parameters to their saved values (usually the defaults, due to
the broken SAVE).
The decode for CFG-CFG had similar bugs related to bit positions.
TESTED:
Tested on LEA-6S, LEA-M8F, LEA-M8T, and LEA-M8N
-rwxr-xr-x | ubxtool | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -200,12 +200,12 @@ class ubx(object): s += 'navConf ' if mask & 0x10: s += 'rxmConf ' - if mask & 0x80: + if mask & 0x100: # not on M8030 s += 'senConf ' - if mask & 0x100: - s += 'rinvConf ' if mask & 0x200: + s += 'rinvConf ' + if mask & 0x400: s += 'antConf ' if mask & 0x800: s += 'logConf ' @@ -1807,10 +1807,10 @@ class ubx(object): # Clear: save_clear = 1 # basic configs alays available to change: - # ioPort, msgConf, infMsg, navConf, rxmConf, senConf - cfg1 = 0x9f - # rinvConf, antConf, logConf - cfg2 = 0x03 + # ioPort, msgConf, infMsg, navConf, rxmConf + cfg1 = 0x1f + # senConf, rinvConf, antConf, logConf + cfg2 = 0x0f m_data = bytearray(13) @@ -1827,7 +1827,7 @@ class ubx(object): m_data[3] = 0 # # save - if 0 == type: + if 0 == save_clear: # saving m_data[4] = cfg1 m_data[5] = cfg2 @@ -1839,7 +1839,7 @@ class ubx(object): m_data[7] = 0 # # load - if False and 0 == type: + if False and 0 == save_clear: # saving m_data[8] = 0 m_data[9] = 0 |