Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbos Watchdog TextLCD mbed ConfigFile
parse.h File Reference
Functions of a low level for analysis of packages of NMEA stream. More...
Go to the source code of this file.
Functions | |
| int | nmea_pack_type (const char *buff, int buff_sz) |
| Define packet type by header (nmeaPACKTYPE). | |
| int | nmea_find_tail (const char *buff, int buff_sz, int *res_crc) |
| Find tail of packet ("\r\n") in buffer and check control sum (CRC). | |
| int | nmea_parse_GPGGA (const char *buff, int buff_sz, nmeaGPGGA *pack) |
| Parse GGA packet from buffer. | |
| int | nmea_parse_GPGSA (const char *buff, int buff_sz, nmeaGPGSA *pack) |
| Parse GSA packet from buffer. | |
| int | nmea_parse_GPGSV (const char *buff, int buff_sz, nmeaGPGSV *pack) |
| Parse GSV packet from buffer. | |
| int | nmea_parse_GPRMC (const char *buff, int buff_sz, nmeaGPRMC *pack) |
| Parse RMC packet from buffer. | |
| int | nmea_parse_GPVTG (const char *buff, int buff_sz, nmeaGPVTG *pack) |
| Parse VTG packet from buffer. | |
| void | nmea_GPGGA2info (nmeaGPGGA *pack, nmeaINFO *info) |
| Fill nmeaINFO structure by GGA packet data. | |
| void | nmea_GPGSA2info (nmeaGPGSA *pack, nmeaINFO *info) |
| Fill nmeaINFO structure by GSA packet data. | |
| void | nmea_GPGSV2info (nmeaGPGSV *pack, nmeaINFO *info) |
| Fill nmeaINFO structure by GSV packet data. | |
| void | nmea_GPRMC2info (nmeaGPRMC *pack, nmeaINFO *info) |
| Fill nmeaINFO structure by RMC packet data. | |
| void | nmea_GPVTG2info (nmeaGPVTG *pack, nmeaINFO *info) |
| Fill nmeaINFO structure by VTG packet data. | |
Detailed Description
Functions of a low level for analysis of packages of NMEA stream.
...
ptype = nmea_pack_type(
(const char *)parser->buffer + nparsed + 1,
parser->buff_use - nparsed - 1);
if(0 == (node = malloc(sizeof(nmeaParserNODE))))
goto mem_fail;
node->pack = 0;
switch(ptype)
{
case GPGGA:
if(0 == (node->pack = malloc(sizeof(nmeaGPGGA))))
goto mem_fail;
node->packType = GPGGA;
if(!nmea_parse_GPGGA(
(const char *)parser->buffer + nparsed,
sen_sz, (nmeaGPGGA *)node->pack))
{
free(node);
node = 0;
}
break;
case GPGSA:
if(0 == (node->pack = malloc(sizeof(nmeaGPGSA))))
goto mem_fail;
node->packType = GPGSA;
if(!nmea_parse_GPGSA(
(const char *)parser->buffer + nparsed,
sen_sz, (nmeaGPGSA *)node->pack))
{
free(node);
node = 0;
}
break;
...
Definition in file parse.h.
Function Documentation
| int nmea_find_tail | ( | const char * | buff, |
| int | buff_sz, | ||
| int * | res_crc | ||
| ) |
Find tail of packet ("\r\n") in buffer and check control sum (CRC).
- Parameters:
-
buff a constant character pointer of packets buffer. buff_sz buffer size. res_crc a integer pointer for return CRC of packet (must be defined).
- Returns:
- Number of bytes to packet tail.
| int nmea_pack_type | ( | const char * | buff, |
| int | buff_sz | ||
| ) |
Define packet type by header (nmeaPACKTYPE).
- Parameters:
-
buff a constant character pointer of packet buffer. buff_sz buffer size.
- Returns:
- The defined packet type
- See also:
- nmeaPACKTYPE
| int nmea_parse_GPGGA | ( | const char * | buff, |
| int | buff_sz, | ||
| nmeaGPGGA * | pack | ||
| ) |
| int nmea_parse_GPGSA | ( | const char * | buff, |
| int | buff_sz, | ||
| nmeaGPGSA * | pack | ||
| ) |
| int nmea_parse_GPGSV | ( | const char * | buff, |
| int | buff_sz, | ||
| nmeaGPGSV * | pack | ||
| ) |
| int nmea_parse_GPRMC | ( | const char * | buff, |
| int | buff_sz, | ||
| nmeaGPRMC * | pack | ||
| ) |
| int nmea_parse_GPVTG | ( | const char * | buff, |
| int | buff_sz, | ||
| nmeaGPVTG * | pack | ||
| ) |
Generated on Thu Jul 14 2022 14:06:47 by
1.7.2