转载请注明:http://blog.youkuaiyun.com/wang_zheng_kai
导航制导与控制实验室 2014年11月10日
好久没有写博客了,先从一个小小的程序開始一段新的历程吧。
近期的项目主要还是用的的是linux系统,这篇文章主要介绍怎样从设置、读取BD+gps模块(um220),实际上主要是对串口(UART)的操作。
/*
* gps.c
*
* um220 test
*
* Author: Wang Zhengkai <449811900@qq.com>
*
*/
#include <stdio.h>
#include <termios.h>
#include <strings.h>
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
/*我用的是ubuntu的电脑測试的,使用的串口是ttyS0*/
#define DEV_NODE "/dev/ttyS0"
#define MAX_PACKET_SIZE 1024
</pre><pre code_snippet_id="478189" snippet_file_n