std::vector<std::string> tokens;
boost::split(tokens, gprmc, boost::is_any_of(","));
+ if(!tokens.size())
+ {
+ return;
+ }
+
if(tokens[2] == "A")
{
isActive = true;
g_assert(multimessageParse);
+ //test false message:
+
+ g_assert(!checksum("GPRMC,172758.296,V"));
+
}
std::string btaddapter = config["bluetoothAdapter"];
bool GpsNmeaSource::checksum(std::string sentence)
{
- if(sentence.empty() || sentence.length() < 4)
+ if(sentence.empty() || sentence.length() < 4 || sentence.find("*") == string::npos || sentence.find("*") >= sentence.length()-2)
{
return false;
}