1bc2ed2b3Sopenharmony_ci/* 2bc2ed2b3Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 3bc2ed2b3Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4bc2ed2b3Sopenharmony_ci * you may not use this file except in compliance with the License. 5bc2ed2b3Sopenharmony_ci * You may obtain a copy of the License at 6bc2ed2b3Sopenharmony_ci * 7bc2ed2b3Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8bc2ed2b3Sopenharmony_ci * 9bc2ed2b3Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10bc2ed2b3Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11bc2ed2b3Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12bc2ed2b3Sopenharmony_ci * See the License for the specific language governing permissions and 13bc2ed2b3Sopenharmony_ci * limitations under the License. 14bc2ed2b3Sopenharmony_ci */ 15bc2ed2b3Sopenharmony_ci 16bc2ed2b3Sopenharmony_ci#ifndef HCE_SERVICE_H 17bc2ed2b3Sopenharmony_ci#define HCE_SERVICE_H 18bc2ed2b3Sopenharmony_ci 19bc2ed2b3Sopenharmony_ci#include "nfc_sdk_common.h" 20bc2ed2b3Sopenharmony_ci#include "ihce_cmd_callback.h" 21bc2ed2b3Sopenharmony_ci#include "ihce_session.h" 22bc2ed2b3Sopenharmony_ci#include "ability_info.h" 23bc2ed2b3Sopenharmony_ci 24bc2ed2b3Sopenharmony_cinamespace OHOS { 25bc2ed2b3Sopenharmony_cinamespace NFC { 26bc2ed2b3Sopenharmony_cinamespace KITS { 27bc2ed2b3Sopenharmony_ciusing OHOS::AppExecFwk::ElementName; 28bc2ed2b3Sopenharmony_ciusing AppExecFwk::AbilityInfo; 29bc2ed2b3Sopenharmony_ciclass HceService final { 30bc2ed2b3Sopenharmony_cipublic: 31bc2ed2b3Sopenharmony_ci explicit HceService(); 32bc2ed2b3Sopenharmony_ci ~HceService(); 33bc2ed2b3Sopenharmony_ci 34bc2ed2b3Sopenharmony_ci static HceService &GetInstance(); 35bc2ed2b3Sopenharmony_ci 36bc2ed2b3Sopenharmony_ci ErrorCode RegHceCmdCallback(const sptr<KITS::IHceCmdCallback> &callback, const std::string &type); 37bc2ed2b3Sopenharmony_ci ErrorCode StopHce(ElementName &element); 38bc2ed2b3Sopenharmony_ci ErrorCode IsDefaultService(ElementName &element, const std::string &type, bool &isDefaultService); 39bc2ed2b3Sopenharmony_ci int SendRawFrame(std::string hexCmdData, bool raw, std::string &hexRespData); 40bc2ed2b3Sopenharmony_ci int GetPaymentServices(std::vector<AbilityInfo> &abilityInfos); 41bc2ed2b3Sopenharmony_ci KITS::ErrorCode StartHce(const ElementName &element, const std::vector<std::string> &aids); 42bc2ed2b3Sopenharmony_ci 43bc2ed2b3Sopenharmony_ciprotected: 44bc2ed2b3Sopenharmony_ci OHOS::sptr<HCE::IHceSession> GetHceSessionProxy(); 45bc2ed2b3Sopenharmony_ci 46bc2ed2b3Sopenharmony_ciprivate: 47bc2ed2b3Sopenharmony_ci OHOS::sptr<HCE::IHceSession> hceSessionProxy_; 48bc2ed2b3Sopenharmony_ci}; 49bc2ed2b3Sopenharmony_ci} // namespace KITS 50bc2ed2b3Sopenharmony_ci} // namespace NFC 51bc2ed2b3Sopenharmony_ci} // namespace OHOS 52bc2ed2b3Sopenharmony_ci#endif