From 8b98a565a5d42377205abed7852843aed2b03b74 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 24 Mar 2017 17:39:20 -0700 Subject: Do not send debug NMEA to ulp Checking in GnssAdapter::reportNmeaEvent to see if the incoming nmea is debug, in which case we do not route that to ULP. Debug NMEA is only for SystemStatus consumption. Change-Id: Ifb60b9a643ad6aeb732fcaf5a68f868cb55cd88a CRs-Fixed: 2027134 --- core/SystemStatus.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'core/SystemStatus.cpp') diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index a7f282d..3310b8b 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include namespace loc_core @@ -48,14 +49,10 @@ protected: std::vector mField; timespec setUtcTime(std::string sutctime); -public: - static const uint32_t NMEA_MINSIZE = 6; - static const uint32_t NMEA_MAXSIZE = 256; - SystemStatusNmeaBase(const char *str_in, uint32_t len_in) { // check size and talker - if (len_in > NMEA_MAXSIZE || len_in < NMEA_MINSIZE || (str_in[0] != '$')) { + if (!loc_nmea_is_debug(str_in, len_in)) { return; } @@ -83,6 +80,10 @@ public: } virtual ~SystemStatusNmeaBase() { } + +public: + static const uint32_t NMEA_MINSIZE = DEBUG_NMEA_MINSIZE; + static const uint32_t NMEA_MAXSIZE = DEBUG_NMEA_MAXSIZE; }; timespec SystemStatusNmeaBase::setUtcTime(std::string sutctime) @@ -1316,9 +1317,7 @@ static uint32_t cnt_s1 = 0; bool SystemStatus::setNmeaString(const char *data, uint32_t len) { bool ret = false; - if (NULL == data - || (len < SystemStatusNmeaBase::NMEA_MINSIZE) - || (len > SystemStatusNmeaBase::NMEA_MAXSIZE)) { + if (!loc_nmea_is_debug(data, len)) { return false; } -- cgit v1.2.3