$GPGGA,,,,,,0,00,99.99,,,,,,*48
用串口接收GPS数据,帧格式为$GPGGA。每次收到数据出发一个UART的中断。
实时监控$字符,捕捉到$后 再逐个捕捉G P G G A,只要一个字符不符合,就停止
类似一个陷阱,如果某数据流包含$GPGGA 那就掉进陷阱了,然后继续接收 保存数据,
但是对于用代码实现没思路
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
楼主,
应该是一个状态转换机制.供参考:
switch(state)
{
case 0:
if(RXdata=='$')//接受到'$'
state=1;
else
state=0;
break;
case 1:
if(RXdata=='G')//接受到$
state=1;
else
state=0;
break;
case 2:
//与上面的case类似
case 3:
//与上面的case类似
case 4:
//与上面的case类似
case 5:
if(RXdata=='A')//接受到$
//完整接收
else
state=0;
break;
default:break;
}