1/* 2 * Copyright (C) 2015 The Android Open Source Project 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 25extern "C" { 26#endif 27 28NFCSTATUS EXTNS_Init (tNFA_DM_CBACK *p_dm_cback, 29 tNFA_CONN_CBACK *p_conn_cback); 30void EXTNS_Close (void); 31NFCSTATUS EXTNS_MfcInit (tNFA_ACTIVATED activationData); 32NFCSTATUS EXTNS_MfcCheckNDef (void); 33NFCSTATUS EXTNS_MfcReadNDef (void); 34NFCSTATUS EXTNS_MfcPresenceCheck (void); 35NFCSTATUS EXTNS_MfcWriteNDef (uint8_t *pBuf, uint32_t len); 36NFCSTATUS EXTNS_MfcFormatTag (uint8_t *key, uint8_t len); 37NFCSTATUS EXTNS_MfcDisconnect (void); 38NFCSTATUS EXTNS_MfcActivated (void); 39NFCSTATUS EXTNS_MfcTransceive (uint8_t *p_data, uint32_t len); 40NFCSTATUS EXTNS_MfcRegisterNDefTypeHandler (tNFA_NDEF_CBACK *ndefHandlerCallback); 41NFCSTATUS EXTNS_MfcCallBack (uint8_t *buf, uint32_t buflen); 42NFCSTATUS EXTNS_MfcSetReadOnly (uint8_t *key, uint8_t len); 43void EXTNS_SetConnectFlag (bool_t flagval); 44bool_t EXTNS_GetConnectFlag (void); 45void EXTNS_SetDeactivateFlag (bool_t flagval); 46bool_t EXTNS_GetDeactivateFlag (void); 47void EXTNS_SetCallBackFlag (bool_t flagval); 48bool_t EXTNS_GetCallBackFlag (void); 49NFCSTATUS EXTNS_CheckMfcResponse (uint8_t** sTransceiveData, uint32_t *sTransceiveDataLen); 50void MfcPresenceCheckResult (NFCSTATUS status); 51void MfcResetPresenceCheckStatus (void); 52NFCSTATUS EXTNS_GetPresenceCheckStatus (void); 53#ifdef __cplusplus 54} 55#endif 56 57/* 58 * Events from JNI for NXP Extensions 59 */ 60#define PH_NXPEXTNS_MIFARE_CHECK_NDEF 0x01 /* MIFARE Check Ndef */ 61#define PH_NXPEXTNS_MIFARE_READ_NDEF 0x02 /* MIFARE Read Ndef */ 62#define PH_NXPEXTNS_MIFARE_WRITE_NDEF 0x03 /* MIFARE Write Ndef */ 63#define PH_NXPEXTNS_MIFARE_FORMAT_NDEF 0x04 /* MIFARE Format */ 64#define PH_NXPEXTNS_DISCONNECT 0x05 /* Target Disconnect */ 65#define PH_NXPEXTNS_ACTIVATED 0x06 /* Target Activated */ 66#define PH_NXPEXTNS_MIFARE_TRANSCEIVE 0x07 /* MIFARE Raw Transceive */ 67#define PH_NXPEXTNS_MIFARE_READ_ONLY 0x08 /* MIFARE Read Only */ 68#define PH_NXPEXTNS_MIFARE_PRESENCE_CHECK 0x09 /* MIFARE Presence Check */ 69#define PH_NXPEXTNS_RX_DATA 0xF1 /* Receive Data */ 70 71#endif /* _PHNXPEXTNS_H_ */ 72