aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/gps
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-07-09 17:36:24 +0200
committerLorenz Meier <lm@inf.ethz.ch>2013-07-09 17:36:48 +0200
commite3bb9e87e2af2f0f70e486405e2c6df5d3e23667 (patch)
treee75ef2ba336930616af45b931c32b2ccb50c344f /src/drivers/gps
parent9910a5ef5fa627322d41b54ca06bf38134d380e7 (diff)
downloadpx4-firmware-e3bb9e87e2af2f0f70e486405e2c6df5d3e23667.tar.gz
px4-firmware-e3bb9e87e2af2f0f70e486405e2c6df5d3e23667.tar.bz2
px4-firmware-e3bb9e87e2af2f0f70e486405e2c6df5d3e23667.zip
Hotfix for GPS: Disable unknown message classes
Diffstat (limited to 'src/drivers/gps')
-rw-r--r--src/drivers/gps/ubx.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/drivers/gps/ubx.cpp b/src/drivers/gps/ubx.cpp
index f2e7ca67d..b46089073 100644
--- a/src/drivers/gps/ubx.cpp
+++ b/src/drivers/gps/ubx.cpp
@@ -176,7 +176,7 @@ UBX::configure(unsigned &baudrate)
// if (wait_for_ack(UBX_CONFIG_TIMEOUT) < 0)
// continue;
configure_message_rate(UBX_CLASS_NAV, UBX_MESSAGE_NAV_TIMEUTC,
- 1);
+ 0);
// /* insist of receiving the ACK for this packet */
// if (wait_for_ack(UBX_CONFIG_TIMEOUT) < 0)
// continue;
@@ -327,6 +327,7 @@ UBX::parse_char(uint8_t b)
}
break;
case UBX_DECODE_GOT_CLASS:
+ {
add_byte_to_checksum(b);
switch (_message_class) {
case NAV:
@@ -413,6 +414,14 @@ UBX::parse_char(uint8_t b)
// config_needed = true;
break;
}
+ // Evaluate state machine - if the state changed,
+ // the state machine was reset via decode_init()
+ // and we want to tell the module to stop sending this message
+
+ // disable unknown message
+ warnx("disabled class %d, msg %d", (int)_message_class, (int)b);
+ configure_message_rate(_message_class, b, 0);
+ }
break;
case UBX_DECODE_GOT_MESSAGEID:
add_byte_to_checksum(b);