| View previous topic :: View next topic |
| Author |
Message |
pegasus2000
Joined: 12 Jul 2006 Posts: 160
|
Posted: Sat Jul 21, 2007 8:56 pm Post subject: Troubles in WLAN routines |
|
|
I have tried to run a simple routine to connect PSP with an access point
(My PC has a LAN with static IP, the PSP has static IP, and test
integrated in firmware works perfectly).
| Code: | int connect_to_apctl(int config)
{
int err;
int stateLast = -1;
/* Connect using the first profile */
err = sceNetApctlConnect(config);
if (err != 0)
{
printf(MODULE_NAME ": sceNetApctlConnect returns %08X\n", err);
return 0;
}
printf(MODULE_NAME ": Connecting...\n");
while (1)
{
int state;
err = sceNetApctlGetState(&state);
if (err != 0)
{
printf(MODULE_NAME ": sceNetApctlGetState returns $%x\n", err);
break;
}
if (state > stateLast)
{
printf(" connection state %d of 4\n", state);
stateLast = state;
}
if (state == 4)
break; // connected with static IP
// wait a little before polling again
sceKernelDelayThread(50*1000); // 50ms
}
printf(MODULE_NAME ": Connected!\n");
if(err != 0)
{
return 0;
}
return 1;
} |
The trouble is that the state returned by sceNetApctlGetState remains
always to zero and it doesn't change to 4. So the loop continues
indefinitely.
Why ? Do you have any ideas about it ? |
|
| Back to top |
|
 |
guyver2
Joined: 10 Jul 2007 Posts: 5
|
Posted: Sun Jul 22, 2007 6:23 am Post subject: |
|
|
I'm sorry but I can't answer your question, I'm using exactly the same code and it works.
Just one question:
I use the sample found in the pspsdk and it works fine in folder GAME150 but I recieve an error (80020148) when I put the Homebrew in the folder GAME340.
What can I do to make it work in 3.40 kernel ? I would like to use wlan AND chotto cam in the same HB but the chotto don't work in 1.50 kernel...
Thank you and sorry for my english. _________________ Psp prog |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Sun Jul 22, 2007 8:55 am Post subject: |
|
|
Build the sample for the 3.xx kernel by compiling it as a PRX and pack that into the eboot (add BUILD_PRX=1 to the Makefile).
Use the sceUtilityLoadNetModule() function to load the needed modules, instead of pspSdkLoadInetModules().
Details of what modules need loading can be found in psputility_netmodules.h |
|
| Back to top |
|
 |
Xfacter
Joined: 28 Feb 2007 Posts: 9
|
Posted: Sun Jul 22, 2007 5:02 pm Post subject: |
|
|
| I was having the same problem. I put pspSdkInetInit in my user thread (instead of the kernel thread) and it worked. |
|
| Back to top |
|
 |
guyver2
Joined: 10 Jul 2007 Posts: 5
|
Posted: Sun Jul 22, 2007 6:35 pm Post subject: |
|
|
thank you, I'll try that _________________ Psp prog |
|
| Back to top |
|
 |
|