blob: 7d6b4efdd1a53b6b25270d79fc286b0fb2e6e751 [file] [log] [blame]
Yuchen He1c9032d2021-08-12 21:40:26 +00001/*
2 * Copyright (C) 2021 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef android_hardware_gnss_common_default_GnssRawMeasurementParser_H_
18#define android_hardware_gnss_common_default_GnssRawMeasurementParser_H_
19
20#include <aidl/android/hardware/gnss/BnGnss.h>
21#include <log/log.h>
22#include <utils/SystemClock.h>
23#include <string>
24#include <unordered_map>
25
26#include "Constants.h"
27#include "ParseUtils.h"
28
29namespace android {
30namespace hardware {
31namespace gnss {
32namespace common {
33
34struct GnssRawMeasurementParser {
35 static std::unique_ptr<aidl::android::hardware::gnss::GnssData> getMeasurementFromStrs(
36 std::string& rawMeasurementStr);
37 static int getClockFlags(const std::vector<std::string>& rawMeasurementRecordValues,
38 const std::unordered_map<std::string, int>& columnNameIdMapping);
39 static int getElapsedRealtimeFlags(
40 const std::vector<std::string>& rawMeasurementRecordValues,
41 const std::unordered_map<std::string, int>& columnNameIdMapping);
42 static int getRawMeasurementFlags(
43 const std::vector<std::string>& rawMeasurementRecordValues,
44 const std::unordered_map<std::string, int>& columnNameIdMapping);
45 static std::unordered_map<std::string, int> getColumnIdNameMappingFromHeader(
46 const std::string& header);
47 static aidl::android::hardware::gnss::GnssConstellationType getGnssConstellationType(
48 int constellationType);
49};
50
51} // namespace common
52} // namespace gnss
53} // namespace hardware
54} // namespace android
55
56#endif // android_hardware_gnss_common_default_GnssRawMeasurementParser_H_