sensors: gnss buffer usage optimalisation#657
Conversation
- increase queue size to fully cover buffer - return "updated" only on GGA messages (they contain new fix) JIRA: PP-449
There was a problem hiding this comment.
Code Review
This pull request modifies the GPS event update logic to return status codes directly from switch cases and increases the UBX inbox size. It also adds a new UBX configuration command to set UART1 output to NMEA only at 115200 baud. A review comment points out that the write call for this new command incorrectly includes the null terminator from the string literal, which may cause issues with the binary protocol; it is recommended to use sizeof(...) - 1 instead.
| write(ctx->filedes, UBX_PREMADE_FIX_10HZ, sizeof(UBX_PREMADE_FIX_10HZ)); | ||
| usleep(100 * 1000); | ||
|
|
||
| write(ctx->filedes, UBX_PREMADE_UART1_OUT_NMEA_ONLY_115200, sizeof(UBX_PREMADE_UART1_OUT_NMEA_ONLY_115200)); |
There was a problem hiding this comment.
Using sizeof() on a string literal includes the implicit null terminator (\0). Since UBX is a binary protocol, sending an extra 0x00 byte after the message is incorrect and may be misinterpreted by the receiver. It is recommended to use sizeof(...) - 1 to send only the actual message bytes.
write(ctx->filedes, UBX_PREMADE_UART1_OUT_NMEA_ONLY_115200, sizeof(UBX_PREMADE_UART1_OUT_NMEA_ONLY_115200) - 1);
Unit Test Results10 514 tests - 29 9 854 ✅ - 27 55m 13s ⏱️ + 2m 1s For more details on these failures, see this check. Results for commit e5cd178. ± Comparison against base commit f20ef15. This pull request removes 30 and adds 1 tests. Note that renamed tests count towards both. |
JIRA: PP-449
Description
Motivation and Context
Types of changes
How Has This Been Tested?
Checklist:
Special treatment