1 /*---------------------------------------------------------------------------*
2 
3   Copyright (C) Nintendo.  All rights reserved.
4 
5   These coded instructions, statements, and computer programs contain
6   proprietary information of Nintendo of America Inc. and/or Nintendo
7   Company Ltd., and are protected by Federal copyright law.  They may
8   not be disclosed to third parties or copied or duplicated in any form,
9   in whole or in part, without the prior written consent of Nintendo.
10 
11  *---------------------------------------------------------------------------*/
12 
13 #ifndef __NN_NFP_NFP_H__
14 #define __NN_NFP_NFP_H__
15 
16 /*!
17 @defgroup nn_nfp  Nintendo Figurine Platform (NFP)
18 @brief  This library is for using NFP features.
19 
20 @section nn_nfp_demo  Demo Program
21 
22 For information about the demo programs for this library, see the <a href="../../Doc/friend_presence_overview.html">NFP Demo</a> reference.
23 
24 @section nn_nfp_guideline_check_tool  Guideline Check Tool
25 
26 A support tool is provided to verity the requirements defined in NFP-related guidelines.
27 For more information, see the <a href="../../Doc/Nfp/nfp_util.html">NFP Util</a> reference.
28 
29 @section nn_nfp_implement_notice  Implementation Notes
30 
31 @subsection nn_nfp_errorhandling_branching  Process Branching
32 The <tt>@ref nn::Result</tt> objects or error codes returned by API functions may be extended by future changes.
33 If application execution branches based on the reason for an error, take the following steps to maintain forward compatibility. @n
34 @li  Always determine branching by handling the <tt>@ref nn::Result</tt> object returned by the API functions. Do not branch execution by looking at the value of the error code.
35 @li  The determination of the <tt>@ref nn::Result</tt> object is performed according to the inclusion relationship (<=, >=, Includes).
36 
37 @subsection nn_nfp_reactivity  Notes on Responsiveness
38 The NFP library includes a large number of API functions for communicating with NFP tags and accessing the file system.
39 Calling these functions from the main loop may slow down processing.
40 
41 We recommend making calls to the NFP library API in a thread other than the main thread in most cases.
42 
43 @subsection nn_nfp_thread_safe  Thread Safety
44 The API functions of the NFP library are not thread-safe.
45 Take care to avoid simultaneous access from multiple threads.
46 
47 @subsection nn_nfp_detect_time  Notes on Tag Detection Time
48 After the <tt>@ref nn::nfp::StartDetection</tt> 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.
49 This is because the system detects tags at a 300 millisecond interval.
50 
51 Note this limitation when implementing an application that requires specific timing for tag detection.
52 
53 @subsection nn_nfp_lost_time  Notes on Determining Tag Loss
54 When a tag in a detected state is removed, it can take about one second for the tag loss (Deactivate) event to fire.
55 This is because the system checks for tag loss at a one-second interval.
56 
57 Note this limitation when using tag loss as a trigger in your application.
58 
59 @subsection nn_nfp_tv_remote  Operation When Opening or Closing the TV Remote Menu
60 If the TV Remote Menu is opened on the Wii U GamePad (DRC) while tag detection is active (<tt>@ref nn::nfp::RW_ACTIVE</tt> state), any tag that is touched to the touchpoint will not be detected or written due to a system limitation.
61 Tag operations resume when the TV Remote Menu is closed.
62 
63 If the TV Remote Menu is opened while a tag is detected, the periodic tag loss check fails.
64 The failure of this check means a loss is detected, the tag loss event (Deactivate) fires, and the state becomes <tt>@ref nn::nfp::RW_DEACTIVE</tt> even if the tag is still touched to the touchpoint.
65 
66 If the TV Remote Menu is opened when writing to a tag, if the write operation has already started, it continues until completion.
67 However, if the menu is opened before the write operation begins, the operation fails but the tag data is not corrupted.
68 
69 To check the state of the TV Remote Menu before an operation, use the <tt>VPADGetTVMenuStatus</tt> function.
70 If the <tt>VPADGetTVMenuStatus</tt> function returns a value of 1, the TV Remote Menu is open.
71 
72 @subsection nn_nfp_hbm  Operation When Opening or Closing the HOME Menu
73 If the HOME Menu is opened while tag detection is active, the tag detection operation is temporarily stopped.
74 When control returns to the application from the HOME Menu, the tag detection operation resumes.
75 
76 If the system transitions to the HOME Menu while a tag is detected, a tag loss (Deactivate) event fires.
77 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.
78 If you want the loss event to fire before transitioning to the HOME Menu, call the <tt>@ref nn::nfp::StopDetection</tt> function on <tt>ReleaseForeground</tt>.
79 
80 @subsection nn_nfp_lcd_off  Operation When the Wii U GamePad (DRC) LCD Is Off
81 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 <tt>VPADSetLcdMode</tt> function.
82 Tag detection is stopped if it is active when the LCD turns off.
83 
84 If the LCD turns off while a tag is detected, a tag loss (Deactivate) event fires.
85 To resume tag detection, call the <tt>@ref nn::nfp::StartDetection</tt> when the LCD is back on.
86 
87 To check whether the DRC LCD is on before an operation, use the <tt>VPADGetLcdMode</tt> function.
88 If <tt>VPADGetLcdMode</tt> returns a value other than <tt>VPAD_LCD_MODE_ON</tt>, the LCD is off.
89 
90 @subsection nn_nfp_wl_disconnect  Operation When the Wii U GamePad (DRC) Disconnects
91 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.
92 In this case, the <tt>@ref nn::nfp::GetNfpState</tt> function returns <tt>@ref nn::nfp::NONE</tt>.
93 
94 After the DRC is reconnected, the NFP features are reinitialized by the system. If the state at the time of disconnect was <tt>@ref nn::nfp::RW_SEARCH</tt> or <tt>@ref nn::nfp::RW_DEACTIVE</tt>, it is restored to that state. All other states are automatically restored to <tt>@ref nn::nfp::INIT</tt>.
95 
96 There is a one to two second delay between when the DRC is reconnected and the restoration process completes.
97 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.
98 (The restoration process might take even longer depending on the wireless environment.)
99 
100 @subsection nn_nfp_delete_backup  Deleting Tag Backup Data
101 Tag backup data can be deleted using the System Configuration Tool. In <b>Data Manager</b>, select <b>Save Data Manager</b>, and then select the <b>Remove NFC Backup Save Data</b> command.
102 Use this feature to verify the <tt>@ref nn::nfp::ResultNeedFormat</tt> and <tt>@ref nn::nfp::ResultNoBackupFile</tt> values.
103 
104 To verify <tt>@ref nn::nfp::ResultNoBackupFile</tt>, delete the backup data and then use the Fill-up tool to fill the system NAND memory.
105 Leave less than 8 MB free space.
106 
107 @section nn_nfp_other_notice  Other Notes
108 
109 @subsection nn_nfp_distance_and_null_point  Tag Detection Distance
110 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).
111 Even if the tag is not touching the DRC, it generally stays detected as long as it remains in this range.
112 
113 Due to the hardware design of the DRC, tags that are placed directly against the unit cannot be detected.
114 When using development tags, note that the tag might not be correctly detected if it is placed in direct contact with the DRC.
115 In retail amiibo products, the tag is embedded in the base and cannot be placed in direct contact with the DRC.
116 
117     @{
118 
119     @namespace  nn::nfp
120     @brief  Namespace for the Nintendo Figurine Platform (NFP) library.
121 
122     @defgroup nn_nfp_result  Nintendo Figurine Platform (NFP) Results
123     @brief  A list of <tt>Result</tt> codes used in the Nintendo Figurine Platform (NFP) library.
124 
125     @}
126 
127 
128 */
129 
130 #include <nn/nfp/nfp_Types.h>
131 #include <nn/nfp/nfp_Result.h>
132 #include <nn/nfp/nfp_Api.h>
133 
134 #endif // __NN_NFP_NFP_H__
135