From 65612b49b110bfcf102656bc065f26ed6eb565bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Sat, 14 Jun 2025 20:21:13 +0200 Subject: [PATCH] include: drivers: gnss: Update gnss_nmea0183_snprintk documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correct improper doc for return value, document the negative error codes, and add more details re: what the function does. Signed-off-by: Benjamin Cabé --- drivers/gnss/gnss_nmea0183.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gnss/gnss_nmea0183.h b/drivers/gnss/gnss_nmea0183.h index 6a3fa177f44..53d7c1ab0a9 100644 --- a/drivers/gnss/gnss_nmea0183.h +++ b/drivers/gnss/gnss_nmea0183.h @@ -21,7 +21,13 @@ uint8_t gnss_nmea0183_checksum(const char *str); /** - * @brief Encapsulate str in NMEA0183 message format + * @brief Format a NMEA 0183 message string with checksum. + * + * This function formats a string according to the NMEA 0183 protocol. It takes + * a printf-like format string and arguments, prefixes the result with '$', + * computes and appends the NMEA checksum, and null-terminates the resulting string. + * + * The output string is of the form: `$*`. * * @example "PAIR%03u", 2 -> "$PAIR002*38" * @@ -30,7 +36,9 @@ uint8_t gnss_nmea0183_checksum(const char *str); * @param fmt Format of string to encapsulate * @param ... Arguments * - * @retval checksum + * @return >0 Length of the resulting string. + * @retval -ENOMEM Size of str is too small. + * @retval -EINVAL Formatting error. */ int gnss_nmea0183_snprintk(char *str, size_t size, const char *fmt, ...);