Skip to content

Commit 4542ddb

Browse files
committed
fix: protocol version
1 parent f939680 commit 4542ddb

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

ublox_gps/include/ublox_gps/gps.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ class Gps final {
300300
* @note This is part of the expert settings. It is recommended you check
301301
* the ublox manual first.
302302
*/
303-
bool setPpp(bool enable);
303+
bool setPpp(bool enable, float protocol_version);
304304

305305
/**
306306
* @brief Set the DGNSS mode (see CfgDGNSS message for details).
@@ -314,7 +314,7 @@ class Gps final {
314314
* @param enable If true, enable ADR.
315315
* @return true on ACK, false on other conditions.
316316
*/
317-
bool setUseAdr(bool enable);
317+
bool setUseAdr(bool enable, float protocol_version);
318318

319319
/**
320320
* @brief Configure the U-Blox to UTC time

ublox_gps/src/gps.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,11 +555,14 @@ bool Gps::setDeadReckonLimit(uint8_t limit) {
555555
return configure(msg);
556556
}
557557

558-
bool Gps::setPpp(bool enable) {
558+
bool Gps::setPpp(bool enable, float protocol_version) {
559559
RCLCPP_DEBUG(logger_,"%s PPP", (enable ? "Enabling" : "Disabling"));
560560

561561
ublox_msgs::msg::CfgNAVX5 msg;
562562
msg.use_ppp = enable;
563+
if(protocol_version >= 18){
564+
msg.version = 2;
565+
}
563566
msg.mask1 = ublox_msgs::msg::CfgNAVX5::MASK1_PPP;
564567
return configure(msg);
565568
}
@@ -571,11 +574,14 @@ bool Gps::setDgnss(uint8_t mode) {
571574
return configure(cfg);
572575
}
573576

574-
bool Gps::setUseAdr(bool enable) {
577+
bool Gps::setUseAdr(bool enable, float protocol_version) {
575578
RCLCPP_DEBUG(logger_, "%s ADR/UDR", (enable ? "Enabling" : "Disabling"));
576579

577580
ublox_msgs::msg::CfgNAVX5 msg;
578581
msg.use_adr = enable;
582+
if(protocol_version >= 18){
583+
msg.version = 2;
584+
}
579585
msg.mask2 = ublox_msgs::msg::CfgNAVX5::MASK2_ADR;
580586
return configure(msg);
581587
}

0 commit comments

Comments
 (0)