Add ACU_GetLastErrorCode && ACU_GetLastDetailErrorCode

This commit is contained in:
Joel16 2018-01-13 11:33:37 -06:00
parent 52be537b48
commit 8be21732f2
2 changed files with 40 additions and 0 deletions

View File

@ -36,3 +36,15 @@ Result ACU_GetSecurityMode(u32 *out);
* @param out Pointer to output the current Wifi SSID length to. * @param out Pointer to output the current Wifi SSID length to.
*/ */
Result ACU_GetSSIDLength(u32 *out); Result ACU_GetSSIDLength(u32 *out);
/**
* @brief Gets the last error to occur during a connection.
* @param errorCode Pointer to output the error code to.
*/
Result ACU_GetLastErrorCode(u32* errorCode);
/**
* @brief Gets the last detailed error to occur during a connection.
* @param errorCode Pointer to output the error code to.
*/
Result ACU_GetLastDetailErrorCode(u32* errorCode);

View File

@ -92,3 +92,31 @@ Result ACU_GetSSIDLength(u32 *out)
return (Result)cmdbuf[1]; return (Result)cmdbuf[1];
} }
Result ACU_GetLastErrorCode(u32* errorCode)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0xA,0,0); // 0xA0000
if(R_FAILED(ret = svcSendSyncRequest(acHandle)))return ret;
if(errorCode) *errorCode = cmdbuf[2];
return (Result)cmdbuf[1];
}
Result ACU_GetLastDetailErrorCode(u32* errorCode)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0xB,0,0); // 0xB0000
if(R_FAILED(ret = svcSendSyncRequest(acHandle)))return ret;
if(errorCode) *errorCode = cmdbuf[2];
return (Result)cmdbuf[1];
}