Cafe SDK  Version 2.13
API References for nn Library Modules
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Modules | Namespaces
Nintendo Figurine Platform (NFP)

This library is for using NFP features. More...


 Nintendo Figurine Platform (NFP) API
 A list of Nintendo Figurine Platform (NFP) library members. (Includes only C++ API members.)
 Nintendo Figurine Platform (NFP) Results
 A list of Result codes used in the Nintendo Figurine Platform (NFP) library.


namespace  nn::nfp
 Namespace for the Nintendo Figurine Platform (NFP) library.

Detailed Description

This library is for using NFP features.

Demo Program

For information about the demo programs for this library, see the NFP Demo reference.

Guideline Check Tool

A support tool is provided to verity the requirements defined in NFP-related guidelines. For more information, see the NFP Util reference.

Implementation Notes

Process Branching

The nn::Result objects or error codes returned by API functions may be extended by future changes. If application execution branches based on the reason for an error, take the following steps to maintain forward compatibility.

Notes on Responsiveness

The NFP library includes a large number of API functions for communicating with NFP tags and accessing the file system. Calling these functions from the main loop may slow down processing.

We recommend making calls to the NFP library API in a thread other than the main thread in most cases.

Thread Safety

The API functions of the NFP library are not thread-safe. Take care to avoid simultaneous access from multiple threads.

Notes on Tag Detection Time

After the nn::nfp::StartDetection function is called, it can take around 300 milliseconds for the actual detection (Activate) event to fire when a tag is touched to the touch point. This is because the system detects tags at a 300 millisecond interval.

Note this limitation when implementing an application that requires specific timing for tag detection.

Notes on Determining Tag Loss

When a tag in a detected state is removed, it can take about one second for the tag loss (Deactivate) event to fire. This is because the system checks for tag loss at a one-second interval.

Note this limitation when using tag loss as a trigger in your application.

Operation When Opening or Closing the TV Remote Menu

If the TV Remote Menu is opened on the Wii U GamePad (DRC) while tag detection is active (nn::nfp::RW_ACTIVE state), any tag that is touched to the touchpoint will not be detected or written due to a system limitation. Tag operations resume when the TV Remote Menu is closed.

If the TV Remote Menu is opened while a tag is detected, the periodic tag loss check fails. The failure of this check means a loss is detected, the tag loss event (Deactivate) fires, and the state becomes nn::nfp::RW_DEACTIVE even if the tag is still touched to the touchpoint.

If the TV Remote Menu is opened when writing to a tag, if the write operation has already started, it continues until completion. However, if the menu is opened before the write operation begins, the operation fails but the tag data is not corrupted.

To check the state of the TV Remote Menu before an operation, use the VPADGetTVMenuStatus function. If the VPADGetTVMenuStatus function returns a value of 1, the TV Remote Menu is open.

Operation When Opening or Closing the HOME Menu

If the HOME Menu is opened while tag detection is active, the tag detection operation is temporarily stopped. When control returns to the application from the HOME Menu, the tag detection operation resumes.

If the system transitions to the HOME Menu while a tag is detected, a tag loss (Deactivate) event fires. The loss event caused by opening or closing the HOME Menu can occur either before or after the menu is opened, depending on system-side processing. If you want the loss event to fire before transitioning to the HOME Menu, call the nn::nfp::StopDetection function on ReleaseForeground.

Operation When the Wii U GamePad (DRC) LCD Is Off

Due to a system limitation, tag detection cannot be started and tags cannot be written while the Wii U GamePad (DRC) LCD is turned off in the HOME Menu settings or with the VPADSetLcdMode function. Tag detection is stopped if it is active when the LCD turns off.

If the LCD turns off while a tag is detected, a tag loss (Deactivate) event fires. To resume tag detection, call the nn::nfp::StartDetection when the LCD is back on.

To check whether the DRC LCD is on before an operation, use the VPADGetLcdMode function. If VPADGetLcdMode returns a value other than VPAD_LCD_MODE_ON, the LCD is off.

Operation When the Wii U GamePad (DRC) Disconnects

If the wireless connection between the Wii U console and the Wii U GamePad (DRC) is lost while the NFP library is in an initialized state, the NFP library features become temporarily unavailable. In this case, the nn::nfp::GetNfpState function returns nn::nfp::NONE.

After the DRC is reconnected, the NFP features are reinitialized by the system. If the state at the time of disconnect was nn::nfp::RW_SEARCH or nn::nfp::RW_DEACTIVE, it is restored to that state. All other states are automatically restored to nn::nfp::INIT.

There is a one to two second delay between when the DRC is reconnected and the restoration process completes. NFP API functions cannot be called during this time. We recommend waiting about two seconds after the connection is re-established before using any NFP API functions. (The restoration process might take even longer depending on the wireless environment.)

Deleting Tag Backup Data

Tag backup data can be deleted using the System Configuration Tool. In Data Manager, select Save Data Manager, and then select the Remove NFC Backup Save Data command. Use this feature to verify the nn::nfp::ResultNeedFormat and nn::nfp::ResultNoBackupFile values.

To verify nn::nfp::ResultNoBackupFile, delete the backup data and then use the Fill-up tool to fill the system NAND memory. Leave less than 8 MB free space.

Other Notes

Tag Detection Distance

Tags can be detected from a distance of about 3-4 cm in the vertical direction from the NFC area mark on the Wii U GamePad (DRC). Even if the tag is not touching the DRC, it generally stays detected as long as it remains in this range.

Due to the hardware design of the DRC, tags that are placed directly against the unit cannot be detected. When using development tags, note that the tag might not be correctly detected if it is placed in direct contact with the DRC. In retail amiibo products, the tag is embedded in the base and cannot be placed in direct contact with the DRC.