Add CFGU_IsNFCSupported (IsFangateSupported)

This commit is contained in:
Joel16 2017-10-26 20:54:15 -05:00
parent a11bec5da5
commit 4bc8e195d5
2 changed files with 20 additions and 0 deletions

View File

@ -84,6 +84,12 @@ Result CFGU_GetCountryCodeString(u16 code, u16* string);
*/ */
Result CFGU_GetCountryCodeID(u16 string, u16* code); Result CFGU_GetCountryCodeID(u16 string, u16* code);
/**
* @brief Checks if NFC (code name: fangate) is supported.
* @param isSupported pointer to the output the result to.
*/
Result CFGU_IsNFCSupported(bool* isSupported);
/** /**
* @brief Gets a config info block with flags = 2. * @brief Gets a config info block with flags = 2.
* @param size Size of the data to retrieve. * @param size Size of the data to retrieve.

View File

@ -133,6 +133,20 @@ Result CFGU_GetCountryCodeID(u16 string, u16* code)
return (Result)cmdbuf[1]; return (Result)cmdbuf[1];
} }
Result CFGU_IsNFCSupported(bool* isSupported)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0xB,0,0); // 0x000B0000
if(R_FAILED(ret = svcSendSyncRequest(cfguHandle)))return ret;
*isSupported = cmdbuf[2] & 0xFF;
return (Result)cmdbuf[1];
}
// See here for block IDs: // See here for block IDs:
// http://3dbrew.org/wiki/Config_Savegame#Configuration_blocks // http://3dbrew.org/wiki/Config_Savegame#Configuration_blocks
Result CFGU_GetConfigInfoBlk2(u32 size, u32 blkID, u8* outData) Result CFGU_GetConfigInfoBlk2(u32 size, u32 blkID, u8* outData)