blob: 39efcd232b969ac1ab91a44742c96e52bc014b7c [file] [log] [blame]
Yu-Han Yanga2f77322018-03-06 10:12:55 -08001/*
2 * Copyright (C) 2016 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 "GnssDebug"
18
19#include <log/log.h>
20
Yu-Han Yanga5098612019-02-08 16:22:07 -080021#include "Constants.h"
Yu-Han Yanga2f77322018-03-06 10:12:55 -080022#include "GnssDebug.h"
Enrico Granata3ba5d222020-10-21 17:20:00 -060023#include "MockLocation.h"
Yu-Han Yanga2f77322018-03-06 10:12:55 -080024
Yu-Han Yanga5098612019-02-08 16:22:07 -080025using namespace ::android::hardware::gnss::common;
26
Yu-Han Yanga2f77322018-03-06 10:12:55 -080027namespace android {
28namespace hardware {
29namespace gnss {
30namespace V1_1 {
31namespace implementation {
32
33// Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow.
34Return<void> GnssDebug::getDebugData(V1_0::IGnssDebug::getDebugData_cb _hidl_cb) {
35 PositionDebug positionDebug = {
Enrico Granata3ba5d222020-10-21 17:20:00 -060036 .valid = true,
37 .latitudeDegrees = gMockLatitudeDegrees,
38 .longitudeDegrees = gMockLongitudeDegrees,
39 .altitudeMeters = gMockAltitudeMeters,
Enrico Granata72a47a22020-11-13 12:52:07 -070040 .speedMetersPerSec = gMockSpeedMetersPerSec,
41 .bearingDegrees = gMockBearingDegrees,
Enrico Granata3ba5d222020-10-21 17:20:00 -060042 .horizontalAccuracyMeters = kMockHorizontalAccuracyMeters,
43 .verticalAccuracyMeters = kMockVerticalAccuracyMeters,
44 .speedAccuracyMetersPerSecond = kMockSpeedAccuracyMetersPerSecond,
45 .bearingAccuracyDegrees = kMockBearingAccuracyDegrees,
46 .ageSeconds = 0.99};
Yu-Han Yanga2f77322018-03-06 10:12:55 -080047
48 TimeDebug timeDebug = {.timeEstimate = kMockTimestamp,
49 .timeUncertaintyNs = 1000,
50 .frequencyUncertaintyNsPerSec = 5.0e4};
51
52 DebugData data = {.position = positionDebug, .time = timeDebug};
53
54 _hidl_cb(data);
55
56 return Void();
57}
58
59} // namespace implementation
60} // namespace V1_1
61} // namespace gnss
62} // namespace hardware
63} // namespace android