1 /*
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 #define LOG_TAG "GnssDebugAidl"
18
19 #include "GnssDebug.h"
20 #include <log/log.h>
21 #include "MockLocation.h"
22
23 namespace aidl::android::hardware::gnss {
24
getDebugData(DebugData * debugData)25 ndk::ScopedAStatus GnssDebug::getDebugData(DebugData* debugData) {
26 ALOGD("GnssDebug::getDebugData");
27
28 PositionDebug positionDebug = {.valid = true,
29 .latitudeDegrees = 37.4219999,
30 .longitudeDegrees = -122.0840575,
31 .altitudeMeters = 1.60062531,
32 .speedMetersPerSec = 0,
33 .bearingDegrees = 0,
34 .horizontalAccuracyMeters = 5,
35 .verticalAccuracyMeters = 5,
36 .speedAccuracyMetersPerSecond = 1,
37 .bearingAccuracyDegrees = 90,
38 .ageSeconds = 0.99};
39 TimeDebug timeDebug = {.timeEstimateMs = 1519930775453L,
40 .timeUncertaintyNs = 1000,
41 .frequencyUncertaintyNsPerSec = 5.0e4};
42 std::vector<SatelliteData> satelliteDataArrayDebug = {};
43 debugData->position = positionDebug;
44 debugData->time = timeDebug;
45 debugData->satelliteDataArray = satelliteDataArrayDebug;
46
47 return ndk::ScopedAStatus::ok();
48 }
49
50 } // namespace aidl::android::hardware::gnss
51