1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef AGNSS_EVENT_CALLBACK_H 17 #define AGNSS_EVENT_CALLBACK_H 18 #ifdef FEATURE_GNSS_SUPPORT 19 #ifdef HDF_DRIVERS_INTERFACE_AGNSS_ENABLE 20 21 #include <v2_0/ia_gnss_callback.h> 22 #ifdef TEL_CORE_SERVICE_ENABLE 23 #include "core_service_client.h" 24 #include "cell_information.h" 25 #endif 26 27 namespace OHOS { 28 namespace Location { 29 using HDI::Location::Agnss::V2_0::IAGnssCallback; 30 using HDI::Location::Agnss::V2_0::AGnssDataLinkRequest; 31 using HDI::Location::Agnss::V2_0::SubscriberSetId; 32 using HDI::Location::Agnss::V2_0::SubscriberSetIdType; 33 using HDI::Location::Agnss::V2_0::AGnssRefInfo; 34 using HDI::Location::Agnss::V2_0::AGnssRefInfoType; 35 using HDI::Location::Agnss::V2_0::AGnssUserPlaneProtocol; 36 37 #ifdef TEL_CORE_SERVICE_ENABLE 38 using OHOS::Telephony::CellInformation; 39 #endif 40 41 class AGnssEventCallback : public IAGnssCallback { 42 public: ~AGnssEventCallback()43 ~AGnssEventCallback() override {} 44 int32_t RequestSetUpAgnssDataLink(const AGnssDataLinkRequest& request) override; 45 int32_t RequestSubscriberSetId(SubscriberSetIdType type) override; 46 int32_t RequestAgnssRefInfo(AGnssRefInfoType type) override; 47 private: 48 #ifdef TEL_CORE_SERVICE_ENABLE 49 void JudgmentDataGsm(AGnssRefInfo& refInfo, sptr<CellInformation> infoItem); 50 void JudgmentDataUmts(AGnssRefInfo& refInfo, sptr<CellInformation> infoItem); 51 void JudgmentDataLte(AGnssRefInfo& refInfo, sptr<CellInformation> infoItem); 52 void JudgmentDataNr(AGnssRefInfo& refInfo, sptr<CellInformation> infoItem); 53 #endif 54 __attribute__((no_sanitize("cfi"))) void GetWiFiRefInfo(AGnssRefInfo& refInfo); 55 void GetCellRefInfo(AGnssRefInfo& refInfo); 56 }; 57 } // namespace Location 58 } // namespace OHOS 59 #endif // HDF_DRIVERS_INTERFACE_AGNSS_ENABLE 60 #endif // FEATURE_GNSS_SUPPORT 61 #endif // AGNSS_EVENT_CALLBACK_H 62