Skip to content

Commit 25a2249

Browse files
committed
Exposing u-blox MINCNO and MINELEV parameters
1 parent d85994b commit 25a2249

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

src/drivers/gps/gps.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,20 @@ GPS::run()
736736
param_get(handle, &gps_ubx_dynmodel);
737737
}
738738

739+
int32_t gps_ubx_min_cno = 6;
740+
handle = param_find("GPS_UBX_MIN_CNO");
741+
742+
if (handle != PARAM_INVALID) {
743+
param_get(handle, &gps_ubx_min_cno);
744+
}
745+
746+
int32_t gps_ubx_min_elev = 10;
747+
handle = param_find("GPS_UBX_MIN_ELEV");
748+
749+
if (handle != PARAM_INVALID) {
750+
param_get(handle, &gps_ubx_min_elev);
751+
}
752+
739753
handle = param_find("GPS_UBX_MODE");
740754

741755
GPSDriverUBX::UBXMode ubx_mode{GPSDriverUBX::UBXMode::Normal};
@@ -877,7 +891,7 @@ GPS::run()
877891
/* FALLTHROUGH */
878892
case gps_driver_mode_t::UBX:
879893
_helper = new GPSDriverUBX(_interface, &GPS::callback, this, &_sensor_gps, _p_report_sat_info,
880-
gps_ubx_dynmodel, heading_offset, f9p_uart2_baudrate, ubx_mode);
894+
gps_ubx_dynmodel, heading_offset, f9p_uart2_baudrate, ubx_mode, gps_ubx_min_cno, gps_ubx_min_elev);
881895
set_device_type(DRV_GPS_DEVTYPE_UBX);
882896
break;
883897
#ifndef CONSTRAINED_FLASH

src/drivers/gps/params.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,32 @@ PARAM_DEFINE_INT32(GPS_DUMP_COMM, 0);
6969
*/
7070
PARAM_DEFINE_INT32(GPS_UBX_DYNMODEL, 7);
7171

72+
/**
73+
* u-blox GPS minimum satellite signal level for navigation
74+
*
75+
* @min 0
76+
* @max 255
77+
* @unit dBHz
78+
*
79+
* @reboot_required true
80+
*
81+
* @group GPS
82+
*/
83+
PARAM_DEFINE_INT32(GPS_UBX_MIN_CNO, 6);
84+
85+
/**
86+
* u-blox GPS minimum elevation for a GNSS satellite to be used in navigation
87+
*
88+
* @min 0
89+
* @max 127
90+
* @unit deg
91+
*
92+
* @reboot_required true
93+
*
94+
* @group GPS
95+
*/
96+
PARAM_DEFINE_INT32(GPS_UBX_MIN_ELEV, 10);
97+
7298
/**
7399
* Enable sat info (if available)
74100
*

0 commit comments

Comments
 (0)