diff options
Diffstat (limited to 'android/location_api/GnssAPIClient.cpp')
-rw-r--r-- | android/location_api/GnssAPIClient.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index fac5d0b..4fcc868 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -40,9 +40,14 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { +using ::android::hardware::gnss::V1_0::IGnss; +using ::android::hardware::gnss::V1_0::IGnssCallback; +using ::android::hardware::gnss::V1_0::IGnssNiCallback; +using ::android::hardware::gnss::V1_0::GnssLocation; + static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out); GnssAPIClient::GnssAPIClient(const sp<IGnssCallback>& gpsCb, @@ -414,11 +419,7 @@ void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotificatio notificationGnss.notificationIdEncoding = IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2; - auto r = gnssNiCbIface->niNotifyCb(notificationGnss); - if (!r.isOk()) { - LOC_LOGE("%s] Error from niNotifyCb description=%s", - __func__, r.description().c_str()); - } + gnssNiCbIface->niNotifyCb(notificationGnss); } void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification) @@ -449,7 +450,7 @@ void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) android::hardware::hidl_string nmeaString; nmeaString.setToExternal(gnssNmeaNotification.nmea, gnssNmeaNotification.length); auto r = gnssCbIface->gnssNmeaCb( - static_cast<GnssUtcTime>(gnssNmeaNotification.timestamp), nmeaString); + static_cast<V1_0::GnssUtcTime>(gnssNmeaNotification.timestamp), nmeaString); if (!r.isOk()) { LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", __func__, gnssNmeaNotification.nmea, gnssNmeaNotification.length, r.description().c_str()); @@ -503,10 +504,10 @@ static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvSta { memset(&out, 0, sizeof(IGnssCallback::GnssSvStatus)); out.numSvs = in.count; - if (out.numSvs > static_cast<uint32_t>(GnssMax::SVS_COUNT)) { + if (out.numSvs > static_cast<uint32_t>(V1_0::GnssMax::SVS_COUNT)) { LOC_LOGW("%s]: Too many satellites %u. Clamps to %d.", - __FUNCTION__, out.numSvs, GnssMax::SVS_COUNT); - out.numSvs = static_cast<uint32_t>(GnssMax::SVS_COUNT); + __FUNCTION__, out.numSvs, V1_0::GnssMax::SVS_COUNT); + out.numSvs = static_cast<uint32_t>(V1_0::GnssMax::SVS_COUNT); } for (size_t i = 0; i < out.numSvs; i++) { IGnssCallback::GnssSvInfo& info = out.gnssSvList[i]; @@ -526,7 +527,7 @@ static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvSta } } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android |