diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-23 15:08:33 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-23 15:08:33 +0200 |
commit | c4d79b84b4eb3b4d255706f29972cd3f31689749 (patch) | |
tree | fa0bc213731474cbebcbb32e441c5b6ad4d1f4d5 /src/drivers/gps/ubx.cpp | |
parent | 7bf1f82f615b05bb37b8c4c45891bbde96745a4b (diff) | |
download | px4-firmware-c4d79b84b4eb3b4d255706f29972cd3f31689749.tar.gz px4-firmware-c4d79b84b4eb3b4d255706f29972cd3f31689749.tar.bz2 px4-firmware-c4d79b84b4eb3b4d255706f29972cd3f31689749.zip |
bugfixes in UBX driver, emit new SNR, Jamming and noise count indices
Diffstat (limited to 'src/drivers/gps/ubx.cpp')
-rw-r--r-- | src/drivers/gps/ubx.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/drivers/gps/ubx.cpp b/src/drivers/gps/ubx.cpp index f4a065c19..19cf5beec 100644 --- a/src/drivers/gps/ubx.cpp +++ b/src/drivers/gps/ubx.cpp @@ -226,6 +226,13 @@ UBX::configure(unsigned &baudrate) return 1; } + configure_message_rate(UBX_CLASS_MON, UBX_MESSAGE_MON_HW, 1); + + if (wait_for_ack(UBX_CONFIG_TIMEOUT) < 0) { + warnx("MSG CFG FAIL: MON HW"); + return 1; + } + _configured = true; return 0; } @@ -566,6 +573,24 @@ UBX::handle_message() break; } + case UBX_CLASS_MON: { + switch (_message_id) { + case UBX_MESSAGE_MON_HW: { + + struct gps_bin_mon_hw_packet *p = (struct gps_bin_mon_hw_packet*) _rx_buffer; + + _gps_position->noise_per_ms = p->noisePerMS; + _gps_position->jamming_indicator = p->jamInd; + + ret = 1; + break; + } + + default: + break; + } + } + default: break; } |