QGIS API Documentation  2.99.0-Master (c558d51)
Functions
parse.h File Reference

Functions of a low level for analysis of packages of NMEA stream. More...

#include "sentence.h"
Include dependency graph for parse.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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). More...
 
void nmea_GPGGA2info (nmeaGPGGA *pack, nmeaINFO *info)
 Fill nmeaINFO structure by GGA packet data. More...
 
void nmea_GPGSA2info (nmeaGPGSA *pack, nmeaINFO *info)
 Fill nmeaINFO structure by GSA packet data. More...
 
void nmea_GPGSV2info (nmeaGPGSV *pack, nmeaINFO *info)
 Fill nmeaINFO structure by GSV packet data. More...
 
void nmea_GPRMC2info (nmeaGPRMC *pack, nmeaINFO *info)
 Fill nmeaINFO structure by RMC packet data. More...
 
void nmea_GPVTG2info (nmeaGPVTG *pack, nmeaINFO *info)
 Fill nmeaINFO structure by VTG packet data. More...
 
int nmea_pack_type (const char *buff, int buff_sz)
 Define packet type by header (nmeaPACKTYPE). More...
 
int nmea_parse_GPGGA (const char *buff, int buff_sz, nmeaGPGGA *pack)
 Parse GGA packet from buffer. More...
 
int nmea_parse_GPGSA (const char *buff, int buff_sz, nmeaGPGSA *pack)
 Parse GSA packet from buffer. More...
 
int nmea_parse_GPGSV (const char *buff, int buff_sz, nmeaGPGSV *pack)
 Parse GSV packet from buffer. More...
 
int nmea_parse_GPRMC (const char *buff, int buff_sz, nmeaGPRMC *pack)
 Parse RMC packet from buffer. More...
 
int nmea_parse_GPVTG (const char *buff, int buff_sz, nmeaGPVTG *pack)
 Parse VTG packet from buffer. More...
 

Detailed Description

Functions of a low level for analysis of packages of NMEA stream.

...
(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;
(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;
(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
buffa constant character pointer of packets buffer.
buff_szbuffer size.
res_crca integer pointer for return CRC of packet (must be defined).
Returns
Number of bytes to packet tail.

Definition at line 166 of file parse.c.

void nmea_GPGGA2info ( nmeaGPGGA pack,
nmeaINFO info 
)

Fill nmeaINFO structure by GGA packet data.

Parameters
packa pointer of packet structure.
infoa pointer of summary information structure.

Definition at line 413 of file parse.c.

void nmea_GPGSA2info ( nmeaGPGSA pack,
nmeaINFO info 
)

Fill nmeaINFO structure by GSA packet data.

Parameters
packa pointer of packet structure.
infoa pointer of summary information structure.

Definition at line 434 of file parse.c.

void nmea_GPGSV2info ( nmeaGPGSV pack,
nmeaINFO info 
)

Fill nmeaINFO structure by GSV packet data.

Parameters
packa pointer of packet structure.
infoa pointer of summary information structure.

Definition at line 466 of file parse.c.

void nmea_GPRMC2info ( nmeaGPRMC pack,
nmeaINFO info 
)

Fill nmeaINFO structure by RMC packet data.

Parameters
packa pointer of packet structure.
infoa pointer of summary information structure.

Definition at line 501 of file parse.c.

void nmea_GPVTG2info ( nmeaGPVTG pack,
nmeaINFO info 
)

Fill nmeaINFO structure by VTG packet data.

Parameters
packa pointer of packet structure.
infoa pointer of summary information structure.

Definition at line 531 of file parse.c.

int nmea_pack_type ( const char *  buff,
int  buff_sz 
)

Define packet type by header (nmeaPACKTYPE).

Parameters
buffa constant character pointer of packet buffer.
buff_szbuffer size.
Returns
The defined packet type
See also
nmeaPACKTYPE

Definition at line 127 of file parse.c.

int nmea_parse_GPGGA ( const char *  buff,
int  buff_sz,
nmeaGPGGA pack 
)

Parse GGA packet from buffer.

Parameters
buffa constant character pointer of packet buffer.
buff_szbuffer size.
packa pointer of packet which will filled by function.
Returns
1 (true) - if parsed successfully or 0 (false) - if fail.

Definition at line 217 of file parse.c.

int nmea_parse_GPGSA ( const char *  buff,
int  buff_sz,
nmeaGPGSA pack 
)

Parse GSA packet from buffer.

Parameters
buffa constant character pointer of packet buffer.
buff_szbuffer size.
packa pointer of packet which will filled by function.
Returns
1 (true) - if parsed successfully or 0 (false) - if fail.

Definition at line 254 of file parse.c.

int nmea_parse_GPGSV ( const char *  buff,
int  buff_sz,
nmeaGPGSV pack 
)

Parse GSV packet from buffer.

Parameters
buffa constant character pointer of packet buffer.
buff_szbuffer size.
packa pointer of packet which will filled by function.
Returns
1 (true) - if parsed successfully or 0 (false) - if fail.

Definition at line 283 of file parse.c.

int nmea_parse_GPRMC ( const char *  buff,
int  buff_sz,
nmeaGPRMC pack 
)

Parse RMC packet from buffer.

Parameters
buffa constant character pointer of packet buffer.
buff_szbuffer size.
packa pointer of packet which will filled by function.
Returns
1 (true) - if parsed successfully or 0 (false) - if fail.

Definition at line 325 of file parse.c.

int nmea_parse_GPVTG ( const char *  buff,
int  buff_sz,
nmeaGPVTG pack 
)

Parse VTG packet from buffer.

Parameters
buffa constant character pointer of packet buffer.
buff_szbuffer size.
packa pointer of packet which will filled by function.
Returns
1 (true) - if parsed successfully or 0 (false) - if fail.

Definition at line 377 of file parse.c.