1 /*
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 
21 #include "Constants.h"
22 #include "GnssDebug.h"
23 
24 using namespace ::android::hardware::gnss::common;
25 
26 namespace android {
27 namespace hardware {
28 namespace gnss {
29 namespace V1_1 {
30 namespace implementation {
31 
32 // Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow.
getDebugData(V1_0::IGnssDebug::getDebugData_cb _hidl_cb)33 Return<void> GnssDebug::getDebugData(V1_0::IGnssDebug::getDebugData_cb _hidl_cb) {
34     PositionDebug positionDebug = {
35         .valid = true,
36         .latitudeDegrees = kMockLatitudeDegrees,
37         .longitudeDegrees = kMockLongitudeDegrees,
38         .altitudeMeters = kMockAltitudeMeters,
39         .speedMetersPerSec = kMockSpeedMetersPerSec,
40         .bearingDegrees = kMockBearingDegrees,
41         .horizontalAccuracyMeters = kMockHorizontalAccuracyMeters,
42         .verticalAccuracyMeters = kMockVerticalAccuracyMeters,
43         .speedAccuracyMetersPerSecond = kMockSpeedAccuracyMetersPerSecond,
44         .bearingAccuracyDegrees = kMockBearingAccuracyDegrees,
45         .ageSeconds = 0.99};
46 
47     TimeDebug timeDebug = {.timeEstimate = kMockTimestamp,
48                            .timeUncertaintyNs = 1000,
49                            .frequencyUncertaintyNsPerSec = 5.0e4};
50 
51     DebugData data = {.position = positionDebug, .time = timeDebug};
52 
53     _hidl_cb(data);
54 
55     return Void();
56 }
57 
58 }  // namespace implementation
59 }  // namespace V1_1
60 }  // namespace gnss
61 }  // namespace hardware
62 }  // namespace android
63