Loading gnss/1.1/vts/functional/Android.bp +3 −0 Original line number Diff line number Diff line Loading @@ -27,5 +27,8 @@ cc_test { "android.hardware.gnss@1.1", "android.hardware.gnss@common-vts-lib", ], shared_libs: [ "android.hardware.gnss.measurement_corrections@1.0", ], test_suites: ["general-tests"], } gnss/2.0/default/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ cc_binary { "AGnssRil.cpp", "Gnss.cpp", "GnssMeasurement.cpp", "GnssMeasurementCorrections.cpp", "GnssVisibilityControl.cpp", "service.cpp" ], Loading gnss/2.0/default/Gnss.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -25,11 +25,14 @@ #include "AGnssRil.h" #include "GnssConfiguration.h" #include "GnssMeasurement.h" #include "GnssMeasurementCorrections.h" #include "GnssVisibilityControl.h" #include "Utils.h" using ::android::hardware::Status; using ::android::hardware::gnss::common::Utils; using ::android::hardware::gnss::measurement_corrections::V1_0::implementation:: GnssMeasurementCorrections; using ::android::hardware::gnss::visibility_control::V1_0::implementation::GnssVisibilityControl; namespace android { Loading Loading @@ -248,8 +251,8 @@ Return<sp<V2_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement_2_0() { Return<sp<measurement_corrections::V1_0::IMeasurementCorrections>> Gnss::getExtensionMeasurementCorrections() { // TODO(b/124012850): Implement function. return sp<measurement_corrections::V1_0::IMeasurementCorrections>{}; ALOGD("Gnss::getExtensionMeasurementCorrections"); return new GnssMeasurementCorrections(); } Return<sp<visibility_control::V1_0::IGnssVisibilityControl>> Gnss::getExtensionVisibilityControl() { Loading gnss/2.0/default/GnssMeasurementCorrections.cpp 0 → 100644 +62 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #define LOG_TAG "GnssMeasurementCorrections" #include "GnssMeasurementCorrections.h" #include <log/log.h> namespace android { namespace hardware { namespace gnss { namespace measurement_corrections { namespace V1_0 { namespace implementation { // Methods from V1_0::IMeasurementCorrections follow. Return<bool> GnssMeasurementCorrections::setCorrections(const MeasurementCorrections& corrections) { ALOGD("setCorrections"); ALOGD("corrections = lat: %f, lng: %f, alt: %f, hUnc: %f, vUnc: %f, toa: %llu, " "satCorrections.size: %d", corrections.latitudeDegrees, corrections.longitudeDegrees, corrections.altitudeMeters, corrections.horizontalPositionUncertaintyMeters, corrections.verticalPositionUncertaintyMeters, static_cast<unsigned long long>(corrections.toaGpsNanosecondsOfWeek), static_cast<int>(corrections.satCorrections.size())); for (auto singleSatCorrection : corrections.satCorrections) { ALOGD("singleSatCorrection = flags: %d, constellation: %d, svid: %d, cfHz: %f, probLos: %f," " epl: %f, eplUnc: %f", static_cast<int>(singleSatCorrection.singleSatCorrectionFlags), static_cast<int>(singleSatCorrection.constellation), static_cast<int>(singleSatCorrection.svid), singleSatCorrection.carrierFrequencyHz, singleSatCorrection.probSatIsLos, singleSatCorrection.excessPathLengthMeters, singleSatCorrection.excessPathLengthUncertaintyMeters); ALOGD("reflecting plane = lat: %f, lng: %f, alt: %f, azm: %f", singleSatCorrection.reflectingPlane.latitudeDegrees, singleSatCorrection.reflectingPlane.longitudeDegrees, singleSatCorrection.reflectingPlane.altitudeMeters, singleSatCorrection.reflectingPlane.azimuthDegrees); } return true; } } // namespace implementation } // namespace V1_0 } // namespace measurement_corrections } // namespace gnss } // namespace hardware } // namespace android gnss/2.0/default/GnssMeasurementCorrections.h 0 → 100644 +48 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <android/hardware/gnss/measurement_corrections/1.0/IMeasurementCorrections.h> #include <hidl/MQDescriptor.h> #include <hidl/Status.h> namespace android { namespace hardware { namespace gnss { namespace measurement_corrections { namespace V1_0 { namespace implementation { using ::android::sp; using ::android::hardware::hidl_array; using ::android::hardware::hidl_memory; using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; struct GnssMeasurementCorrections : public IMeasurementCorrections { // Methods from V1_0::IMeasurementCorrections follow. Return<bool> setCorrections(const MeasurementCorrections& corrections) override; }; } // namespace implementation } // namespace V1_0 } // namespace measurement_corrections } // namespace gnss } // namespace hardware } // namespace android Loading
gnss/1.1/vts/functional/Android.bp +3 −0 Original line number Diff line number Diff line Loading @@ -27,5 +27,8 @@ cc_test { "android.hardware.gnss@1.1", "android.hardware.gnss@common-vts-lib", ], shared_libs: [ "android.hardware.gnss.measurement_corrections@1.0", ], test_suites: ["general-tests"], }
gnss/2.0/default/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ cc_binary { "AGnssRil.cpp", "Gnss.cpp", "GnssMeasurement.cpp", "GnssMeasurementCorrections.cpp", "GnssVisibilityControl.cpp", "service.cpp" ], Loading
gnss/2.0/default/Gnss.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -25,11 +25,14 @@ #include "AGnssRil.h" #include "GnssConfiguration.h" #include "GnssMeasurement.h" #include "GnssMeasurementCorrections.h" #include "GnssVisibilityControl.h" #include "Utils.h" using ::android::hardware::Status; using ::android::hardware::gnss::common::Utils; using ::android::hardware::gnss::measurement_corrections::V1_0::implementation:: GnssMeasurementCorrections; using ::android::hardware::gnss::visibility_control::V1_0::implementation::GnssVisibilityControl; namespace android { Loading Loading @@ -248,8 +251,8 @@ Return<sp<V2_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement_2_0() { Return<sp<measurement_corrections::V1_0::IMeasurementCorrections>> Gnss::getExtensionMeasurementCorrections() { // TODO(b/124012850): Implement function. return sp<measurement_corrections::V1_0::IMeasurementCorrections>{}; ALOGD("Gnss::getExtensionMeasurementCorrections"); return new GnssMeasurementCorrections(); } Return<sp<visibility_control::V1_0::IGnssVisibilityControl>> Gnss::getExtensionVisibilityControl() { Loading
gnss/2.0/default/GnssMeasurementCorrections.cpp 0 → 100644 +62 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #define LOG_TAG "GnssMeasurementCorrections" #include "GnssMeasurementCorrections.h" #include <log/log.h> namespace android { namespace hardware { namespace gnss { namespace measurement_corrections { namespace V1_0 { namespace implementation { // Methods from V1_0::IMeasurementCorrections follow. Return<bool> GnssMeasurementCorrections::setCorrections(const MeasurementCorrections& corrections) { ALOGD("setCorrections"); ALOGD("corrections = lat: %f, lng: %f, alt: %f, hUnc: %f, vUnc: %f, toa: %llu, " "satCorrections.size: %d", corrections.latitudeDegrees, corrections.longitudeDegrees, corrections.altitudeMeters, corrections.horizontalPositionUncertaintyMeters, corrections.verticalPositionUncertaintyMeters, static_cast<unsigned long long>(corrections.toaGpsNanosecondsOfWeek), static_cast<int>(corrections.satCorrections.size())); for (auto singleSatCorrection : corrections.satCorrections) { ALOGD("singleSatCorrection = flags: %d, constellation: %d, svid: %d, cfHz: %f, probLos: %f," " epl: %f, eplUnc: %f", static_cast<int>(singleSatCorrection.singleSatCorrectionFlags), static_cast<int>(singleSatCorrection.constellation), static_cast<int>(singleSatCorrection.svid), singleSatCorrection.carrierFrequencyHz, singleSatCorrection.probSatIsLos, singleSatCorrection.excessPathLengthMeters, singleSatCorrection.excessPathLengthUncertaintyMeters); ALOGD("reflecting plane = lat: %f, lng: %f, alt: %f, azm: %f", singleSatCorrection.reflectingPlane.latitudeDegrees, singleSatCorrection.reflectingPlane.longitudeDegrees, singleSatCorrection.reflectingPlane.altitudeMeters, singleSatCorrection.reflectingPlane.azimuthDegrees); } return true; } } // namespace implementation } // namespace V1_0 } // namespace measurement_corrections } // namespace gnss } // namespace hardware } // namespace android
gnss/2.0/default/GnssMeasurementCorrections.h 0 → 100644 +48 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <android/hardware/gnss/measurement_corrections/1.0/IMeasurementCorrections.h> #include <hidl/MQDescriptor.h> #include <hidl/Status.h> namespace android { namespace hardware { namespace gnss { namespace measurement_corrections { namespace V1_0 { namespace implementation { using ::android::sp; using ::android::hardware::hidl_array; using ::android::hardware::hidl_memory; using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; struct GnssMeasurementCorrections : public IMeasurementCorrections { // Methods from V1_0::IMeasurementCorrections follow. Return<bool> setCorrections(const MeasurementCorrections& corrections) override; }; } // namespace implementation } // namespace V1_0 } // namespace measurement_corrections } // namespace gnss } // namespace hardware } // namespace android