/* * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "se_impl.h" #include #include #include #define HDF_LOG_TAG hdf_se namespace OHOS { namespace HDI { namespace SecureElement { extern "C" ISecureElementInterface *SecureElementInterfaceImplGetInstance(void) { using OHOS::HDI::SecureElement::SeImpl; SeImpl* service = new (std::nothrow) SeImpl(); if (service == nullptr) { return nullptr; } return service; } int32_t SeImpl::init(const sptr& clientCallback, SecureElementStatus& status) { return adaptor_.init(clientCallback, status); } int32_t SeImpl::getAtr(std::vector& response) { return adaptor_.getAtr(response); } int32_t SeImpl::isSecureElementPresent(bool& present) { return adaptor_.isSecureElementPresent(present); } int32_t SeImpl::openLogicalChannel(const std::vector& aid, uint8_t p2, std::vector& response, uint8_t& channelNumber, SecureElementStatus& status) { return adaptor_.openLogicalChannel(aid, p2, response, channelNumber, status); } int32_t SeImpl::openBasicChannel(const std::vector& aid, uint8_t p2, std::vector& response, SecureElementStatus& status) { return adaptor_.openBasicChannel(aid, p2, response, status); } int32_t SeImpl::closeChannel(uint8_t channelNumber, SecureElementStatus& status) { return adaptor_.closeChannel(channelNumber, status); } int32_t SeImpl::transmit(const std::vector& command, std::vector& response, SecureElementStatus& status) { return adaptor_.transmit(command, response, status); } int32_t SeImpl::reset(SecureElementStatus& status) { return adaptor_.reset(status); } } // SecureElement } // HDI } // OHOS