1 /* 2 * Copyright (C) 2023 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 #ifndef HCE_SESSION_PROXY_H 16 #define HCE_SESSION_PROXY_H 17 18 #include "element_name.h" 19 #include "iremote_proxy.h" 20 #include "ihce_session.h" 21 #include "nfc_basic_proxy.h" 22 #include "ihce_cmd_callback.h" 23 #include "ability_info.h" 24 25 26 namespace OHOS { 27 namespace NFC { 28 namespace HCE { 29 using OHOS::AppExecFwk::ElementName; 30 using AppExecFwk::AbilityInfo; 31 class HceSessionProxy final : public OHOS::IRemoteProxy<IHceSession>, public NfcBasicProxy { 32 public: HceSessionProxy(const OHOS::sptr<OHOS::IRemoteObject> & remote)33 explicit HceSessionProxy(const OHOS::sptr<OHOS::IRemoteObject> &remote) 34 : OHOS::IRemoteProxy<IHceSession>(remote), NfcBasicProxy(remote) 35 { 36 } ~HceSessionProxy()37 ~HceSessionProxy() override {} 38 39 KITS::ErrorCode RegHceCmdCallback(const sptr<KITS::IHceCmdCallback> &callback, const std::string &type) override; 40 41 int SendRawFrame(std::string hexCmdData, bool raw, std::string &hexRespData) override; 42 int GetPaymentServices(std::vector<AbilityInfo> &abilityInfos) override; 43 KITS::ErrorCode StopHce(ElementName &element) override; 44 KITS::ErrorCode IsDefaultService(ElementName &element, const std::string &type, bool &isDefaultService) override; 45 KITS::ErrorCode StartHce(const ElementName &element, const std::vector<std::string> &aids) override; 46 }; 47 } // namespace HCE 48 } // namespace NFC 49 } // namespace OHOS 50 #endif 51