libnx  v4.2.2
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 
NfpLaReturnValueForAmiiboSettings::flags
u8 flags
0 = error, non-zero = success.
Definition: nfp_la.h:41
NfpLaStartParamTypeForAmiiboSettings
NfpLaStartParamTypeForAmiiboSettings
Values for NfpLaStartParamForAmiiboSettings::type.
Definition: nfp_la.h:12
NfcDeviceHandle
Nfc/Nfp DeviceHandle.
Definition: nfc.h:90
nfpLaStartNicknameAndOwnerSettings
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.
NfpLaStartParamForAmiiboSettings::register_info
NfpRegisterInfo register_info
NfpRegisterInfo, only enabled when flags bit2 is set.
Definition: nfp_la.h:34
u8
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
NfpLaAmiiboSettingsStartParam::unk_x28
u8 unk_x28
Unknown.
Definition: nfp_la.h:23
NfpTagInfo
Definition: nfc.h:51
NfpLaStartParamTypeForAmiiboSettings_NicknameAndOwnerSettings
@ NfpLaStartParamTypeForAmiiboSettings_NicknameAndOwnerSettings
NicknameAndOwnerSettings.
Definition: nfp_la.h:13
NfpLaAmiiboSettingsStartParam
AmiiboSettingsStartParam.
Definition: nfp_la.h:20
NfpLaStartParamForAmiiboSettings::type
u8 type
NfpLaStartParamTypeForAmiiboSettings
Definition: nfp_la.h:29
NfpLaStartParamForAmiiboSettings::unk_x3
u8 unk_x3
NfpLaAmiiboSettingsStartParam::unk_x28.
Definition: nfp_la.h:31
NfpRegisterInfo
Definition: nfc.h:75
nfpLaStartGameDataEraser
Result nfpLaStartGameDataEraser(const NfpLaAmiiboSettingsStartParam *in_param, const NfpTagInfo *in_tag_info, NfpTagInfo *out_tag_info, NfcDeviceHandle *handle)
Launches the applet for GameDataEraser.
NfpLaStartParamForAmiiboSettings::flags
u8 flags
Flags.
Definition: nfp_la.h:30
NfpLaStartParamTypeForAmiiboSettings_Formatter
@ NfpLaStartParamTypeForAmiiboSettings_Formatter
Formatter.
Definition: nfp_la.h:16
NfpLaReturnValueForAmiiboSettings::handle
NfcDeviceHandle handle
NfcDeviceHandle
Definition: nfp_la.h:43
Result
u32 Result
Function error code result type.
Definition: types.h:44
NfpLaStartParamForAmiiboSettings::unk_x0
u8 unk_x0
Unknown.
Definition: nfp_la.h:28
nfpLaStartFormatter
Result nfpLaStartFormatter(const NfpLaAmiiboSettingsStartParam *in_param, NfpTagInfo *out_tag_info, NfcDeviceHandle *handle)
Launches the applet for Formatter.
NfpLaReturnValueForAmiiboSettings::register_info
NfpRegisterInfo register_info
NfpRegisterInfo, only available when flags bit2 is set.
Definition: nfp_la.h:45
NfpLaReturnValueForAmiiboSettings
ReturnValueForAmiiboSettings.
Definition: nfp_la.h:40
NfpLaReturnValueForAmiiboSettings::tag_info
NfpTagInfo tag_info
NfpTagInfo
Definition: nfp_la.h:44
NfpLaStartParamTypeForAmiiboSettings_GameDataEraser
@ NfpLaStartParamTypeForAmiiboSettings_GameDataEraser
GameDataEraser.
Definition: nfp_la.h:14
nfpLaStartRestorer
Result nfpLaStartRestorer(const NfpLaAmiiboSettingsStartParam *in_param, const NfpTagInfo *in_tag_info, NfpTagInfo *out_tag_info, NfcDeviceHandle *handle)
Launches the applet for Restorer.
NfpLaStartParamForAmiiboSettings
StartParamForAmiiboSettings.
Definition: nfp_la.h:27
NfpLaStartParamForAmiiboSettings::tag_info
NfpTagInfo tag_info
NfpTagInfo, only enabled when flags bit1 is set.
Definition: nfp_la.h:33
NfpLaStartParamTypeForAmiiboSettings_Restorer
@ NfpLaStartParamTypeForAmiiboSettings_Restorer
Restorer.
Definition: nfp_la.h:15