diff options
author | Kevin Tang <zhikait@codeaurora.org> | 2017-03-24 17:39:20 -0700 |
---|---|---|
committer | Kevin Tang <zhikait@codeaurora.org> | 2017-03-31 19:39:01 -0700 |
commit | 8b98a565a5d42377205abed7852843aed2b03b74 (patch) | |
tree | 8fa044a6641264f360ba9f801673a53c31608865 /core/SystemStatus.cpp | |
parent | 905d69ef10c930dc943b1725dfbcf1408efae197 (diff) | |
download | gps-8b98a565a5d42377205abed7852843aed2b03b74.tar.gz |
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
Diffstat (limited to 'core/SystemStatus.cpp')
-rw-r--r-- | core/SystemStatus.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
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 <sys/time.h> #include <pthread.h> #include <platform_lib_log_util.h> +#include <loc_nmea.h> #include <SystemStatus.h> namespace loc_core @@ -48,14 +49,10 @@ protected: std::vector<std::string> 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; } |