NXP NFC Library Top Level API.
More...
NXP NFC Library Top Level API.
- General
- This module provides an high level abstraction of the NXP NFC Reader Library stack, focusing on simplicity while featuring the mostly used functionality. It aims to write NXP NFC applications requiring as less code as possible. Still there is the possibility to use the legacy NXP NFC Reader Library stack API by calling phNfcLib_GetDataParams in order to retrieve the dataparams structure required when calling NXP NFC Reader Library stack functions.
- Activation and Transmission Channel
- One of the main concepts of the NXP NFC Library module are the transmission channels. A transmission channel is a logical connection between the device running the library and a peer. Once a peer could be activated this logical channel gets established and subsequent calls to phNfcLib_Transmit and phNfcLib_Receive are performing transmissions over this channel. In fact this channel defines how data sent over the channel gets encapsulated. There are three different channels available:
- NFC Forum Channel: This channel is used to transfer NDEF messages
- EMVCo Channel: This channel is used to transfer ISO 7816 APDUs over the ISO14443-4 protocol, according to EMVCo L1 specification.
- ISO Channel: General channel which performs raw data transfer on block/frame level as defined in the corresponding protocols.
- See also
- For more information refer to phNfcLib_Transmit, phNfcLib_Receive and phNfcLib_Activate.
- NXP Nfc Library EMVCo State Machine
- The NXP NFC Library module implements a state machine ensuring the API functions exposed are executed in the correct order and state.
- NXP Nfc Library ISO State Machine
- The NXP NFC Library module implements a state machine ensuring the API functions exposed are executed in the correct order and state.
Functions in this module are only allowed to be called in specific states, otherwise PH_NFCLIB_STATUS_INVALID_STATE an error is returned The API function description section provides information which state is required for each function to be called.
- Example Code for EMVCo polling application. (Activation and one APDU data exchange)
#include <ph_Status.h>
#include <phNfcLib.h>
{
phNfcLib_Status_t status;
if (status == PH_NFCLIB_STATUS_PEER_ACTIVATION_DONE)
{
}
else
{
}
return status;
}
- Example Code for Reading an NDEF record.
#include <ph_Status.h>
#include <phNfcLib.h>
phNfcLib_Status_t NdefActivateAndRead(
uint8_t * aNdefMessage,
uint16_t *pNdefMessageSize)
{
phNfcLib_Status_t status;
if (status == PH_NFCLIB_STATUS_PEER_ACTIVATION_DONE)
{
}
else
{
}
return status;
}