fix empty gnss

This commit is contained in:
oarcher 2024-08-28 21:02:52 +02:00
parent bc7eb17c0b
commit f2263e62bf

View file

@ -64,15 +64,15 @@ std::map<std::string, std::string> get_gnssinfo_tokens(const std::string &gnss_i
// for 7600 (16 tokens): // for 7600 (16 tokens):
// +CGNSSINFO: 2,04,03,00,4836.989133,N,00433.611595,W,060824,102247.0,-13.8,0.0,70.4,1.7,1.4,1.0 // +CGNSSINFO: 2,04,03,00,4836.989133,N,00433.611595,W,060824,102247.0,-13.8,0.0,70.4,1.7,1.4,1.0
std::string data = gnss_info.substr(12);
std::map<std::string, std::string> gnss_data; std::map<std::string, std::string> gnss_data;
if (data.find(",,,,,,") != std::string::npos) { if (gnss_info.find(",,,,,,") != std::string::npos) {
ESP_LOGW(TAG, "No GNSS location available"); ESP_LOGW(TAG, "No GNSS location available");
return gnss_data; // empty return gnss_data; // empty
} }
std::string data = gnss_info.substr(12);
std::vector<std::string> parts; std::vector<std::string> parts;
char delimiter = ','; char delimiter = ',';
std::istringstream token_stream(data); std::istringstream token_stream(data);