This function is useful when writing libraries that use minmea and support NMEA as well as other sentence types.
@@ -10,7 +10,6 @@
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <stdarg.h>
#define boolstr(s) ((s) ? "true" : "false")
@@ -85,10 +84,6 @@ bool minmea_check(const char *sentence, bool strict)
return true;
}
-static inline bool minmea_isfield(char c) {
- return isprint((unsigned char) c) && c != ',' && c != '*';
-}
-
bool minmea_scan(const char *sentence, const char *format, ...)
{
bool result = false;
@@ -13,6 +13,7 @@
extern "C" {
#endif
+#include <ctype.h>
#include <stdint.h>
#include <stdbool.h>
#include <time.h>
@@ -277,6 +278,14 @@ static inline float minmea_tocoord(const struct minmea_float *f)
return (float) degrees + (float) minutes / (60 * f->scale);
+/**
+ * Check whether a character belongs to the set of characters allowed in a
+ * sentence data field.
+ */
+static inline bool minmea_isfield(char c) {
+ return isprint((unsigned char) c) && c != ',' && c != '*';
+}
+
#ifdef __cplusplus