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 16#ifndef OHOS_HDI_NFC_V1_1_NFCINTERFACESTUB_H 17#define OHOS_HDI_NFC_V1_1_NFCINTERFACESTUB_H 18 19#include <ipc_object_stub.h> 20#include <message_option.h> 21#include <message_parcel.h> 22#include <object_collector.h> 23#include <refbase.h> 24#include "v1_0/nfc_interface_stub.h" 25#include "v1_1/infc_interface.h" 26 27namespace OHOS { 28namespace HDI { 29namespace Nfc { 30namespace V1_1 { 31 32using namespace OHOS; 33class NfcInterfaceStub : public IPCObjectStub { 34public: 35 explicit NfcInterfaceStub(const sptr<INfcInterface> &impl); 36 virtual ~NfcInterfaceStub(); 37 38 int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; 39 40 static int32_t NfcInterfaceStubGetVendorConfig_(MessageParcel& nfcInterfaceData, MessageParcel& nfcInterfaceReply, MessageOption& nfcInterfaceOption, sptr<OHOS::HDI::Nfc::V1_1::INfcInterface> impl); 41 42 static int32_t NfcInterfaceStubDoFactoryReset_(MessageParcel& nfcInterfaceData, MessageParcel& nfcInterfaceReply, MessageOption& nfcInterfaceOption, sptr<OHOS::HDI::Nfc::V1_1::INfcInterface> impl); 43 44 static int32_t NfcInterfaceStubShutdown_(MessageParcel& nfcInterfaceData, MessageParcel& nfcInterfaceReply, MessageOption& nfcInterfaceOption, sptr<OHOS::HDI::Nfc::V1_1::INfcInterface> impl); 45 46 static int32_t NfcInterfaceStubIoctlWithResponse_(MessageParcel& nfcInterfaceData, MessageParcel& nfcInterfaceReply, MessageOption& nfcInterfaceOption, sptr<OHOS::HDI::Nfc::V1_1::INfcInterface> impl); 47 48private: 49 int32_t NfcInterfaceStubGetVendorConfig(MessageParcel& nfcInterfaceData, MessageParcel& nfcInterfaceReply, MessageOption& nfcInterfaceOption); 50 51 int32_t NfcInterfaceStubDoFactoryReset(MessageParcel& nfcInterfaceData, MessageParcel& nfcInterfaceReply, MessageOption& nfcInterfaceOption); 52 53 int32_t NfcInterfaceStubShutdown(MessageParcel& nfcInterfaceData, MessageParcel& nfcInterfaceReply, MessageOption& nfcInterfaceOption); 54 55 int32_t NfcInterfaceStubIoctlWithResponse(MessageParcel& nfcInterfaceData, MessageParcel& nfcInterfaceReply, MessageOption& nfcInterfaceOption); 56 57 int32_t NfcInterfaceStubOpen(MessageParcel& nfcInterfaceData, MessageParcel& nfcInterfaceReply, MessageOption& nfcInterfaceOption); 58 59 int32_t NfcInterfaceStubCoreInitialized(MessageParcel& nfcInterfaceData, MessageParcel& nfcInterfaceReply, MessageOption& nfcInterfaceOption); 60 61 int32_t NfcInterfaceStubPrediscover(MessageParcel& nfcInterfaceData, MessageParcel& nfcInterfaceReply, MessageOption& nfcInterfaceOption); 62 63 int32_t NfcInterfaceStubWrite(MessageParcel& nfcInterfaceData, MessageParcel& nfcInterfaceReply, MessageOption& nfcInterfaceOption); 64 65 int32_t NfcInterfaceStubControlGranted(MessageParcel& nfcInterfaceData, MessageParcel& nfcInterfaceReply, MessageOption& nfcInterfaceOption); 66 67 int32_t NfcInterfaceStubPowerCycle(MessageParcel& nfcInterfaceData, MessageParcel& nfcInterfaceReply, MessageOption& nfcInterfaceOption); 68 69 int32_t NfcInterfaceStubClose(MessageParcel& nfcInterfaceData, MessageParcel& nfcInterfaceReply, MessageOption& nfcInterfaceOption); 70 71 int32_t NfcInterfaceStubIoctl(MessageParcel& nfcInterfaceData, MessageParcel& nfcInterfaceReply, MessageOption& nfcInterfaceOption); 72 73 int32_t NfcInterfaceStubGetVersion(MessageParcel& nfcInterfaceData, MessageParcel& nfcInterfaceReply, MessageOption& nfcInterfaceOption); 74 75 76 static inline ObjectDelegator<OHOS::HDI::Nfc::V1_1::NfcInterfaceStub, OHOS::HDI::Nfc::V1_1::INfcInterface> objDelegator_; 77 sptr<OHOS::HDI::Nfc::V1_1::INfcInterface> impl_; 78}; 79} // V1_1 80} // Nfc 81} // HDI 82} // OHOS 83 84#endif // OHOS_HDI_NFC_V1_1_NFCINTERFACESTUB_H 85 86