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