66#include <3ds/synchronization.h>
77#include <3ds/services/ac.h>
88#include <3ds/ipc.h>
9+ #include <string.h>
910
1011static Handle acHandle ;
1112static int acRefCount ;
@@ -30,6 +31,11 @@ void acExit(void)
3031 svcCloseHandle (acHandle );
3132}
3233
34+ Handle * acGetSessionHandle (void )
35+ {
36+ return & acHandle ;
37+ }
38+
3339Result acWaitInternetConnection (void )
3440{
3541 Result ret = 0 ;
@@ -284,3 +290,36 @@ Result ACU_GetProxyUserName(char *username)
284290
285291 return (Result )cmdbuf [1 ];
286292}
293+
294+ Result ACI_LoadNetworkSetting (u32 slot )
295+ {
296+ u32 * cmdbuf = getThreadCommandBuffer ();
297+
298+ cmdbuf [0 ] = IPC_MakeHeader (0x401 ,1 ,0 ); // 0x04010040
299+ cmdbuf [1 ] = slot ;
300+
301+ Result ret = 0 ;
302+ if (R_FAILED (ret = svcSendSyncRequest (acHandle ))) return ret ;
303+
304+ return (Result )cmdbuf [1 ];
305+ }
306+
307+ Result ACI_GetNetworkWirelessEssidSecuritySsid (void * ssid )
308+ {
309+ u32 * cmdbuf = getThreadCommandBuffer ();
310+ u32 * staticbufs = getThreadStaticBuffers ();
311+
312+ cmdbuf [0 ] = IPC_MakeHeader (0x40F ,0 ,0 ); // 0x040F0000
313+
314+ u32 staticbufBackup [2 ];
315+ memcpy (staticbufBackup , staticbufs , 8 );
316+
317+ staticbufs [0 ] = IPC_Desc_StaticBuffer (0x20 , 0 ); // at most 32 bytes
318+ staticbufs [1 ] = (u32 )ssid ;
319+
320+ Result ret = svcSendSyncRequest (acHandle );
321+
322+ memcpy (staticbufs , staticbufBackup , 8 );
323+
324+ return R_SUCCEEDED (ret ) ? (Result )cmdbuf [1 ] : ret ;
325+ }
0 commit comments