4. State Transitions

The internal states of the NFP library transition as shown in the following diagram.

Figure 4-1. NFP Library State Transition Diagram

NONE INIT RW_SEARCH RW_ACTIVE RW_DEACTIVE RW_MOUNT RW_MOUNT_ROM Initialize Finalize StartDetection StopDetection StopDetection StartDetection StopDetection Restore InitializeCreateInfo CreateApplicationArea GetTagInfo Mount Unmount OpenApplicationArea ReadApplicationArea WriteApplicationArea Flush GetTagInfo GetNfpCommonInfo GetNfpRegisterInfo GetNfpRomInfo MountRom Unmount GetTagInfo GetNfpRomInfo Detect tag Detected tag left Detected tag left Detected tag left Transition caused by function call Transition caused by external factor

Warning:

Although it is not indicated in the diagram, calling nn::nfp::Finalize in any state causes the library to transition to the NONE state. In addition, the state transitions to INIT whenever the system enters wireless-disabled mode or Sleep Mode in all cases except when the state is NONE or INIT.

Warning:

When using the NFC reader/writer for CTR, if the connection to the device is lost while in a state other than NONE or INIT, the state transitions to INIT.

The states are defined in nn::nfp::NfpState and you can get the current state by calling nn::nfp::GetNfpState.

Each state represents the following.

Table 4-1. State Definitions
State Description
NONE The state before the NFP library is initialized.
INIT The NFP library is initialized but has not yet started looking for tags.
RW_SEARCH The library is searching for tags.
RW_ACTIVE A tag has been detected.
RW_DEACTIVE The detected tag left the range of communication.
RW_MOUNT The detected tag has been mounted. The detected tag cannot be mounted if it is not an NFP tag.
RW_MOUNT_ROM The detected tag has been mounted. Unlike the RW_MOUNT state, this state limits the information that can be accessed.
Table 4-2. Functions Available in Each State
State Available Functions (nn::nfp Namespace Omitted)
NONE Initialize
INIT SetActivateEvent, SetDeactivateEvent, StartDetection
RW_SEARCH StopDetection
RW_ACTIVE GetTagInfo, Mount, MountRom, Restore, StopDetection
RW_DEACTIVE StartDetection, StopDetection
RW_MOUNT CreateApplicationArea, Flush, GetNfpCommonInfo, GetNfpRegisterInfo, GetNfpRomInfo, GetTagInfo, OpenApplicationArea, ReadApplicationArea, StopDetection, Unmount, WriteApplicationArea
RW_MOUNT_ROM GetNfpRomInfo, GetTagInfo, StopDetection, Unmount
Other than NONE Finalize, GetConnectionStatus, InitializeCreateInfo
All GetNfpState

Using the NFP library increases the power consumption of the New Nintendo 3DS system and affects the battery life. The relationship between the state of the NFP library and how it affects power consumption is as follows.

State New Nintendo 3DS Battery Life
NONE No change
INIT, RW_SEARCH, RW_DEACTIVE Reduction of less than 1%
RW_ACTIVE, RW_MOUNT, RW_MOUNT_ROM Reduction of approximately 8%

Battery life information for the NFC Reader/Writer is as follows. The battery life for CTR is the same as when using infrared communication.

State Connection to NFC Reader/Writer NFC Reader/Writer Battery Life
NONE, INIT Disconnected No change
INIT, RW_DEACTIVE Connected Reduction of approximately 40%
RW_SEARCH Connected Reduction of approximately 91%
RW_ACTIVE, RW_MOUNT, RW_MOUNT_ROM Connected Reduction of approximately 75 %

We recommend transitioning to a state that minimizes power consumption whenever possible. However, before calling the nn::nfp::Finalize function, note that the nn::nfp::Initialize function requires approximately one second to execute.

 


CONFIDENTIAL