nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 NXP Semiconductors |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef _PHNXPEXTNS_H_ |
| 18 | #define _PHNXPEXTNS_H_ |
| 19 | |
| 20 | #include <nfa_api.h> |
| 21 | #include <sys/types.h> |
| 22 | #include <errno.h> |
| 23 | #include <phNfcStatus.h> |
| 24 | #ifdef __cplusplus |
| 25 | extern "C" { |
| 26 | #endif |
| 27 | |
nxpandroid | 34627bd | 2016-05-27 15:52:30 +0530 | [diff] [blame^] | 28 | NFCSTATUS EXTNS_Init (tNFA_DM_CBACK *p_dm_cback, |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 29 | tNFA_CONN_CBACK *p_conn_cback); |
nxpandroid | 34627bd | 2016-05-27 15:52:30 +0530 | [diff] [blame^] | 30 | void EXTNS_Close (void); |
| 31 | NFCSTATUS EXTNS_MfcInit (tNFA_ACTIVATED activationData); |
| 32 | NFCSTATUS EXTNS_MfcCheckNDef (void); |
| 33 | NFCSTATUS EXTNS_MfcReadNDef (void); |
| 34 | NFCSTATUS EXTNS_MfcPresenceCheck (void); |
| 35 | NFCSTATUS EXTNS_MfcWriteNDef (uint8_t *pBuf, uint32_t len); |
| 36 | NFCSTATUS EXTNS_MfcFormatTag (uint8_t *key, uint8_t len); |
| 37 | NFCSTATUS EXTNS_MfcDisconnect (void); |
| 38 | NFCSTATUS EXTNS_MfcActivated (void); |
| 39 | NFCSTATUS EXTNS_MfcTransceive (uint8_t *p_data, uint32_t len); |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 40 | NFCSTATUS EXTNS_MfcRegisterNDefTypeHandler (tNFA_NDEF_CBACK *ndefHandlerCallback); |
nxpandroid | 34627bd | 2016-05-27 15:52:30 +0530 | [diff] [blame^] | 41 | NFCSTATUS EXTNS_MfcCallBack (uint8_t *buf, uint32_t buflen); |
| 42 | NFCSTATUS EXTNS_MfcSetReadOnly (uint8_t *key, uint8_t len); |
| 43 | void EXTNS_SetConnectFlag (bool_t flagval); |
| 44 | bool_t EXTNS_GetConnectFlag (void); |
| 45 | void EXTNS_SetDeactivateFlag (bool_t flagval); |
| 46 | bool_t EXTNS_GetDeactivateFlag (void); |
| 47 | void EXTNS_SetCallBackFlag (bool_t flagval); |
| 48 | bool_t EXTNS_GetCallBackFlag (void); |
| 49 | NFCSTATUS EXTNS_CheckMfcResponse (uint8_t** sTransceiveData, uint32_t *sTransceiveDataLen); |
| 50 | void MfcPresenceCheckResult (NFCSTATUS status); |
| 51 | void MfcResetPresenceCheckStatus (void); |
| 52 | NFCSTATUS EXTNS_GetPresenceCheckStatus (void); |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 53 | |
| 54 | #ifdef __cplusplus |
| 55 | } |
| 56 | #endif |
| 57 | |
| 58 | /* |
| 59 | * Events from JNI for NXP Extensions |
| 60 | */ |
nxpandroid | 34627bd | 2016-05-27 15:52:30 +0530 | [diff] [blame^] | 61 | #define PH_NXPEXTNS_MIFARE_CHECK_NDEF 0x01 /* MIFARE Check Ndef */ |
| 62 | #define PH_NXPEXTNS_MIFARE_READ_NDEF 0x02 /* MIFARE Read Ndef */ |
| 63 | #define PH_NXPEXTNS_MIFARE_WRITE_NDEF 0x03 /* MIFARE Write Ndef */ |
| 64 | #define PH_NXPEXTNS_MIFARE_FORMAT_NDEF 0x04 /* MIFARE Format */ |
| 65 | #define PH_NXPEXTNS_DISCONNECT 0x05 /* Target Disconnect */ |
| 66 | #define PH_NXPEXTNS_ACTIVATED 0x06 /* Target Activated */ |
| 67 | #define PH_NXPEXTNS_MIFARE_TRANSCEIVE 0x07 /* MIFARE Raw Transceive */ |
| 68 | #define PH_NXPEXTNS_MIFARE_READ_ONLY 0x08 /* MIFARE Read Only */ |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 69 | #define PH_NXPEXTNS_MIFARE_PRESENCE_CHECK 0x09 /* MIFARE Presence Check */ |
nxpandroid | 34627bd | 2016-05-27 15:52:30 +0530 | [diff] [blame^] | 70 | #define PH_NXPEXTNS_RX_DATA 0xF1 /* Receive Data */ |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 71 | |
| 72 | #endif /* _PHNXPEXTNS_H_ */ |