libnx  v4.7.0
nfp_la.h
Go to the documentation of this file.
1 /**
2  * @file nfp_la.h
3  * @brief Wrapper for using the cabinet (amiibo) LibraryApplet.
4  * @author yellows8
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 #include "../services/nfc.h"
10 
11 /// Values for NfpLaStartParamForAmiiboSettings::type.
12 typedef enum {
18 
19 /// AmiiboSettingsStartParam
20 typedef struct {
21  u8 unk_x0[0x8]; ///< Unknown
22  u8 unk_x8[0x20]; ///< Unknown
23  u8 unk_x28; ///< Unknown
25 
26 /// StartParamForAmiiboSettings
27 typedef struct {
28  u8 unk_x0; ///< Unknown
29  u8 type; ///< \ref NfpLaStartParamTypeForAmiiboSettings
30  u8 flags; ///< Flags
31  u8 unk_x3; ///< NfpLaAmiiboSettingsStartParam::unk_x28
32  u8 unk_x4[0x8]; ///< NfpLaAmiiboSettingsStartParam::unk_x0
33  NfpTagInfo tag_info; ///< \ref NfpTagInfo, only enabled when flags bit1 is set.
34  NfpRegisterInfo register_info; ///< \ref NfpRegisterInfo, only enabled when flags bit2 is set.
35  u8 unk_x164[0x20]; ///< NfpLaAmiiboSettingsStartParam::unk_x8
36  u8 unk_x184[0x24]; ///< Unknown
38 
39 /// ReturnValueForAmiiboSettings
40 typedef struct {
41  u8 flags; ///< 0 = error, non-zero = success.
42  u8 pad[3]; ///< Padding
43  NfcDeviceHandle handle; ///< \ref NfcDeviceHandle
44  NfpTagInfo tag_info; ///< \ref NfpTagInfo
45  NfpRegisterInfo register_info; ///< \ref NfpRegisterInfo, only available when flags bit2 is set.
46  u8 unk_x164[0x24]; ///< Unknown
48 
49 /**
50  * @brief Launches the applet for NicknameAndOwnerSettings.
51  * @note Official sw does not expose functionality for using input/output \ref NfpTagInfo at the same time.
52  * @param[in] in_param \ref NfpLaAmiiboSettingsStartParam
53  * @param[in] in_tag_info \ref NfpTagInfo. Optional, can be NULL. If specified, this must match the scanned amiibo.
54  * @param[in] in_reg_info \ref NfpRegisterInfo. Optional, can be NULL. If specified, this sets the \ref NfpRegisterInfo which will be used for writing, with an option for the user to change it.
55  * @param[out] out_tag_info \ref NfpTagInfo. Optional, can be NULL.
56  * @param[out] handle \ref NfcDeviceHandle
57  * @param[out] reg_info_flag Flag indicating whether the data for out_reg_info is set. Optional, can be NULL.
58  * @param[out] out_reg_info \ref NfpRegisterInfo, see reg_info_flag. Optional, can be NULL.
59  */
60 Result nfpLaStartNicknameAndOwnerSettings(const NfpLaAmiiboSettingsStartParam *in_param, const NfpTagInfo *in_tag_info, const NfpRegisterInfo *in_reg_info, NfpTagInfo *out_tag_info, NfcDeviceHandle *handle, bool *reg_info_flag, NfpRegisterInfo *out_reg_info);
61 
62 /**
63  * @brief Launches the applet for GameDataEraser.
64  * @note Official sw does not expose functionality for using input/output \ref NfpTagInfo at the same time.
65  * @param[in] in_param \ref NfpLaAmiiboSettingsStartParam
66  * @param[in] in_tag_info \ref NfpTagInfo. Optional, can be NULL. If specified, this must match the scanned amiibo.
67  * @param[out] out_tag_info \ref NfpTagInfo. Optional, can be NULL.
68  * @param[out] handle \ref NfcDeviceHandle
69  */
70 Result nfpLaStartGameDataEraser(const NfpLaAmiiboSettingsStartParam *in_param, const NfpTagInfo *in_tag_info, NfpTagInfo *out_tag_info, NfcDeviceHandle *handle);
71 
72 /**
73  * @brief Launches the applet for Restorer.
74  * @note Official sw does not expose functionality for using input/output \ref NfpTagInfo at the same time.
75  * @param[in] in_param \ref NfpLaAmiiboSettingsStartParam
76  * @param[in] in_tag_info \ref NfpTagInfo. Optional, can be NULL. If specified, this must match the scanned amiibo.
77  * @param[out] out_tag_info \ref NfpTagInfo. Optional, can be NULL.
78  * @param[out] handle \ref NfcDeviceHandle
79  */
80 Result nfpLaStartRestorer(const NfpLaAmiiboSettingsStartParam *in_param, const NfpTagInfo *in_tag_info, NfpTagInfo *out_tag_info, NfcDeviceHandle *handle);
81 
82 /**
83  * @brief Launches the applet for Formatter.
84  * @param[in] in_param \ref NfpLaAmiiboSettingsStartParam
85  * @param[out] out_tag_info \ref NfpTagInfo
86  * @param[out] handle \ref NfcDeviceHandle
87  */
89 
Result nfpLaStartNicknameAndOwnerSettings(const NfpLaAmiiboSettingsStartParam *in_param, const NfpTagInfo *in_tag_info, const NfpRegisterInfo *in_reg_info, NfpTagInfo *out_tag_info, NfcDeviceHandle *handle, bool *reg_info_flag, NfpRegisterInfo *out_reg_info)
Launches the applet for NicknameAndOwnerSettings.
NfpLaStartParamTypeForAmiiboSettings
Values for NfpLaStartParamForAmiiboSettings::type.
Definition: nfp_la.h:12
@ NfpLaStartParamTypeForAmiiboSettings_NicknameAndOwnerSettings
NicknameAndOwnerSettings.
Definition: nfp_la.h:13
@ NfpLaStartParamTypeForAmiiboSettings_GameDataEraser
GameDataEraser.
Definition: nfp_la.h:14
@ NfpLaStartParamTypeForAmiiboSettings_Restorer
Restorer.
Definition: nfp_la.h:15
@ NfpLaStartParamTypeForAmiiboSettings_Formatter
Formatter.
Definition: nfp_la.h:16
Result nfpLaStartRestorer(const NfpLaAmiiboSettingsStartParam *in_param, const NfpTagInfo *in_tag_info, NfpTagInfo *out_tag_info, NfcDeviceHandle *handle)
Launches the applet for Restorer.
Result nfpLaStartGameDataEraser(const NfpLaAmiiboSettingsStartParam *in_param, const NfpTagInfo *in_tag_info, NfpTagInfo *out_tag_info, NfcDeviceHandle *handle)
Launches the applet for GameDataEraser.
Result nfpLaStartFormatter(const NfpLaAmiiboSettingsStartParam *in_param, NfpTagInfo *out_tag_info, NfcDeviceHandle *handle)
Launches the applet for Formatter.
Nfc/Nfp DeviceHandle.
Definition: nfc.h:237
AmiiboSettingsStartParam.
Definition: nfp_la.h:20
u8 unk_x28
Unknown.
Definition: nfp_la.h:23
ReturnValueForAmiiboSettings.
Definition: nfp_la.h:40
NfcDeviceHandle handle
NfcDeviceHandle
Definition: nfp_la.h:43
NfpRegisterInfo register_info
NfpRegisterInfo, only available when flags bit2 is set.
Definition: nfp_la.h:45
NfpTagInfo tag_info
NfpTagInfo
Definition: nfp_la.h:44
u8 flags
0 = error, non-zero = success.
Definition: nfp_la.h:41
StartParamForAmiiboSettings.
Definition: nfp_la.h:27
u8 unk_x3
NfpLaAmiiboSettingsStartParam::unk_x28.
Definition: nfp_la.h:31
NfpTagInfo tag_info
NfpTagInfo, only enabled when flags bit1 is set.
Definition: nfp_la.h:33
u8 flags
Flags.
Definition: nfp_la.h:30
u8 unk_x0
Unknown.
Definition: nfp_la.h:28
NfpRegisterInfo register_info
NfpRegisterInfo, only enabled when flags bit2 is set.
Definition: nfp_la.h:34
u8 type
NfpLaStartParamTypeForAmiiboSettings
Definition: nfp_la.h:29
Definition: nfc.h:138
Definition: nfc.h:105
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
u32 Result
Function error code result type.
Definition: types.h:44