/*---------------------------------------------------------------------------*
Copyright (C) 2014 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
*---------------------------------------------------------------------------*/
#ifndef __NN_NFP_NFP_H__
#define __NN_NFP_NFP_H__
/*!
@defgroup nn_nfp Nintendo Figurine Platform (NFP)
@brief This library is for using NFP features.
@section nn_nfp_demo Demo Program
For information about the demo programs for this library, see the NFP Demo reference.
@section nn_nfp_guideline_check_tool 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.
@section nn_nfp_implement_notice Implementation Notes
@subsection nn_nfp_errorhandling_branching Process Branching
The @ref 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. @n
@li Always determine branching by handling the @ref nn::Result object returned by the API functions. Do not branch execution by looking at the value of the error code.
@li The determination of the @ref nn::Result object is performed according to the inclusion relationship (<=, >=, Includes).
@subsection nn_nfp_reactivity 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.
@subsection nn_nfp_thread_safe Thread Safety
The API functions of the NFP library are not thread-safe.
Take care to avoid simultaneous access from multiple threads.
@subsection nn_nfp_detect_time Notes on Tag Detection Time
After the @ref 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.
@subsection nn_nfp_lost_time 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.
@subsection nn_nfp_tv_remote 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 (@ref 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 @ref 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.
@subsection nn_nfp_hbm 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 @ref nn::nfp::StopDetection function on ReleaseForeground.
@subsection nn_nfp_lcd_off 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 @ref 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.
@subsection nn_nfp_wl_disconnect 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 @ref nn::nfp::GetNfpState function returns @ref 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 @ref nn::nfp::RW_SEARCH or @ref nn::nfp::RW_DEACTIVE, it is restored to that state. All other states are automatically restored to @ref 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.)
@subsection nn_nfp_delete_backup 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 @ref nn::nfp::ResultNeedFormat and @ref nn::nfp::ResultNoBackupFile values.
To verify @ref 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.
@section nn_nfp_other_notice Other Notes
@subsection nn_nfp_distance_and_null_point 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.
@{
@namespace nn::nfp
@brief Namespace for the Nintendo Figurine Platform (NFP) library.
@defgroup nn_nfp_result Nintendo Figurine Platform (NFP) Results
@brief A list of Result codes used in the Nintendo Figurine Platform (NFP) library.
@}
*/
#include
#include
#include
#endif // __NN_NFP_NFP_H__