• 大小: 51.05 KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-10-06
  • 语言: 其他
  • 标签: nmea  gps  

资源简介

解析gps nmea语句(gpgga,gprmc,gpgsv,gpgsa),并含有计算两点距离(地面)的公式,用c语言编写,可以移植到单片机上,缩短开发时间。

资源截图

代码片段和文件信息

#include 
#include 

#ifdef NMEA_WIN
#   include 
#else
#   include 
#endif

int main()
{
    nmeaINFO info;
    char buff[2048];
    int gen_sz;
    int it;

    nmea_zero_INFO(&info);

    info.sig = 3;
    info.fix = 3;
    info.lat = 5000.0;
    info.lon = 3600.0;
    info.speed = 2.14 * NMEA_TUS_MS;
    info.elv = 10.86;

    info.satinfo.inuse = 1;
    info.satinfo.inview = 1;

    /*
    info.satinfo.sat[0].id = 1;
    info.satinfo.sat[0].in_use = 1;
    info.satinfo.sat[0].elv = 50;
    info.satinfo.sat[0].azimuth = 0;
    info.satinfo.sat[0].sig = 99;
    */

    for(it = 0; it < 10; ++it)
    {
        gen_sz = nmea_generate(
            &buff[0] 2048 &info
            GPGGA | GPGSA | GPGSV | GPRMC | GPVTG
            );

        buff[gen_sz] = 0;
        printf(“%s\n“ &buff[0]);

#ifdef NMEA_WIN
        Sleep(500);
#else
        usleep(500000);
#endif        

        info.speed += .1;
    }

    return 0;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        693  2008-03-11 14:24  nmealib\CHANGELOG.TXT

     文件         31  2007-10-21 22:28  nmealib\doc\makefile

     文件       8867  2008-03-11 13:51  nmealib\doc\nmea.doxygen

     文件       1059  2008-03-11 13:56  nmealib\include\nmea\config.h

     文件        891  2007-10-19 14:23  nmealib\include\nmea\context.h

     文件       1311  2007-10-19 14:23  nmealib\include\nmea\generate.h

     文件       1903  2007-10-19 14:23  nmealib\include\nmea\generator.h

     文件       2380  2008-03-11 13:56  nmealib\include\nmea\gmath.h

     文件       3107  2007-11-15 16:50  nmealib\include\nmea\info.h

     文件        485  2008-03-11 13:56  nmealib\include\nmea\nmea.h

     文件       1117  2007-10-19 14:23  nmealib\include\nmea\parse.h

     文件       1182  2007-10-19 14:23  nmealib\include\nmea\parser.h

     文件       4933  2008-03-11 13:56  nmealib\include\nmea\sentence.h

     文件        988  2007-10-19 14:23  nmealib\include\nmea\time.h

     文件        672  2007-10-19 14:23  nmealib\include\nmea\tok.h

     文件        726  2007-10-19 14:23  nmealib\include\nmea\units.h

     文件      26432  2008-03-11 12:57  nmealib\LICENSE.TXT

     文件        838  2008-03-11 14:16  nmealib\Makefile

     文件       2998  2007-10-19 14:23  nmealib\nmea.ico

     文件       6308  2007-10-23 12:10  nmealib\nmea.sln

     文件       1539  2008-03-11 13:56  nmealib\README.TXT

     文件       7240  2007-10-23 12:16  nmealib\samples\generate\generate.vcproj

     文件        980  2008-03-11 14:20  nmealib\samples\generate\main.c

     文件       7241  2007-10-23 12:16  nmealib\samples\generator\generator.vcproj

     文件        717  2008-03-11 14:20  nmealib\samples\generator\main.c

     文件       3085  2007-10-23 11:14  nmealib\samples\math\main.c

     文件       7261  2007-10-23 12:16  nmealib\samples\math\math.vcproj

     文件        909  2008-03-11 12:02  nmealib\samples\parse\main.c

     文件       7262  2007-10-23 12:16  nmealib\samples\parse\parse.vcproj

     文件      13676  2007-10-19 14:24  nmealib\samples\parse_file\gpslog.txt

............此处省略29个文件信息

评论

共有 条评论