1bc2ed2b3Sopenharmony_ci/* 2bc2ed2b3Sopenharmony_ci * Copyright (C) 2022 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#ifndef I_NFC_CONTROLLER_SERVICE_H 16bc2ed2b3Sopenharmony_ci#define I_NFC_CONTROLLER_SERVICE_H 17bc2ed2b3Sopenharmony_ci 18bc2ed2b3Sopenharmony_ci#include "nfc_sdk_common.h" 19bc2ed2b3Sopenharmony_ci#include "indef_msg_callback.h" 20bc2ed2b3Sopenharmony_ci#include "infc_controller_callback.h" 21bc2ed2b3Sopenharmony_ci#ifdef VENDOR_APPLICATIONS_ENABLED 22bc2ed2b3Sopenharmony_ci#include "ion_card_emulation_notify_cb.h" 23bc2ed2b3Sopenharmony_ci#include "iquery_app_info_callback.h" 24bc2ed2b3Sopenharmony_ci#endif 25bc2ed2b3Sopenharmony_ci#include "iremote_broker.h" 26bc2ed2b3Sopenharmony_ci#include "element_name.h" 27bc2ed2b3Sopenharmony_ci 28bc2ed2b3Sopenharmony_cinamespace OHOS { 29bc2ed2b3Sopenharmony_cinamespace NFC { 30bc2ed2b3Sopenharmony_ciclass INfcControllerService : public OHOS::IRemoteBroker { 31bc2ed2b3Sopenharmony_cipublic: 32bc2ed2b3Sopenharmony_ci DECLARE_INTERFACE_DESCRIPTOR(u"ohos.nfc.INfcControllerService"); 33bc2ed2b3Sopenharmony_ci 34bc2ed2b3Sopenharmony_ci virtual ~INfcControllerService() {} 35bc2ed2b3Sopenharmony_ci /** 36bc2ed2b3Sopenharmony_ci * @brief Get the NFC state 37bc2ed2b3Sopenharmony_ci * @return The NFC State 38bc2ed2b3Sopenharmony_ci */ 39bc2ed2b3Sopenharmony_ci virtual int GetState() = 0; 40bc2ed2b3Sopenharmony_ci /** 41bc2ed2b3Sopenharmony_ci * @brief Turn On NFC 42bc2ed2b3Sopenharmony_ci * @return The status code of calling function. 43bc2ed2b3Sopenharmony_ci */ 44bc2ed2b3Sopenharmony_ci virtual int TurnOn() = 0; 45bc2ed2b3Sopenharmony_ci /** 46bc2ed2b3Sopenharmony_ci * @brief Turn Off NFC 47bc2ed2b3Sopenharmony_ci * @return The status code of calling function. 48bc2ed2b3Sopenharmony_ci */ 49bc2ed2b3Sopenharmony_ci virtual int TurnOff() = 0; 50bc2ed2b3Sopenharmony_ci /** 51bc2ed2b3Sopenharmony_ci * @brief NFC enable 52bc2ed2b3Sopenharmony_ci * @param isOpen The output for checking nfc is open or not. 53bc2ed2b3Sopenharmony_ci * @return The status code of calling function. 54bc2ed2b3Sopenharmony_ci */ 55bc2ed2b3Sopenharmony_ci virtual int IsNfcOpen(bool &isOpen) = 0; 56bc2ed2b3Sopenharmony_ci 57bc2ed2b3Sopenharmony_ci virtual KITS::ErrorCode RegisterCallBack(const sptr<INfcControllerCallback> &callback, 58bc2ed2b3Sopenharmony_ci const std::string& type) = 0; 59bc2ed2b3Sopenharmony_ci virtual KITS::ErrorCode UnRegisterCallBack(const std::string& type) = 0; 60bc2ed2b3Sopenharmony_ci virtual OHOS::sptr<IRemoteObject> GetTagServiceIface() = 0; 61bc2ed2b3Sopenharmony_ci virtual OHOS::sptr<IRemoteObject> GetHceServiceIface() = 0; 62bc2ed2b3Sopenharmony_ci virtual KITS::ErrorCode RegNdefMsgCb(const sptr<INdefMsgCallback> &callback) = 0; 63bc2ed2b3Sopenharmony_ci#ifdef VENDOR_APPLICATIONS_ENABLED 64bc2ed2b3Sopenharmony_ci virtual KITS::ErrorCode RegQueryApplicationCb(sptr<IQueryAppInfoCallback> callback) = 0; 65bc2ed2b3Sopenharmony_ci virtual KITS::ErrorCode RegCardEmulationNotifyCb(sptr<IOnCardEmulationNotifyCb> callback) = 0; 66bc2ed2b3Sopenharmony_ci virtual KITS::ErrorCode NotifyEventStatus(int eventType, int arg1, std::string arg2) = 0; 67bc2ed2b3Sopenharmony_ci#endif 68bc2ed2b3Sopenharmony_ci}; 69bc2ed2b3Sopenharmony_ci} // namespace NFC 70bc2ed2b3Sopenharmony_ci} // namespace OHOS 71bc2ed2b3Sopenharmony_ci#endif // I_NFC_CONTROLLER_SERVICE_H 72