Coder Social home page Coder Social logo

nmea0183-c's Introduction

NMEA0183-C

GPS NMEA0183协议简要解析框架

  • 支持解析 RMC、GGA、VTG、HDT等消息字段信息,由于解析框架比较明了,移植源码者可自行考虑添加新的解析代码。

  • 解析方式采用逐个字段解析的方式,能很大程度上节省消耗内存空间。

  • 重新编写数据转换函数,不依赖外部库,移植时一般只需包含NMEA0183.h文件即可。

  • 代码示例:

    char nmea[] =
    "$GNRMC,102219.00,A,2239.11578,N,11406.59325,E,0.009,,291018,,,D62\r\n"
    "$GNVTG,,T,,M,0.009,N,0.017,K,D
    37\r\n"
    "$GNGGA,102220.00,2239.11583,N,11406.59338,E,2,09,1.30,112.7,M,-2.3,M,,0000*52\r\n";

    NMEA0183 nmea0183;
    unsigned int index = 0;
    
    for(index=0; index<sizeof(nmea); ++index)
    {
    	if(nmea_decode(&nmea0183, nmea[index]))
    	{
          ///解析代码成功
    	}
    }
    

解析成功后得到的数据保存在nmea0183.gpsData结构体缓冲区中。

  • NMEA0183解析代码思路来源于开源飞控代码(Ardupilot),所以该份代码开源,可免费使用。
  • 该程序代码是在32位处理器下运行调试通过的,移植注意数据类型的大小,防止数据溢出造成数据出错
  • ( 如有Bug,望能反馈 ! QQ: 2281280195 )
    • 作者: ouyanglei 时间:2018-11-16

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.