summaryrefslogtreecommitdiff
path: root/utils/loc_nmea.h
diff options
context:
space:
mode:
authorKevin Tang <zhikait@codeaurora.org>2017-03-24 17:39:20 -0700
committerKevin Tang <zhikait@codeaurora.org>2017-03-31 19:39:01 -0700
commit8b98a565a5d42377205abed7852843aed2b03b74 (patch)
tree8fa044a6641264f360ba9f801673a53c31608865 /utils/loc_nmea.h
parent905d69ef10c930dc943b1725dfbcf1408efae197 (diff)
downloadgps-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 'utils/loc_nmea.h')
-rw-r--r--utils/loc_nmea.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/loc_nmea.h b/utils/loc_nmea.h
index 92f997e..d182e41 100644
--- a/utils/loc_nmea.h
+++ b/utils/loc_nmea.h
@@ -43,4 +43,12 @@ void loc_nmea_generate_pos(const UlpLocation &location,
unsigned char generate_nmea,
std::vector<std::string> &nmeaArraystr);
+#define DEBUG_NMEA_MINSIZE 6
+#define DEBUG_NMEA_MAXSIZE 256
+inline bool loc_nmea_is_debug(const char* nmea, int length) {
+ return ((nullptr != nmea) &&
+ (length >= DEBUG_NMEA_MINSIZE) && (length <= DEBUG_NMEA_MAXSIZE) &&
+ (nmea[0] == '$') && (nmea[1] == 'P') && (nmea[2] == 'Q') && (nmea[3] == 'W'));
+}
+
#endif // LOC_ENG_NMEA_H