Line 50:
Line 50:
#define PROXY_CFG_SIZE 0x1c8
#define PROXY_CFG_SIZE 0x1c8
+
+
</syntaxhighlight>
+
+
==Implementation Example==
+
===WiFi===
+
<syntaxhighlight lang="C">
+
+
#define NET_GET_WIFI_CFG 0x0C
+
#define NET_SET_WIFI_CFG 0x11
+
+
#define NET_GET_PROXY_CFG 0x26
+
#define NET_SET_PROXY_CFG 0x25
+
+
int fd;
+
WifiConfig *wf_cfg;
+
+
int handle = IOS_Open((char*)"/dev/net/ifmgr/ncl", 0);
+
if(!handle)
+
{
+
_print("Couldn't open IOSU module. Press + to exit.");
+
flipBuffers();
+
goto end;
+
}
+
+
wf_cfg = (WifiConfig*)OSAllocFromSystem(0x70, 4);
+
if(!wf_cfg)
+
{
+
_print("Couldn't alloc output buffer. Press + to exit");
+
flipBuffers();
+
goto end;
+
}
+
+
memset(wf_cfg, 0, 0x70);
+
IOS_Ioctl(handle, NET_GET_WIFI_CFG, NULL, 0, wf_cfg, 0x70);
+
+
fd = open("sd:/wifi_cfg.bin", O_WRONLY);
+
write(fd, wf_cfg, 0x70);
+
close(fd);
+
+
_print("File written to SD Card ! Press + to exit");
+
flipBuffers();
+
+
end:
</syntaxhighlight>
</syntaxhighlight>