Add a few more ACU functions (#379)

This commit is contained in:
Joel 2017-12-01 10:58:08 -06:00 committed by fincs
parent 65673fd3f3
commit 6f64dee330
2 changed files with 60 additions and 0 deletions

View File

@ -18,3 +18,21 @@ Result acWaitInternetConnection(void);
* @param out Pointer to output the current Wifi status to. (0 = not connected, 1 = O3DS Internet, 2 = N3DS Internet)
*/
Result ACU_GetWifiStatus(u32 *out);
/**
* @brief Gets the current Wifi status.
* @param out Pointer to output the current Wifi status to. (1 = not connected, 3 = connected)
*/
Result ACU_GetStatus(u32 *out);
/**
* @brief Gets the current Wifi security mode.
* @param out Pointer to output the current Wifi security mode to. (0 = Open Authentication, 1 = WEP 40-bit, 2 = WEP 104-bit, 3 = WEP 128-bit, 4 = WPA TKIP, 5 = WPA2 TKIP, 6 = WPA AES, 7 = WPA2 AES)
*/
Result ACU_GetSecurityMode(u32 *out);
/**
* @brief Gets the current Wifi SSID length.
* @param out Pointer to output the current Wifi SSID length to.
*/
Result ACU_GetSSIDLength(u32 *out);

View File

@ -50,3 +50,45 @@ Result ACU_GetWifiStatus(u32 *out)
return (Result)cmdbuf[1];
}
Result ACU_GetStatus(u32 *out)
{
Result ret=0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0xC,0,0); // 0x000C0000
if(R_FAILED(ret = svcSendSyncRequest(acHandle)))return ret;
*out = cmdbuf[2];
return (Result)cmdbuf[1];
}
Result ACU_GetSecurityMode(u32 *out)
{
Result ret=0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x33,0,0); // 0x00330000
if(R_FAILED(ret = svcSendSyncRequest(acHandle)))return ret;
*out = cmdbuf[2];
return (Result)cmdbuf[1];
}
Result ACU_GetSSIDLength(u32 *out)
{
Result ret=0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x35,0,0); // 0x00350000
if(R_FAILED(ret = svcSendSyncRequest(acHandle)))return ret;
*out = cmdbuf[2];
return (Result)cmdbuf[1];
}