diff options
author | Yuchen He <yuchenhe@google.com> | 2022-01-20 22:57:09 +0000 |
---|---|---|
committer | Yuchen He <yuchenhe@google.com> | 2022-01-20 23:17:16 +0000 |
commit | 090f16c0b8687d569aab0977885ef45ced5d25c4 (patch) | |
tree | d3f7a104c0cfc3359e913a141de89e291886febb /gnss/common/utils/default/GnssReplayUtils.cpp | |
parent | b4a2d1e64d37b985c00cd6d1e83a1d3b412a66f4 (diff) |
Supported synchronized fixed location and measurement from device files
Replace NMEA by one row fixed location data
Test: atest VtsHalGnssTargetTest
Test: launch_cvd -cpus 16 -memory_mb 16192 --start_gnss_proxy --gnss_file_path=/usr/local/google/home/yuchenhe/Downloads/raw.txt --fixed_location_file_path=/google/data/rw/users/yu/yuchenhe/input.txt
Bug: 213225295
Change-Id: Ide7bbb3e81a90414496084691227bd95a2e7af18
Diffstat (limited to 'gnss/common/utils/default/GnssReplayUtils.cpp')
-rw-r--r-- | gnss/common/utils/default/GnssReplayUtils.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gnss/common/utils/default/GnssReplayUtils.cpp b/gnss/common/utils/default/GnssReplayUtils.cpp index 535647716b..37da57171f 100644 --- a/gnss/common/utils/default/GnssReplayUtils.cpp +++ b/gnss/common/utils/default/GnssReplayUtils.cpp @@ -29,11 +29,24 @@ std::string ReplayUtils::getGnssPath() { return GNSS_PATH; } +std::string ReplayUtils::getFixedLocationPath() { + char devname_value[PROPERTY_VALUE_MAX] = ""; + if (property_get("debug.location.fixedlocation.devname", devname_value, NULL) > 0) { + return devname_value; + } + return FIXED_LOCATION_PATH; +} + bool ReplayUtils::hasGnssDeviceFile() { struct stat sb; return stat(getGnssPath().c_str(), &sb) != -1; } +bool ReplayUtils::hasFixedLocationDeviceFile() { + struct stat sb; + return stat(getFixedLocationPath().c_str(), &sb) != -1; +} + bool ReplayUtils::isGnssRawMeasurement(const std::string& inputStr) { // TODO: add more logic check to by pass invalid data. return !inputStr.empty() && (inputStr.find("Raw") != std::string::npos); |