优化GGA的判断

This commit is contained in:
weidong 2024-10-18 19:01:03 +08:00
parent d0db10a822
commit 89e58eb38e

View File

@ -51,14 +51,9 @@ public class Gga {
byte d0 = data.getByte(pos); byte d0 = data.getByte(pos);
byte d1 = data.getByte(pos+1); byte d1 = data.getByte(pos+1);
if(GGA_FLAG[0] == d0){ if(GGA_FLAG[0] == d0){
if(data.readableBytes()>5 &&
data.getByte(pos+3) == GGA_FLAG[3] &&
data.getByte(pos+4) == GGA_FLAG[4] &&
data.getByte(pos+5) == GGA_FLAG[5]) {
found = true; found = true;
break; break;
} }
}
else if(d0 == rtcm_flag){ else if(d0 == rtcm_flag){
if(d1 == 0x31) { // d331粘包 if(d1 == 0x31) { // d331粘包
pos += 26; pos += 26;