GPS导航系统需要实时获取来自接收机串口的定位数据,在对串口实时监控的同时还可以在前台进行一些其他的操作,利用基于多线程的串口通信编程思想方法可以很好地解决这一问题。介绍多线程的基本概念和串口通信编程技术,分析了GPS导航系统的功能和需求,着重阐述了采用基于多线程的CSerialPort类的串口通信方法来获取定位数据,并;且给出了CSerialPort类的使用方法。经过调试.程序运行平稳。
The GPS navigation system needs not only gaining real - time orientation data from the receiver serial port but also operating other somethings, the way that based on the multi - thread and the serial communication programming technology theory can solve this question. The multi - thread basic concept and the serial port communication programming technology are introduced, and the GPS navigation system's function and the requirement are analysed, real - time orientation data by using CSerialPort class based on the multi- thread,and the application method of CSerialPort class are given. After the debugging, the program runs steady.