wut  v1.7.0
Wii U Toolchain
Data Structures | Typedefs | Enumerations | Functions
Nfc_nfc

Near Field Communication (NFC). More...

Collaboration diagram for Nfc_nfc:

Data Structures

struct  NFCUid
 
struct  NFCTagInfo
 
struct  NFCNTAGVersion
 
struct  NFCReadT2TResult
 

Typedefs

typedef int32_t NFCError
 
typedef uint8_t NFCProtocol
 
typedef uint8_t NFCTechnology
 
typedef uint8_t NFCTechnologyMask
 
typedef uint8_t NFCNDEFFlags
 
typedef struct NFCUid NFCUid
 
typedef struct NFCTagInfo NFCTagInfo
 
typedef struct NFCNTAGVersion NFCNTAGVersion
 
typedef struct NFCReadT2TResult NFCReadT2TResult
 
typedef enum NFCMode NFCMode
 
typedef enum NFCProtocolEnum NFCProtocolEnum
 
typedef enum NFCTechnologyEnum NFCTechnologyEnum
 
typedef enum NFCTechnologyMaskEnum NFCTechnologyMaskEnum
 
typedef enum NFCNDEFFlagsEnum NFCNDEFFlagsEnum
 
typedef void(* NFCCallbackFn) (VPADChan chan, NFCError error, void *userContext)
 Generic callback function. More...
 
typedef void(* NFCTagDetectCallbackFn) (VPADChan chan, BOOL hasTag, void *userContext)
 Callback function for NFCSetTagDetectCallback. More...
 
typedef void(* NFCDetectCallbackFn) (VPADChan chan, NFCError error, NFCUid *uid, BOOL readOnly, BOOL hasLockedData, NFCNDEFFlags flags, void *userContext)
 Callback function for NFCDetect. More...
 
typedef void(* NFCRawDataCallbackFn) (VPADChan chan, NFCError error, uint32_t responseSize, void *responseData, void *userContext)
 Callback function for NFCSendRawData and variations. More...
 
typedef void(* NFCRawDataTwiceCallbackFn) (VPADChan chan, NFCError error, uint8_t numCompleted, uint32_t response0Size, void *response0Data, uint32_t response1Size, void *response1Data, void *userContext)
 Callback function for NFCSendRawDataTwice and variations. More...
 
typedef void(* NFCReadCallbackFn) (VPADChan chan, NFCError error, NFCUid *uid, BOOL readOnly, uint32_t dataSize, void *data, uint32_t lockedDataSize, void *lockedData, void *userContext)
 Callback function for NFCRead. More...
 
typedef void(* NFCReadT2TCallbackFn) (VPADChan chan, NFCError error, uint8_t rfDiscId, NFCProtocol protocol, NFCTechnology technology, uint8_t uidSize, uint8_t *uid, NFCNTAGVersion *version, NFCReadT2TResult *result, void *userContext)
 Callback function for NFCReadT2T. More...
 
typedef void(* NFCGetTagInfoCallbackFn) (VPADChan chan, NFCError error, NFCTagInfo *tagInfo, void *userContext)
 Callback function for NFCGetTagInfo. More...
 
typedef void(* NFCGetTagInfoMultiCallbackFn) (VPADChan chan, NFCError error, uint8_t numTagInfos, NFCTagInfo *tagInfo0, NFCTagInfo *tagInfo1, NFCTagInfo *tagInfo2, void *userContext)
 Callback function for NFCGetTagInfoMulti. More...
 

Enumerations

enum  NFCMode {
  NFC_MODE_INVALID = -1 ,
  NFC_MODE_IDLE = 0 ,
  NFC_MODE_ACTIVE = 1
}
 
enum  NFCProtocolEnum {
  NFC_PROTOCOL_UNKNOWN = 0x00 ,
  NFC_PROTOCOL_T1T = 0x01 ,
  NFC_PROTOCOL_T2T = 0x02 ,
  NFC_PROTOCOL_T3T = 0x03 ,
  NFC_PROTOCOL_ISO_DEP = 0x04 ,
  NFC_PROTOCOL_15693 = 0x83
}
 
enum  NFCTechnologyEnum {
  NFC_TECHNOLOGY_A = 0x00 ,
  NFC_TECHNOLOGY_B = 0x01 ,
  NFC_TECHNOLOGY_F = 0x02 ,
  NFC_TECHNOLOGY_ISO15693 = 0x06
}
 
enum  NFCTechnologyMaskEnum {
  NFC_TECHNOLOGY_MASK_ALL = 0 ,
  NFC_TECHNOLOGY_MASK_A = (1 << 0) ,
  NFC_TECHNOLOGY_MASK_B = (1 << 1) ,
  NFC_TECHNOLOGY_MASK_F = (1 << 2) ,
  NFC_TECHNOLOGY_MASK_ISO15693 = (1 << 3)
}
 
enum  NFCNDEFFlagsEnum {
  NFC_NDEF_FLAG_READ_ONLY = (1 << 0) ,
  NFC_NDEF_FLAG_FORMATED = (1 << 1) ,
  NFC_NDEF_FLAG_SUPPORTED = (1 << 2) ,
  NFC_NDEF_FLAG_UNKNOWN = (1 << 3) ,
  NFC_NDEF_FLAG_FORMATABLE = (1 << 4) ,
  NFC_NDEF_FLAG_SOFT_LOCKABLE = (1 << 5) ,
  NFC_NDEF_FLAG_HARD_LOCKABLE = (1 << 6) ,
  NFC_NDEF_FLAG_OTP = (1 << 7)
}
 

Functions

NFCError NFCInit (VPADChan chan)
 Initializes the NFC library. More...
 
NFCError NFCInitEx (VPADChan chan, uint32_t powerMode)
 Initializes the NFC library. More...
 
NFCError NFCShutdown (VPADChan chan)
 Shutdown the NFC library. More...
 
BOOL NFCIsInit (VPADChan chan)
 Check if NFC is initialized. More...
 
void NFCProc (VPADChan chan)
 Process NFC. More...
 
void NFCSetTagDetectCallback (VPADChan chan, NFCTagDetectCallbackFn callback, void *userContext)
 Set a callback which will be called once a tag is attached / removed. More...
 
NFCMode NFCGetMode (VPADChan chan)
 Get the current NFC mode. More...
 
NFCError NFCSetMode (VPADChan chan, NFCMode mode)
 Set the current NFC mode. More...
 
NFCError NFCAbort (VPADChan chan, NFCCallbackFn callback, void *userContext)
 Abort pending NFC operations. More...
 
NFCError NFCAntennaCheck (VPADChan chan, NFCCallbackFn callback, void *userContext)
 Check the NFC antenna. More...
 
NFCError NFCDetect (VPADChan chan, uint32_t discoveryTimeout, NFCDetectCallbackFn callback, void *userContext)
 Start tag discovery and provide info about the first detected tag. More...
 
NFCError NFCSetLockBitsForT1T (VPADChan chan, uint8_t numBlocks, NFCRawDataCallbackFn callback, void *userContext)
 This will lock an area of blocks at the end of a 512-byte Type 1 Tag. More...
 
NFCError NFCRead (VPADChan chan, uint32_t discoveryTimeout, NFCUid *uid, NFCUid *uidMask, NFCReadCallbackFn callback, void *userContext)
 Read from a tag. More...
 
NFCError NFCWrite (VPADChan chan, uint32_t discoveryTimeout, NFCUid *uid, NFCUid *uidMask, uint32_t size, void *data, NFCCallbackFn callback, void *userContext)
 Write to a tag. More...
 
NFCError NFCSendRawData (VPADChan chan, BOOL startDiscovery, uint32_t discoveryTimeout, uint32_t commandTimeout, uint32_t commandSize, uint32_t responseSize, void *commandData, NFCRawDataCallbackFn callback, void *userContext)
 Send a raw NFC command to a tag. More...
 
NFCError NFCSendRawDataEx (VPADChan chan, BOOL startDiscovery, uint32_t discoveryTimeout, uint32_t commandTimeout, uint32_t commandSize, uint32_t responseSize, void *commandData, BOOL disableCRC, NFCRawDataCallbackFn callback, void *userContext)
 Send a raw NFC command to a tag. More...
 
NFCError NFCSendRawDataEx2 (VPADChan chan, BOOL startDiscovery, uint32_t discoveryTimeout, uint32_t commandTimeout, uint32_t commandSize, uint32_t responseSize, void *commandData, BOOL disableCRC, NFCTechnologyMask techMask, NFCRawDataCallbackFn callback, void *userContext)
 Send a raw NFC command to a tag. More...
 
NFCError NFCSendRawDataWithPrePolling (VPADChan chan, BOOL startDiscovery, uint32_t discoveryTimeout, uint32_t commandTimeout, uint32_t commandSize, uint32_t responseSize, void *commandData, NFCRawDataCallbackFn callback, void *userContext)
 Send a raw NFC command to a tag. More...
 
NFCError NFCSendRawDataWithPrePollingEx (VPADChan chan, BOOL startDiscovery, uint32_t discoveryTimeout, uint32_t commandTimeout, uint32_t commandSize, uint32_t responseSize, void *commandData, NFCRawDataCallbackFn callback, void *userContext)
 Send a raw NFC command to a tag. More...
 
NFCError NFCSendRawDataTwice (VPADChan chan, uint32_t command0Timeout, uint32_t command0Size, uint32_t response0Size, void *command0Data, uint32_t command1Timeout, uint32_t command1Size, uint32_t response1Size, void *command1Data, NFCRawDataTwiceCallbackFn callback, void *userContext)
 Send two raw NFC commands to an activated tag. More...
 
NFCError NFCFormat (VPADChan chan, uint32_t discoveryTimeout, NFCUid *uid, NFCUid *uidMask, NFCCallbackFn callback, void *userContext)
 Check if the tag is NDEF Formatable. More...
 
NFCError NFCGetTagInfo (VPADChan chan, uint32_t discoveryTimeout, NFCGetTagInfoCallbackFn callback, void *userContext)
 Obtain info about tags. More...
 
NFCError NFCGetTagInfoMulti (VPADChan chan, uint32_t discoveryTimeout, NFCGetTagInfoMultiCallbackFn callback, void *userContext)
 Obtain info about multiple tags. More...
 
NFCError NFCIsTagPresent (VPADChan chan, uint32_t discoveryTimeout, NFCUid *uid, NFCUid *uidMask, NFCCallbackFn callback, void *userContext)
 Check if a tag is still present. More...
 
NFCError NFCSetReadOnly (VPADChan chan, uint32_t discoveryTimeout, NFCUid *uid, NFCUid *uidMask, BOOL readOnly, NFCCallbackFn callback, void *userContext)
 Make a Type 1 Tag read only by setting the RWA byte. More...
 
NFCError NFCReadT2T (VPADChan chan, uint32_t discoveryTimeout, NFCUid *uid, NFCUid *uidMask, NFCNTAGVersion *version, uint32_t commandTimeout, uint8_t numReads, uint8_t read0Start, uint8_t read0End, uint8_t read1Start, uint8_t read1End, uint8_t read2Start, uint8_t read2End, uint8_t read3Start, uint8_t read3End, uint8_t authenticate, NFCReadT2TCallbackFn callback, void *userContext)
 Read data from a Type 2 NTAG. More...
 
NFCError NFCWriteT2T (VPADChan chan, uint16_t discoveryTimeout, NFCUid *uid, NFCUid *uidMask, NFCNTAGVersion *version, uint32_t commandTimeout, uint8_t numWrites, uint8_t write0Start, uint8_t write0Size, void *write0Data, uint8_t write1Start, uint8_t write1Size, void *write1Data, uint8_t write2Start, uint8_t write2Size, void *write2Data, uint8_t write3Start, uint8_t write3Size, void *write3Data, uint8_t activationStart, uint32_t *deactivationData, uint32_t *activationData, uint8_t authenticate, uint8_t activate, NFCCallbackFn callback, void *userContext)
 Write data to a Type 2 NTAG. More...
 
void NFCGetUIDFromActivationEventData (void *data, NFCProtocol *outProtocol, NFCTechnology *outTechnology, uint8_t *outUidSize, uint8_t *outUid)
 Get the UID and other parameters from activation event data. More...
 
NFCError __NFCSystemAbort (VPADChan chan)
 Abort and call pending callbacks. More...
 

Detailed Description

Near Field Communication (NFC).


Data Structure Documentation

◆ NFCUid

struct NFCUid

Definition at line 82 of file nfc.h.

Data Fields
uint8_t uid[7]

◆ NFCTagInfo

struct NFCTagInfo

Definition at line 89 of file nfc.h.

Data Fields
uint8_t uidSize
uint8_t uid[10]
NFCTechnology technology
NFCProtocol protocol

◆ NFCNTAGVersion

struct NFCNTAGVersion

Definition at line 104 of file nfc.h.

Data Fields
uint8_t header
uint8_t vendorId
uint8_t productType
uint8_t productSubtype
uint8_t majorProductVersion
uint8_t minorProductversion
uint8_t storageSize
uint8_t protocolType

◆ NFCReadT2TResult

struct NFCReadT2TResult

Definition at line 125 of file nfc.h.

Data Fields
uint8_t numReads The amount of reads which have been performed.
uint8_t read0Start
uint8_t read0End
uint8_t read1Start
uint8_t read1End
uint8_t read2Start
uint8_t read2End
uint8_t read3Start
uint8_t read3End
uint8_t data[0x3A0] The data which has been read.

Typedef Documentation

◆ NFCError

typedef int32_t NFCError

Definition at line 16 of file nfc.h.

◆ NFCProtocol

typedef uint8_t NFCProtocol

Definition at line 17 of file nfc.h.

◆ NFCTechnology

typedef uint8_t NFCTechnology

Definition at line 18 of file nfc.h.

◆ NFCTechnologyMask

typedef uint8_t NFCTechnologyMask

Definition at line 19 of file nfc.h.

◆ NFCNDEFFlags

typedef uint8_t NFCNDEFFlags

Definition at line 20 of file nfc.h.

◆ NFCUid

typedef struct NFCUid NFCUid

Definition at line 20 of file nfc.h.

◆ NFCTagInfo

typedef struct NFCTagInfo NFCTagInfo

Definition at line 20 of file nfc.h.

◆ NFCNTAGVersion

Definition at line 20 of file nfc.h.

◆ NFCReadT2TResult

Definition at line 20 of file nfc.h.

◆ NFCMode

typedef enum NFCMode NFCMode

◆ NFCProtocolEnum

◆ NFCTechnologyEnum

◆ NFCTechnologyMaskEnum

◆ NFCNDEFFlagsEnum

◆ NFCCallbackFn

typedef void(* NFCCallbackFn) (VPADChan chan, NFCError error, void *userContext)

Generic callback function.

Parameters
chanThe channel this callback is coming from.
error0 on success.
userContextUser provided value.

Definition at line 164 of file nfc.h.

◆ NFCTagDetectCallbackFn

typedef void(* NFCTagDetectCallbackFn) (VPADChan chan, BOOL hasTag, void *userContext)

Callback function for NFCSetTagDetectCallback.

Parameters
chanThe channel this callback is coming from.
hasTagTRUE if a tag has been attached. FALSE if a tag has been removed.
userContextUser provided value.

Definition at line 181 of file nfc.h.

◆ NFCDetectCallbackFn

typedef void(* NFCDetectCallbackFn) (VPADChan chan, NFCError error, NFCUid *uid, BOOL readOnly, BOOL hasLockedData, NFCNDEFFlags flags, void *userContext)

Callback function for NFCDetect.

Parameters
chanThe channel this callback is coming from.
error0 on success.
uidThe UID of the tag.
readOnlyTRUE if the tag is read only.
hasLockedDataTRUE if the tag has a locked area.
flagsA combination of NFCNDEFFlagsEnum flags.
userContextUser provided value.

Definition at line 210 of file nfc.h.

◆ NFCRawDataCallbackFn

typedef void(* NFCRawDataCallbackFn) (VPADChan chan, NFCError error, uint32_t responseSize, void *responseData, void *userContext)

Callback function for NFCSendRawData and variations.

Parameters
chanThe channel this callback is coming from.
error0 on success.
responseSizeThe size of the responseData.
responseDataThe data received from the tag.
userContextUser provided value.

Definition at line 237 of file nfc.h.

◆ NFCRawDataTwiceCallbackFn

typedef void(* NFCRawDataTwiceCallbackFn) (VPADChan chan, NFCError error, uint8_t numCompleted, uint32_t response0Size, void *response0Data, uint32_t response1Size, void *response1Data, void *userContext)

Callback function for NFCSendRawDataTwice and variations.

Parameters
chanThe channel this callback is coming from.
error0 on success.
numCompletedThe amount of commands which have been sent to the tag.
response0Size,response1SizeThe size of the response data.
response0Data,response1DataThe data received from each of the commands.
userContextUser provided value.

Definition at line 265 of file nfc.h.

◆ NFCReadCallbackFn

typedef void(* NFCReadCallbackFn) (VPADChan chan, NFCError error, NFCUid *uid, BOOL readOnly, uint32_t dataSize, void *data, uint32_t lockedDataSize, void *lockedData, void *userContext)

Callback function for NFCRead.

Parameters
chanThe channel this callback is coming from.
error0 on success.
uidThe UID of the tag.
readOnlyTRUE if the tag is read only.
dataSizeThe size of the read data.
dataThe data payload of the first tnf 5 NDEF record.
lockedDataSizeThe size of the locked data.
lockedDataThe data of the locked area (see NFCSetLockBitsForT1T).
userContextUser provided value.

Definition at line 305 of file nfc.h.

◆ NFCReadT2TCallbackFn

typedef void(* NFCReadT2TCallbackFn) (VPADChan chan, NFCError error, uint8_t rfDiscId, NFCProtocol protocol, NFCTechnology technology, uint8_t uidSize, uint8_t *uid, NFCNTAGVersion *version, NFCReadT2TResult *result, void *userContext)

Callback function for NFCReadT2T.

Parameters
chanThe channel this callback is coming from.
error0 on success.
rfDiscIdRF Discovery ID.
protocolThe tag protocol.
technologyDiscovery type / Detected technology.
uidSizeThe size of the UID.
uidThe UID of the tag.
versionThe response of the NTAG GET_VERSION command.
resultThe read result.
userContextUser provided value.

Definition at line 349 of file nfc.h.

◆ NFCGetTagInfoCallbackFn

typedef void(* NFCGetTagInfoCallbackFn) (VPADChan chan, NFCError error, NFCTagInfo *tagInfo, void *userContext)

Callback function for NFCGetTagInfo.

Parameters
chanThe channel this callback is coming from.
error0 on success.
tagInfoThe tag info.
userContextUser provided value.

Definition at line 376 of file nfc.h.

◆ NFCGetTagInfoMultiCallbackFn

typedef void(* NFCGetTagInfoMultiCallbackFn) (VPADChan chan, NFCError error, uint8_t numTagInfos, NFCTagInfo *tagInfo0, NFCTagInfo *tagInfo1, NFCTagInfo *tagInfo2, void *userContext)

Callback function for NFCGetTagInfoMulti.

Parameters
chanThe channel this callback is coming from.
error0 on success.
numTagInfosThe amount of tag infos which have been obtained.
tagInfo0,tagInfo1,tagInfo2The obtained tag infos.
userContextUser provided value.

Definition at line 400 of file nfc.h.

Enumeration Type Documentation

◆ NFCMode

enum NFCMode
Enumerator
NFC_MODE_INVALID 
NFC_MODE_IDLE 

NFC is idle.

NFC_MODE_ACTIVE 

NFC is discovering / has an active tag.

Definition at line 26 of file nfc.h.

◆ NFCProtocolEnum

Enumerator
NFC_PROTOCOL_UNKNOWN 
NFC_PROTOCOL_T1T 
NFC_PROTOCOL_T2T 
NFC_PROTOCOL_T3T 
NFC_PROTOCOL_ISO_DEP 
NFC_PROTOCOL_15693 

Definition at line 35 of file nfc.h.

◆ NFCTechnologyEnum

Enumerator
NFC_TECHNOLOGY_A 
NFC_TECHNOLOGY_B 
NFC_TECHNOLOGY_F 
NFC_TECHNOLOGY_ISO15693 

Definition at line 45 of file nfc.h.

◆ NFCTechnologyMaskEnum

Enumerator
NFC_TECHNOLOGY_MASK_ALL 
NFC_TECHNOLOGY_MASK_A 
NFC_TECHNOLOGY_MASK_B 
NFC_TECHNOLOGY_MASK_F 
NFC_TECHNOLOGY_MASK_ISO15693 

Definition at line 53 of file nfc.h.

◆ NFCNDEFFlagsEnum

Enumerator
NFC_NDEF_FLAG_READ_ONLY 

Tag is read only.

NFC_NDEF_FLAG_FORMATED 

Tag formated for NDEF.

NFC_NDEF_FLAG_SUPPORTED 

NDEF supported by the tag.

NFC_NDEF_FLAG_UNKNOWN 

Unable to find if tag is ndef capable/formated/read only.

NFC_NDEF_FLAG_FORMATABLE 

Tag supports format operation.

NFC_NDEF_FLAG_SOFT_LOCKABLE 

Tag can be soft locked.

NFC_NDEF_FLAG_HARD_LOCKABLE 

Tag can be hard locked.

NFC_NDEF_FLAG_OTP 

Tag is one time programmable.

Definition at line 62 of file nfc.h.

Function Documentation

◆ NFCInit()

NFCError NFCInit ( VPADChan  chan)

Initializes the NFC library.

Parameters
chanThe DRC channel to use.
Returns
0 on success.

◆ NFCInitEx()

NFCError NFCInitEx ( VPADChan  chan,
uint32_t  powerMode 
)

Initializes the NFC library.

Parameters
chanThe DRC channel to use.
powerModeUnknown.
Returns
0 on success.

◆ NFCShutdown()

NFCError NFCShutdown ( VPADChan  chan)

Shutdown the NFC library.

Parameters
chanThe DRC channel to use.
Returns
0 on success.

◆ NFCIsInit()

BOOL NFCIsInit ( VPADChan  chan)

Check if NFC is initialized.

Parameters
chanThe DRC channel to use.
Returns
TRUE if initialized, FALSE otherwise.

◆ NFCProc()

void NFCProc ( VPADChan  chan)

Process NFC.

This needs to be called periodically and will call pending callbacks.

Parameters
chanThe DRC channel to use.

◆ NFCSetTagDetectCallback()

void NFCSetTagDetectCallback ( VPADChan  chan,
NFCTagDetectCallbackFn  callback,
void *  userContext 
)

Set a callback which will be called once a tag is attached / removed.

Parameters
chanThe DRC channel to use.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.

◆ NFCGetMode()

NFCMode NFCGetMode ( VPADChan  chan)

Get the current NFC mode.

Parameters
chanThe DRC channel to use.
Returns
The current NFC mode.

◆ NFCSetMode()

NFCError NFCSetMode ( VPADChan  chan,
NFCMode  mode 
)

Set the current NFC mode.

Parameters
chanThe DRC channel to use.
modeThe NFC mode to set.
Returns
0 on success.

◆ NFCAbort()

NFCError NFCAbort ( VPADChan  chan,
NFCCallbackFn  callback,
void *  userContext 
)

Abort pending NFC operations.

Parameters
chanThe DRC channel to use.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCAntennaCheck()

NFCError NFCAntennaCheck ( VPADChan  chan,
NFCCallbackFn  callback,
void *  userContext 
)

Check the NFC antenna.

Parameters
chanThe DRC channel to use.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCDetect()

NFCError NFCDetect ( VPADChan  chan,
uint32_t  discoveryTimeout,
NFCDetectCallbackFn  callback,
void *  userContext 
)

Start tag discovery and provide info about the first detected tag.

Parameters
chanThe DRC channel to use.
discoveryTimeoutTimeout in ms until tag discovery is cancelled.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCSetLockBitsForT1T()

NFCError NFCSetLockBitsForT1T ( VPADChan  chan,
uint8_t  numBlocks,
NFCRawDataCallbackFn  callback,
void *  userContext 
)

This will lock an area of blocks at the end of a 512-byte Type 1 Tag.

Parameters
chanThe DRC channel to use.
numBlocksThe amount of blocks which should be locked. Setting this to 16 would lock the last 16 blocks of the tag. The maximum value is 48 which would lock blocks 16 to 63.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCRead()

NFCError NFCRead ( VPADChan  chan,
uint32_t  discoveryTimeout,
NFCUid uid,
NFCUid uidMask,
NFCReadCallbackFn  callback,
void *  userContext 
)

Read from a tag.

This will start by reading the locked pages from a Type 1 Tag (aka. lockedData). Then it reads the NDEF tag data and returns the payload data from the first tnf 5 record.

Parameters
chanThe DRC channel to use.
discoveryTimeoutTimeout in ms until tag discovery is cancelled.
uidThe UID of the expected tag.
uidMaskThe UID of the tag will be masked with this mask before compared to the expected UID.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCWrite()

NFCError NFCWrite ( VPADChan  chan,
uint32_t  discoveryTimeout,
NFCUid uid,
NFCUid uidMask,
uint32_t  size,
void *  data,
NFCCallbackFn  callback,
void *  userContext 
)

Write to a tag.

This will create a NDEF structure and add the data to a TNF 5 record, then writes it to the tag.

Parameters
chanThe DRC channel to use.
discoveryTimeoutTimeout in ms until tag discovery is cancelled.
uidThe UID of the expected tag.
uidMaskThe UID of the tag will be masked with this mask before compared to the expected UID.
sizeThe size of the data.
dataA pointer to the data which will be copied to the NDEF payload.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCSendRawData()

NFCError NFCSendRawData ( VPADChan  chan,
BOOL  startDiscovery,
uint32_t  discoveryTimeout,
uint32_t  commandTimeout,
uint32_t  commandSize,
uint32_t  responseSize,
void *  commandData,
NFCRawDataCallbackFn  callback,
void *  userContext 
)

Send a raw NFC command to a tag.

Parameters
chanThe DRC channel to use.
startDiscoveryIf TRUE, start tag discovery and activate the tag if found. This will ignore any command data and receives the activation event data in the callback (see NFCGetUIDFromActivationEventData).
discoveryTimeoutTimeout in ms until tag discovery is cancelled.
commandTimeoutTimeout in ms after a command has been sent to the tag.
commandSizeSize of the command data.
responseSizeSize of the response data from the tag.
commandDataPointer to the command data. Note: The crc should not be included in the command and will be appended automatically.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCSendRawDataEx()

NFCError NFCSendRawDataEx ( VPADChan  chan,
BOOL  startDiscovery,
uint32_t  discoveryTimeout,
uint32_t  commandTimeout,
uint32_t  commandSize,
uint32_t  responseSize,
void *  commandData,
BOOL  disableCRC,
NFCRawDataCallbackFn  callback,
void *  userContext 
)

Send a raw NFC command to a tag.

Parameters
chanThe DRC channel to use.
startDiscoveryIf TRUE, start tag discovery and activate the tag if found. This will ignore any command data and receives the activation event data in the callback (see NFCGetUIDFromActivationEventData).
discoveryTimeoutTimeout in ms until tag discovery is cancelled.
commandTimeoutTimeout in ms after a command has been sent to the tag.
commandSizeSize of the command data.
responseSizeSize of the response data from the tag.
commandDataPointer to the command data. Note: The crc should not be included in the command and will be appended automatically.
disableCRCTRUE if the CRC check should be disabled.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCSendRawDataEx2()

NFCError NFCSendRawDataEx2 ( VPADChan  chan,
BOOL  startDiscovery,
uint32_t  discoveryTimeout,
uint32_t  commandTimeout,
uint32_t  commandSize,
uint32_t  responseSize,
void *  commandData,
BOOL  disableCRC,
NFCTechnologyMask  techMask,
NFCRawDataCallbackFn  callback,
void *  userContext 
)

Send a raw NFC command to a tag.

Parameters
chanThe DRC channel to use.
startDiscoveryIf TRUE, start tag discovery and activate the tag if found. This will ignore any command data and receives the activation event data in the callback (see NFCGetUIDFromActivationEventData).
discoveryTimeoutTimeout in ms until tag discovery is cancelled.
commandTimeoutTimeout in ms after a command has been sent to the tag.
commandSizeSize of the command data.
responseSizeSize of the response data from the tag.
commandDataPointer to the command data. Note: The crc should not be included in the command and will be appended automatically.
disableCRCTRUE if the CRC check should be disabled.
techMaskOne or more technology masks which should be used OR'd together.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCSendRawDataWithPrePolling()

NFCError NFCSendRawDataWithPrePolling ( VPADChan  chan,
BOOL  startDiscovery,
uint32_t  discoveryTimeout,
uint32_t  commandTimeout,
uint32_t  commandSize,
uint32_t  responseSize,
void *  commandData,
NFCRawDataCallbackFn  callback,
void *  userContext 
)

Send a raw NFC command to a tag.

Starts tag discovery and activation before sending the command data. Note: This forces NFC_TECHNOLOGY_MASK_F, see NFCSendRawDataWithPrePollingEx for a generic version.

Parameters
chanThe DRC channel to use.
startDiscoveryIf TRUE, start tag discovery and activate the tag if found, before sending the command data. If FALSE this will behave exactly like NFCSendRawData.
discoveryTimeoutTimeout in ms until tag discovery is cancelled.
commandTimeoutTimeout in ms after a command has been sent to the tag.
commandSizeSize of the command data.
responseSizeSize of the response data from the tag.
commandDataPointer to the command data. Note: The crc should not be included in the command and will be appended automatically.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCSendRawDataWithPrePollingEx()

NFCError NFCSendRawDataWithPrePollingEx ( VPADChan  chan,
BOOL  startDiscovery,
uint32_t  discoveryTimeout,
uint32_t  commandTimeout,
uint32_t  commandSize,
uint32_t  responseSize,
void *  commandData,
NFCRawDataCallbackFn  callback,
void *  userContext 
)

Send a raw NFC command to a tag.

Starts tag discovery and activation before sending the command data.

Parameters
chanThe DRC channel to use.
startDiscoveryIf TRUE, start tag discovery and activate the tag if found, before sending the command data. If FALSE this will behave exactly like NFCSendRawData.
discoveryTimeoutTimeout in ms until tag discovery is cancelled.
commandTimeoutTimeout in ms after a command has been sent to the tag.
commandSizeSize of the command data.
responseSizeSize of the response data from the tag.
commandDataPointer to the command data. Note: The crc should not be included in the command and will be appended automatically.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCSendRawDataTwice()

NFCError NFCSendRawDataTwice ( VPADChan  chan,
uint32_t  command0Timeout,
uint32_t  command0Size,
uint32_t  response0Size,
void *  command0Data,
uint32_t  command1Timeout,
uint32_t  command1Size,
uint32_t  response1Size,
void *  command1Data,
NFCRawDataTwiceCallbackFn  callback,
void *  userContext 
)

Send two raw NFC commands to an activated tag.

Parameters
chanThe DRC channel to use.
command0Timeout,command1TimeoutTimeout in ms after a command has been sent to the tag.
command0Size,command1SizeSize of the command data.
response0Size,response1SizeSize of the response data from the tag.
command0Data,command1SizePointer to the command data. Note: The crc should not be included in the command and will be appended automatically.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCFormat()

NFCError NFCFormat ( VPADChan  chan,
uint32_t  discoveryTimeout,
NFCUid uid,
NFCUid uidMask,
NFCCallbackFn  callback,
void *  userContext 
)

Check if the tag is NDEF Formatable.

If yes, format the tag.

Parameters
chanThe DRC channel to use.
discoveryTimeoutTimeout in ms until tag discovery is cancelled.
uidThe UID of the expected tag.
uidMaskThe UID of the tag will be masked with this mask before compared to the expected UID.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCGetTagInfo()

NFCError NFCGetTagInfo ( VPADChan  chan,
uint32_t  discoveryTimeout,
NFCGetTagInfoCallbackFn  callback,
void *  userContext 
)

Obtain info about tags.

Parameters
chanThe DRC channel to use.
discoveryTimeoutTimeout in ms until tag discovery is cancelled.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCGetTagInfoMulti()

NFCError NFCGetTagInfoMulti ( VPADChan  chan,
uint32_t  discoveryTimeout,
NFCGetTagInfoMultiCallbackFn  callback,
void *  userContext 
)

Obtain info about multiple tags.

Parameters
chanThe DRC channel to use.
discoveryTimeoutTimeout in ms until tag discovery is cancelled.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCIsTagPresent()

NFCError NFCIsTagPresent ( VPADChan  chan,
uint32_t  discoveryTimeout,
NFCUid uid,
NFCUid uidMask,
NFCCallbackFn  callback,
void *  userContext 
)

Check if a tag is still present.

Parameters
chanThe DRC channel to use.
discoveryTimeoutTimeout in ms until tag discovery is cancelled.
uidThe UID of the expected tag.
uidMaskThe UID of the tag will be masked with this mask before compared to the expected UID.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCSetReadOnly()

NFCError NFCSetReadOnly ( VPADChan  chan,
uint32_t  discoveryTimeout,
NFCUid uid,
NFCUid uidMask,
BOOL  readOnly,
NFCCallbackFn  callback,
void *  userContext 
)

Make a Type 1 Tag read only by setting the RWA byte.

Parameters
chanThe DRC channel to use.
discoveryTimeoutTimeout in ms until tag discovery is cancelled.
uidThe UID of the expected tag.
uidMaskThe UID of the tag will be masked with this mask before compared to the expected UID.
readOnlyTRUE if read only, FALSE otherwise.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCReadT2T()

NFCError NFCReadT2T ( VPADChan  chan,
uint32_t  discoveryTimeout,
NFCUid uid,
NFCUid uidMask,
NFCNTAGVersion version,
uint32_t  commandTimeout,
uint8_t  numReads,
uint8_t  read0Start,
uint8_t  read0End,
uint8_t  read1Start,
uint8_t  read1End,
uint8_t  read2Start,
uint8_t  read2End,
uint8_t  read3Start,
uint8_t  read3End,
uint8_t  authenticate,
NFCReadT2TCallbackFn  callback,
void *  userContext 
)

Read data from a Type 2 NTAG.

Parameters
chanThe DRC channel to use.
discoveryTimeoutTimeout in ms until tag discovery is cancelled.
uidThe UID of the expected tag.
uidMaskThe UID of the tag will be masked with this mask before compared to the expected UID.
versionA pointer to the expected response data from the NTAG GET_VERSION command. The contents of this data is ignored for reads.
commandTimeoutTimeout in ms after a command has been sent to the tag.
numReadsThe amount of read commands which should be peformed.
read0Start,read1Start,read2Start,read3StartThe start page address.
read0End,read1End,read2End,read3EndThe end page address.
authenticateTRUE if authentification using PWD_AUTH should be done.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCWriteT2T()

NFCError NFCWriteT2T ( VPADChan  chan,
uint16_t  discoveryTimeout,
NFCUid uid,
NFCUid uidMask,
NFCNTAGVersion version,
uint32_t  commandTimeout,
uint8_t  numWrites,
uint8_t  write0Start,
uint8_t  write0Size,
void *  write0Data,
uint8_t  write1Start,
uint8_t  write1Size,
void *  write1Data,
uint8_t  write2Start,
uint8_t  write2Size,
void *  write2Data,
uint8_t  write3Start,
uint8_t  write3Size,
void *  write3Data,
uint8_t  activationStart,
uint32_t *  deactivationData,
uint32_t *  activationData,
uint8_t  authenticate,
uint8_t  activate,
NFCCallbackFn  callback,
void *  userContext 
)

Write data to a Type 2 NTAG.

Parameters
chanThe DRC channel to use.
discoveryTimeoutTimeout in ms until tag discovery is cancelled.
uidThe UID of the expected tag.
uidMaskThe UID of the tag will be masked with this mask before compared to the expected UID.
versionA pointer to the expected response data from the NTAG GET_VERSION command.
commandTimeoutTimeout in ms after a command has been sent to the tag.
numWritesThe amount of write commands which should be peformed.
write0Start,write1Start,write2Start,write3StartThe start page address.
write0Size,write1Size,write2Size,write3SizeThe size of the data to write in bytes.
write0Data,write1Data,write2Data,write3DataThe data which should be written (max. 0xF0 bytes per write).
activationStartPage address where activation/deactivation should be performed
deactivationDataPointer to the deactivation data
activationDataPointer to the activation data
authenticateTRUE if (custom?) authentification using PWD_AUTH should be done.
activateTRUE if activation should be done. This will write the deactivation data to the activation start before performing any writes. After writing is completed the activation data will be written to the activation start. If writing fails at any point the activation data can be checked to ensure writing has completed.
callbackA pointer to the callback function.
userContextUser provided value which will be passed to the callback.
Returns
0 on success.

◆ NFCGetUIDFromActivationEventData()

void NFCGetUIDFromActivationEventData ( void *  data,
NFCProtocol outProtocol,
NFCTechnology outTechnology,
uint8_t *  outUidSize,
uint8_t *  outUid 
)

Get the UID and other parameters from activation event data.

Parameters
dataPointer to the activation event data returned by NFCRawDataCallbackFn if startDiscovery is true.
outProtocolPointer to write the protocol to.
outTechnologyPointer to write the technology to.
outUidSizePointer to write the UID size to.
outUidPointer to write the UID to (max. 10 bytes).

◆ __NFCSystemAbort()

NFCError __NFCSystemAbort ( VPADChan  chan)

Abort and call pending callbacks.

Parameters
chanThe DRC channel to use.
Returns
0 on success.