1bc2ed2b3Sopenharmony_ci/*
2bc2ed2b3Sopenharmony_ci * Copyright (C) 2023 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 NCI_CE_PROXY_H
16bc2ed2b3Sopenharmony_ci#define NCI_CE_PROXY_H
17bc2ed2b3Sopenharmony_ci#include "inci_ce_interface.h"
18bc2ed2b3Sopenharmony_ci
19bc2ed2b3Sopenharmony_cinamespace OHOS {
20bc2ed2b3Sopenharmony_cinamespace NFC {
21bc2ed2b3Sopenharmony_cinamespace NCI {
22bc2ed2b3Sopenharmony_ciclass NciCeProxy final : public INciCeInterface {
23bc2ed2b3Sopenharmony_cipublic:
24bc2ed2b3Sopenharmony_ci    NciCeProxy();
25bc2ed2b3Sopenharmony_ci
26bc2ed2b3Sopenharmony_ci    /**
27bc2ed2b3Sopenharmony_ci     * @brief Set the listener to receive the card emulation notifications.
28bc2ed2b3Sopenharmony_ci     * @param listener The listener to receive the card emulation notifications.
29bc2ed2b3Sopenharmony_ci     */
30bc2ed2b3Sopenharmony_ci    void SetCeHostListener(std::weak_ptr<ICeHostListener> listener) override;
31bc2ed2b3Sopenharmony_ci
32bc2ed2b3Sopenharmony_ci    /**
33bc2ed2b3Sopenharmony_ci     * @brief compute the routing parameters based on the default payment app
34bc2ed2b3Sopenharmony_ci     * and all installed app.
35bc2ed2b3Sopenharmony_ci     * @return True if success, otherwise false.
36bc2ed2b3Sopenharmony_ci     */
37bc2ed2b3Sopenharmony_ci    bool ComputeRoutingParams(int defaultPaymentType) override;
38bc2ed2b3Sopenharmony_ci
39bc2ed2b3Sopenharmony_ci    /**
40bc2ed2b3Sopenharmony_ci     * @brief Commit the routing parameters to nfc controller.
41bc2ed2b3Sopenharmony_ci     * @return True if success, otherwise false.
42bc2ed2b3Sopenharmony_ci     */
43bc2ed2b3Sopenharmony_ci    bool CommitRouting() override;
44bc2ed2b3Sopenharmony_ci
45bc2ed2b3Sopenharmony_ci    /**
46bc2ed2b3Sopenharmony_ci     * @brief  send raw frame data
47bc2ed2b3Sopenharmony_ci     * @param  hexCmdData the data to send
48bc2ed2b3Sopenharmony_ci     * @return True if success, otherwise false.
49bc2ed2b3Sopenharmony_ci     */
50bc2ed2b3Sopenharmony_ci    bool SendRawFrame(std::string &hexCmdData) override;
51bc2ed2b3Sopenharmony_ci    /**
52bc2ed2b3Sopenharmony_ci     * @brief  add aid routing
53bc2ed2b3Sopenharmony_ci     * @param  aidStr: aid
54bc2ed2b3Sopenharmony_ci     * @param  route: route dest
55bc2ed2b3Sopenharmony_ci     * @param  aidInfo: prefix subset etc
56bc2ed2b3Sopenharmony_ci     * @param  power: power state
57bc2ed2b3Sopenharmony_ci     * @return True if success, otherwise false.
58bc2ed2b3Sopenharmony_ci     */
59bc2ed2b3Sopenharmony_ci    bool AddAidRouting(const std::string &aidStr, int route, int aidInfo,
60bc2ed2b3Sopenharmony_ci                       int power) override;
61bc2ed2b3Sopenharmony_ci    /**
62bc2ed2b3Sopenharmony_ci     * @brief  clear aid table
63bc2ed2b3Sopenharmony_ci     * @return True if success, otherwise false.
64bc2ed2b3Sopenharmony_ci     */
65bc2ed2b3Sopenharmony_ci    bool ClearAidTable() override;
66bc2ed2b3Sopenharmony_ci
67bc2ed2b3Sopenharmony_ci    /**
68bc2ed2b3Sopenharmony_ci     * @brief get sim bundle name of the vendor
69bc2ed2b3Sopenharmony_ci     * @return sim bundle name of the vendor
70bc2ed2b3Sopenharmony_ci     */
71bc2ed2b3Sopenharmony_ci    std::string GetSimVendorBundleName() override;
72bc2ed2b3Sopenharmony_ci
73bc2ed2b3Sopenharmony_ci    /**
74bc2ed2b3Sopenharmony_ci     * @brief Notify Default Payment Type
75bc2ed2b3Sopenharmony_ci     * @param paymentType see enum DefaultPaymentType
76bc2ed2b3Sopenharmony_ci     */
77bc2ed2b3Sopenharmony_ci    void NotifyDefaultPaymentType(int paymentType) override;
78bc2ed2b3Sopenharmony_ci
79bc2ed2b3Sopenharmony_ciprivate:
80bc2ed2b3Sopenharmony_ci    std::shared_ptr<INciCeInterface> nciCeInterface_;
81bc2ed2b3Sopenharmony_ci};
82bc2ed2b3Sopenharmony_ci} // namespace NCI
83bc2ed2b3Sopenharmony_ci} // namespace NFC
84bc2ed2b3Sopenharmony_ci} // namespace OHOS
85bc2ed2b3Sopenharmony_ci#endif /* NCI_CE_PROXY_H */