Skip to content

Commit faa8621

Browse files
tokangasnordicjm
authored andcommitted
net: lib: nrf_cloud: Fix for PGPS_EVT_AVAILABLE not being sent
The PGPS_EVT_AVAILABLE event was skipped also when predictions had been downloaded during library initialization, but no prediction had been injected to GNSS. Signed-off-by: Tommi Kangas <[email protected]>
1 parent f2a9d8b commit faa8621

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

subsys/net/lib/nrf_cloud/src/nrf_cloud_pgps.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ int nrf_cloud_pgps_notify_prediction(void)
493493
*/
494494
int err;
495495
int pnum;
496+
struct nrf_modem_gnss_agnss_data_frame processed;
496497
struct nrf_cloud_pgps_prediction *prediction = NULL;
497498
struct nrf_cloud_pgps_event evt = {
498499
.type = PGPS_EVT_AVAILABLE,
@@ -503,7 +504,12 @@ int nrf_cloud_pgps_notify_prediction(void)
503504
return -EINVAL;
504505
}
505506

506-
if (prediction_timer_is_running()) {
507+
nrf_cloud_agnss_processed(&processed);
508+
509+
/* If the prediction timer is running and a prediction has already been injected,
510+
* there's no need to find the next prediction yet.
511+
*/
512+
if (prediction_timer_is_running() && processed.system[0].sv_mask_ephe != 0) {
507513
LOG_INF("Not time to find next prediction yet.");
508514
return 0;
509515
}

0 commit comments

Comments
 (0)