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