Hi everyone,
I've been trying to get adhoc wifi to work on the PSP in user-mode, but haven't been successful.
A lot of the examples I find use PspPet's loadutil library to load and patch drivers in kernel mode, but it seems to me like the latest version of pspsdk no longer requires this (please correct me if I'm wrong), since the libraries and header declarations are already part of the SDK.
I wrote a simple program to simply initialize, then terminate an adhoc connection - the entire program runs in user mode - but I'm getting an error from sceNetInit, which is the first network-related function I call.
My question is, does an application need to be run in kernel mode for ad-hoc to work with the current version of the SDK? Can anyone provide a possible reason why my call to sceNetInit fails (and yes, I checked the wifi switch :))
Here's my PSP_MODULE_INFO declaration:
PSP_MODULE_INFO(PSP_APP_NAME, 0, 1, 1);
PSP_MAIN_THREAD_ATTR(0);
Any help is appreciated.
Thanks
Adhoc wifi
-
- Posts: 376
- Joined: Wed May 10, 2006 11:31 pm
Hi uberjack.
Adhoc in usermode is possible.
I commited a decent sized update to the adhoc stuff in the SDK last night, so check that out.
To load the required net and adhoc modules, simply call the functions from psputility_netmodules.h.
Your app is still running in kernel mode, change the following line:
To:
The sceUtilityLoadNetModule function only works on firmware 2.0+.
I'll be commiting some more adhoc stuff in the near future as well as some samples.
Hope this helps.
Adhoc in usermode is possible.
I commited a decent sized update to the adhoc stuff in the SDK last night, so check that out.
To load the required net and adhoc modules, simply call the functions from psputility_netmodules.h.
Code: Select all
sceUtilityLoadNetModule(PSP_NET_MODULE_COMMON);
sceUtilityLoadNetModule(PSP_NET_MODULE_ADHOC);
Code: Select all
PSP_MAIN_THREAD_ATTR(0);
Code: Select all
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);
I'll be commiting some more adhoc stuff in the near future as well as some samples.
Hope this helps.
Hi Insert_witty_name,
Thanks very much for the speedy reply. One of my units is actually at 1.50. Does this mean that I need to run in kernel mode for compatibility with both versions (and do things the old-fashioned way)?
Thanks very much for the speedy reply. One of my units is actually at 1.50. Does this mean that I need to run in kernel mode for compatibility with both versions (and do things the old-fashioned way)?
Thanks, will doYour app is still running in kernel mode, change the following line:
-
- Posts: 376
- Joined: Wed May 10, 2006 11:31 pm
Here's a bit of code i use to load the network modules depending on firmware version:
Code: Select all
// setup the net environment
int ret;
#ifdef PSPFW3X
printf("[main]: initing PSP 3.x network... \n");
if( (ret = sceUtilityLoadNetModule(1)) ) /* common */
{
printf( "[main]: Unable to load 3.x net common modules: %x\n", ret );
}
if( (ret = sceUtilityLoadNetModule(3)) ) /* inet */
{
printf( "[main]: Unable to load 3.x net inet modules: %x\n", ret );
}
#else
printf("[main]: initing PSP 1.5 network... \n");
if( (ret = pspSdkLoadInetModules()) )
{
printf( "[main]: Unable to load inet modules: %x\n", ret );
}
#endif
"We are dreamers, shapers, singers, and makers. We study the mysteries of laser and circuit, crystal and scanner, holographic demons and invocations of equations. These are the tools we employ and we know... many things." -- Elric, B5
But 1.5 won't be higher compatibility for much longer. As more slims come out, and as 3.71+ M33 gets more prevalent on phats, 3.xx homebrew becomes more predominant. Having to add the 1.5 addon to 3.71 M33 on a phat wastes precious flash space.uberjack wrote:While I don't disagree with you, J.F., I prefer to keep my older PSP at the earlier firmware for sentimental reasons :)
Plus, higher compatibility is always better, no?
Thanks again guys