From 7b838ee9531060ab1ba93d6e02cb72b67c462b60 Mon Sep 17 00:00:00 2001 From: pengxiaochuan Date: Fri, 21 Nov 2025 15:58:20 +0800 Subject: [PATCH] add gnss2 --- .../interfaces/gnss/aidl/default/Android.bp | 110 + .../interfaces/gnss/aidl/default/Gnss.cpp | 428 ++++ .../gnss/aidl/default/GnssBatching.cpp | 130 ++ .../aidl/default/GnssMeasurementInterface.cpp | 214 ++ .../gnss/aidl/default/apex_file_contexts | 3 + .../gnss/aidl/default/gnss-default.rc | 5 + .../gnss/aidl/default/gnss-measurements.json | 2070 +++++++++++++++++ .../default/GnssRawMeasurementParser.cpp | 311 +++ .../common/utils/default/GnssReplayUtils.cpp | 105 + aosp/vendor/common/prebuild/Android.bp | 47 + .../common/prebuild/include/PacketQueue.h | 132 -- .../vendor/common/prebuild/include/VmiAgent.h | 29 - .../common/prebuild/include/VmiCamera.h | 2 + .../common/prebuild/include/VmiCameraHeader.h | 205 ++ aosp/vendor/common/prebuild/include/VmiGnss.h | 54 + .../common/prebuild/include/VmiGnssHeader.h | 321 +++ .../common/prebuild/include/VmiMsgHeader.h | 228 +- aosp/vendor/isula/manifest.xml | 9 - 18 files changed, 4027 insertions(+), 376 deletions(-) create mode 100644 aosp/hardware/interfaces/gnss/aidl/default/Android.bp create mode 100644 aosp/hardware/interfaces/gnss/aidl/default/Gnss.cpp create mode 100644 aosp/hardware/interfaces/gnss/aidl/default/GnssBatching.cpp create mode 100644 aosp/hardware/interfaces/gnss/aidl/default/GnssMeasurementInterface.cpp create mode 100644 aosp/hardware/interfaces/gnss/aidl/default/apex_file_contexts create mode 100644 aosp/hardware/interfaces/gnss/aidl/default/gnss-default.rc create mode 100644 aosp/hardware/interfaces/gnss/aidl/default/gnss-measurements.json create mode 100644 aosp/hardware/interfaces/gnss/common/utils/default/GnssRawMeasurementParser.cpp create mode 100644 aosp/hardware/interfaces/gnss/common/utils/default/GnssReplayUtils.cpp delete mode 100644 aosp/vendor/common/prebuild/include/PacketQueue.h create mode 100644 aosp/vendor/common/prebuild/include/VmiCameraHeader.h create mode 100644 aosp/vendor/common/prebuild/include/VmiGnss.h create mode 100644 aosp/vendor/common/prebuild/include/VmiGnssHeader.h diff --git a/aosp/hardware/interfaces/gnss/aidl/default/Android.bp b/aosp/hardware/interfaces/gnss/aidl/default/Android.bp new file mode 100644 index 000000000..4b889114c --- /dev/null +++ b/aosp/hardware/interfaces/gnss/aidl/default/Android.bp @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2020 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. + */ + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +cc_binary { + name: "android.hardware.gnss-service.brcm", + relative_install_path: "hw", + installable: false, // install APEX instead + vendor: true, + cflags: [ + "-Wall", + "-Wextra", + ], + shared_libs: [ + "libbase", + "libcutils", + "libbinder_ndk", + "libhidlbase", + "libutils", + "liblog", + "android.hardware.gnss@2.1", + "android.hardware.gnss@2.0", + "android.hardware.gnss@1.0", + "android.hardware.gnss.measurement_corrections@1.1", + "android.hardware.gnss.measurement_corrections@1.0", + "android.hardware.gnss.visibility_control@1.0", + "android.hardware.gnss-V4-ndk", + "libvmignss", + ], + srcs: [ + "AGnssRil.cpp", + "AGnss.cpp", + "Gnss.cpp", + "GnssAntennaInfo.cpp", + "GnssBatching.cpp", + "GnssDebug.cpp", + "GnssGeofence.cpp", + "GnssNavigationMessageInterface.cpp", + "GnssPowerIndication.cpp", + "GnssPsds.cpp", + "GnssConfiguration.cpp", + "GnssMeasurementInterface.cpp", + "GnssVisibilityControl.cpp", + "MeasurementCorrectionsInterface.cpp", + "service.cpp", + ], + static_libs: [ + "android.hardware.gnss@common-default-lib", + ], +} + +prebuilt_etc { + name: "gnss-default.rc", + src: "gnss-default.rc", + installable: false, +} + +prebuilt_etc { + name: "gnss-default.xml", + src: "gnss-default.xml", + sub_dir: "vintf", + installable: false, +} + +prebuilt_etc { + name: "gnss-measurements.json", + src: "gnss-measurements.json", + installable: false, +} + +apex { + name: "com.android.hardware.gnss", + manifest: "apex_manifest.json", + file_contexts: "apex_file_contexts", + key: "com.android.hardware.key", + certificate: ":com.android.hardware.certificate", + updatable: false, + vendor: true, + + binaries: [ + "android.hardware.gnss-service.brcm", + ], + prebuilts: [ + "gnss-default.rc", + "gnss-default.xml", + "android.hardware.location.gps.prebuilt.xml", // permission + "gnss-measurements.json", + ], +} diff --git a/aosp/hardware/interfaces/gnss/aidl/default/Gnss.cpp b/aosp/hardware/interfaces/gnss/aidl/default/Gnss.cpp new file mode 100644 index 000000000..cdd883404 --- /dev/null +++ b/aosp/hardware/interfaces/gnss/aidl/default/Gnss.cpp @@ -0,0 +1,428 @@ +/* + * Copyright (C) 2020 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 "GnssAidl" + +#include "Gnss.h" +#include +#include +#include +#include "AGnss.h" +#include "AGnssRil.h" +#include "DeviceFileReader.h" +#include "FixLocationParser.h" +#include "GnssAntennaInfo.h" +#include "GnssBatching.h" +#include "GnssConfiguration.h" +#include "GnssDebug.h" +#include "GnssGeofence.h" +#include "GnssNavigationMessageInterface.h" +#include "GnssPsds.h" +#include "GnssVisibilityControl.h" +#include "MeasurementCorrectionsInterface.h" +#include "Utils.h" + +#include "VmiGnss.h" + +namespace aidl::android::hardware::gnss { +using ::android::hardware::gnss::common::Utils; + +using ndk::ScopedAStatus; +using GnssSvInfo = IGnssCallback::GnssSvInfo; + +constexpr int TTFF_MILLIS = 2200; + +std::shared_ptr Gnss::sGnssCallback = nullptr; + +Gnss::Gnss() : mMinIntervalMs(1000), mFirstFixReceived(false) { + // Init VmiGnss + ::android::gnss::VmiGnss::GetInstance(); +} + +ScopedAStatus Gnss::setCallback(const std::shared_ptr& callback) { + ALOGD("setCallback"); + if (callback == nullptr) { + ALOGE("%s: Null callback ignored", __func__); + return ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + sGnssCallback = callback; + + int capabilities = + (int)(IGnssCallback::CAPABILITY_MEASUREMENTS | IGnssCallback::CAPABILITY_SCHEDULING | + IGnssCallback::CAPABILITY_SATELLITE_BLOCKLIST | + IGnssCallback::CAPABILITY_SATELLITE_PVT | + IGnssCallback::CAPABILITY_CORRELATION_VECTOR | + IGnssCallback::CAPABILITY_ANTENNA_INFO | + IGnssCallback::CAPABILITY_ACCUMULATED_DELTA_RANGE); + auto status = sGnssCallback->gnssSetCapabilitiesCb(capabilities); + if (!status.isOk()) { + ALOGE("%s: Unable to invoke callback.gnssSetCapabilitiesCb", __func__); + } + + IGnssCallback::GnssSystemInfo systemInfo = { + .yearOfHw = 2022, + .name = "Google, Cuttlefish, AIDL v3", + }; + status = sGnssCallback->gnssSetSystemInfoCb(systemInfo); + if (!status.isOk()) { + ALOGE("%s: Unable to invoke callback.gnssSetSystemInfoCb", __func__); + } + GnssSignalType signalType1 = { + .constellation = GnssConstellationType::GPS, + .carrierFrequencyHz = 1.57542e+09, + .codeType = GnssSignalType::CODE_TYPE_C, + }; + GnssSignalType signalType2 = { + .constellation = GnssConstellationType::GLONASS, + .carrierFrequencyHz = 1.5980625e+09, + .codeType = GnssSignalType::CODE_TYPE_C, + }; + status = sGnssCallback->gnssSetSignalTypeCapabilitiesCb( + std::vector({signalType1, signalType2})); + if (!status.isOk()) { + ALOGE("%s: Unable to invoke callback.gnssSetSignalTypeCapabilitiesCb", __func__); + } + return ScopedAStatus::ok(); +} + +std::unique_ptr Gnss::getLocationFromHW() { + if (!::android::hardware::gnss::common::ReplayUtils::hasFixedLocationDeviceFile()) { + return nullptr; + } + std::string inputStr = + ::android::hardware::gnss::common::DeviceFileReader::Instance().getLocationData(); + return ::android::hardware::gnss::common::FixLocationParser::getLocationFromInputStr(inputStr); +} + +ScopedAStatus Gnss::start() { + ALOGD("start()"); + if (mIsActive) { + ALOGW("Gnss has started. Restarting..."); + stop(); + } + + // Notify VmiGnss to start location. + ::android::gnss::VmiGnss::GetInstance()->StartLocation(); + + mIsActive = true; + mThreadBlocker.reset(); + // notify measurement engine to update measurement interval + mGnssMeasurementInterface->setLocationEnabled(true); + this->reportGnssStatusValue(IGnssCallback::GnssStatusValue::SESSION_BEGIN); + mThread = std::thread([this]() { + if (!mGnssMeasurementEnabled || mMinIntervalMs <= mGnssMeasurementIntervalMs) { + this->reportSvStatus(); + } + if (!mFirstFixReceived) { + std::this_thread::sleep_for(std::chrono::milliseconds(TTFF_MILLIS)); + mFirstFixReceived = true; + } + do { + if (!mIsActive) { + break; + } + if (!mGnssMeasurementEnabled || mMinIntervalMs <= mGnssMeasurementIntervalMs) { + this->reportSvStatus(); + } + this->reportNmea(); + + auto currentLocation = getLocationFromHW(); + mGnssPowerIndication->notePowerConsumption(); + if (currentLocation != nullptr) { + this->reportLocation(*currentLocation); + + // Set FIFO location to VmiGnss. + ::android::gnss::VmiGnss::GetInstance()->SetFifoLocation(std::move(currentLocation)); + } else { + // Get location from VmiGnss. + currentLocation = ::android::gnss::VmiGnss::GetInstance()->GetLocation(); + if (currentLocation != nullptr) { + this->reportLocation(*currentLocation); + continue; + } + + const auto location = Utils::getMockLocation(); + this->reportLocation(location); + } + } while (mIsActive && mThreadBlocker.wait_for(std::chrono::milliseconds(mMinIntervalMs))); + }); + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::stop() { + ALOGD("stop"); + // Notify VmiGnss to stop location. + ::android::gnss::VmiGnss::GetInstance()->StopLocation(); + + mIsActive = false; + mGnssMeasurementInterface->setLocationEnabled(false); + this->reportGnssStatusValue(IGnssCallback::GnssStatusValue::SESSION_END); + mThreadBlocker.notify(); + if (mThread.joinable()) { + mThread.join(); + } + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::close() { + ALOGD("close"); + sGnssCallback = nullptr; + return ScopedAStatus::ok(); +} + +void Gnss::reportLocation(const GnssLocation& location) const { + std::unique_lock lock(mMutex); + if (sGnssCallback == nullptr) { + ALOGE("%s: GnssCallback is null.", __func__); + return; + } + auto status = sGnssCallback->gnssLocationCb(location); + if (!status.isOk()) { + ALOGE("%s: Unable to invoke gnssLocationCb", __func__); + } + return; +} + +void Gnss::reportSvStatus() const { + if (mIsSvStatusActive) { + // Get svInfoList from VmiGnss. + auto svInfoList = ::android::gnss::VmiGnss::GetInstance()->GetSvInfoList(); + if (svInfoList != nullptr) { + reportSvStatus(*svInfoList); + return; + } + auto svStatus = filterBlocklistedSatellites(Utils::getMockSvInfoList()); + reportSvStatus(svStatus); + } +} + +void Gnss::reportSvStatus(const std::vector& svInfoList) const { + std::unique_lock lock(mMutex); + if (sGnssCallback == nullptr) { + ALOGE("%s: sGnssCallback is null.", __func__); + return; + } + auto status = sGnssCallback->gnssSvStatusCb(svInfoList); + if (!status.isOk()) { + ALOGE("%s: Unable to invoke callback", __func__); + } +} + +std::vector Gnss::filterBlocklistedSatellites( + std::vector gnssSvInfoList) const { + for (uint32_t i = 0; i < gnssSvInfoList.size(); i++) { + if (mGnssConfiguration->isBlocklisted(gnssSvInfoList[i])) { + gnssSvInfoList[i].svFlag &= ~(uint32_t)IGnssCallback::GnssSvFlags::USED_IN_FIX; + } + } + return gnssSvInfoList; +} + +void Gnss::reportGnssStatusValue(const IGnssCallback::GnssStatusValue gnssStatusValue) const { + std::unique_lock lock(mMutex); + if (sGnssCallback == nullptr) { + ALOGE("%s: sGnssCallback is null.", __func__); + return; + } + auto status = sGnssCallback->gnssStatusCb(gnssStatusValue); + if (!status.isOk()) { + ALOGE("%s: Unable to invoke gnssStatusCb", __func__); + } +} + +void Gnss::reportNmea() const { + if (mIsNmeaActive) { + std::unique_lock lock(mMutex); + if (sGnssCallback == nullptr) { + ALOGE("%s: sGnssCallback is null.", __func__); + return; + } + nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC); + auto status = sGnssCallback->gnssNmeaCb(now, "$TEST,0,1,2,3,4,5"); + if (!status.isOk()) { + ALOGE("%s: Unable to invoke callback", __func__); + } + } +} + +ScopedAStatus Gnss::startSvStatus() { + ALOGD("startSvStatus"); + mIsSvStatusActive = true; + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::stopSvStatus() { + ALOGD("stopSvStatus"); + mIsSvStatusActive = false; + return ScopedAStatus::ok(); +} +ScopedAStatus Gnss::startNmea() { + ALOGD("startNmea"); + mIsNmeaActive = true; + return ScopedAStatus::ok(); +} +ScopedAStatus Gnss::stopNmea() { + ALOGD("stopNmea"); + mIsNmeaActive = false; + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::getExtensionAGnss(std::shared_ptr* iAGnss) { + ALOGD("Gnss::getExtensionAGnss"); + *iAGnss = SharedRefBase::make(); + return ndk::ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs, int uncertaintyMs) { + ALOGD("injectTime. timeMs:%" PRId64 ", timeReferenceMs:%" PRId64 ", uncertaintyMs:%d", timeMs, + timeReferenceMs, uncertaintyMs); + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::getExtensionAGnssRil(std::shared_ptr* iAGnssRil) { + ALOGD("Gnss::getExtensionAGnssRil"); + *iAGnssRil = SharedRefBase::make(); + return ndk::ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::injectLocation(const GnssLocation& location) { + ALOGD("injectLocation. lat:%lf, lng:%lf, acc:%f", location.latitudeDegrees, + location.longitudeDegrees, location.horizontalAccuracyMeters); + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::injectBestLocation(const GnssLocation& location) { + ALOGD("injectBestLocation. lat:%lf, lng:%lf, acc:%f", location.latitudeDegrees, + location.longitudeDegrees, location.horizontalAccuracyMeters); + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::deleteAidingData(GnssAidingData aidingDataFlags) { + ALOGD("deleteAidingData. flags:%d", (int)aidingDataFlags); + mFirstFixReceived = false; + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::setPositionMode(const PositionModeOptions& options) { + ALOGD("setPositionMode. minIntervalMs:%d, lowPowerMode:%d", options.minIntervalMs, + (int)options.lowPowerMode); + mMinIntervalMs = std::max(1000, options.minIntervalMs); + mGnssMeasurementInterface->setLocationInterval(mMinIntervalMs); + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::getExtensionPsds(std::shared_ptr* iGnssPsds) { + ALOGD("getExtensionPsds"); + *iGnssPsds = SharedRefBase::make(); + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::getExtensionGnssConfiguration( + std::shared_ptr* iGnssConfiguration) { + ALOGD("getExtensionGnssConfiguration"); + if (mGnssConfiguration == nullptr) { + mGnssConfiguration = SharedRefBase::make(); + } + *iGnssConfiguration = mGnssConfiguration; + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::getExtensionGnssPowerIndication( + std::shared_ptr* iGnssPowerIndication) { + ALOGD("getExtensionGnssPowerIndication"); + if (mGnssPowerIndication == nullptr) { + mGnssPowerIndication = SharedRefBase::make(); + } + + *iGnssPowerIndication = mGnssPowerIndication; + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::getExtensionGnssMeasurement( + std::shared_ptr* iGnssMeasurement) { + ALOGD("getExtensionGnssMeasurement"); + if (mGnssMeasurementInterface == nullptr) { + mGnssMeasurementInterface = SharedRefBase::make(); + mGnssMeasurementInterface->setGnssInterface(static_cast>(this)); + } + *iGnssMeasurement = mGnssMeasurementInterface; + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::getExtensionGnssBatching(std::shared_ptr* iGnssBatching) { + ALOGD("getExtensionGnssBatching"); + + *iGnssBatching = SharedRefBase::make(); + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::getExtensionGnssGeofence(std::shared_ptr* iGnssGeofence) { + ALOGD("getExtensionGnssGeofence"); + + *iGnssGeofence = SharedRefBase::make(); + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::getExtensionGnssNavigationMessage( + std::shared_ptr* iGnssNavigationMessage) { + ALOGD("getExtensionGnssNavigationMessage"); + + *iGnssNavigationMessage = SharedRefBase::make(); + return ScopedAStatus::ok(); +} + +ndk::ScopedAStatus Gnss::getExtensionGnssDebug(std::shared_ptr* iGnssDebug) { + ALOGD("Gnss::getExtensionGnssDebug"); + + *iGnssDebug = SharedRefBase::make(); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus Gnss::getExtensionGnssVisibilityControl( + std::shared_ptr* iGnssVisibilityControl) { + ALOGD("Gnss::getExtensionGnssVisibilityControl"); + + *iGnssVisibilityControl = SharedRefBase::make(); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus Gnss::getExtensionGnssAntennaInfo( + std::shared_ptr* iGnssAntennaInfo) { + ALOGD("Gnss::getExtensionGnssAntennaInfo"); + + *iGnssAntennaInfo = SharedRefBase::make(); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus Gnss::getExtensionMeasurementCorrections( + std::shared_ptr* + iMeasurementCorrections) { + ALOGD("Gnss::getExtensionMeasurementCorrections"); + + *iMeasurementCorrections = + SharedRefBase::make(); + return ndk::ScopedAStatus::ok(); +} + +void Gnss::setGnssMeasurementEnabled(const bool enabled) { + mGnssMeasurementEnabled = enabled; +} + +void Gnss::setGnssMeasurementInterval(const long intervalMs) { + mGnssMeasurementIntervalMs = intervalMs; +} + +} // namespace aidl::android::hardware::gnss diff --git a/aosp/hardware/interfaces/gnss/aidl/default/GnssBatching.cpp b/aosp/hardware/interfaces/gnss/aidl/default/GnssBatching.cpp new file mode 100644 index 000000000..25b9fc773 --- /dev/null +++ b/aosp/hardware/interfaces/gnss/aidl/default/GnssBatching.cpp @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2021 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 "GnssBatchingAidl" + +#include "GnssBatching.h" +#include +#include +#include +#include +#include "Utils.h" + +#include "VmiGnss.h" + +namespace aidl::android::hardware::gnss { + +using namespace ::android::hardware::gnss; + +constexpr int BATCH_SIZE = 10; + +std::shared_ptr GnssBatching::sCallback = nullptr; + +GnssBatching::GnssBatching() + : mMinIntervalMs(1000), + mWakeUpOnFifoFull(false), + mBatchedLocations(std::vector()) {} +GnssBatching::~GnssBatching() { + cleanup(); +} + +ndk::ScopedAStatus GnssBatching::init(const std::shared_ptr& callback) { + ALOGD("init"); + std::unique_lock lock(mMutex); + sCallback = callback; + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus GnssBatching::getBatchSize(int* size) { + ALOGD("getBatchingSize"); + *size = BATCH_SIZE; + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus GnssBatching::start(const Options& options) { + ALOGD("start: periodNanos=%" PRId64 ", minDistanceMeters=%f, flags=%d", options.periodNanos, + options.minDistanceMeters, options.flags); + if (mIsActive) { + ALOGW("Gnss has started. Restarting..."); + stop(); + } + + // mMinIntervalMs is not smaller than 1 sec + long periodNanos = (options.periodNanos < 1e9) ? 1e9 : options.periodNanos; + mMinIntervalMs = periodNanos / 1e6; + mWakeUpOnFifoFull = (options.flags & IGnssBatching::WAKEUP_ON_FIFO_FULL) ? true : false; + mMinDistanceMeters = options.minDistanceMeters; + + mIsActive = true; + mThread = std::thread([this]() { + while (mIsActive == true) { + const auto location = *::android::gnss::VmiGnss::GetInstance()->GetLocation(); + this->batchLocation(location); + std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMs)); + } + }); + + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus GnssBatching::flush() { + ALOGD("flush"); + std::vector copy = std::vector(mBatchedLocations); + ndk::ScopedAStatus status; + if (sCallback != nullptr) { + sCallback->gnssLocationBatchCb(copy); + status = ndk::ScopedAStatus::ok(); + } else { + ALOGE("GnssBatchingCallback is null. flush() failed."); + status = ndk::ScopedAStatus::fromServiceSpecificError(IGnss::ERROR_GENERIC); + } + mBatchedLocations.clear(); + return status; +} + +ndk::ScopedAStatus GnssBatching::stop() { + ALOGD("stop"); + // Do not call flush() at stop() + mIsActive = false; + if (mThread.joinable()) { + mThread.join(); + } + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus GnssBatching::cleanup() { + ALOGD("cleanup"); + std::unique_lock lock(mMutex); + if (mIsActive) { + stop(); + } + flush(); + + sCallback = nullptr; + return ndk::ScopedAStatus::ok(); +} + +void GnssBatching::batchLocation(const GnssLocation& location) { + if (mBatchedLocations.size() > BATCH_SIZE) { + mBatchedLocations.erase(mBatchedLocations.begin()); + } + mBatchedLocations.push_back(location); + if (mWakeUpOnFifoFull && mBatchedLocations.size() == BATCH_SIZE) { + flush(); + } +} + +} // namespace aidl::android::hardware::gnss diff --git a/aosp/hardware/interfaces/gnss/aidl/default/GnssMeasurementInterface.cpp b/aosp/hardware/interfaces/gnss/aidl/default/GnssMeasurementInterface.cpp new file mode 100644 index 000000000..11a6e17ba --- /dev/null +++ b/aosp/hardware/interfaces/gnss/aidl/default/GnssMeasurementInterface.cpp @@ -0,0 +1,214 @@ +/* + * Copyright (C) 2020 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 "GnssMeasIfaceAidl" + +#include "GnssMeasurementInterface.h" +#include +#include +#include "DeviceFileReader.h" +#include "Gnss.h" +#include "GnssRawMeasurementParser.h" +#include "GnssReplayUtils.h" +#include "Utils.h" + +#include "VmiGnss.h" + +namespace aidl::android::hardware::gnss { + +using Utils = ::android::hardware::gnss::common::Utils; +using ReplayUtils = ::android::hardware::gnss::common::ReplayUtils; +using GnssRawMeasurementParser = ::android::hardware::gnss::common::GnssRawMeasurementParser; +using DeviceFileReader = ::android::hardware::gnss::common::DeviceFileReader; + +std::shared_ptr GnssMeasurementInterface::sCallback = nullptr; + +GnssMeasurementInterface::GnssMeasurementInterface() + : mIntervalMs(1000), mLocationIntervalMs(1000) { + mThreads.reserve(2); +} + +GnssMeasurementInterface::~GnssMeasurementInterface() { + waitForStoppingThreads(); +} + +ndk::ScopedAStatus GnssMeasurementInterface::setCallback( + const std::shared_ptr& callback, const bool enableFullTracking, + const bool enableCorrVecOutputs) { + ALOGD("setCallback: enableFullTracking: %d enableCorrVecOutputs: %d", (int)enableFullTracking, + (int)enableCorrVecOutputs); + { + std::unique_lock lock(mMutex); + sCallback = callback; + } + + if (mIsActive) { + ALOGW("GnssMeasurement callback already set. Resetting the callback..."); + stop(); + } + start(enableCorrVecOutputs, enableFullTracking); + + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus GnssMeasurementInterface::setCallbackWithOptions( + const std::shared_ptr& callback, const Options& options) { + ALOGD("setCallbackWithOptions: fullTracking:%d, corrVec:%d, intervalMs:%d", + (int)options.enableFullTracking, (int)options.enableCorrVecOutputs, options.intervalMs); + { + std::unique_lock lock(mMutex); + sCallback = callback; + } + + if (mIsActive) { + ALOGW("GnssMeasurement callback already set. Resetting the callback..."); + stop(); + } + mIntervalMs = std::max(options.intervalMs, 1000); + mGnss->setGnssMeasurementInterval(mIntervalMs); + start(options.enableCorrVecOutputs, options.enableFullTracking); + + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus GnssMeasurementInterface::close() { + ALOGD("close"); + if (mIsActive) { + stop(); + } + { + std::unique_lock lock(mMutex); + sCallback = nullptr; + } + mIntervalMs = 1000; + return ndk::ScopedAStatus::ok(); +} + +void GnssMeasurementInterface::start(const bool enableCorrVecOutputs, + const bool enableFullTracking) { + ALOGD("start"); + + if (mIsActive) { + ALOGD("restarting since measurement has started"); + stop(); + } + + // notify VmiGnss to start measurement + ::android::gnss::VmiGnss::GetInstance()->StartMeasurement(); + + mIsActive = true; + mGnss->setGnssMeasurementEnabled(true); + mThreads.emplace_back(std::thread([this, enableCorrVecOutputs, enableFullTracking]() { + waitForStoppingThreads(); + mThreadBlocker.reset(); + + int intervalMs; + do { + if (!mIsActive) { + break; + } + std::string rawMeasurementStr = ""; + if (ReplayUtils::hasGnssDeviceFile() && + ReplayUtils::isGnssRawMeasurement( + rawMeasurementStr = + DeviceFileReader::Instance().getGnssRawMeasurementData())) { + ALOGD("rawMeasurementStr(size: %zu) from device file: %s", rawMeasurementStr.size(), + rawMeasurementStr.c_str()); + auto measurement = + GnssRawMeasurementParser::getMeasurementFromStrs(rawMeasurementStr); + if (measurement != nullptr) { + this->reportMeasurement(*measurement); + + // Set FIFO measurement data to VmiGnss. + ::android::gnss::VmiGnss::GetInstance()->SetFifoMeasurement(std::move(measurement)); + } + } else { + // Get measurement data from VmiGnss. + auto gnssMeasurement = ::android::gnss::VmiGnss::GetInstance()->GetMeasurementData(); + if (gnssMeasurement != nullptr) { + this->reportMeasurement(*gnssMeasurement); + } else { + auto measurement = + Utils::getMockMeasurement(enableCorrVecOutputs, enableFullTracking); + this->reportMeasurement(measurement); + } + + if (!mLocationEnabled || mLocationIntervalMs > mIntervalMs) { + mGnss->reportSvStatus(); + } + } + intervalMs = + (mLocationEnabled) ? std::min(mLocationIntervalMs, mIntervalMs) : mIntervalMs; + } while (mIsActive && mThreadBlocker.wait_for(std::chrono::milliseconds(intervalMs))); + })); +} + +void GnssMeasurementInterface::stop() { + ALOGD("stop"); + // notify VmiGnss to start measurement + ::android::gnss::VmiGnss::GetInstance()->StopMeasurement(); + + mIsActive = false; + mGnss->setGnssMeasurementEnabled(false); + mThreadBlocker.notify(); + for (auto iter = mThreads.begin(); iter != mThreads.end(); ++iter) { + if (iter->joinable()) { + mFutures.push_back(std::async(std::launch::async, [this, iter] { + iter->join(); + mThreads.erase(iter); + })); + } else { + mThreads.erase(iter); + } + } +} + +void GnssMeasurementInterface::reportMeasurement(const GnssData& data) { + ALOGD("reportMeasurement()"); + std::shared_ptr callbackCopy; + { + std::unique_lock lock(mMutex); + if (sCallback == nullptr) { + ALOGE("%s: GnssMeasurement::sCallback is null.", __func__); + return; + } + callbackCopy = sCallback; + } + callbackCopy->gnssMeasurementCb(data); +} + +void GnssMeasurementInterface::setLocationInterval(const int intervalMs) { + mLocationIntervalMs = intervalMs; +} + +void GnssMeasurementInterface::setLocationEnabled(const bool enabled) { + mLocationEnabled = enabled; +} + +void GnssMeasurementInterface::setGnssInterface(const std::shared_ptr& gnss) { + mGnss = gnss; +} + +void GnssMeasurementInterface::waitForStoppingThreads() { + for (auto& future : mFutures) { + ALOGD("Stopping previous thread."); + future.wait(); + ALOGD("Done stopping thread."); + } + mFutures.clear(); +} + +} // namespace aidl::android::hardware::gnss diff --git a/aosp/hardware/interfaces/gnss/aidl/default/apex_file_contexts b/aosp/hardware/interfaces/gnss/aidl/default/apex_file_contexts new file mode 100644 index 000000000..edb85097a --- /dev/null +++ b/aosp/hardware/interfaces/gnss/aidl/default/apex_file_contexts @@ -0,0 +1,3 @@ +(/.*)? u:object_r:vendor_file:s0 +/etc(/.*)? u:object_r:vendor_configs_file:s0 +/bin/hw/android\.hardware\.gnss-service\.brcm u:object_r:hal_gnss_default_exec:s0 diff --git a/aosp/hardware/interfaces/gnss/aidl/default/gnss-default.rc b/aosp/hardware/interfaces/gnss/aidl/default/gnss-default.rc new file mode 100644 index 000000000..768fa3ccf --- /dev/null +++ b/aosp/hardware/interfaces/gnss/aidl/default/gnss-default.rc @@ -0,0 +1,5 @@ +service vendor.gnss-default /apex/com.android.hardware.gnss/bin/hw/android.hardware.gnss-service.brcm + interface aidl android.hardware.gnss.IGnss/default + class hal + user gps + group system gps radio diff --git a/aosp/hardware/interfaces/gnss/aidl/default/gnss-measurements.json b/aosp/hardware/interfaces/gnss/aidl/default/gnss-measurements.json new file mode 100644 index 000000000..b42aee147 --- /dev/null +++ b/aosp/hardware/interfaces/gnss/aidl/default/gnss-measurements.json @@ -0,0 +1,2070 @@ +{ + "GnssClock": { + "biasNs": -0.8339567184448242, + "biasUncertaintyNs": 42.658590245991945, + "driftNsps": -0.09571948633518541, + "driftUncertaintyNsps": 9.670470626342892, + "flags": 125, + "fullBiasNs": -1445455114708011308, + "hwClockDiscontinuityCount": 1065, + "leapSecond": 18, + "referenceSignalTypeForIsb": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 1 + }, + "timeNs": 2186986721000000, + "timeUncertaintyNs": 0.0 + }, + "GnssMeasurements": [ + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.06, + "basebandCN0DbHz": 22.9, + "cN0Dbhz": 26.5, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 1, + "flags": 205312, + "fullInterSignalBiasNs": 0.0, + "fullInterSignalBiasUncertaintyNs": 0.0, + "multipathIndicator": 0, + "pseudorangeRateMps": 86.93566131591797, + "pseudorangeRateUncertaintyMps": 1.3910000324249268, + "receivedSvTimeInNs": 355701343760164, + "receivedSvTimeUncertaintyInNs": 35, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 1 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 2, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.06, + "basebandCN0DbHz": 38.699999999999996, + "cN0Dbhz": 42.3, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 1, + "flags": 205312, + "fullInterSignalBiasNs": 0.0, + "fullInterSignalBiasUncertaintyNs": 0.0, + "multipathIndicator": 0, + "pseudorangeRateMps": 245.19711303710938, + "pseudorangeRateUncertaintyMps": 0.618186891078949, + "receivedSvTimeInNs": 355701360575362, + "receivedSvTimeUncertaintyInNs": 6, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 1 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 10, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.06, + "basebandCN0DbHz": 30.9, + "cN0Dbhz": 34.5, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 1, + "flags": 205312, + "fullInterSignalBiasNs": 0.0, + "fullInterSignalBiasUncertaintyNs": 0.0, + "multipathIndicator": 0, + "pseudorangeRateMps": 578.024169921875, + "pseudorangeRateUncertaintyMps": 0.040995653718709946, + "receivedSvTimeInNs": 355701348267573, + "receivedSvTimeUncertaintyInNs": 14, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 1 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 12, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.06, + "basebandCN0DbHz": 36.199999999999996, + "cN0Dbhz": 39.8, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 1, + "flags": 205312, + "fullInterSignalBiasNs": 0.0, + "fullInterSignalBiasUncertaintyNs": 0.0, + "multipathIndicator": 0, + "pseudorangeRateMps": 667.9429931640625, + "pseudorangeRateUncertaintyMps": 0.02870025485754013, + "receivedSvTimeInNs": 355701353222218, + "receivedSvTimeUncertaintyInNs": 8, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 1 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 23, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.06, + "basebandCN0DbHz": 39.199999999999996, + "cN0Dbhz": 42.8, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 1, + "flags": 205312, + "fullInterSignalBiasNs": 0.0, + "fullInterSignalBiasUncertaintyNs": 0.0, + "multipathIndicator": 0, + "pseudorangeRateMps": 337.552734375, + "pseudorangeRateUncertaintyMps": 0.5906730890274048, + "receivedSvTimeInNs": 355701358544214, + "receivedSvTimeUncertaintyInNs": 6, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 1 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 25, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.06, + "basebandCN0DbHz": 32.699999999999996, + "cN0Dbhz": 36.3, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 1, + "flags": 205312, + "fullInterSignalBiasNs": 0.0, + "fullInterSignalBiasUncertaintyNs": 0.0, + "multipathIndicator": 0, + "pseudorangeRateMps": -662.2943115234375, + "pseudorangeRateUncertaintyMps": 1.744140625, + "receivedSvTimeInNs": 355701353219153, + "receivedSvTimeUncertaintyInNs": 12, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 1 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 26, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.06, + "basebandCN0DbHz": 33.9, + "cN0Dbhz": 37.5, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 1, + "flags": 205312, + "fullInterSignalBiasNs": 0.0, + "fullInterSignalBiasUncertaintyNs": 0.0, + "multipathIndicator": 0, + "pseudorangeRateMps": -313.7655944824219, + "pseudorangeRateUncertaintyMps": 0.04269833862781525, + "receivedSvTimeInNs": 355701345693687, + "receivedSvTimeUncertaintyInNs": 11, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 1 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 29, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.06, + "basebandCN0DbHz": 30.799999999999997, + "cN0Dbhz": 34.4, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 1, + "flags": 205312, + "fullInterSignalBiasNs": 0.0, + "fullInterSignalBiasUncertaintyNs": 0.0, + "multipathIndicator": 0, + "pseudorangeRateMps": -289.2458190917969, + "pseudorangeRateUncertaintyMps": 1.172257661819458, + "receivedSvTimeInNs": 355701355345252, + "receivedSvTimeUncertaintyInNs": 14, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 1 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 31, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.06, + "basebandCN0DbHz": 40.9, + "cN0Dbhz": 44.5, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 1, + "flags": 205312, + "fullInterSignalBiasNs": 0.0, + "fullInterSignalBiasUncertaintyNs": 0.0, + "multipathIndicator": 0, + "pseudorangeRateMps": -184.85226440429688, + "pseudorangeRateUncertaintyMps": 0.021006640046834946, + "receivedSvTimeInNs": 355701357835492, + "receivedSvTimeUncertaintyInNs": 5, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 1 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 32, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.06, + "basebandCN0DbHz": 38.6, + "cN0Dbhz": 42.2, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 4, + "flags": 205312, + "fullInterSignalBiasNs": 0.0, + "fullInterSignalBiasUncertaintyNs": 0.0, + "multipathIndicator": 0, + "pseudorangeRateMps": 53.02887725830078, + "pseudorangeRateUncertaintyMps": 0.6121869087219238, + "receivedSvTimeInNs": 355701304138960, + "receivedSvTimeUncertaintyInNs": 6, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 4 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 194, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.06, + "basebandCN0DbHz": 36.6, + "cN0Dbhz": 40.2, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 4, + "flags": 205312, + "fullInterSignalBiasNs": 0.0, + "fullInterSignalBiasUncertaintyNs": 0.0, + "multipathIndicator": 0, + "pseudorangeRateMps": 91.9727783203125, + "pseudorangeRateUncertaintyMps": 0.03920025750994682, + "receivedSvTimeInNs": 355701306995251, + "receivedSvTimeUncertaintyInNs": 8, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 4 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 195, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.82, + "basebandCN0DbHz": 35.4, + "cN0Dbhz": 39.4, + "carrierCycles": 0, + "carrierFrequencyHz": 1.600875008E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 3, + "flags": 205312, + "fullInterSignalBiasNs": 3794.172119140625, + "fullInterSignalBiasUncertaintyNs": 26.295635223388672, + "multipathIndicator": 0, + "pseudorangeRateMps": 707.5081787109375, + "pseudorangeRateUncertaintyMps": 0.02622477523982525, + "receivedSvTimeInNs": 20883355032386, + "receivedSvTimeUncertaintyInNs": 9, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.600875008E9, + "codeType": "C", + "constellation": 3 + }, + "snrDb": 0.0, + "state": 49359, + "svid": 9, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.82, + "basebandCN0DbHz": 34.5, + "cN0Dbhz": 38.5, + "carrierCycles": 0, + "carrierFrequencyHz": 1.602E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 3, + "flags": 205312, + "fullInterSignalBiasNs": 3794.172119140625, + "fullInterSignalBiasUncertaintyNs": 26.295635223388672, + "multipathIndicator": 0, + "pseudorangeRateMps": -479.9023132324219, + "pseudorangeRateUncertaintyMps": 0.04780123010277748, + "receivedSvTimeInNs": 20883361037724, + "receivedSvTimeUncertaintyInNs": 10, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.602E9, + "codeType": "C", + "constellation": 3 + }, + "snrDb": 0.0, + "state": 49359, + "svid": 11, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.82, + "basebandCN0DbHz": 36.3, + "cN0Dbhz": 40.3, + "carrierCycles": 0, + "carrierFrequencyHz": 1.604812544E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 3, + "flags": 205312, + "fullInterSignalBiasNs": 3794.172119140625, + "fullInterSignalBiasUncertaintyNs": 26.295635223388672, + "multipathIndicator": 0, + "pseudorangeRateMps": 41.7977180480957, + "pseudorangeRateUncertaintyMps": 0.04661417007446289, + "receivedSvTimeInNs": 20883361715904, + "receivedSvTimeUncertaintyInNs": 8, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.604812544E9, + "codeType": "C", + "constellation": 3 + }, + "snrDb": 0.0, + "state": 49359, + "svid": 7, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.82, + "basebandCN0DbHz": 18.9, + "cN0Dbhz": 22.9, + "carrierCycles": 0, + "carrierFrequencyHz": 1.605374976E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 3, + "flags": 205312, + "fullInterSignalBiasNs": 3794.172119140625, + "fullInterSignalBiasUncertaintyNs": 26.295635223388672, + "multipathIndicator": 0, + "pseudorangeRateMps": -488.0153503417969, + "pseudorangeRateUncertaintyMps": 1.024999976158142, + "receivedSvTimeInNs": 20883359606779, + "receivedSvTimeUncertaintyInNs": 61, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.605374976E9, + "codeType": "C", + "constellation": 3 + }, + "snrDb": 0.0, + "state": 49359, + "svid": 8, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 37.400000000000006, + "cN0Dbhz": 41.7, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": 6.400820732116699, + "pseudorangeRateUncertaintyMps": 0.6470630168914795, + "receivedSvTimeInNs": 355687305705888, + "receivedSvTimeUncertaintyInNs": 7, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 59, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 38.6, + "cN0Dbhz": 42.9, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": -192.64852905273438, + "pseudorangeRateUncertaintyMps": 0.024840790778398514, + "receivedSvTimeInNs": 355687355129983, + "receivedSvTimeUncertaintyInNs": 6, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 42, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 24.4, + "cN0Dbhz": 28.7, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": -188.75758361816406, + "pseudorangeRateUncertaintyMps": 10.472332954406738, + "receivedSvTimeInNs": 355687292935029, + "receivedSvTimeUncertaintyInNs": 27, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 40, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 35.1, + "cN0Dbhz": 39.4, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": 101.02027130126953, + "pseudorangeRateUncertaintyMps": 0.03835790231823921, + "receivedSvTimeInNs": 355687307053554, + "receivedSvTimeUncertaintyInNs": 9, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 39, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 19.4, + "cN0Dbhz": 23.7, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": -539.6981811523438, + "pseudorangeRateUncertaintyMps": 0.9375, + "receivedSvTimeInNs": 355687344716513, + "receivedSvTimeUncertaintyInNs": 53, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 33, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 35.1, + "cN0Dbhz": 39.4, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": -192.71864318847656, + "pseudorangeRateUncertaintyMps": 0.6024764180183411, + "receivedSvTimeInNs": 355687355828361, + "receivedSvTimeUncertaintyInNs": 9, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 24, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 41.2, + "cN0Dbhz": 45.5, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": 292.1044006347656, + "pseudorangeRateUncertaintyMps": 0.029726961627602577, + "receivedSvTimeInNs": 355687351124877, + "receivedSvTimeUncertaintyInNs": 5, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 21, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 19.9, + "cN0Dbhz": 24.2, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": -419.4334716796875, + "pseudorangeRateUncertaintyMps": 0.8569999933242798, + "receivedSvTimeInNs": 355687351770145, + "receivedSvTimeUncertaintyInNs": 53, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 14, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 35.0, + "cN0Dbhz": 39.3, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": 13.24645709991455, + "pseudorangeRateUncertaintyMps": 0.03535790368914604, + "receivedSvTimeInNs": 355687309327558, + "receivedSvTimeUncertaintyInNs": 9, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 13, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 28.599999999999998, + "cN0Dbhz": 32.9, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": -98.8954849243164, + "pseudorangeRateUncertaintyMps": 0.038439277559518814, + "receivedSvTimeInNs": 355687294241891, + "receivedSvTimeUncertaintyInNs": 17, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 10, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 29.7, + "cN0Dbhz": 34.0, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": 75.40345764160156, + "pseudorangeRateUncertaintyMps": 0.05203739181160927, + "receivedSvTimeInNs": 355687304815028, + "receivedSvTimeUncertaintyInNs": 16, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 9, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 33.0, + "cN0Dbhz": 37.3, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": 86.33295440673828, + "pseudorangeRateUncertaintyMps": 0.6143782138824463, + "receivedSvTimeInNs": 355687308913545, + "receivedSvTimeUncertaintyInNs": 11, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 8, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 27.900000000000002, + "cN0Dbhz": 32.2, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": -165.6571502685547, + "pseudorangeRateUncertaintyMps": 5.806629180908203, + "receivedSvTimeInNs": 355687296342564, + "receivedSvTimeUncertaintyInNs": 19, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 7, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 19.3, + "cN0Dbhz": 23.6, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": 82.01046752929688, + "pseudorangeRateUncertaintyMps": 1.6169999837875366, + "receivedSvTimeInNs": 355687307302878, + "receivedSvTimeUncertaintyInNs": 53, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 6, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 36.800000000000004, + "cN0Dbhz": 41.1, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": 7.691181182861328, + "pseudorangeRateUncertaintyMps": 1.2874000072479248, + "receivedSvTimeInNs": 355687301409628, + "receivedSvTimeUncertaintyInNs": 8, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 4, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 33.400000000000006, + "cN0Dbhz": 37.7, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": 4.771719932556152, + "pseudorangeRateUncertaintyMps": 0.8822524547576904, + "receivedSvTimeInNs": 355687308664735, + "receivedSvTimeUncertaintyInNs": 11, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 3, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 32.7, + "cN0Dbhz": 37.0, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": 4.290999412536621, + "pseudorangeRateUncertaintyMps": 0.5518114566802979, + "receivedSvTimeInNs": 355687305895668, + "receivedSvTimeUncertaintyInNs": 12, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 2, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 9.22, + "basebandCN0DbHz": 33.1, + "cN0Dbhz": 37.4, + "carrierCycles": 0, + "carrierFrequencyHz": 1.561097984E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1566.04296875, + "fullInterSignalBiasUncertaintyNs": 7.990529537200928, + "multipathIndicator": 0, + "pseudorangeRateMps": 2.6485519409179688, + "pseudorangeRateUncertaintyMps": 0.8822524547576904, + "receivedSvTimeInNs": 355687304450226, + "receivedSvTimeUncertaintyInNs": 11, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.561097984E9, + "codeType": "I", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 1, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.23, + "basebandCN0DbHz": 41.400000000000006, + "cN0Dbhz": 45.7, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 6, + "flags": 205312, + "fullInterSignalBiasNs": -1468.9149169921875, + "fullInterSignalBiasUncertaintyNs": 8.100892066955566, + "multipathIndicator": 0, + "pseudorangeRateMps": -21.13579559326172, + "pseudorangeRateUncertaintyMps": 1.1984641551971436, + "receivedSvTimeInNs": 355701347607021, + "receivedSvTimeUncertaintyInNs": 5, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 6 + }, + "snrDb": 0.0, + "state": 23567, + "svid": 7, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.23, + "basebandCN0DbHz": 19.099999999999998, + "cN0Dbhz": 23.4, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 6, + "flags": 205312, + "fullInterSignalBiasNs": -1468.9149169921875, + "fullInterSignalBiasUncertaintyNs": 8.100892066955566, + "multipathIndicator": 0, + "pseudorangeRateMps": 202.70599365234375, + "pseudorangeRateUncertaintyMps": 1.8707237243652344, + "receivedSvTimeInNs": 355701338884995, + "receivedSvTimeUncertaintyInNs": 53, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 6 + }, + "snrDb": 0.0, + "state": 23567, + "svid": 8, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.23, + "basebandCN0DbHz": 30.999999999999996, + "cN0Dbhz": 35.3, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 6, + "flags": 205312, + "fullInterSignalBiasNs": -1468.9149169921875, + "fullInterSignalBiasUncertaintyNs": 8.100892066955566, + "multipathIndicator": 0, + "pseudorangeRateMps": 456.4225769042969, + "pseudorangeRateUncertaintyMps": 0.06239195168018341, + "receivedSvTimeInNs": 355701335999135, + "receivedSvTimeUncertaintyInNs": 13, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 6 + }, + "snrDb": 0.0, + "state": 23567, + "svid": 13, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.23, + "basebandCN0DbHz": 19.599999999999998, + "cN0Dbhz": 23.9, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 6, + "flags": 205312, + "fullInterSignalBiasNs": -1468.9149169921875, + "fullInterSignalBiasUncertaintyNs": 8.100892066955566, + "multipathIndicator": 0, + "pseudorangeRateMps": -564.795166015625, + "pseudorangeRateUncertaintyMps": 4.723628997802734, + "receivedSvTimeInNs": 355701337663011, + "receivedSvTimeUncertaintyInNs": 53, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 6 + }, + "snrDb": 0.0, + "state": 23567, + "svid": 21, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.23, + "basebandCN0DbHz": 26.8, + "cN0Dbhz": 31.1, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 6, + "flags": 205312, + "fullInterSignalBiasNs": -1468.9149169921875, + "fullInterSignalBiasUncertaintyNs": 8.100892066955566, + "multipathIndicator": 0, + "pseudorangeRateMps": 385.91790771484375, + "pseudorangeRateUncertaintyMps": 3.4946930408477783, + "receivedSvTimeInNs": 355701341839442, + "receivedSvTimeUncertaintyInNs": 21, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 6 + }, + "snrDb": 0.0, + "state": 23567, + "svid": 26, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.23, + "basebandCN0DbHz": 37.0, + "cN0Dbhz": 41.3, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 6, + "flags": 205312, + "fullInterSignalBiasNs": -1468.9149169921875, + "fullInterSignalBiasUncertaintyNs": 8.100892066955566, + "multipathIndicator": 0, + "pseudorangeRateMps": -317.5943298339844, + "pseudorangeRateUncertaintyMps": 0.059705495834350586, + "receivedSvTimeInNs": 355701348112261, + "receivedSvTimeUncertaintyInNs": 7, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 6 + }, + "snrDb": 0.0, + "state": 23567, + "svid": 27, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.23, + "basebandCN0DbHz": 20.7, + "cN0Dbhz": 25.0, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 6, + "flags": 205312, + "fullInterSignalBiasNs": -1468.9149169921875, + "fullInterSignalBiasUncertaintyNs": 8.100892066955566, + "multipathIndicator": 0, + "pseudorangeRateMps": -250.4308319091797, + "pseudorangeRateUncertaintyMps": 0.6691243052482605, + "receivedSvTimeInNs": 355701343708175, + "receivedSvTimeUncertaintyInNs": 46, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 6 + }, + "snrDb": 0.0, + "state": 23567, + "svid": 29, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.23, + "basebandCN0DbHz": 37.800000000000004, + "cN0Dbhz": 42.1, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 6, + "flags": 205312, + "fullInterSignalBiasNs": -1468.9149169921875, + "fullInterSignalBiasUncertaintyNs": 8.100892066955566, + "multipathIndicator": 0, + "pseudorangeRateMps": 166.34642028808594, + "pseudorangeRateUncertaintyMps": 0.06120549514889717, + "receivedSvTimeInNs": 355701345929972, + "receivedSvTimeUncertaintyInNs": 7, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 6 + }, + "snrDb": 0.0, + "state": 23567, + "svid": 30, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.23, + "basebandCN0DbHz": 25.3, + "cN0Dbhz": 29.6, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 6, + "flags": 205312, + "fullInterSignalBiasNs": -1468.9149169921875, + "fullInterSignalBiasUncertaintyNs": 8.100892066955566, + "multipathIndicator": 0, + "pseudorangeRateMps": 75.93669128417969, + "pseudorangeRateUncertaintyMps": 0.6200000047683716, + "receivedSvTimeInNs": 355701339138466, + "receivedSvTimeUncertaintyInNs": 24, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "C", + "constellation": 6 + }, + "snrDb": 0.0, + "state": 23567, + "svid": 33, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": -1.95, + "basebandCN0DbHz": 31.700000000000003, + "cN0Dbhz": 36.6, + "carrierCycles": 0, + "carrierFrequencyHz": 1.176450048E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 1, + "flags": 205312, + "fullInterSignalBiasNs": -7869.38037109375, + "fullInterSignalBiasUncertaintyNs": 1.5442157983779907, + "multipathIndicator": 0, + "pseudorangeRateMps": 245.36553955078125, + "pseudorangeRateUncertaintyMps": 0.01273791678249836, + "receivedSvTimeInNs": 355701360583234, + "receivedSvTimeUncertaintyInNs": 3, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.176450048E9, + "codeType": "Q", + "constellation": 1 + }, + "snrDb": 0.0, + "state": 81935, + "svid": 10, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": -1.95, + "basebandCN0DbHz": 32.7, + "cN0Dbhz": 37.6, + "carrierCycles": 0, + "carrierFrequencyHz": 1.176450048E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 1, + "flags": 205312, + "fullInterSignalBiasNs": -7869.38037109375, + "fullInterSignalBiasUncertaintyNs": 1.5442157983779907, + "multipathIndicator": 0, + "pseudorangeRateMps": 667.9931640625, + "pseudorangeRateUncertaintyMps": 0.03104022517800331, + "receivedSvTimeInNs": 355701353230226, + "receivedSvTimeUncertaintyInNs": 3, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.176450048E9, + "codeType": "Q", + "constellation": 1 + }, + "snrDb": 0.0, + "state": 81935, + "svid": 23, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": -1.95, + "basebandCN0DbHz": 33.2, + "cN0Dbhz": 38.1, + "carrierCycles": 0, + "carrierFrequencyHz": 1.176450048E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 1, + "flags": 205312, + "fullInterSignalBiasNs": -7869.38037109375, + "fullInterSignalBiasUncertaintyNs": 1.5442157983779907, + "multipathIndicator": 0, + "pseudorangeRateMps": 337.350830078125, + "pseudorangeRateUncertaintyMps": 0.06746994704008102, + "receivedSvTimeInNs": 355701358552068, + "receivedSvTimeUncertaintyInNs": 3, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.176450048E9, + "codeType": "Q", + "constellation": 1 + }, + "snrDb": 0.0, + "state": 81935, + "svid": 25, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": -1.95, + "basebandCN0DbHz": 28.700000000000003, + "cN0Dbhz": 33.6, + "carrierCycles": 0, + "carrierFrequencyHz": 1.176450048E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 1, + "flags": 205312, + "fullInterSignalBiasNs": -7869.38037109375, + "fullInterSignalBiasUncertaintyNs": 1.5442157983779907, + "multipathIndicator": 0, + "pseudorangeRateMps": -661.8915405273438, + "pseudorangeRateUncertaintyMps": 0.037614788860082626, + "receivedSvTimeInNs": 355701353227094, + "receivedSvTimeUncertaintyInNs": 5, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.176450048E9, + "codeType": "Q", + "constellation": 1 + }, + "snrDb": 0.0, + "state": 81935, + "svid": 26, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": -1.95, + "basebandCN0DbHz": 30.9, + "cN0Dbhz": 35.8, + "carrierCycles": 0, + "carrierFrequencyHz": 1.176450048E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 1, + "flags": 205312, + "fullInterSignalBiasNs": -7869.38037109375, + "fullInterSignalBiasUncertaintyNs": 1.5442157983779907, + "multipathIndicator": 0, + "pseudorangeRateMps": -184.80030822753906, + "pseudorangeRateUncertaintyMps": 0.06974140554666519, + "receivedSvTimeInNs": 355701357843348, + "receivedSvTimeUncertaintyInNs": 4, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.176450048E9, + "codeType": "Q", + "constellation": 1 + }, + "snrDb": 0.0, + "state": 81935, + "svid": 32, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": -1.95, + "basebandCN0DbHz": 31.800000000000004, + "cN0Dbhz": 36.7, + "carrierCycles": 0, + "carrierFrequencyHz": 1.176450048E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 4, + "flags": 205312, + "fullInterSignalBiasNs": -7869.38037109375, + "fullInterSignalBiasUncertaintyNs": 1.5442157983779907, + "multipathIndicator": 0, + "pseudorangeRateMps": 52.92866897583008, + "pseudorangeRateUncertaintyMps": 0.01873791590332985, + "receivedSvTimeInNs": 355701304146837, + "receivedSvTimeUncertaintyInNs": 3, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.176450048E9, + "codeType": "Q", + "constellation": 4 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 194, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": -1.95, + "basebandCN0DbHz": 32.2, + "cN0Dbhz": 37.1, + "carrierCycles": 0, + "carrierFrequencyHz": 1.176450048E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 4, + "flags": 205312, + "fullInterSignalBiasNs": -7869.38037109375, + "fullInterSignalBiasUncertaintyNs": 1.5442157983779907, + "multipathIndicator": 0, + "pseudorangeRateMps": 91.96581268310547, + "pseudorangeRateUncertaintyMps": 0.022040225565433502, + "receivedSvTimeInNs": 355701307003069, + "receivedSvTimeUncertaintyInNs": 3, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.176450048E9, + "codeType": "Q", + "constellation": 4 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 195, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": -1.95, + "basebandCN0DbHz": 29.499999999999996, + "cN0Dbhz": 34.8, + "carrierCycles": 0, + "carrierFrequencyHz": 1.176450048E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 6, + "flags": 205312, + "fullInterSignalBiasNs": -7870.89208984375, + "fullInterSignalBiasUncertaintyNs": 89.10694885253906, + "multipathIndicator": 0, + "pseudorangeRateMps": -21.62059211730957, + "pseudorangeRateUncertaintyMps": 6.172347068786621, + "receivedSvTimeInNs": 355701347613403, + "receivedSvTimeUncertaintyInNs": 4, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.176450048E9, + "codeType": "Q", + "constellation": 6 + }, + "snrDb": 0.0, + "state": 81935, + "svid": 7, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": -1.95, + "basebandCN0DbHz": 20.0, + "cN0Dbhz": 25.3, + "carrierCycles": 0, + "carrierFrequencyHz": 1.176450048E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 6, + "flags": 205312, + "fullInterSignalBiasNs": -7870.89208984375, + "fullInterSignalBiasUncertaintyNs": 89.10694885253906, + "multipathIndicator": 0, + "pseudorangeRateMps": 456.376953125, + "pseudorangeRateUncertaintyMps": 0.08474752306938171, + "receivedSvTimeInNs": 355701336005530, + "receivedSvTimeUncertaintyInNs": 10, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.176450048E9, + "codeType": "Q", + "constellation": 6 + }, + "snrDb": 0.0, + "state": 81935, + "svid": 13, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": -1.95, + "basebandCN0DbHz": 22.4, + "cN0Dbhz": 27.7, + "carrierCycles": 0, + "carrierFrequencyHz": 1.176450048E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 6, + "flags": 205312, + "fullInterSignalBiasNs": -7870.89208984375, + "fullInterSignalBiasUncertaintyNs": 89.10694885253906, + "multipathIndicator": 0, + "pseudorangeRateMps": 386.13763427734375, + "pseudorangeRateUncertaintyMps": 1.552125096321106, + "receivedSvTimeInNs": 355701341845895, + "receivedSvTimeUncertaintyInNs": 8, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.176450048E9, + "codeType": "Q", + "constellation": 6 + }, + "snrDb": 0.0, + "state": 81935, + "svid": 26, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": -1.95, + "basebandCN0DbHz": 28.599999999999998, + "cN0Dbhz": 33.9, + "carrierCycles": 0, + "carrierFrequencyHz": 1.176450048E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 6, + "flags": 205312, + "fullInterSignalBiasNs": -7870.89208984375, + "fullInterSignalBiasUncertaintyNs": 89.10694885253906, + "multipathIndicator": 0, + "pseudorangeRateMps": -317.6210021972656, + "pseudorangeRateUncertaintyMps": 0.030114788562059402, + "receivedSvTimeInNs": 355701348118675, + "receivedSvTimeUncertaintyInNs": 5, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.176450048E9, + "codeType": "Q", + "constellation": 6 + }, + "snrDb": 0.0, + "state": 81935, + "svid": 27, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": -1.95, + "basebandCN0DbHz": 31.499999999999996, + "cN0Dbhz": 36.8, + "carrierCycles": 0, + "carrierFrequencyHz": 1.176450048E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 6, + "flags": 205312, + "fullInterSignalBiasNs": -7870.89208984375, + "fullInterSignalBiasUncertaintyNs": 89.10694885253906, + "multipathIndicator": 0, + "pseudorangeRateMps": 166.31349182128906, + "pseudorangeRateUncertaintyMps": 0.05023791640996933, + "receivedSvTimeInNs": 355701345936349, + "receivedSvTimeUncertaintyInNs": 3, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.176450048E9, + "codeType": "Q", + "constellation": 6 + }, + "snrDb": 0.0, + "state": 81935, + "svid": 30, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": -1.95, + "basebandCN0DbHz": 19.9, + "cN0Dbhz": 25.2, + "carrierCycles": 0, + "carrierFrequencyHz": 1.176450048E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 6, + "flags": 205312, + "fullInterSignalBiasNs": -7870.89208984375, + "fullInterSignalBiasUncertaintyNs": 89.10694885253906, + "multipathIndicator": 0, + "pseudorangeRateMps": 75.8934097290039, + "pseudorangeRateUncertaintyMps": 0.9278355836868286, + "receivedSvTimeInNs": 355701339144836, + "receivedSvTimeUncertaintyInNs": 11, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.176450048E9, + "codeType": "Q", + "constellation": 6 + }, + "snrDb": 0.0, + "state": 81935, + "svid": 33, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": -1.95, + "basebandCN0DbHz": 32.0, + "cN0Dbhz": 36.5, + "carrierCycles": 0, + "carrierFrequencyHz": 1.176450048E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -7868.33447265625, + "fullInterSignalBiasUncertaintyNs": 90.34577941894531, + "multipathIndicator": 0, + "pseudorangeRateMps": 292.1622619628906, + "pseudorangeRateUncertaintyMps": 0.08804022520780563, + "receivedSvTimeInNs": 355687351131157, + "receivedSvTimeUncertaintyInNs": 3, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.176450048E9, + "codeType": "Q", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 21, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": -1.95, + "basebandCN0DbHz": 28.799999999999997, + "cN0Dbhz": 33.3, + "carrierCycles": 0, + "carrierFrequencyHz": 1.176450048E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -7868.33447265625, + "fullInterSignalBiasUncertaintyNs": 90.34577941894531, + "multipathIndicator": 0, + "pseudorangeRateMps": -192.56417846679688, + "pseudorangeRateUncertaintyMps": 0.10061479359865189, + "receivedSvTimeInNs": 355687355834663, + "receivedSvTimeUncertaintyInNs": 5, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.176450048E9, + "codeType": "Q", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 24, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": -1.95, + "basebandCN0DbHz": 30.299999999999997, + "cN0Dbhz": 34.8, + "carrierCycles": 0, + "carrierFrequencyHz": 1.176450048E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -7868.33447265625, + "fullInterSignalBiasUncertaintyNs": 90.34577941894531, + "multipathIndicator": 0, + "pseudorangeRateMps": 101.06497955322266, + "pseudorangeRateUncertaintyMps": 0.054741404950618744, + "receivedSvTimeInNs": 355687307059854, + "receivedSvTimeUncertaintyInNs": 4, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.176450048E9, + "codeType": "Q", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 39, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": -1.95, + "basebandCN0DbHz": 29.0, + "cN0Dbhz": 33.5, + "carrierCycles": 0, + "carrierFrequencyHz": 1.176450048E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -7868.33447265625, + "fullInterSignalBiasUncertaintyNs": 90.34577941894531, + "multipathIndicator": 0, + "pseudorangeRateMps": -192.5506591796875, + "pseudorangeRateUncertaintyMps": 0.06847423315048218, + "receivedSvTimeInNs": 355687355136230, + "receivedSvTimeUncertaintyInNs": 4, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.176450048E9, + "codeType": "Q", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 42, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.23, + "basebandCN0DbHz": 40.3, + "cN0Dbhz": 47.3, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1482.304931640625, + "fullInterSignalBiasUncertaintyNs": 88.98330688476562, + "multipathIndicator": 0, + "pseudorangeRateMps": 292.1517639160156, + "pseudorangeRateUncertaintyMps": 0.05100664123892784, + "receivedSvTimeInNs": 355687351124761, + "receivedSvTimeUncertaintyInNs": 2, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "P", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 21, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.23, + "basebandCN0DbHz": 35.1, + "cN0Dbhz": 42.1, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1482.304931640625, + "fullInterSignalBiasUncertaintyNs": 88.98330688476562, + "multipathIndicator": 0, + "pseudorangeRateMps": -192.5623779296875, + "pseudorangeRateUncertaintyMps": 0.05930919572710991, + "receivedSvTimeInNs": 355687355828261, + "receivedSvTimeUncertaintyInNs": 2, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "P", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 24, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.23, + "basebandCN0DbHz": 34.8, + "cN0Dbhz": 41.8, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1482.304931640625, + "fullInterSignalBiasUncertaintyNs": 88.98330688476562, + "multipathIndicator": 0, + "pseudorangeRateMps": 101.08654022216797, + "pseudorangeRateUncertaintyMps": 0.09289910644292831, + "receivedSvTimeInNs": 355687307053459, + "receivedSvTimeUncertaintyInNs": 2, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "P", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 39, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.23, + "basebandCN0DbHz": 22.4, + "cN0Dbhz": 29.4, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1482.304931640625, + "fullInterSignalBiasUncertaintyNs": 88.98330688476562, + "multipathIndicator": 0, + "pseudorangeRateMps": -188.5292510986328, + "pseudorangeRateUncertaintyMps": 3.4898383617401123, + "receivedSvTimeInNs": 355687292934993, + "receivedSvTimeUncertaintyInNs": 8, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "P", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 40, + "timeOffsetNs": 0.0 + }, + { + "accumulatedDeltaRangeM": 0.0, + "accumulatedDeltaRangeState": 16, + "accumulatedDeltaRangeUncertaintyM": 0.0, + "agcLevelDb": 11.23, + "basebandCN0DbHz": 37.1, + "cN0Dbhz": 44.1, + "carrierCycles": 0, + "carrierFrequencyHz": 1.575420032E9, + "carrierPhase": 0.0, + "carrierPhaseUncertainty": 0.0, + "constellation": 5, + "flags": 205312, + "fullInterSignalBiasNs": -1482.304931640625, + "fullInterSignalBiasUncertaintyNs": 88.98330688476562, + "multipathIndicator": 0, + "pseudorangeRateMps": -192.5023651123047, + "pseudorangeRateUncertaintyMps": 0.0582054927945137, + "receivedSvTimeInNs": 355687355129877, + "receivedSvTimeUncertaintyInNs": 2, + "satelliteInterSignalBiasNs": 0.0, + "satelliteInterSignalBiasUncertaintyNs": 0.0, + "signalType": { + "carrierFrequencyHz": 1.575420032E9, + "codeType": "P", + "constellation": 5 + }, + "snrDb": 0.0, + "state": 16399, + "svid": 42, + "timeOffsetNs": 0.0 + } + ], + "timestampMs": 1763606884503 +} diff --git a/aosp/hardware/interfaces/gnss/common/utils/default/GnssRawMeasurementParser.cpp b/aosp/hardware/interfaces/gnss/common/utils/default/GnssRawMeasurementParser.cpp new file mode 100644 index 000000000..dab1d8f5d --- /dev/null +++ b/aosp/hardware/interfaces/gnss/common/utils/default/GnssRawMeasurementParser.cpp @@ -0,0 +1,311 @@ +/* + * Copyright (C) 2021 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. + */ + +#include "GnssRawMeasurementParser.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace common { + +using aidl::android::hardware::gnss::ElapsedRealtime; +using aidl::android::hardware::gnss::GnssClock; +using aidl::android::hardware::gnss::GnssConstellationType; +using aidl::android::hardware::gnss::GnssData; +using aidl::android::hardware::gnss::GnssMeasurement; +using aidl::android::hardware::gnss::GnssMultipathIndicator; +using aidl::android::hardware::gnss::GnssSignalType; + +using ParseUtils = ::android::hardware::gnss::common::ParseUtils; + +std::unordered_map GnssRawMeasurementParser::getColumnIdNameMappingFromHeader( + const std::string& header) { + std::vector columnNames; + std::unordered_map columnNameIdMapping; + std::string s = header; + // Trim left spaces + s.erase(s.begin(), + std::find_if(s.begin(), s.end(), [](unsigned char ch) { return !std::isspace(ch); })); + // Trim right spaces + s.erase(std::find_if(s.rbegin(), s.rend(), [](unsigned char ch) { return !std::isspace(ch); }) + .base(), + s.end()); + // Find the start position of "Raw", in case the header contains extra comments. + size_t rawPos = s.find("Raw"); + if (rawPos == std::string::npos) { + ALOGE("Invalid header: %s", header.c_str()); + return columnNameIdMapping; + } + // Remove comment symbol, start from `Raw`. + s = s.substr(rawPos); + + ParseUtils::splitStr(s, COMMA_SEPARATOR, columnNames); + int columnId = 0; + for (auto& name : columnNames) { + columnNameIdMapping[name] = columnId++; + } + + return columnNameIdMapping; +} + +int GnssRawMeasurementParser::getClockFlags( + const std::vector& rawMeasurementRecordValues, + const std::unordered_map& columnNameIdMapping) { + int clockFlags = 0; + if (!rawMeasurementRecordValues[columnNameIdMapping.at("LeapSecond")].empty()) { + clockFlags |= GnssClock::HAS_LEAP_SECOND; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("FullBiasNanos")].empty()) { + clockFlags |= GnssClock::HAS_FULL_BIAS; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("BiasNanos")].empty()) { + clockFlags |= GnssClock::HAS_BIAS; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("BiasUncertaintyNanos")].empty()) { + clockFlags |= GnssClock::HAS_BIAS_UNCERTAINTY; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("DriftNanosPerSecond")].empty()) { + clockFlags |= GnssClock::HAS_DRIFT; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("DriftUncertaintyNanosPerSecond")] + .empty()) { + clockFlags |= GnssClock::HAS_DRIFT_UNCERTAINTY; + } + return clockFlags; +} + +int GnssRawMeasurementParser::getElapsedRealtimeFlags( + const std::vector& rawMeasurementRecordValues, + const std::unordered_map& columnNameIdMapping) { + int elapsedRealtimeFlags = ElapsedRealtime::HAS_TIMESTAMP_NS; + if (!rawMeasurementRecordValues[columnNameIdMapping.at("TimeUncertaintyNanos")].empty()) { + elapsedRealtimeFlags |= ElapsedRealtime::HAS_TIME_UNCERTAINTY_NS; + } + return elapsedRealtimeFlags; +} + +int GnssRawMeasurementParser::getRawMeasurementFlags( + const std::vector& rawMeasurementRecordValues, + const std::unordered_map& columnNameIdMapping) { + int rawMeasurementFlags = 0; + if (!rawMeasurementRecordValues[columnNameIdMapping.at("SnrInDb")].empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_SNR; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("CarrierFrequencyHz")].empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_CARRIER_FREQUENCY; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("CarrierCycles")].empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_CARRIER_CYCLES; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("CarrierPhase")].empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_CARRIER_PHASE; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("CarrierPhaseUncertainty")].empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_CARRIER_PHASE_UNCERTAINTY; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("AgcDb")].empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_AUTOMATIC_GAIN_CONTROL; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("FullInterSignalBiasNanos")].empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_FULL_ISB; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("FullInterSignalBiasUncertaintyNanos")] + .empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_FULL_ISB_UNCERTAINTY; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("SatelliteInterSignalBiasNanos")] + .empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_SATELLITE_ISB; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at( + "SatelliteInterSignalBiasUncertaintyNanos")] + .empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_SATELLITE_ISB_UNCERTAINTY; + } + // HAS_SATELLITE_PVT and HAS_CORRELATION_VECTOR fields currently not in rawmeasurement + // output, need add them later. + return rawMeasurementFlags; +} + +GnssConstellationType GnssRawMeasurementParser::getGnssConstellationType(int constellationType) { + GnssConstellationType gnssConstellationType = + aidl::android::hardware::gnss::GnssConstellationType::UNKNOWN; + + switch (constellationType) { + case 1: + gnssConstellationType = aidl::android::hardware::gnss::GnssConstellationType::GPS; + break; + case 2: + gnssConstellationType = aidl::android::hardware::gnss::GnssConstellationType::SBAS; + break; + case 3: + gnssConstellationType = aidl::android::hardware::gnss::GnssConstellationType::GLONASS; + break; + case 4: + gnssConstellationType = aidl::android::hardware::gnss::GnssConstellationType::QZSS; + break; + case 5: + gnssConstellationType = aidl::android::hardware::gnss::GnssConstellationType::BEIDOU; + break; + case 6: + gnssConstellationType = aidl::android::hardware::gnss::GnssConstellationType::GALILEO; + break; + default: + gnssConstellationType = aidl::android::hardware::gnss::GnssConstellationType::UNKNOWN; + } + + return gnssConstellationType; +} + +std::unique_ptr GnssRawMeasurementParser::getMeasurementFromStrs( + std::string& rawMeasurementStr) { + /* + * Raw,utcTimeMillis,TimeNanos,LeapSecond,TimeUncertaintyNanos,FullBiasNanos,BiasNanos, + * BiasUncertaintyNanos,DriftNanosPerSecond,DriftUncertaintyNanosPerSecond, + * HardwareClockDiscontinuityCount,Svid,TimeOffsetNanos,State,ReceivedSvTimeNanos, + * ReceivedSvTimeUncertaintyNanos,Cn0DbHz,PseudorangeRateMetersPerSecond, + * PseudorangeRateUncertaintyMetersPerSecond,AccumulatedDeltaRangeState, + * AccumulatedDeltaRangeMeters,AccumulatedDeltaRangeUncertaintyMeters,CarrierFrequencyHz, + * CarrierCycles,CarrierPhase,CarrierPhaseUncertainty,MultipathIndicator,SnrInDb, + * ConstellationType,AgcDb,BasebandCn0DbHz,FullInterSignalBiasNanos, + * FullInterSignalBiasUncertaintyNanos,SatelliteInterSignalBiasNanos, + * SatelliteInterSignalBiasUncertaintyNanos,CodeType,ChipsetElapsedRealtimeNanos + */ + ALOGD("Parsing %zu bytes rawMeasurementStr.", rawMeasurementStr.size()); + if (rawMeasurementStr.empty()) { + return nullptr; + } + std::vector rawMeasurementStrRecords; + ParseUtils::splitStr(rawMeasurementStr, LINE_SEPARATOR, rawMeasurementStrRecords); + if (rawMeasurementStrRecords.size() <= 1) { + ALOGE("Raw GNSS Measurements parser failed. (No records) "); + return nullptr; + } + + // Get the column name mapping from the header. + std::unordered_map columnNameIdMapping = + getColumnIdNameMappingFromHeader(rawMeasurementStrRecords[0]); + + if (columnNameIdMapping.size() < 37 || !ParseUtils::isValidHeader(columnNameIdMapping)) { + ALOGE("Raw GNSS Measurements parser failed. (No header or missing columns.) "); + return nullptr; + } + + // Set GnssClock from 1st record. + std::size_t pointer = 1; + std::vector firstRecordValues; + ParseUtils::splitStr(rawMeasurementStrRecords[pointer], COMMA_SEPARATOR, firstRecordValues); + GnssClock clock = { + .gnssClockFlags = getClockFlags(firstRecordValues, columnNameIdMapping), + .timeNs = ParseUtils::tryParseLongLong( + firstRecordValues[columnNameIdMapping.at("TimeNanos")], 0), + .fullBiasNs = ParseUtils::tryParseLongLong( + firstRecordValues[columnNameIdMapping.at("FullBiasNanos")], 0), + .biasNs = ParseUtils::tryParseDouble( + firstRecordValues[columnNameIdMapping.at("BiasNanos")], 0), + .biasUncertaintyNs = ParseUtils::tryParseDouble( + firstRecordValues[columnNameIdMapping.at("BiasUncertaintyNanos")], 0), + .driftNsps = ParseUtils::tryParseDouble( + firstRecordValues[columnNameIdMapping.at("DriftNanosPerSecond")], 0), + .driftUncertaintyNsps = ParseUtils::tryParseDouble( + firstRecordValues[columnNameIdMapping.at("DriftNanosPerSecond")], 0), + .hwClockDiscontinuityCount = ParseUtils::tryParseInt( + firstRecordValues[columnNameIdMapping.at("HardwareClockDiscontinuityCount")], + 0)}; + + ElapsedRealtime timestamp = { + .flags = getElapsedRealtimeFlags(firstRecordValues, columnNameIdMapping), + .timestampNs = ParseUtils::tryParseLongLong( + firstRecordValues[columnNameIdMapping.at("ChipsetElapsedRealtimeNanos")]), + .timeUncertaintyNs = ParseUtils::tryParseDouble( + firstRecordValues[columnNameIdMapping.at("TimeUncertaintyNanos")], 0)}; + + std::vector measurementsVec; + for (pointer = 1; pointer < rawMeasurementStrRecords.size(); pointer++) { + std::vector rawMeasurementValues; + std::string line = rawMeasurementStrRecords[pointer]; + ParseUtils::splitStr(line, COMMA_SEPARATOR, rawMeasurementValues); + GnssSignalType signalType = { + .constellation = getGnssConstellationType(ParseUtils::tryParseInt( + rawMeasurementValues[columnNameIdMapping.at("ConstellationType")], 0)), + .carrierFrequencyHz = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at("CarrierFrequencyHz")], 0), + .codeType = rawMeasurementValues[columnNameIdMapping.at("CodeType")], + }; + GnssMeasurement measurement = { + .flags = getRawMeasurementFlags(rawMeasurementValues, columnNameIdMapping), + .svid = ParseUtils::tryParseInt( + rawMeasurementValues[columnNameIdMapping.at("Svid")], 0), + .signalType = signalType, + .receivedSvTimeInNs = ParseUtils::tryParseLongLong( + rawMeasurementValues[columnNameIdMapping.at("ReceivedSvTimeNanos")], 0), + .receivedSvTimeUncertaintyInNs = + ParseUtils::tryParseLongLong(rawMeasurementValues[columnNameIdMapping.at( + "ReceivedSvTimeUncertaintyNanos")], + 0), + .antennaCN0DbHz = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at("Cn0DbHz")], 0), + .basebandCN0DbHz = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at("BasebandCn0DbHz")], 0), + .agcLevelDb = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at("AgcDb")], 0), + .pseudorangeRateMps = + ParseUtils::tryParseDouble(rawMeasurementValues[columnNameIdMapping.at( + "PseudorangeRateMetersPerSecond")], + 0), + .pseudorangeRateUncertaintyMps = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at( + "PseudorangeRateUncertaintyMetersPerSecond")], + 0), + .accumulatedDeltaRangeState = ParseUtils::tryParseInt( + rawMeasurementValues[columnNameIdMapping.at("AccumulatedDeltaRangeState")], + 0), + .accumulatedDeltaRangeM = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at("AccumulatedDeltaRangeMeters")], + 0), + .accumulatedDeltaRangeUncertaintyM = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at( + "AccumulatedDeltaRangeUncertaintyMeters")], + 0), + .multipathIndicator = GnssMultipathIndicator::UNKNOWN, // Not in GnssLogger yet. + .state = ParseUtils::tryParseInt( + rawMeasurementValues[columnNameIdMapping.at("State")], 0), + .fullInterSignalBiasNs = ParseUtils::tryParseDouble(rawMeasurementValues[31], 0), + .fullInterSignalBiasUncertaintyNs = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at("FullInterSignalBiasNanos")], + 0), + .satelliteInterSignalBiasNs = + ParseUtils::tryParseDouble(rawMeasurementValues[columnNameIdMapping.at( + "SatelliteInterSignalBiasNanos")], + 0), + .satelliteInterSignalBiasUncertaintyNs = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at( + "SatelliteInterSignalBiasUncertaintyNanos")], + 0), + .satellitePvt = {}, + .correlationVectors = {}}; + measurementsVec.push_back(measurement); + } + + GnssData gnssData = { + .measurements = measurementsVec, .clock = clock, .elapsedRealtime = timestamp}; + return std::make_unique(gnssData); +} + +} // namespace common +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/aosp/hardware/interfaces/gnss/common/utils/default/GnssReplayUtils.cpp b/aosp/hardware/interfaces/gnss/common/utils/default/GnssReplayUtils.cpp new file mode 100644 index 000000000..b86c9f386 --- /dev/null +++ b/aosp/hardware/interfaces/gnss/common/utils/default/GnssReplayUtils.cpp @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2021 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. + */ + +#include "GnssReplayUtils.h" + +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace common { + +std::string ReplayUtils::getGnssPath() { + std::array devname_value; + + // Get VmiGnss's location unique fifo path + devname_value.fill(0); + if (property_get("com.location.gnss.filepath", devname_value.begin(), NULL) > 0) { + return devname_value.begin(); + } + + // Get VmiGnss's location/measurement shared fifo path + devname_value.fill(0); + if (property_get("com.vendor.gnss.filepath", devname_value.begin(), NULL) > 0) { + return devname_value.begin(); + } + + devname_value.fill(0); + if (property_get("debug.location.gnss.devname", devname_value.begin(), NULL) > 0) { + return devname_value.begin(); + } + + devname_value.fill(0); + if (property_get("vendor.ser.gnss-uart", devname_value.begin(), NULL) > 0) { + return devname_value.begin(); + } + + return GNSS_PATH; +} + +std::string ReplayUtils::getFixedLocationPath() { + std::array devname_value; + + // Get VmiGnss's measurement unique fifo path + devname_value.fill(0); + if (property_get("com.location.fixedlocation.filepath", devname_value.begin(), NULL) > 0) { + return devname_value.begin(); + } + + // Get VmiGnss's location/measurement shared fifo path + devname_value.fill(0); + if (property_get("com.vendor.gnss.filepath", devname_value.begin(), NULL) > 0) { + return devname_value.begin(); + } + + devname_value.fill(0); + if (property_get("debug.location.fixedlocation.devname", devname_value.begin(), NULL) > 0) { + return devname_value.begin(); + } + + devname_value.fill(0); + if (property_get("vendor.ser.gnss-uart", devname_value.begin(), NULL) > 0) { + return devname_value.begin(); + } + + return FIXED_LOCATION_PATH; +} + +bool ReplayUtils::hasGnssDeviceFile() { + struct stat sb; + return stat(getGnssPath().c_str(), &sb) != -1; +} + +bool ReplayUtils::hasFixedLocationDeviceFile() { + struct stat sb; + return stat(getFixedLocationPath().c_str(), &sb) != -1; +} + +bool ReplayUtils::isGnssRawMeasurement(const std::string& inputStr) { + // TODO: add more logic check to by pass invalid data. + return !inputStr.empty() && (inputStr.find("Raw") != std::string::npos); +} + +bool ReplayUtils::isNMEA(const std::string& inputStr) { + return !inputStr.empty() && (inputStr.find("$GPRMC,", 0) != std::string::npos || + inputStr.find("$GPGGA,", 0) != std::string::npos); +} + +} // namespace common +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/aosp/vendor/common/prebuild/Android.bp b/aosp/vendor/common/prebuild/Android.bp index 95cd45540..80fc7a668 100644 --- a/aosp/vendor/common/prebuild/Android.bp +++ b/aosp/vendor/common/prebuild/Android.bp @@ -51,3 +51,50 @@ cc_prebuilt_library_shared { "libpng", ], } + +cc_prebuilt_library_shared { + name: "vmi-gnss-service-aidl-V2-ndk", + vendor: true, + arch: { + arm: { + srcs: ["system/lib64/vmi-gnss-service-aidl-V2-ndk.so"], + }, + arm64: { + srcs: ["system/lib64/vmi-gnss-service-aidl-V2-ndk.so"], + }, + }, + compile_multilib: "both", + check_elf_files: false, +} + +cc_prebuilt_library_shared { + name: "libvmignss", + vendor: true, + arch: { + arm: { + srcs: ["system/lib64/libvmignss.so"], + }, + arm64: { + srcs: ["system/lib64/libvmignss.so"], + }, + }, + compile_multilib: "both", + check_elf_files: false, + export_include_dirs: ["include"], + shared_libs: [ + "libcutils", + "liblog", + "libutils", + "libhidlbase", + "libbinder_ndk", + "libxml2", + "libjsoncpp", + "android.hardware.gnss-V4-ndk", + "vmi-gnss-service-aidl-V2-ndk", + ], + export_shared_lib_headers: [ + "libxml2", + "libjsoncpp", + "vmi-gnss-service-aidl-V2-ndk", + ], +} diff --git a/aosp/vendor/common/prebuild/include/PacketQueue.h b/aosp/vendor/common/prebuild/include/PacketQueue.h deleted file mode 100644 index bc7ee0faf..000000000 --- a/aosp/vendor/common/prebuild/include/PacketQueue.h +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2025-2025. All rights reserved. - * Description: VmiAgent接收队列的包装类,带有退出机制避免锁销毁后访问 - */ - -#ifndef PACKET_QUEUE_H -#define PACKET_QUEUE_H - -#include -#include -#include -#include -#include -#include - -namespace android { - -constexpr static uint32_t PUBLIC_QUEUE_ID = 0xFF; - -class PacketQueue { -private: - // 包装缓冲区及其大小的结构体 - struct BufferWithSize { - std::unique_ptr buffer; - size_t size; - }; - -public: - PacketQueue() : m_running(true) {} - ~PacketQueue() { - // 析构时设置退出标志并唤醒所有等待线程 - stop(); - } - - // 禁止拷贝和移动,避免锁和条件变量的不安全操作 - PacketQueue(const PacketQueue&) = delete; - PacketQueue& operator=(const PacketQueue&) = delete; - PacketQueue(PacketQueue&&) = delete; - PacketQueue& operator=(PacketQueue&&) = delete; - - // 入队操作 - 保存缓冲区大小 - // 当队列已停止时,忽略入队操作 - void enqueue(std::unique_ptr buffer, size_t size) { - std::lock_guard lock(m_mutex); - if (m_running) { // 只有运行中才处理入队 - m_queue.push({std::move(buffer), size}); - m_cond.notify_one(); - } - } - - // 出队操作(阻塞模式) - 返回缓冲区大小 - // 当队列已停止时,返回空指针 - std::unique_ptr dequeue(size_t& outSize) { - std::unique_lock lock(m_mutex); - // 等待队列非空或已停止 - m_cond.wait(lock, [this] { return !m_queue.empty() || !m_running; }); - - // 如果队列已停止,直接返回空 - if (!m_running) { - outSize = 0; - return nullptr; - } - - auto item = std::move(m_queue.front()); - m_queue.pop(); - outSize = item.size; - return std::move(item.buffer); - } - - // 出队操作(带超时) - 返回缓冲区大小 - // 当队列已停止时,返回空指针 - std::unique_ptr dequeue(size_t& outSize, std::chrono::milliseconds timeout) { - std::unique_lock lock(m_mutex); - // 等待队列非空、已停止或超时 - if (!m_cond.wait_for(lock, timeout, [this] { return !m_queue.empty() || !m_running; })) { - outSize = 0; - return nullptr; // 超时 - } - - // 如果队列已停止,直接返回空 - if (!m_running) { - outSize = 0; - return nullptr; - } - - auto item = std::move(m_queue.front()); - m_queue.pop(); - outSize = item.size; - return std::move(item.buffer); - } - - // 停止队列,唤醒所有等待线程,后续操作将被忽略 - void stop() { - std::lock_guard lock(m_mutex); - if (m_running) { - m_running = false; - m_cond.notify_all(); // 唤醒所有等待的线程 - } - } - - // 清空队列内容 - void clear() { - std::lock_guard lock(m_mutex); - while (!m_queue.empty()) { - m_queue.pop(); - } - m_cond.notify_all(); // 唤醒所有等待的线程 - } - - // 检查队列是否为空 - bool empty() const { - std::lock_guard lock(m_mutex); - return m_queue.empty(); - } - - // 获取队列大小 - size_t size() const { - std::lock_guard lock(m_mutex); - return m_queue.size(); - } - -private: - std::queue m_queue; - mutable std::mutex m_mutex; // mutable允许在const函数中加锁 - std::condition_variable m_cond; // 条件变量用于等待/通知机制 - bool m_running; // 运行状态标志,控制队列生命周期 -}; - -} // namespace android - -#endif // PACKET_QUEUE_H - diff --git a/aosp/vendor/common/prebuild/include/VmiAgent.h b/aosp/vendor/common/prebuild/include/VmiAgent.h index b2223e5e9..7e43e9e23 100644 --- a/aosp/vendor/common/prebuild/include/VmiAgent.h +++ b/aosp/vendor/common/prebuild/include/VmiAgent.h @@ -14,7 +14,6 @@ #include #include #include "VmiMsgHeader.h" -#include "PacketQueue.h" namespace android { @@ -27,34 +26,6 @@ public: ~VmiAgent(); int Init(const std::string&); static std::shared_ptr GetInstance(); - std::unique_ptr WaitForMessage(int id, MsgType type, size_t& size, int32_t timeout = 5000); - int Write(const uint8_t* buffer, size_t size); - void InitQueue(int, MsgType); - void EnQueue(int, MsgType, std::unique_ptr, size_t); - int GetClientNum() { return m_clientNum.load(); } - -private: - void StateHandler(const std::string&); - void IOThread(); - int InitServerFd(); - uint64_t GetCurrentTimeMs(); - void ProcessData(); - int Read(uint8_t *buffer, size_t size); - - std::string m_unixSocketName; - std::mutex m_lock; - std::thread* m_ioThread{nullptr}; - std::atomic_bool m_threadRun{false}; - std::atomic_bool m_connected{false}; - std::atomic_int_fast32_t m_clientNum{0}; - int m_serverFd{-1}; - int m_clientFd{-1}; - std::atomic_uint_fast64_t m_lastTime{0}; - std::atomic_uint_fast32_t m_messageCount{0}; - static std::shared_ptr g_instance; - static std::mutex g_instanceLock; - std::map, PacketQueue> m_packetMap; - std::mutex m_packetMapLock; }; } diff --git a/aosp/vendor/common/prebuild/include/VmiCamera.h b/aosp/vendor/common/prebuild/include/VmiCamera.h index faa2dbb85..906c7b48f 100644 --- a/aosp/vendor/common/prebuild/include/VmiCamera.h +++ b/aosp/vendor/common/prebuild/include/VmiCamera.h @@ -9,6 +9,8 @@ #include #include +#include "VmiCameraHeader.h" + namespace android { class VmiCamera { diff --git a/aosp/vendor/common/prebuild/include/VmiCameraHeader.h b/aosp/vendor/common/prebuild/include/VmiCameraHeader.h new file mode 100644 index 000000000..44240c812 --- /dev/null +++ b/aosp/vendor/common/prebuild/include/VmiCameraHeader.h @@ -0,0 +1,205 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2025-2025. All rights reserved. + * Description: VMi消息头定义 + */ + +#ifndef VMI_CAMERA_HEADER_H +#define VMI_CAMERA_HEADER_H + +#include +#include +#include +#include +#include + +#include "VmiMsgHeader.h" + +namespace android { + +const uint16_t DEV_OPT_CAMERA_GET_PARAM_REQ = 0x1; +const uint16_t DEV_OPT_CAMERA_GET_PARAM_RSP = 0x1001; +const uint16_t DEV_OPT_CAMERA_SET_PARAM_REQ = 0x2; +const uint16_t DEV_OPT_CAMERA_SET_PARAM_RSP = 0x1002; +const uint16_t DEV_OPT_CAMERA_GET_INFO_REQ = 0x3; +const uint16_t DEV_OPT_CAMERA_GET_INFO_RSP = 0x1003; +const uint16_t DEV_OPT_CAMERA_START_PREVIEW_REQ = 0x4; +const uint16_t DEV_OPT_CAMERA_START_PREVIEW_RSP = 0x1004; +const uint16_t DEV_OPT_CAMERA_STOP_PREVIEW_REQ = 0x5; +const uint16_t DEV_OPT_CAMERA_STOP_PREVIEW_RSP = 0x1005; +const uint16_t DEV_OPT_CAMERA_USE_FORMAT_REQ = 0x6; +const uint16_t DEV_OPT_CAMERA_USE_FORMAT_RSP = 0x1006; +const uint16_t DEV_OPT_CAMERA_GET_SIZE_REQ = 0x7; +const uint16_t DEV_OPT_CAMERA_GET_SIZE_RSP = 0x1007; +const uint16_t DEV_OPT_CAMERA_FRAME = 0x8; + +// 摄像头帧数据的类型 +const uint8_t VMI_CAMERA_FORMAT_H264 = 0x01; +const uint8_t VMI_CAMERA_FORMAT_JPEG = 0x02; +const uint8_t VMI_CAMERA_FORMAT_I420 = 0x03; +const uint8_t VMI_CAMERA_FORMAT_LOCAL = 0x04; +const uint8_t VMI_CAMERA_FORMAT_INVALID = 0xFF; + +struct DEV_CAMERA_START_REVIEW_REQ : public DEV_VMI_HEADER { + uint16_t width; + uint16_t height; + uint16_t fps; + DEV_CAMERA_START_REVIEW_REQ() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_CAMERA_START_PREVIEW_REQ); + this->devType = htons(0x1); + this->len = htonl(sizeof(struct DEV_VMI_HEADER) + sizeof(uint16_t)*3); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + this->width = htons(640); //default value; + this->height = htons(480); //default value; + this->fps = htons(30); //default value; + } +} __attribute__((packed)); + +struct DEV_CAMERA_START_REVIEW_RSP : public DEV_VMI_HEADER { + DEV_CAMERA_START_REVIEW_RSP() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_CAMERA_START_PREVIEW_RSP); + this->devType = htons(0x1); + this->len = htonl(sizeof(struct DEV_VMI_HEADER) + sizeof(uint16_t)); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } + uint16_t result; +} __attribute__((packed)); + +struct DEV_CAMERA_STOP_REVIEW_REQ : public DEV_VMI_HEADER { + DEV_CAMERA_STOP_REVIEW_REQ() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_CAMERA_STOP_PREVIEW_REQ); + this->devType = htons(0x1); + this->len = htonl(sizeof(struct DEV_VMI_HEADER)); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } +} __attribute__((packed)); + +struct DEV_CAMERA_STOP_REVIEW_RSP : public DEV_VMI_HEADER { + DEV_CAMERA_STOP_REVIEW_RSP() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_CAMERA_STOP_PREVIEW_RSP); + this->devType = htons(0x1); + this->len = htonl(sizeof(struct DEV_VMI_HEADER) + sizeof(uint16_t)); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } + uint16_t result; +} __attribute__((packed)); + +struct DEV_CAMERA_GET_PARAM_REQ : public DEV_VMI_HEADER { + DEV_CAMERA_GET_PARAM_REQ() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_CAMERA_GET_PARAM_REQ); + this->devType = htons(0x1); + this->len = htonl(sizeof(struct DEV_VMI_HEADER)); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } +} __attribute__((packed)); + +struct DEV_CAMERA_GET_PARAM_RSP_DATA { + uint16_t result; + uint8_t data[0]; +} __attribute__((packed)); + +struct DEV_CAMERA_GET_PARAM_RSP : public DEV_VMI_HEADER { + DEV_CAMERA_GET_PARAM_RSP() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_CAMERA_GET_PARAM_RSP); + this->devType = htons(0x1); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } + struct DEV_CAMERA_GET_PARAM_RSP_DATA* rspData; +} __attribute__((packed)); + +struct DEV_CAMERA_GET_INFO_REQ : public DEV_VMI_HEADER { + DEV_CAMERA_GET_INFO_REQ() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_CAMERA_GET_INFO_REQ); + this->devType = htons(0x1); + this->len = htonl(sizeof(struct DEV_VMI_HEADER)); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } +} __attribute__((packed)); + +struct DEV_CAMERA_GET_INFO_RSP_DATA { + uint16_t result; + uint8_t facing; + uint16_t orientation; + +} __attribute__((packed)); + +struct DEV_CAMERA_GET_INFO_RSP : public DEV_VMI_HEADER { + DEV_CAMERA_GET_INFO_RSP() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_CAMERA_GET_INFO_RSP); + this->devType = htons(0x1); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } + struct DEV_CAMERA_GET_INFO_RSP_DATA* rspData; +} __attribute__((packed)); + +struct DEV_CAMERA_GET_SIZE_REQ : public DEV_VMI_HEADER { + DEV_CAMERA_GET_SIZE_REQ() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_CAMERA_GET_SIZE_REQ); + this->devType = htons(0x1); + this->len = htonl(sizeof(struct DEV_VMI_HEADER)); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } +} __attribute__((packed)); + +struct DEV_CAMERA_GET_SIZE_RSP_DATA { + uint16_t result; + uint16_t width; + uint16_t height; + +} __attribute__((packed)); + +struct DEV_CAMERA_GET_SIZE_RSP : public DEV_VMI_HEADER { + DEV_CAMERA_GET_SIZE_RSP() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_CAMERA_GET_SIZE_RSP); + this->devType = htons(0x1); + this->len = htonl(sizeof(struct DEV_VMI_HEADER) + sizeof(struct DEV_CAMERA_GET_SIZE_RSP_DATA)); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } + struct DEV_CAMERA_GET_SIZE_RSP_DATA* rspData; +} __attribute__((packed)); + +struct DEV_CAMERA_SET_PARAM_REQ : public DEV_VMI_HEADER { + uint8_t data[0]; + + DEV_CAMERA_SET_PARAM_REQ() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_CAMERA_SET_PARAM_REQ); + this->devType = htons(0x1); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } +} __attribute__((packed)); + +} + +#endif diff --git a/aosp/vendor/common/prebuild/include/VmiGnss.h b/aosp/vendor/common/prebuild/include/VmiGnss.h new file mode 100644 index 000000000..406a64d9b --- /dev/null +++ b/aosp/vendor/common/prebuild/include/VmiGnss.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2025-2025. All rights reserved. + * Description: VmiGnss 虚拟Gnss定位实现单例 + */ + +#ifndef VMI_GNSS_H +#define VMI_GNSS_H + +#include +#include +#include + +#include +#include + +#include "VmiGnssHeader.h" + +namespace android { + +namespace gnss { + +using aidl::android::hardware::gnss::GnssData; +using aidl::android::hardware::gnss::GnssLocation; +using GnssSvInfo = aidl::android::hardware::gnss::IGnssCallback::GnssSvInfo; + +class VmiGnss { +public: + ~VmiGnss(); + VmiGnss(const VmiGnss&) = delete; + VmiGnss& operator=(const VmiGnss&) = delete; + VmiGnss(VmiGnss&&) = delete; + VmiGnss& operator=(VmiGnss&&) = delete; + + static std::shared_ptr GetInstance(); + +public: + int StartLocation(); + int StopLocation(); + int StartMeasurement(); + int StopMeasurement(); + + std::unique_ptr GetLocation(); + std::unique_ptr GetMeasurementData(); + std::unique_ptr> GetSvInfoList(); + + void SetFifoLocation(std::unique_ptr fifoLoc); + void SetFifoMeasurement(std::unique_ptr fifoMeasurement); +}; + +} // namespace gnss + +} // namespace android + +#endif //VMI_GNSS_H diff --git a/aosp/vendor/common/prebuild/include/VmiGnssHeader.h b/aosp/vendor/common/prebuild/include/VmiGnssHeader.h new file mode 100644 index 000000000..6056747db --- /dev/null +++ b/aosp/vendor/common/prebuild/include/VmiGnssHeader.h @@ -0,0 +1,321 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2025-2025. All rights reserved. + * Description: VmiLocation消息头定义 + */ + +#ifndef VMI_LOCATION_HEADER_H +#define VMI_LOCATION_HEADER_H + +#include "VmiMsgHeader.h" + +namespace android { + +namespace gnss { + +const MsgType DEV_OPT_GNSS_LOCATION_START_REQ = 0x0; +const MsgType DEV_OPT_GNSS_LOCATION_STOP_REQ = 0X1; +const MsgType DEV_OPT_GNSS_LOCATION_DATA_REQ = 0x2; +const MsgType DEV_OPT_GNSS_MEASUREMENT_START_REQ = 0x3; +const MsgType DEV_OPT_GNSS_MEASUREMENT_STOP_REQ = 0x4; +const MsgType DEV_OPT_GNSS_MEASUREMENT_DATA_REQ = 0x5; + +const MsgType DEV_OPT_GNSS_LOCATION_DATA_LIST_REQ = 0x6; +const MsgType DEV_OPT_GNSS_TRAJECTORY_FILE_ADD_REQ = 0x7; +const MsgType DEV_OPT_GNSS_TRAJECTORY_FILE_DEL_REQ = 0x8; +const MsgType DEV_OPT_GNSS_MEASUREMENT_DATA_LIST_REQ = 0x9; +const MsgType DEV_OPT_GNSS_MEASUREMENT_FILE_SET_REQ = 0x10; + +const MsgType DEV_OPT_GNSS_VERSION_RESPONSE = 0x100; +const MsgType DEV_OPT_GNSS_DATA_RESPONSE = 0x101; + +const uint8_t MEASUREMENTS_MAX_NUM = 64; + +const DevId GNSS_LOCATION = 0x0; +const DevId GNSS_MEASUREMENT = 0x1; +const DevId GNSS_GPX = 0x2; + +const uint16_t DEV_LOCATION = 0x4; + +enum VmiGnssErrors { + GNSS_SUCCESS = 0, + GNSS_DISABLED, + GNSS_RESPONSE_TIME_OUT, + GNSS_RESPONSE_NO_DATA, + GNSS_RESPONSE_WRONG_VERSION, + GNSS_INVALID_LOCATION_COORD_ERR, + GNSS_INVALID_TRAJECTORY_FILE_ERR, + GNSS_INVALID_MEASUREMENT_DATA_ERR, + GNSS_INVALID_DATA_VERSIONS_ERR, + GPX_FILE_OPEN_FAILED, + GPX_FILE_SIZE_EXCEED, + GPX_FILE_EXTENSION_ERROR, + GPX_XML_PARSING_ERROR, + GPX_XML_NO_ELEMENTS, + GPX_UNSUPPORTED_VERSION, + GPX_NO_TRACKS, + GPX_INVALID_WAYPOINT, + GPX_NOT_PLAYING, + MEASUREMENT_FILE_OPEN_FAILED, + MEASUREMENT_PARSE_JSON_FAILED, + MEASUREMENT_MISSING_ELEMENT, + MEASUREMENT_INVALID_PARAM, + FIFO_INJECTION_PRIORITY_OVERRIDE_ERR, +}; + +enum GnssMeasurementVersions { + MEASUREMENT_V1 = 1, + MEASUREMENT_V2 = 1 << 1, +}; + +enum GnssDataSource { + CMD, + CME, + BINDER, + INIT, +}; + +struct GnssClock_V1 { + uint16_t flags; + int16_t leapSecond; + int64_t timeNs; + double timeUncertaintyNs; + int64_t fullBiasNs; + double biasNs; + double biasUncertaintyNs; + double driftNsps; + double driftUncertaintyNsps; + uint32_t hwClockDiscontinuityCount; +} __attribute__((packed)); + +struct GnssMeasurement_V1 { + uint32_t flags; + int16_t svid; + uint8_t constellation; + double timeOffsetNs; + uint32_t state; + int64_t receivedSvTimeInNs; + int64_t receivedSvTimeUncertaintyInNs; + double cN0Dbhz; + double pseudorangeRateMps; + double pseudorangeRateUncertaintyMps; + uint16_t accumulatedDeltaRangeState; + double accumulatedDeltaRangeM; + double accumulatedDeltaRangeUncertaintyM; + float carrierFrequencyHz; + int64_t carrierCycles; + double carrierPhase; + double carrierPhaseUncertainty; + uint8_t multipathIndicator; + double snrDb; +} __attribute__((packed)); + +struct GnssMeasurementPacket_V1 { + GnssClock_V1 clock; + uint8_t count; + GnssMeasurement_V1 measurements[MEASUREMENTS_MAX_NUM]; +} __attribute__((packed)); + +enum GnssConstellationType_V2 { + UNKNOWN = 0, + GPS = 1, + SBAS = 2, + GLONASS = 3, + QZSS = 4, + BEIDOU = 5, + GALILEO = 6, + IRNSS = 7, +}; + +enum CodeType_V2 { + // const @utf8InCpp String CODE_TYPE_UNKNOWN = "UNKNOWN"; + CODE_TYPE_UNKNOWN = 0, + // const @utf8InCpp String CODE_TYPE_A = "A"; + CODE_TYPE_A = 1, + // const @utf8InCpp String CODE_TYPE_B = "B"; + CODE_TYPE_B = 2, + // const @utf8InCpp String CODE_TYPE_C = "C"; + CODE_TYPE_C = 3, + // const @utf8InCpp String CODE_TYPE_D = "D"; + CODE_TYPE_D = 4, + // const @utf8InCpp String CODE_TYPE_I = "I"; + CODE_TYPE_I = 5, + // const @utf8InCpp String CODE_TYPE_L = "L"; + CODE_TYPE_L = 6, + // const @utf8InCpp String CODE_TYPE_M = "M"; + CODE_TYPE_M = 7, + // const @utf8InCpp String CODE_TYPE_N = "N"; + CODE_TYPE_N = 8, + // const @utf8InCpp String CODE_TYPE_P = "P"; + CODE_TYPE_P = 9, + // const @utf8InCpp String CODE_TYPE_Q = "Q"; + CODE_TYPE_Q = 10, + // const @utf8InCpp String CODE_TYPE_S = "S"; + CODE_TYPE_S = 11, + // const @utf8InCpp String CODE_TYPE_W = "W"; + CODE_TYPE_W = 12, + // const @utf8InCpp String CODE_TYPE_X = "X"; + CODE_TYPE_X = 13, + // const @utf8InCpp String CODE_TYPE_Y = "Y"; + CODE_TYPE_Y = 14, + // const @utf8InCpp String CODE_TYPE_Z = "Z"; + CODE_TYPE_Z = 15, +}; + +struct GnssSignalType_V2 { + uint8_t constellation; // @see GnssConstellationType_V2 + double carrierFrequencyHz; + uint8_t codeType; // @see CodeType +} __attribute__((packed)); + +struct GnssClock_V2 : public GnssClock_V1 { + GnssSignalType_V2 referenceSignalTypeForIsb; +} __attribute__((packed)); + +struct GnssMeasurement_V2 : public GnssMeasurement_V1 { + GnssSignalType_V2 signalType; + double basebandCN0DbHz; + double agcLevelDb; + double fullInterSignalBiasNs; + double fullInterSignalBiasUncertaintyNs; + double satelliteInterSignalBiasNs; + double satelliteInterSignalBiasUncertaintyNs; +} __attribute__((packed)); + +struct GnssMeasurementPacket_V2 { + GnssClock_V2 clock; + uint8_t count; + GnssMeasurement_V2 measurements[MEASUREMENTS_MAX_NUM]; +} __attribute__((packed)); + +struct DEV_GNSS_LOCATION_START_REQ : public DEV_VMI_HEADER { + + DEV_GNSS_LOCATION_START_REQ() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_GNSS_LOCATION_START_REQ); + this->devType = htons(DEV_LOCATION); + this->devId = htons(GNSS_LOCATION); + this->len = htonl(sizeof(struct DEV_GNSS_LOCATION_START_REQ)); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } +} __attribute__((packed)); + +struct DEV_GNSS_LOCATION_STOP_REQ : public DEV_VMI_HEADER { + + DEV_GNSS_LOCATION_STOP_REQ() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_GNSS_LOCATION_STOP_REQ); + this->devType = htons(DEV_LOCATION); + this->devId = htons(GNSS_LOCATION); + this->len = htonl(sizeof(struct DEV_GNSS_LOCATION_STOP_REQ)); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } +} __attribute__((packed)); + +struct DEV_GNSS_LOCATION_DATA_REQ : public DEV_VMI_HEADER { + + DEV_GNSS_LOCATION_DATA_REQ() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_GNSS_LOCATION_DATA_REQ); + this->devType = htons(DEV_LOCATION); + this->devId = htons(GNSS_LOCATION); + this->len = htonl(sizeof(struct DEV_GNSS_LOCATION_DATA_REQ)); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } +} __attribute__((packed)); + +struct DEV_GNSS_MEASUREMENT_START_REQ : public DEV_VMI_HEADER { + + DEV_GNSS_MEASUREMENT_START_REQ() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_GNSS_MEASUREMENT_START_REQ); + this->devType = htons(DEV_LOCATION); + this->devId = htons(GNSS_MEASUREMENT); + this->len = htonl(sizeof(struct DEV_GNSS_MEASUREMENT_START_REQ)); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } +} __attribute__((packed)); + +struct DEV_GNSS_MEASUREMENT_STOP_REQ : public DEV_VMI_HEADER { + + DEV_GNSS_MEASUREMENT_STOP_REQ() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_GNSS_MEASUREMENT_STOP_REQ); + this->devType = htons(DEV_LOCATION); + this->devId = htons(GNSS_MEASUREMENT); + this->len = htonl(sizeof(struct DEV_GNSS_MEASUREMENT_STOP_REQ)); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } +} __attribute__((packed)); + +struct DEV_GNSS_MEASUREMENT_DATA_REQ : public DEV_VMI_HEADER { + + DEV_GNSS_MEASUREMENT_DATA_REQ() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_GNSS_MEASUREMENT_DATA_REQ); + this->devType = htons(DEV_LOCATION); + this->devId = htons(GNSS_MEASUREMENT); + this->len = htonl(sizeof(struct DEV_GNSS_MEASUREMENT_DATA_REQ)); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } +} __attribute__((packed)); + +struct DEV_GNSS_LOCATION_DATA_LIST_REQ : public DEV_VMI_HEADER { + + DEV_GNSS_LOCATION_DATA_LIST_REQ() + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_GNSS_LOCATION_DATA_LIST_REQ); + this->devType = htons(DEV_LOCATION); + this->devId = htons(GNSS_MEASUREMENT); + this->len = htonl(sizeof(struct DEV_GNSS_LOCATION_DATA_LIST_REQ)); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } +} __attribute__((packed)); + +struct DEV_GNSS_VERSION_RESPONSE : public DEV_VMI_HEADER { + + DEV_GNSS_VERSION_RESPONSE(DevId devId, int respLen) + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_GNSS_VERSION_RESPONSE); + this->devType = htons(DEV_LOCATION); + this->devId = htons(devId); + this->len = htonl(sizeof(struct DEV_GNSS_VERSION_RESPONSE) + respLen); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } +} __attribute__((packed)); + +struct DEV_GNSS_DATA_RESPONSE : public DEV_VMI_HEADER { + + DEV_GNSS_DATA_RESPONSE(DevId devId, int respLen) + { + this->version = htons(0x1); + this->optType = htons(DEV_OPT_GNSS_DATA_RESPONSE); + this->devType = htons(DEV_LOCATION); + this->devId = htons(devId); + this->len = htonl(sizeof(struct DEV_GNSS_DATA_RESPONSE) + respLen); + this->nextProto = htons(0x0); + this->hopLimits = htons(0x0); + } +} __attribute__((packed)); + +} // namespace gnss + +} // namespace android + +#endif // VMI_LOCATION_HEADER_H + diff --git a/aosp/vendor/common/prebuild/include/VmiMsgHeader.h b/aosp/vendor/common/prebuild/include/VmiMsgHeader.h index 9eec8a7f4..1da0123a5 100644 --- a/aosp/vendor/common/prebuild/include/VmiMsgHeader.h +++ b/aosp/vendor/common/prebuild/include/VmiMsgHeader.h @@ -15,31 +15,9 @@ namespace android { using MsgType = uint16_t; +using DevId = uint16_t; -const uint16_t DEV_OPT_CAMERA_GET_PARAM_REQ = 0x1; -const uint16_t DEV_OPT_CAMERA_GET_PARAM_RSP = 0x1001; -const uint16_t DEV_OPT_CAMERA_SET_PARAM_REQ = 0x2; -const uint16_t DEV_OPT_CAMERA_SET_PARAM_RSP = 0x1002; -const uint16_t DEV_OPT_CAMERA_GET_INFO_REQ = 0x3; -const uint16_t DEV_OPT_CAMERA_GET_INFO_RSP = 0x1003; -const uint16_t DEV_OPT_CAMERA_START_PREVIEW_REQ = 0x4; -const uint16_t DEV_OPT_CAMERA_START_PREVIEW_RSP = 0x1004; -const uint16_t DEV_OPT_CAMERA_STOP_PREVIEW_REQ = 0x5; -const uint16_t DEV_OPT_CAMERA_STOP_PREVIEW_RSP = 0x1005; -const uint16_t DEV_OPT_CAMERA_USE_FORMAT_REQ = 0x6; -const uint16_t DEV_OPT_CAMERA_USE_FORMAT_RSP = 0x1006; -const uint16_t DEV_OPT_CAMERA_GET_SIZE_REQ = 0x7; -const uint16_t DEV_OPT_CAMERA_GET_SIZE_RSP = 0x1007; -const uint16_t DEV_OPT_CAMERA_FRAME = 0x8; - -// 摄像头帧数据的类型 -const uint8_t VMI_CAMERA_FORMAT_H264 = 0x01; -const uint8_t VMI_CAMERA_FORMAT_JPEG = 0x02; -const uint8_t VMI_CAMERA_FORMAT_I420 = 0x03; -const uint8_t VMI_CAMERA_FORMAT_LOCAL = 0x04; -const uint8_t VMI_CAMERA_FORMAT_INVALID = 0xFF; - -struct DEV_CAMERA_HEADER { +struct DEV_VMI_HEADER { uint16_t version; uint16_t optType; uint16_t devType; @@ -49,180 +27,14 @@ struct DEV_CAMERA_HEADER { uint16_t hopLimits; } __attribute__((packed)); -struct DEV_CAMERA_START_REVIEW_REQ { - struct DEV_CAMERA_HEADER devCameraHeader; - uint16_t width; - uint16_t height; - uint16_t fps; - DEV_CAMERA_START_REVIEW_REQ() - { - devCameraHeader.version = htons(0x1); - devCameraHeader.optType = htons(DEV_OPT_CAMERA_START_PREVIEW_REQ); - devCameraHeader.devType = htons(0x1); - devCameraHeader.len = htonl(sizeof(struct DEV_CAMERA_HEADER) + sizeof(uint16_t)*3); - devCameraHeader.nextProto = htons(0x0); - devCameraHeader.hopLimits = htons(0x0); - width = htons(640); //default value; - height = htons(480); //default value; - fps = htons(30); //default value; - } -} __attribute__((packed)); - -struct DEV_CAMERA_START_REVIEW_RSP { - struct DEV_CAMERA_HEADER devCameraHeader; - DEV_CAMERA_START_REVIEW_RSP() - { - devCameraHeader.version = htons(0x1); - devCameraHeader.optType = htons(DEV_OPT_CAMERA_START_PREVIEW_RSP); - devCameraHeader.devType = htons(0x1); - devCameraHeader.len = htonl(sizeof(struct DEV_CAMERA_HEADER) + sizeof(uint16_t)); - devCameraHeader.nextProto = htons(0x0); - devCameraHeader.hopLimits = htons(0x0); - } - uint16_t result; -} __attribute__((packed)); - -struct DEV_CAMERA_STOP_REVIEW_REQ{ - struct DEV_CAMERA_HEADER devCameraHeader; - - DEV_CAMERA_STOP_REVIEW_REQ() - { - devCameraHeader.version = htons(0x1); - devCameraHeader.optType = htons(DEV_OPT_CAMERA_STOP_PREVIEW_REQ); - devCameraHeader.devType = htons(0x1); - devCameraHeader.len = htonl(sizeof(struct DEV_CAMERA_HEADER)); - devCameraHeader.nextProto = htons(0x0); - devCameraHeader.hopLimits = htons(0x0); - } +struct DEV_VMI_RESPONSE { + uint16_t errCode; + uint8_t *message; } __attribute__((packed)); -struct DEV_CAMERA_STOP_REVIEW_RSP { - struct DEV_CAMERA_HEADER devCameraHeader; - DEV_CAMERA_STOP_REVIEW_RSP() - { - devCameraHeader.version = htons(0x1); - devCameraHeader.optType = htons(DEV_OPT_CAMERA_STOP_PREVIEW_RSP); - devCameraHeader.devType = htons(0x1); - devCameraHeader.len = htonl(sizeof(struct DEV_CAMERA_HEADER) + sizeof(uint16_t)); - devCameraHeader.nextProto = htons(0x0); - devCameraHeader.hopLimits = htons(0x0); - } - uint16_t result; -} __attribute__((packed)); - -struct DEV_CAMERA_GET_PARAM_REQ { - struct DEV_CAMERA_HEADER devCameraHeader; - - DEV_CAMERA_GET_PARAM_REQ() - { - devCameraHeader.version = htons(0x1); - devCameraHeader.optType = htons(DEV_OPT_CAMERA_GET_PARAM_REQ); - devCameraHeader.devType = htons(0x1); - devCameraHeader.len = htonl(sizeof(struct DEV_CAMERA_HEADER)); - devCameraHeader.nextProto = htons(0x0); - devCameraHeader.hopLimits = htons(0x0); - } -} __attribute__((packed)); - -struct DEV_CAMERA_GET_PARAM_RSP_DATA { - uint16_t result; - uint8_t data[0]; -} __attribute__((packed)); - -struct DEV_CAMERA_GET_PARAM_RSP { - struct DEV_CAMERA_HEADER devCameraHeader; - DEV_CAMERA_GET_PARAM_RSP() - { - devCameraHeader.version = htons(0x1); - devCameraHeader.optType = htons(DEV_OPT_CAMERA_GET_PARAM_RSP); - devCameraHeader.devType = htons(0x1); - devCameraHeader.nextProto = htons(0x0); - devCameraHeader.hopLimits = htons(0x0); - } - struct DEV_CAMERA_GET_PARAM_RSP_DATA* rspData; -} __attribute__((packed)); - -struct DEV_CAMERA_GET_INFO_REQ { - struct DEV_CAMERA_HEADER devCameraHeader; - - DEV_CAMERA_GET_INFO_REQ() - { - devCameraHeader.version = htons(0x1); - devCameraHeader.optType = htons(DEV_OPT_CAMERA_GET_INFO_REQ); - devCameraHeader.devType = htons(0x1); - devCameraHeader.len = htonl(sizeof(struct DEV_CAMERA_HEADER)); - devCameraHeader.nextProto = htons(0x0); - devCameraHeader.hopLimits = htons(0x0); - } -} __attribute__((packed)); - -struct DEV_CAMERA_GET_INFO_RSP_DATA { - uint16_t result; - uint8_t facing; - uint16_t orientation; - -} __attribute__((packed)); - -struct DEV_CAMERA_GET_INFO_RSP { - struct DEV_CAMERA_HEADER devCameraHeader; - DEV_CAMERA_GET_INFO_RSP() - { - devCameraHeader.version = htons(0x1); - devCameraHeader.optType = htons(DEV_OPT_CAMERA_GET_INFO_RSP); - devCameraHeader.devType = htons(0x1); - devCameraHeader.nextProto = htons(0x0); - devCameraHeader.hopLimits = htons(0x0); - } - struct DEV_CAMERA_GET_INFO_RSP_DATA* rspData; -} __attribute__((packed)); - -struct DEV_CAMERA_GET_SIZE_REQ { - struct DEV_CAMERA_HEADER devCameraHeader; - - DEV_CAMERA_GET_SIZE_REQ() - { - devCameraHeader.version = htons(0x1); - devCameraHeader.optType = htons(DEV_OPT_CAMERA_GET_SIZE_REQ); - devCameraHeader.devType = htons(0x1); - devCameraHeader.len = htonl(sizeof(struct DEV_CAMERA_HEADER)); - devCameraHeader.nextProto = htons(0x0); - devCameraHeader.hopLimits = htons(0x0); - } -} __attribute__((packed)); - -struct DEV_CAMERA_GET_SIZE_RSP_DATA { - uint16_t result; - uint16_t width; - uint16_t height; - -} __attribute__((packed)); - -struct DEV_CAMERA_GET_SIZE_RSP { - struct DEV_CAMERA_HEADER devCameraHeader; - DEV_CAMERA_GET_SIZE_RSP() - { - devCameraHeader.version = htons(0x1); - devCameraHeader.optType = htons(DEV_OPT_CAMERA_GET_SIZE_RSP); - devCameraHeader.devType = htons(0x1); - devCameraHeader.len = htonl(sizeof(struct DEV_CAMERA_HEADER) + sizeof(uint16_t) * 3); - devCameraHeader.nextProto = htons(0x0); - devCameraHeader.hopLimits = htons(0x0); - } - struct DEV_CAMERA_GET_SIZE_RSP_DATA* rspData; -} __attribute__((packed)); - -struct DEV_CAMERA_SET_PARAM_REQ { - struct DEV_CAMERA_HEADER devCameraHeader; - uint8_t data[0]; - - DEV_CAMERA_SET_PARAM_REQ() - { - devCameraHeader.version = htons(0x1); - devCameraHeader.optType = htons(DEV_OPT_CAMERA_SET_PARAM_REQ); - devCameraHeader.devType = htons(0x1); - devCameraHeader.nextProto = htons(0x0); - devCameraHeader.hopLimits = htons(0x0); - } +struct DEV_DATA_VERSION { + uint16_t devId; + uint32_t version; } __attribute__((packed)); class VmiMsgHeader { @@ -256,16 +68,20 @@ private: // 解析包头 void ParseHeader() { - const uint8_t* ptr = buffer.get(); - - // 直接通过指针访问和类型转换读取各字段 - version = ntohs(*reinterpret_cast(ptr + offsetof(DEV_CAMERA_HEADER, version))); - optType = ntohs(*reinterpret_cast(ptr + offsetof(DEV_CAMERA_HEADER, optType))); - devType = ntohs(*reinterpret_cast(ptr + offsetof(DEV_CAMERA_HEADER, devType))); - devId = ntohs(*reinterpret_cast(ptr + offsetof(DEV_CAMERA_HEADER, devId))); - len = ntohl(*reinterpret_cast(ptr + offsetof(DEV_CAMERA_HEADER, len))); - nextProto = ntohs(*reinterpret_cast(ptr + offsetof(DEV_CAMERA_HEADER, nextProto))); - hopLimits = ntohs(*reinterpret_cast(ptr + offsetof(DEV_CAMERA_HEADER, hopLimits))); + if (!buffer) { + // 如果buffer为空,直接截断处理 + return; + } + + // 直接通过结构体访问和类型转换读取各字段 + const DEV_VMI_HEADER* header = reinterpret_cast(buffer.get()); + version = ntohs(header->version); + optType = ntohs(header->optType); + devType = ntohs(header->devType); + devId = ntohs(header->devId); + len = ntohl(header->len); + nextProto = ntohs(header->nextProto); + hopLimits = ntohs(header->hopLimits); } }; diff --git a/aosp/vendor/isula/manifest.xml b/aosp/vendor/isula/manifest.xml index 69765b39d..39392afbf 100644 --- a/aosp/vendor/isula/manifest.xml +++ b/aosp/vendor/isula/manifest.xml @@ -44,15 +44,6 @@ default - - android.hardware.gnss - hwbinder - 1.0 - - IGnss - default - - android.hardware.audio.effect passthrough -- Gitee