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_VENDOR_H
16 #define I_NFC_VENDOR_H
17 
18 #include "v1_1/nfc_types.h"
19 
20 typedef uint8_t nfc_event_t;
21 typedef uint8_t nfc_status_t;
22 
23 typedef void (NfcStackCallbackT)(nfc_event_t event, nfc_status_t eventStatus);
24 typedef void (NfcStackDataCallbackT)(uint16_t dataLen, uint8_t *pData);
25 
26 namespace OHOS {
27 namespace HDI {
28 namespace Nfc {
29 class INfcVendor {
30 public:
~INfcVendor()31     virtual ~INfcVendor() {}
32     virtual int VendorOpen(NfcStackCallbackT *pCback, NfcStackDataCallbackT *pDataCback);
33     virtual int VendorWrite(uint16_t dataLen, const uint8_t *pData);
34     virtual int VendorCoreInitialized(uint16_t coreInitRspLen, uint8_t *pCoreInitRspParams);
35     virtual int VendorPrediscover(void);
36     virtual int VendorClose(bool bShutdown);
37     virtual int VendorControlGranted(void);
38     virtual int VendorPowerCycle(void);
39     virtual int VendorIoctl(long arg, void *pData);
40     virtual int VendorIoctlWithResponse(long arg, void *pData, uint16_t dataLen, std::vector<uint8_t> &pRetVal);
41     virtual int VendorGetConfig(V1_1::NfcVendorConfig &config);
42     virtual int VendorFactoryReset(void);
43     virtual int VendorShutdownCase(void);
44 };
45 } // Nfc
46 } // HDI
47 } // OHOS
48 #endif /* I_NFC_VENDOR_H */
49