首先从官网上下载了一个c语言的nmealib,附在附件中。
此lib只提供五种语句,主要是用于gps的。
离我的项目要求甚远,可以作为参考。。
 
/*
 *
 * NMEA library
 * URL: http://nmea.sourceforge.net
 * Author: Tim (xtimor@gmail.com)
 * Licence: http://www.gnu.org/licenses/lgpl.html
 * $Id: nmea.h 17 2008-03-11 11:56:11Z xtimor $
 *
 */
#ifndef __NMEA_H__
#define __NMEA_H__
#include "./config.h"    //一些基本配置的宏定义
#include "./units.h"      //包括距离单元和速度单元
#include "./gmath.h"    //涉及到数据的数学方面的处理
#include "./info.h"       //nmea结构的信息
#include "./sentence.h"  //nmea具体gps数据结构
#include "./generate.h"  //根据结构产生数据
#include "./generator.h" //同上
#include "./parse.h"     //分解数据
#include "./parser.h"    //同上
#include "./context.h"   //对字符流的处理,不涉及具体数据结构
#endif /* __NMEA_H__ */
这是nmea.h,,,从这个头文件,包含了nmealib中大部分头文件,其他的头文件也是间接的被包含。所以调用的时候,直接调用这个头文件,就可以使用了。
 
 
/*
 *
 * NMEA library
 * URL: http://nmea.sourceforge.net
 * Author: Tim (xtimor@gmail.com)
 * Licence: http://www.gnu.org/licenses/lgpl.html
 * $Id: config.h 17 2008-03-11 11:56:11Z xtimor $
 *
 */
//关于nmea的配置信息。
#ifndef __NMEA_CONFIG_H__
#define __NMEA_CONFIG_H__
#define NMEA_VERSION        ("0.5.3")    //版本
#define NMEA_VERSION_MAJOR  (0)
#define NMEA_VERSION_MINOR  (5)
#define NMEA_VERSION_PATCH  (3)
#define NMEA_CONVSTR_BUF    (256)     //字母大小写转换缓存
#define NMEA_TIMEPARSE_BUF  (256)   //相位时间缓存
#if defined(WINCE) || defined(UNDER_CE)     //低于等于wince的版本,都使用NMEA_CE
#   define  NMEA_CE
#endif
#if defined(WIN32) || defined(NMEA_CE)
#   define  NMEA_WIN                        //总结以上两句,不管什么版本的windows,都是用NMEA_WIN
#else
#   define  NMEA_UNI                           
#endif
#if defined(NMEA_WIN) && (_MSC_VER >= 1400)
# pragma warning(disable: 4996) /* declared deprecated */
#endif
#if defined(_MSC_VER)       //Microsoft的C编译器的版本
# define NMEA_POSIX(x)  _##x          // POSIX 表示可移植操作系统接口(Portable Operating System Interface ,缩写为 POSIX 是为了读音更像 UNIX)。   
# define NMEA_INLINE    __inline
#else
# define NMEA_POSIX(x)  x
# define NMEA_INLINE    inline
#endif
#if !defined(NDEBUG) && !defined(NMEA_CE)
#   include <assert.h>
#   define NMEA_ASSERT(x)   assert(x)    //Assert - 断言 ,复杂的用法
#else
#   define NMEA_ASSERT(x)
#endif
#endif /* __NMEA_CONFIG_H__ */