8 #define NFC_ERR_INVALID_STATE 0xC8A17600
11 #define NFC_ERR_APPDATA_UNINITIALIZED 0xC8A17620
14 #define NFC_ERR_AMIIBO_NOTSETUP 0xC8A17628
17 #define NFC_ERR_APPID_MISMATCH 0xC8A17638
20 #define NFC_ERR_DATACORRUPTION0 0xC8C1760C
23 #define NFC_ERR_DATACORRUPTION1 0xC8A17618
26 #define NFC_STARTSCAN_DEFAULTINPUT 0
36 NFC_TagState_Uninitialized = 0,
46 NFC_amiiboFlag_Setup =
BIT(4),
71 u16 lastwritedate_year;
72 u8 lastwritedate_month;
Result nfcCmd22(void)
Unknown.
Result nfcGetTagInfo(NFC_TagInfo *out)
Returns the current TagInfo.
Result nfcCmd21(void)
Unknown.
Result nfcUpdateStoredAmiiboData(void)
This writes the amiibo data stored in memory to the actual amiibo data storage(which is normally the ...
Result nfcGetAmiiboConfig(NFC_AmiiboConfig *out)
Returns the current AmiiboConfig.
void nfcExit(void)
Shuts down NFC.
Result nfcLoadAmiiboData(void)
Read amiibo NFC data and load in memory.
NFC_TagState
Definition: nfc.h:35
@ NFC_TagState_DataReady
NFC tag is now out of range, where the NFC tag was previously in range. This occurs automatically wit...
Definition: nfc.h:41
@ NFC_TagState_OutOfRange
NFC tag is in range. The state automatically changes to this when the state was previously value 2,...
Definition: nfc.h:40
@ NFC_TagState_Scanning
Not currently scanning for NFC tags. Set by nfcStopScanning() and nfcInit(), when successful.
Definition: nfc.h:38
@ NFC_TagState_ScanningStopped
nfcInit() was not used yet.
Definition: nfc.h:37
@ NFC_TagState_InRange
Currently scanning for NFC tags. Set by nfcStartScanning() when successful.
Definition: nfc.h:39
Result nfcInit(NFC_OpType type)
Initializes NFC.
Result nfcGetTagState(NFC_TagState *state)
Returns the current NFC tag state.
Result nfcSendTagCommand(const void *inbuf, size_t insize, void *outbuf, size_t outsize, size_t *actual_transfer_size, u64 microseconds)
This sends a raw NFC command to the tag.
@ NFC_amiiboFlag_AppDataSetup
This indicates that the amiibo was setup with amiibo Settings. nfcGetAmiiboSettings() will return an ...
Definition: nfc.h:47
Result nfcReadAppData(void *buf, size_t size)
Reads the appdata.
Result nfcOpenAppData(u32 amiibo_appid)
Opens the appdata, when the amiibo appdata was previously initialized.
Result nfcResetTagScanState(void)
If the tagstate is valid(NFC_TagState_DataReady or 6), it then sets the current tagstate to NFC_TagSt...
NFC_OpType
NFC operation type.
Definition: nfc.h:29
@ NFC_OpType_NFCTag
Unknown.
Definition: nfc.h:31
@ NFC_OpType_RawNFC
This is the default.
Definition: nfc.h:32
Result nfcGetAmiiboSettings(NFC_AmiiboSettings *out)
Returns the current AmiiboSettings.
Result nfcStartOtherTagScanning(u16 unk0, u32 unk1)
Starts scanning for NFC tags when initialized with NFC_OpType_RawNFC.
Result nfcStartScanning(u16 inval)
Starts scanning for NFC tags.
Handle nfcGetSessionHandle(void)
Gets the NFC service handle.
Result nfcInitializeWriteAppData(u32 amiibo_appid, const void *buf, size_t size)
This initializes the appdata using the specified input, when the appdata previously wasn't initialize...
Result nfcWriteAppData(const void *buf, size_t size, NFC_TagInfo *taginfo)
Writes the appdata, after nfcOpenAppData() was used successfully.
void nfcStopScanning(void)
Stops scanning for NFC tags.
AmiiboConfig structure, see also here: https://3dbrew.org/wiki/NFC:GetAmiiboConfig.
Definition: nfc.h:70
u8 type
ID shared by all exact same amiibo. Some amiibo are only distinguished by this one like regular SMB S...
Definition: nfc.h:78
u16 amiiboID
ID of the series.
Definition: nfc.h:77
u8 series
the first element is the collection ID, the second the character in this collection,...
Definition: nfc.h:76
u8 pagex4_byte3
Type of amiibo 0 = figure, 1 = card, 2 = plush.
Definition: nfc.h:79
AmiiboSettings structure, see also here: https://3dbrew.org/wiki/NFC:GetAmiiboSettings.
Definition: nfc.h:58
u8 flags
"UTF-16BE Amiibo nickname."
Definition: nfc.h:61
u16 setupdate_year
"This is plaintext_amiibosettingsdata[1]." "Country Code ID, from the system which setup this amiibo....
Definition: nfc.h:63
u8 countrycodeid
"This is plaintext_amiibosettingsdata[0] & 0xF." See also the NFC_amiiboFlag enums.
Definition: nfc.h:62
Used by nfcInitializeWriteAppData() internally, see also here: https://3dbrew.org/wiki/NFC:GetAppData...
Definition: nfc.h:85
Used by nfcWriteAppData() internally, see also: https://3dbrew.org/wiki/NFC:WriteAppData.
Definition: nfc.h:91
u8 unk_x2
"u16 size/offset of the below ID data. Normally this is 0x7. When this is <=10, this field is the siz...
Definition: nfc.h:52
#define BIT(n)
Creates a bitmask from a bit number.
Definition: types.h:47
uint64_t u64
64-bit unsigned integer
Definition: types.h:24
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
u32 Handle
Resource handle.
Definition: types.h:41
s32 Result
Function result.
Definition: types.h:42
uint16_t u16
16-bit unsigned integer
Definition: types.h:22
uint32_t u32
32-bit unsigned integer
Definition: types.h:23