Skip to content

Commit 212dbd3

Browse files
plskeggsrlubos
authored andcommitted
net: lib: nrf_cloud: Add comment for AGNSS
Add a comment to explain how a tricky part of nrf_cloud_agnss_process() works. This comment is meant to explain a false positive error found by static analysis. Jira: IRIS-9985 Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
1 parent baff83c commit 212dbd3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

+17
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,23 @@ int nrf_cloud_agnss_process(const char *buf, size_t buf_len)
619619

620620
LOG_DBG("Parsed_len: %d", parsed_len);
621621

622+
/**
623+
* The else clause below was incorrectly flagged by Coverity as a copy of
624+
* overlapped memory bug.
625+
*
626+
* This is by design. The cloud will transmit 0 or more, up to 32,
627+
* nrf_cloud_agnss_tow_element structs, which will be copied into the local
628+
* sys_time struct's sv_tow array. The cloud side does this to conserve data
629+
* bandwidth, as quite often there are few if any TOW elements.
630+
*
631+
* In the same data buffer, there will be exactly one
632+
* nrf_cloud_agnss_system_time element struct (the first 12 bytes only),
633+
* which will then be copied into the local sys_time struct before the
634+
* sv_tow array.
635+
*
636+
* This locally-assembled sys_time struct will then be passed to
637+
* agnss_send_to_modem(), which expects this combined structure.
638+
*/
622639
if (element.type == NRF_CLOUD_AGNSS_GPS_TOWS) {
623640
memcpy(&sys_time.sv_tow[element.tow->sv_id - 1],
624641
element.tow,

0 commit comments

Comments
 (0)