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_SECURE_ELEMENT_V1_0_SECUREELEMENTINTERFACESTUB_H 17#define OHOS_HDI_SECURE_ELEMENT_V1_0_SECUREELEMENTINTERFACESTUB_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/isecure_element_interface.h" 25 26namespace OHOS { 27namespace HDI { 28namespace SecureElement { 29namespace V1_0 { 30 31using namespace OHOS; 32class SecureElementInterfaceStub : public IPCObjectStub { 33public: 34 explicit SecureElementInterfaceStub(const sptr<ISecureElementInterface> &impl); 35 virtual ~SecureElementInterfaceStub(); 36 37 int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; 38 39 static int32_t SecureElementInterfaceStubinit_(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption, sptr<OHOS::HDI::SecureElement::V1_0::ISecureElementInterface> impl); 40 41 static int32_t SecureElementInterfaceStubgetAtr_(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption, sptr<OHOS::HDI::SecureElement::V1_0::ISecureElementInterface> impl); 42 43 static int32_t SecureElementInterfaceStubisSecureElementPresent_(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption, sptr<OHOS::HDI::SecureElement::V1_0::ISecureElementInterface> impl); 44 45 static int32_t SecureElementInterfaceStubopenLogicalChannel_(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption, sptr<OHOS::HDI::SecureElement::V1_0::ISecureElementInterface> impl); 46 47 static int32_t SecureElementInterfaceStubopenBasicChannel_(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption, sptr<OHOS::HDI::SecureElement::V1_0::ISecureElementInterface> impl); 48 49 static int32_t SecureElementInterfaceStubcloseChannel_(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption, sptr<OHOS::HDI::SecureElement::V1_0::ISecureElementInterface> impl); 50 51 static int32_t SecureElementInterfaceStubtransmit_(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption, sptr<OHOS::HDI::SecureElement::V1_0::ISecureElementInterface> impl); 52 53 static int32_t SecureElementInterfaceStubreset_(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption, sptr<OHOS::HDI::SecureElement::V1_0::ISecureElementInterface> impl); 54 55 static int32_t SecureElementInterfaceStubGetVersion_(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption, sptr<OHOS::HDI::SecureElement::V1_0::ISecureElementInterface> impl); 56 57private: 58 int32_t SecureElementInterfaceStubinit(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption); 59 60 int32_t SecureElementInterfaceStubgetAtr(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption); 61 62 int32_t SecureElementInterfaceStubisSecureElementPresent(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption); 63 64 int32_t SecureElementInterfaceStubopenLogicalChannel(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption); 65 66 int32_t SecureElementInterfaceStubopenBasicChannel(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption); 67 68 int32_t SecureElementInterfaceStubcloseChannel(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption); 69 70 int32_t SecureElementInterfaceStubtransmit(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption); 71 72 int32_t SecureElementInterfaceStubreset(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption); 73 74 int32_t SecureElementInterfaceStubGetVersion(MessageParcel& secureElementInterfaceData, MessageParcel& secureElementInterfaceReply, MessageOption& secureElementInterfaceOption); 75 76 77 static inline ObjectDelegator<OHOS::HDI::SecureElement::V1_0::SecureElementInterfaceStub, OHOS::HDI::SecureElement::V1_0::ISecureElementInterface> objDelegator_; 78 sptr<OHOS::HDI::SecureElement::V1_0::ISecureElementInterface> impl_; 79}; 80} // V1_0 81} // SecureElement 82} // HDI 83} // OHOS 84 85#endif // OHOS_HDI_SECURE_ELEMENT_V1_0_SECUREELEMENTINTERFACESTUB_H 86 87