Skip to content

Commit 721f291

Browse files
tokangasrlubos
authored andcommitted
samples: cellular: gnss: Fix assistance in cold start test mode
Fixed a couple of bugs in TTFF test mode with CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST_COLD_START and assistance enabled. The assistance request was missing system IDs and assistance data was downloaded twice before the first GNSS start. Signed-off-by: Tommi Kangas <[email protected]>
1 parent 9208d47 commit 721f291

File tree

1 file changed

+5
-2
lines changed
  • samples/cellular/gnss/src

1 file changed

+5
-2
lines changed

samples/cellular/gnss/src/main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,15 @@ static void gnss_event_handler(int event)
165165
break;
166166

167167
case NRF_MODEM_GNSS_EVT_AGNSS_REQ:
168-
#if !defined(CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE)
168+
#if !defined(CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE) && \
169+
!defined(CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST_COLD_START)
169170
retval = nrf_modem_gnss_read(&last_agnss,
170171
sizeof(last_agnss),
171172
NRF_MODEM_GNSS_DATA_AGNSS_REQ);
172173
if (retval == 0) {
173174
k_work_submit_to_queue(&gnss_work_q, &agnss_data_get_work);
174175
}
175-
#endif /* !CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE */
176+
#endif /* !CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE && !CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST_COLD_START */
176177
break;
177178

178179
default:
@@ -399,11 +400,13 @@ static void ttff_test_prepare_work_fn(struct k_work *item)
399400
NRF_MODEM_GNSS_AGNSS_POSITION_REQUEST |
400401
NRF_MODEM_GNSS_AGNSS_INTEGRITY_REQUEST;
401402
last_agnss.system_count = 1;
403+
last_agnss.system[0].system_id = NRF_MODEM_GNSS_SYSTEM_GPS;
402404
last_agnss.system[0].sv_mask_ephe = 0xffffffff;
403405
last_agnss.system[0].sv_mask_alm = 0xffffffff;
404406
#if defined(CONFIG_GNSS_SAMPLE_ASSISTANCE_NRF_CLOUD)
405407
if (qzss_assistance_is_supported()) {
406408
last_agnss.system_count = 2;
409+
last_agnss.system[0].system_id = NRF_MODEM_GNSS_SYSTEM_QZSS;
407410
last_agnss.system[1].sv_mask_ephe = 0x3ff;
408411
last_agnss.system[1].sv_mask_alm = 0x3ff;
409412
}

0 commit comments

Comments
 (0)