Skip to content

Added checks to discard gps data if RMC or GLL status is invalid#32

Open
Bigmouseears wants to merge 4 commits into
mainfrom
feature/nr/gps_validation
Open

Added checks to discard gps data if RMC or GLL status is invalid#32
Bigmouseears wants to merge 4 commits into
mainfrom
feature/nr/gps_validation

Conversation

@Bigmouseears

@Bigmouseears Bigmouseears commented May 26, 2026

Copy link
Copy Markdown

Description

A brief description of the changes in the PR

Issue Link

Please provide a link to the issue (e.g. "Closes #1").

Also, if this PR is one of multiple for this issue, link the parent if this is a child OR link
the children if this is the parent. Do not use "closes" keywords on child PRs, only use them on
the parent.

Testing

  • Passes existing unit tests
  • Unit tests modified
  • Integration test performed

Attach any test artifacts here, if relevant.

Other

Leave any additional notes here

Reviewer Checklist

Standards

  • Follows FCF Architectural Standards
  • Follows SDR Coding Standards
  • Code complexity/function Size is minimized
  • Code is testable
  • Code is readable and commented properly
  • License terms are respected

Error Handling

  • Potentially unsafe functions return a status code
  • Error returns properly handled

Memory

  • Stack allocated memory is scoped correctly
  • Heap allocated memory is avoided
  • Globally allocated memory is minimized except when necessary
  • Pointers are used correctly
  • Concurrency has been considered

Performance

  • Rate limiters are respected
  • Busy waiting is avoided
  • "Delay" calls are not used in performance sensitive code

@ETSells ETSells left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Technically should be ready to go, but I'd like some robustness cases put in place to exercise the new invalid paths. We can sync on what updating the tests should look like @Bigmouseears.

If you want to get started on them ahead of time, look in driver/_test/driver/gps/test_gps.c:test_GPS_parse, cases/NMEA_inputs.txt, and cases/gps_parse_expected.txt

@Bigmouseears

Bigmouseears commented Jun 2, 2026

Copy link
Copy Markdown
Author

I have it so that GPS data values are all set to 0 if data is invalid. Not sure if that will break anything so I guess it's worth mentioning.

@Bigmouseears

Copy link
Copy Markdown
Author

Wow i'm surprised it passed the unit tests. I wonder if I may have done the tests wrong?

@ETSells

ETSells commented Jun 3, 2026

Copy link
Copy Markdown
Member

Test request:

Add a case where there's data in the GPS struct already, and you receive an invalid message, confirm that the preexisting data is not overwritten

@ETSells

ETSells commented Jun 10, 2026

Copy link
Copy Markdown
Member

OH dude that explains so much, the driver CI is borked for unit tests and doesn't fail the job on a test fail.

Messages 9 and 15 fail to parse on the runner. Statement coverage is achieved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants