I can´t work with wifi, my code is :
Code: Select all
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspwlan.h>
#include <pspsdk.h>
#include <pspnet_adhoc.h>
#include <string.h>
PSP_MODULE_INFO("Wifi", 0x1000, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(0);
SceUID load_start_module(const char *path, int flags, int type);
int sceNetInit(u32 r4, u32 r5, u32 r6, u32 r7, u32 r8);
/* Define printf, just to make typing easier */
#define printf pspDebugScreenPrintf
int user_main(SceSize args, void *argp){
SceCtrlData pad;
u32 err;
printf("User main\n");
printf("sceNetInit()\n");
err = sceNetInit(0x20000, 0x20, 0x1000, 0x20, 0x1000);
printf("Return: %x\n",err);
printf("sceNetAdhocInit()\n");
err = sceNetAdhocInit();
printf("Return: %x\n",err);
while(1){
sceCtrlReadBufferPositive(&pad,1);
if( pad.Buttons & PSP_CTRL_DOWN ) { break; }
}
}
int main(int argc, char *argp[]){
pspDebugScreenInit();
printf("Loading PRX...\n");
printf("Return: %x\n",load_start_module("flash0:/kd/ifhandle.prx", 0, 0));
printf("Return: %x\n",load_start_module("flash0:/kd/memab.prx", 0, 0));
printf("Return: %x\n",load_start_module("flash0:/kd/pspnet_adhoc_auth.prx", 0, 0));
printf("Return: %x\n",load_start_module("flash0:/kd/pspnet.prx", 0, 0));
printf("Return: %x\n",load_start_module("flash0:/kd/pspnet_adhoc.prx", 0, 0));
printf("Return: %x\n",load_start_module("flash0:/kd/pspnet_adhocctl.prx", 0, 0));
printf("Return: %x\n",load_start_module("flash0:/kd/pspnet_adhoc_matching.prx", 0, 0));
/* create user thread */
SceUID thid = sceKernelCreateThread("User Mode Thread", user_main,
0x11, // default priority
256 * 1024, // stack size (256KB is regular default)
PSP_THREAD_ATTR_USER, NULL); //# user mode
// start user thread, then wait for it to do everything else
sceKernelStartThread(thid, 0, 0);
sceKernelWaitThreadEnd(thid, NULL);
/* quick clean exit */
sceKernelExitGame();
return 0;
}
SceUID load_start_module(const char *path, int flags, int type)
{
SceKernelLMOption option;
SceUID mpid;
SceModule *mod;
SceUID modid;
int fd;
/* If the type is 0, then load the module in the kernel partition, otherwise load it
in the user partition. */
if (type == 0) {
mpid = 1;
} else {
mpid = 2;
}
memset(&option, 0, sizeof(option));
option.size = sizeof(option);
option.mpidtext = mpid;
option.mpiddata = mpid;
option.position = 0;
option.access = 1;
modid = sceKernelLoadModule(path, flags, type > 0 ? &option : NULL);
mod = sceKernelFindModuleByUID(modid);
return sceKernelStartModule(modid, 0, NULL, &fd, NULL);
}
return the error SCE_KERNEL_ERROR_LIBRARY_NOT_YET_LINKED = 0x8002013a , why ? I read some post, but i didn´t find the info or i didn´t understand it