libnx  v4.7.0
Data Structures | Enumerations | Functions
nfc.h File Reference

Nintendo Figurine (amiibo) Platform (nfp:user) service IPC wrapper. More...

#include "../types.h"
#include "../sf/service.h"
#include "../services/mii.h"

Go to the source code of this file.

Data Structures

struct  NfpTagInfo
 
struct  NfcTagInfo
 
struct  NfpCommonInfo
 
struct  NfpModelInfo
 
struct  NfpRegisterInfo
 
struct  NfpRegisterInfoPrivate
 
struct  NfpAdminInfo
 
struct  NfpData
 
struct  NfcSectorKey
 
struct  NfcMifareReadBlockParameter
 
struct  NfcMifareReadBlockData
 
struct  NfcMifareWriteBlockParameter
 
struct  NfcRequiredMcuVersionData
 
struct  NfcDeviceHandle
 Nfc/Nfp DeviceHandle. More...
 

Enumerations

enum  NfpServiceType {
  NfpServiceType_User = 0 ,
  NfpServiceType_Debug = 1 ,
  NfpServiceType_System = 2
}
 NfpServiceType. More...
 
enum  NfcServiceType {
  NfcServiceType_User = 0 ,
  NfcServiceType_System = 1
}
 NfcServiceType. More...
 
enum  NfpState {
  NfpState_NonInitialized = 0 ,
  NfpState_Initialized = 1
}
 
enum  NfcState {
  NfcState_NonInitialized = 0 ,
  NfcState_Initialized = 1
}
 
enum  NfpDeviceState {
  NfpDeviceState_Initialized = 0 ,
  NfpDeviceState_SearchingForTag = 1 ,
  NfpDeviceState_TagFound = 2 ,
  NfpDeviceState_TagRemoved = 3 ,
  NfpDeviceState_TagMounted = 4 ,
  NfpDeviceState_Unavailable = 5 ,
  NfpDeviceState_Finalized = 6
}
 
enum  NfcDeviceState {
  NfcDeviceState_Initialized = 0 ,
  NfcDeviceState_SearchingForTag = 1 ,
  NfcDeviceState_TagFound = 2 ,
  NfcDeviceState_TagRemoved = 3 ,
  NfcDeviceState_TagMounted = 4 ,
  NfcDeviceState_Unavailable = 5 ,
  NfcDeviceState_Finalized = 6
}
 
enum  NfpApplicationAreaVersion {
  NfpApplicationAreaVersion_3DS = 0 ,
  NfpApplicationAreaVersion_WiiU = 1 ,
  NfpApplicationAreaVersion_3DSv2 = 2 ,
  NfpApplicationAreaVersion_Switch = 3 ,
  NfpApplicationAreaVersion_NotSet = 0xFF
}
 
enum  NfpDeviceType { NfpDeviceType_Amiibo = 0 }
 
enum  NfpMountTarget {
  NfpMountTarget_Rom = 1 ,
  NfpMountTarget_Ram = 2 ,
  NfpMountTarget_All = 3
}
 
enum  NfcProtocol {
  NfcProtocol_None = 0 ,
  NfcProtocol_TypeA = (1U<<( 0 )) ,
  NfcProtocol_TypeB = (1U<<( 1 )) ,
  NfcProtocol_TypeF = (1U<<( 2 )) ,
  NfcProtocol_All = 0xFFFFFFFF
}
 
enum  NfcTagType {
  NfcTagType_None = 0 ,
  NfcTagType_Type1 = (1U<<( 0 )) ,
  NfcTagType_Type2 = (1U<<( 1 )) ,
  NfcTagType_Type3 = (1U<<( 2 )) ,
  NfcTagType_Type4A = (1U<<( 3 )) ,
  NfcTagType_Type4B = (1U<<( 4 )) ,
  NfcTagType_Type5 = (1U<<( 5 )) ,
  NfcTagType_Mifare = (1U<<( 6 )) ,
  NfcTagType_All = 0xFFFFFFFF
}
 
enum  NfcMifareCommand {
  NfcMifareCommand_Read = 0x30 ,
  NfcMifareCommand_AuthA = 0x60 ,
  NfcMifareCommand_AuthB = 0x61 ,
  NfcMifareCommand_Write = 0xA0 ,
  NfcMifareCommand_Transfer = 0xB0 ,
  NfcMifareCommand_Decrement = 0xC0 ,
  NfcMifareCommand_Increment = 0xC1 ,
  NfcMifareCommand_Store = 0xC2
}
 

Functions

Result nfpInitialize (NfpServiceType service_type)
 Initialize nfp:*.
 
void nfpExit (void)
 Exit nfp:*.
 
Result nfcInitialize (NfcServiceType service_type)
 Initialize nfc:*.
 
void nfcExit (void)
 Exit nfc:*.
 
Result nfcMfInitialize ()
 Initialize nfc:mf:u.
 
void nfcMfExit (void)
 Exit nfc:mf:u.
 
ServicenfpGetServiceSession (void)
 Gets the Service object for the actual nfp:* service session.
 
ServicenfpGetServiceSession_Interface (void)
 Gets the Service object for the interface from nfp:*.
 
ServicenfcGetServiceSession (void)
 Gets the Service object for the actual nfc:* service session.
 
ServicenfcGetServiceSession_Interface (void)
 Gets the Service object for the interface from nfc:*.
 
ServicenfcMfGetServiceSession (void)
 Gets the Service object for the actual nfc:mf:u service session.
 
ServicenfcMfGetServiceSession_Interface (void)
 Gets the Service object for the interface from nfc:mf:u.
 
Result nfpListDevices (s32 *total_out, NfcDeviceHandle *out, s32 count)
 
Result nfpStartDetection (const NfcDeviceHandle *handle)
 
Result nfpStopDetection (const NfcDeviceHandle *handle)
 
Result nfpMount (const NfcDeviceHandle *handle, NfpDeviceType device_type, NfpMountTarget mount_target)
 
Result nfpUnmount (const NfcDeviceHandle *handle)
 
Result nfcListDevices (s32 *total_out, NfcDeviceHandle *out, s32 count)
 Only available with [4.0.0+].
 
Result nfcStartDetection (const NfcDeviceHandle *handle, NfcProtocol protocol)
 Only available with [4.0.0+].
 
Result nfcStopDetection (const NfcDeviceHandle *handle)
 Only available with [4.0.0+].
 
Result nfcMfListDevices (s32 *total_out, NfcDeviceHandle *out, s32 count)
 
Result nfcMfStartDetection (const NfcDeviceHandle *handle)
 
Result nfcMfStopDetection (const NfcDeviceHandle *handle)
 
Result nfpOpenApplicationArea (const NfcDeviceHandle *handle, u32 app_id)
 Not available with NfpServiceType_System.
 
Result nfpGetApplicationArea (const NfcDeviceHandle *handle, void *buf, size_t buf_size, u32 *out_size)
 Not available with NfpServiceType_System.
 
Result nfpSetApplicationArea (const NfcDeviceHandle *handle, const void *buf, size_t buf_size)
 Not available with NfpServiceType_System.
 
Result nfpFlush (const NfcDeviceHandle *handle)
 
Result nfpRestore (const NfcDeviceHandle *handle)
 
Result nfpCreateApplicationArea (const NfcDeviceHandle *handle, u32 app_id, const void *buf, size_t buf_size)
 Not available with NfpServiceType_System.
 
Result nfpRecreateApplicationArea (const NfcDeviceHandle *handle, u32 app_id, const void *buf, size_t buf_size)
 Not available with NfpServiceType_System. More...
 
Result nfpGetApplicationAreaSize (const NfcDeviceHandle *handle, u32 *out_app_area_size)
 Not available with NfpServiceType_System.
 
Result nfpDeleteApplicationArea (const NfcDeviceHandle *handle)
 Not available with NfpServiceType_User.
 
Result nfpExistsApplicationArea (const NfcDeviceHandle *handle, bool *out)
 Not available with NfpServiceType_User.
 
Result nfpGetTagInfo (const NfcDeviceHandle *handle, NfpTagInfo *out)
 
Result nfpGetRegisterInfo (const NfcDeviceHandle *handle, NfpRegisterInfo *out)
 
Result nfpGetCommonInfo (const NfcDeviceHandle *handle, NfpCommonInfo *out)
 
Result nfpGetModelInfo (const NfcDeviceHandle *handle, NfpModelInfo *out)
 
Result nfpGetAdminInfo (const NfcDeviceHandle *handle, NfpAdminInfo *out)
 Not available with NfpServiceType_User.
 
Result nfcGetTagInfo (const NfcDeviceHandle *handle, NfcTagInfo *out)
 Only available with [4.0.0+].
 
Result nfcMfGetTagInfo (const NfcDeviceHandle *handle, NfcTagInfo *out)
 
Result nfpAttachActivateEvent (const NfcDeviceHandle *handle, Event *out_event)
 Returned event will have autoclear off.
 
Result nfpAttachDeactivateEvent (const NfcDeviceHandle *handle, Event *out_event)
 Returned event will have autoclear off.
 
Result nfcAttachActivateEvent (const NfcDeviceHandle *handle, Event *out_event)
 Returned event will have autoclear off. More...
 
Result nfcAttachDeactivateEvent (const NfcDeviceHandle *handle, Event *out_event)
 Returned event will have autoclear off. More...
 
Result nfcMfAttachActivateEvent (const NfcDeviceHandle *handle, Event *out_event)
 Returned event will have autoclear off.
 
Result nfcMfAttachDeactivateEvent (const NfcDeviceHandle *handle, Event *out_event)
 Returned event will have autoclear off.
 
Result nfpGetState (NfpState *out)
 
Result nfpGetDeviceState (const NfcDeviceHandle *handle, NfpDeviceState *out)
 
Result nfpGetNpadId (const NfcDeviceHandle *handle, u32 *out)
 
Result nfcGetState (NfcState *out)
 Only available with [4.0.0+].
 
Result nfcGetDeviceState (const NfcDeviceHandle *handle, NfcDeviceState *out)
 Only available with [4.0.0+].
 
Result nfcGetNpadId (const NfcDeviceHandle *handle, u32 *out)
 Only available with [4.0.0+].
 
Result nfcMfGetState (NfcState *out)
 
Result nfcMfGetDeviceState (const NfcDeviceHandle *handle, NfcDeviceState *out)
 
Result nfcMfGetNpadId (const NfcDeviceHandle *handle, u32 *out)
 
Result nfpAttachAvailabilityChangeEvent (Event *out_event)
 Returned event will have autoclear on. More...
 
Result nfcAttachAvailabilityChangeEvent (Event *out_event)
 Returned event will have autoclear on. More...
 
Result nfcMfAttachAvailabilityChangeEvent (Event *out_event)
 Returned event will have autoclear on.
 
Result nfpFormat (const NfcDeviceHandle *handle)
 Not available with NfpServiceType_User.
 
Result nfpGetRegisterInfoPrivate (const NfcDeviceHandle *handle, NfpRegisterInfoPrivate *out)
 Not available with NfpServiceType_User.
 
Result nfpSetRegisterInfoPrivate (const NfcDeviceHandle *handle, const NfpRegisterInfoPrivate *register_info_private)
 Not available with NfpServiceType_User.
 
Result nfpDeleteRegisterInfo (const NfcDeviceHandle *handle)
 Not available with NfpServiceType_User.
 
Result nfpGetAll (const NfcDeviceHandle *handle, NfpData *out)
 Only available with NfpServiceType_Debug.
 
Result nfpSetAll (const NfcDeviceHandle *handle, const NfpData *nfp_data)
 Only available with NfpServiceType_Debug.
 
Result nfpFlushDebug (const NfcDeviceHandle *handle)
 Only available with NfpServiceType_Debug.
 
Result nfpBreakTag (const NfcDeviceHandle *handle, u32 break_type)
 Only available with NfpServiceType_Debug.
 
Result nfpReadBackupData (const NfcDeviceHandle *handle, void *out_buf, size_t buf_size, u32 *out_size)
 Only available with NfpServiceType_Debug.
 
Result nfpWriteBackupData (const NfcDeviceHandle *handle, const void *buf, size_t buf_size)
 Only available with NfpServiceType_Debug.
 
Result nfpWriteNtf (const NfcDeviceHandle *handle, u32 write_type, const void *buf, size_t buf_size)
 Only available with NfpServiceType_Debug.
 
Result nfcIsNfcEnabled (bool *out)
 This uses nfc:*.
 
Result nfcReadMifare (const NfcDeviceHandle *handle, NfcMifareReadBlockData *out_block_data, const NfcMifareReadBlockParameter *read_block_parameter, s32 count)
 Only available with [4.0.0+].
 
Result nfcWriteMifare (const NfcDeviceHandle *handle, const NfcMifareWriteBlockParameter *write_block_parameter, s32 count)
 Only available with [4.0.0+].
 
Result nfcMfReadMifare (const NfcDeviceHandle *handle, NfcMifareReadBlockData *out_block_data, const NfcMifareReadBlockParameter *read_block_parameter, s32 count)
 
Result nfcMfWriteMifare (const NfcDeviceHandle *handle, const NfcMifareWriteBlockParameter *write_block_parameter, s32 count)
 
Result nfcSendCommandByPassThrough (const NfcDeviceHandle *handle, u64 timeout, const void *cmd_buf, size_t cmd_buf_size, void *reply_buf, size_t reply_buf_size, u64 *out_size)
 Only available with [4.0.0+].
 
Result nfcKeepPassThroughSession (const NfcDeviceHandle *handle)
 Only available with [4.0.0+].
 
Result nfcReleasePassThroughSession (const NfcDeviceHandle *handle)
 Only available with [4.0.0+].
 

Detailed Description

Nintendo Figurine (amiibo) Platform (nfp:user) service IPC wrapper.

Author
averne

Enumeration Type Documentation

◆ NfcProtocol

Enumerator
NfcProtocol_TypeA 

ISO14443A.

NfcProtocol_TypeB 

ISO14443B.

NfcProtocol_TypeF 

Sony FeliCa.

◆ NfcServiceType

NfcServiceType.

Enumerator
NfcServiceType_User 

Initializes nfc:user.

NfcServiceType_System 

Initializes nfc:sys.

◆ NfcTagType

enum NfcTagType
Enumerator
NfcTagType_Type1 

ISO14443A RW. Topaz.

NfcTagType_Type2 

ISO14443A RW. Ultralight, NTAGX, ST25TN.

NfcTagType_Type3 

ISO14443A RW/RO. Sony FeliCa.

NfcTagType_Type4A 

ISO14443A RW/RO. DESFire.

NfcTagType_Type4B 

ISO14443B RW/RO. DESFire.

NfcTagType_Type5 

ISO15693 RW/RO. SLI, SLIX, ST25TV.

NfcTagType_Mifare 

Mifare clasic. Skylanders.

◆ NfpServiceType

NfpServiceType.

Enumerator
NfpServiceType_User 

Initializes nfp:user.

NfpServiceType_Debug 

Initializes nfp:dbg.

NfpServiceType_System 

Initializes nfp:sys.

Function Documentation

◆ nfcAttachActivateEvent()

Result nfcAttachActivateEvent ( const NfcDeviceHandle handle,
Event out_event 
)

Returned event will have autoclear off.

Only available with [4.0.0+].

◆ nfcAttachAvailabilityChangeEvent()

Result nfcAttachAvailabilityChangeEvent ( Event out_event)

Returned event will have autoclear on.

Only available with [4.0.0+].

◆ nfcAttachDeactivateEvent()

Result nfcAttachDeactivateEvent ( const NfcDeviceHandle handle,
Event out_event 
)

Returned event will have autoclear off.

Only available with [4.0.0+].

◆ nfpAttachAvailabilityChangeEvent()

Result nfpAttachAvailabilityChangeEvent ( Event out_event)

Returned event will have autoclear on.

Only available with [3.0.0+].

◆ nfpRecreateApplicationArea()

Result nfpRecreateApplicationArea ( const NfcDeviceHandle handle,
u32  app_id,
const void *  buf,
size_t  buf_size 
)

Not available with NfpServiceType_System.

Only available with [3.0.0+].