The internal states of the NFP library transition as shown in the following diagram.
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
.
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.
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. |
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 SNAKE 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 | SNAKE 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 94% |
RW_ACTIVE, RW_MOUNT, RW_MOUNT_ROM | Connected | Reduction of approximately 65 % |
We recommend transitioning to a state that minimizes power consumption whenever possible. However, it is unnecessary to call the nn::nfp::Finalize()
function too frequently because the nn::nfp::Initialize()
function requires approximately one second to execute.