> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/readme/files/dir_44d926a17fc606d3c25449ba60427c63/dir_048f823fee1bfb22502a8732b9a001aa/nfc_8cpp.md).

# nfc.cpp

[Macros](#define-members) | [Functions](#func-members)

`#include <stdio.h>` `#include <stdlib.h>` `#include <string.h>` `#include <stddef.h>` `#include <pwd.h>` `#include <algorithm>` `#include <unistd.h>` `#include <fcntl.h>` `#include <errno.h>` `#include "`[nfc.h](/adk-5.0-programmers-guide/nfc_8h_source.md)`"` `#include "`[\_logf.h](/adk-5.0-programmers-guide/__logf_8h_source.md)`"` `#include "nfc/NFC_Client.h"` `#include "nfc/NFC_Interface.h"` `#include "`[hexutil.h](/adk-5.0-programmers-guide/sdi_2src_2hexutil_8h_source.md)`"` `#include "`[util.h](/adk-5.0-programmers-guide/sdi_2src_2util_8h_source.md)`"` `#include "`[btlv\_helper.h](/adk-5.0-programmers-guide/btlv__helper_8h_source.md)`"` `#include "`[tec/tec.h](/adk-5.0-programmers-guide/tec_8h_source.md)`"` `#include "`[sys.h](/adk-5.0-programmers-guide/sys_8h_source.md)`"` `#include "`[sdi\_tags.h](/adk-5.0-programmers-guide/src_2sdi__tags_8h_source.md)`"` `#include "`[config.h](/adk-5.0-programmers-guide/config_8h_source.md)`"` `#include "`[directory.h](/adk-5.0-programmers-guide/directory_8h_source.md)`"` `#include "epp/counterTop.h"`

Include dependency graph for nfc.cpp:

![](/files/N2p3b9FKEkQcIeGJJEk8)

|         |                                                                                                                |
| ------- | -------------------------------------------------------------------------------------------------------------- |
| Macros  |                                                                                                                |
| #define | [CLASS](#aeb04f2e0012cb07d68538599161c9693)   0                                                                |
| #define | [INSTRUCTION](#a3fbaf422cb6aaf4b403d71d972d4bc89)   1                                                          |
| #define | [P1](#a6c2a9f7efd46f0160f3037869924d6ce)   2                                                                   |
| #define | [P2](#ae00a52dba55d31948c377fa85d385b87)   3                                                                   |
| #define | [NFC\_BUFFER\_SIZE](#aa6f734d34c6ee0cf731449ef1548acfc)   8192                                                 |
| #define | [SET\_RESULT](#ae27eea42be89a6e50555732afafcfb8f)(sw1, sw2)   { rsp\[0] = sw1; rsp\[1] = sw2; \*rspSize = 2; } |

|                              |                                                                                                                                                                                                    |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Functions                    |                                                                                                                                                                                                    |
| std::vector< std::string > & | [NFC\_get\_appID\_Static](#ac065a52a8673baeae8711309bfc176c6) ()                                                                                                                                   |
| std::string &                | [NFC\_get\_appID\_Preload](#ac4a4bf1a760772ae31fe002226cc3a90) ()                                                                                                                                  |
| void                         | [NFC\_deletePreloadFile](#a1cd110adeb746aeac51b38d524be8c99) ()                                                                                                                                    |
| bool                         | [NFC\_getPreloadFileName](#a7bb3be6ba4ceea178891fa7b10367a04) (char \*filename, unsigned buffersize, string appID)                                                                                 |
| void                         | [handleNFC](#a0f8dfff45f86ad2e782439e8c60c9694) (unsigned short msgBufSize, unsigned char \*msg, unsigned short msgSize, unsigned short rspBufSize, unsigned char \*rsp, unsigned short \*rspSize) |
| void                         | [handleVAS](#aeec5749ee271c67acbe1dad2c9267215) (unsigned short msgBufSize, unsigned char \*msg, unsigned short msgSize, unsigned short rspBufSize, unsigned char \*rsp, unsigned short \*rspSize) |

### MacroDefinition Documentation <a href="#macro-definition-documentation" id="macro-definition-documentation"></a>

### CLASS <a href="#aeb04f2e0012cb07d68538599161c9693" id="aeb04f2e0012cb07d68538599161c9693"></a>

\#define CLASS   0

### INSTRUCTION <a href="#a3fbaf422cb6aaf4b403d71d972d4bc89" id="a3fbaf422cb6aaf4b403d71d972d4bc89"></a>

\#define INSTRUCTION   1

### NFC\_BUFFER\_SIZE <a href="#aa6f734d34c6ee0cf731449ef1548acfc" id="aa6f734d34c6ee0cf731449ef1548acfc"></a>

\#define NFC\_BUFFER\_SIZE   8192

### P1 <a href="#a6c2a9f7efd46f0160f3037869924d6ce" id="a6c2a9f7efd46f0160f3037869924d6ce"></a>

\#define P1   2

### P2 <a href="#ae00a52dba55d31948c377fa85d385b87" id="ae00a52dba55d31948c377fa85d385b87"></a>

\#define P2   3

### SET\_RESULT <a href="#ae27eea42be89a6e50555732afafcfb8f" id="ae27eea42be89a6e50555732afafcfb8f"></a>

\#define SET\_RESULT

### FunctionDocumentation <a href="#function-documentation" id="function-documentation"></a>

### handleNFC() <a href="#a0f8dfff45f86ad2e782439e8c60c9694" id="a0f8dfff45f86ad2e782439e8c60c9694"></a>

void handleNFC

### handleVAS() <a href="#aeec5749ee271c67acbe1dad2c9267215" id="aeec5749ee271c67acbe1dad2c9267215"></a>

void handleVAS

### NFC\_deletePreloadFile() <a href="#a1cd110adeb746aeac51b38d524be8c99" id="a1cd110adeb746aeac51b38d524be8c99"></a>

void NFC\_deletePreloadFile

### NFC\_get\_appID\_Preload() <a href="#ac4a4bf1a760772ae31fe002226cc3a90" id="ac4a4bf1a760772ae31fe002226cc3a90"></a>

std::string& NFC\_get\_appID\_Preload

### NFC\_get\_appID\_Static() <a href="#ac065a52a8673baeae8711309bfc176c6" id="ac065a52a8673baeae8711309bfc176c6"></a>

std::vector\\& NFC\_get\_appID\_Static

### NFC\_getPreloadFileName() <a href="#a7bb3be6ba4ceea178891fa7b10367a04" id="a7bb3be6ba4ceea178891fa7b10367a04"></a>

bool NFC\_getPreloadFileName


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/readme/files/dir_44d926a17fc606d3c25449ba60427c63/dir_048f823fee1bfb22502a8732b9a001aa/nfc_8cpp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
