Make minmea_isfield public.
This function is useful when writing libraries that use minmea and support NMEA as well as other sentence types.
This commit is contained in:
parent
0a0a14a42e
commit
85439b97dd
5
minmea.c
5
minmea.c
@ -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;
|
||||
|
9
minmea.h
9
minmea.h
@ -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
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user