Skip to content

Commit

Permalink
net: lib: nrf_cloud: Add comment for AGNSS
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
plskeggs committed Jan 9, 2025
1 parent 09d5944 commit 0ea064a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions subsys/net/lib/nrf_cloud/src/nrf_cloud_agnss.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,23 @@ int nrf_cloud_agnss_process(const char *buf, size_t buf_len)

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

/**
* The else clause below was incorrectly flagged by Coverity as a copy of
* overlapped memory bug.
*

Check failure on line 625 in subsys/net/lib/nrf_cloud/src/nrf_cloud_agnss.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TRAILING_WHITESPACE

subsys/net/lib/nrf_cloud/src/nrf_cloud_agnss.c:625 trailing whitespace
* This is by design. The cloud will transmit 0 or more, up to 32,
* nrf_cloud_agnss_tow_element structs, which will be copied into the local
* sys_time struct's sv_tow array. The cloud side does this to conserve data
* bandwidth, as quite often there are few if any TOW elements.
*

Check failure on line 630 in subsys/net/lib/nrf_cloud/src/nrf_cloud_agnss.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TRAILING_WHITESPACE

subsys/net/lib/nrf_cloud/src/nrf_cloud_agnss.c:630 trailing whitespace
* In the same data buffer, there will be exactly one
* nrf_cloud_agnss_system_time element struct (the first 12 bytes only),
* which will then be copied into the local sys_time struct before the
* sv_tow array.
*

Check failure on line 635 in subsys/net/lib/nrf_cloud/src/nrf_cloud_agnss.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TRAILING_WHITESPACE

subsys/net/lib/nrf_cloud/src/nrf_cloud_agnss.c:635 trailing whitespace
* This locally-assembled sys_time struct will then be passed to
* agnss_send_to_modem(), which expects this combined structure.
*/
if (element.type == NRF_CLOUD_AGNSS_GPS_TOWS) {
memcpy(&sys_time.sv_tow[element.tow->sv_id - 1],
element.tow,
Expand Down

0 comments on commit 0ea064a

Please sign in to comment.