libNEMA

所属分类:C/C++工具库
开发工具:C
文件大小:9KB
下载次数:0
上传日期:2016-06-24 15:52:25
上 传 者sh-1993
说明:  NEMA 183 GPS消息解析器的libNEMA,C实现,该解析器还处理与GPS接收器的串行连接。
(libNEMA,C implementation of a NEMA 183 GPS message parser, which also handles serial connections to GPS receivers.)

文件列表:
Makefile (605, 2016-06-24)
include (0, 2016-06-24)
include\libNEMA.h (899, 2016-06-24)
lib (0, 2016-06-24)
lib\junk (0, 2016-06-24)
src (0, 2016-06-24)
src\lnConnect.c (1748, 2016-06-24)
src\lnDisconnect.c (423, 2016-06-24)
src\lnParseMsg.c (6418, 2016-06-24)
src\lnPrintState.c (620, 2016-06-24)
src\lnReadMsg.c (321, 2016-06-24)
src\lnSendMsg.c (182, 2016-06-24)
tests (0, 2016-06-24)
tests\Makefile (208, 2016-06-24)
tests\lnConnect.c (207, 2016-06-24)
tests\lnParseMsg.c (2466, 2016-06-24)
tests\lnReadMsg.c (338, 2016-06-24)
tests\test.h (348, 2016-06-24)

libNEMA ======= C implementation of a NEMA 183 GPS message parser, which also handles serial connections to GPS receivers. This library is designed to be compiled on unix based systems. Aside from dependence on system libraries, this library is self contained and requires few prerequsites. Requirements ============ * gcc * GNU Make Usage ============ Using libNEMA is very easy. You can start reading and parsing NEMA messages from a serial device in 3 function calls! First you will need to connect to the GPS device in order to obtain a file descriptor like so. `int fd = lnConnect("/dev/ttyAMA0", 9600);` Here we connect to a device that is located at the path `/dev/ttyAMA0` and is running at 9600 baud. Now we need to read some data from the device. ``` unsigned char buf[1024]; lnReadMsg(buf, 1024); ``` This reads the available information into a statically allocated buffer. The size of the buffer is also passed to libNEMA to avoid mistakenly modifiying the wrong data. Finally we can parse the message. ``` GpsState state; lnParseMsg(&state, buf); ``` The `GpsState` type is a struct that contains lat, long, altitude, speed, time, fix and a variety of other useful pieces of information that have been decoded from the messages.

近期下载者

相关文件


收藏者