• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 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 I_NFC_CONTROLLER_SERVICE_H
16 #define I_NFC_CONTROLLER_SERVICE_H
17 
18 #include "nfc_sdk_common.h"
19 #include "infc_controller_callback.h"
20 #include "iremote_broker.h"
21 
22 namespace OHOS {
23 namespace NFC {
24 class INfcControllerService : public OHOS::IRemoteBroker {
25 public:
26     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.nfc.INfcControllerService");
27 
~INfcControllerService()28     virtual ~INfcControllerService() {}
29     /**
30      * @brief  Get the NFC state
31      * @return The NFC State
32      */
33     virtual int GetState() = 0;
34     /**
35      * @brief Turn On NFC
36      * @return The status code of calling function.
37      */
38     virtual int TurnOn() = 0;
39     /**
40      * @brief Turn Off NFC
41      * @return The status code of calling function.
42      */
43     virtual int TurnOff() = 0;
44      /**
45      * @brief NFC enable
46      * @param isOpen The output for checking nfc is open or not.
47      * @return The status code of calling function.
48      */
49     virtual int IsNfcOpen(bool &isOpen) = 0;
50 
51     virtual KITS::ErrorCode RegisterCallBack(const sptr<INfcControllerCallback> &callback,
52         const std::string& type) = 0;
53     virtual KITS::ErrorCode UnRegisterCallBack(const std::string& type) = 0;
54     virtual OHOS::sptr<IRemoteObject> GetTagServiceIface() = 0;
55 private:
56 };
57 }  // namespace NFC
58 }  // namespace OHOS
59 #endif  // I_NFC_CONTROLLER_SERVICE_H
60