To detect and access NFC Data Exchange Format data, the NFC reader uses the Capability Container (CC) file contained inside the NDEF Tag Application. The CC file is a read-only file with file identifier equal to E103h. It is used to store management data for the Type 4 Tag platform.
The CC file module provides functions to parse raw CC file data to its descriptor structure. The API of the module is described in CC file parser.
You can use the module to print out the tag content. The output of the parser consists of the following data:
Field name | Description |
---|---|
CCLEN | Size of the CC file. |
Mapping Version | Type 4 Tag version number. |
MLe | Maximum R-APDU data size. |
MLc | Maximum C-APDU data size. |
Extended NDEF/NDEF File Control TLV | Management data for the NDEF file with its payload. |
TLV Blocks | One or more TLV blocks may be present (optional). |
Certain types of TLV blocks are supported by Type 4 Tag:
TLV Block Name | Tag Field Value | Length Field Value |
---|---|---|
NDEF File Control TLV | 04h | 06h |
Proprietary File Control TLV | 05h | 06h |
Extended NDEF File Control TLV | 06h | 08h |
More detailed information about each TLV block inside Type 4 Tag is also printed out. The output of the parser consists of the following data:
Field name | Description |
---|---|
File identifier | Used for the Select procedure. |
Maximum file size | Maximum capacity of the file (in bytes). |
Read access condition | Read access level of the file. |
Write access condition | Write access level of the file. |
Optionally, content of the file (described by the TLV block) can also be printed out. However, in such case you must call an additional function which binds the TLV structure with the described file content.
The following code example shows how to parse raw CC file data from a Type 4 Tag:
Apart from parsing raw CC file data, this module can be used to search for File Control TLVs within a CC file. The following code example shows this functionality:
The following example shows how to use this module to bind a File Control TLV with its file content:
Note that if you want to store all data from a Type 4 Tag within a CC file structure, you must first parse raw CC file data and then bind all detected files with the tag's TLV blocks.