for(i = 0; i < NMEAP_MAX_SENTENCE_LENGTH; i++)
{
- char c = *s++;
+ unsigned char c = *s++;
if (c == '.')
{
* Return altitude in meter from a string.
*
*/
-static uint16_t nmea_altitude(const char *palt, const char *punits)
+static int32_t nmea_altitude(const char *palt, const char *punits)
{
- uint32_t alt;
+ int32_t alt;
if (*palt == 0)
return 0;
*/
if (sentence->callout != 0)
(*sentence->callout)(context, vtg, context->user_data);
-
+
return NMEA_GPVTG;
}
}
-/*
+/**
* Parse NMEA sentence from a channel.
*/
void nmea_poll(nmeap_context_t *context, KFile *channel)
{
- int c;
+ int c, e;
while ((c = kfile_getc(channel)) != EOF)
nmeap_parse(context, c);
+
+ if ((e = kfile_error(channel)))
+ {
+ LOG_ERR("ch error [%0X]\n", e);
+ kfile_clearerr(channel);
+ }
}