Hi,
I would like to know how to create a Ad hoc connection. What modules to use? Where to find the information about modules when we need something? do you know if there any tutorial on networks with the PSP?
thank you, all responses are welcome...
Rad
Ad hoc network
[EDIT] I found something on http://psp-news.dcemu.co.uk/smsplus.shtml and there is the source code, i'll check tomorow...
Ok, I am answering myself:
There we can found different header that contains different functions for creating a connection.
Now I am trying to create a AD HOC network. So we have to load some modules:
the thing is that there is a module called ad hoc. But what is the difference btween PSP_NET_MODULE_ADHOC PSP_NET_MODULE_COMMON PSP_NET_MODULE_INET ? I don t know if somebody can answer me...
Then it is possible to do 2 different thing:
create a configure sceUtilityCreateNetParam
set the parameters with sceUtilitySetNetParam
But I don t know in which order to do,I tried both and had an error. If you have any information about this also it would be great.
Finally I found some other function such as:
sceUtilityNetconfInitStart
sceUtilityMsgDialogInitStart
and also all the file in the net directory...
The thing is that all these function do not have any documentation. So it is very difficult to understand what they do exactly... Once again, if you know how and where to find the info, it would be helpful.
Thank you for all your answers, I prefer that you say 10 times the same thing than never. You will find my function in the following:
Ok, I am answering myself:
We have to look in utility Directory Reference.What modules to use?
There we can found different header that contains different functions for creating a connection.
Now I am trying to create a AD HOC network. So we have to load some modules:
the thing is that there is a module called ad hoc. But what is the difference btween PSP_NET_MODULE_ADHOC PSP_NET_MODULE_COMMON PSP_NET_MODULE_INET ? I don t know if somebody can answer me...
Then it is possible to do 2 different thing:
create a configure sceUtilityCreateNetParam
set the parameters with sceUtilitySetNetParam
But I don t know in which order to do,I tried both and had an error. If you have any information about this also it would be great.
Finally I found some other function such as:
sceUtilityNetconfInitStart
sceUtilityMsgDialogInitStart
and also all the file in the net directory...
The thing is that all these function do not have any documentation. So it is very difficult to understand what they do exactly... Once again, if you know how and where to find the info, it would be helpful.
Thank you for all your answers, I prefer that you say 10 times the same thing than never. You will find my function in the following:
Code: Select all
int adhoConnect()
{
int conf=1;
int check=0;
// pspUtilityNetconfData * data;
// SceUtilityMsgDialogParams *params
//
//
// pspDebugScreenClear();
//
// sceUtilityNetconfInitStart(data);
// sceUtilityMsgDialogInitStart (params);
if(sceUtilityLoadNetModule(PSP_NET_MODULE_ADHOC)<0)
{
printf("Error loading AD HOC module\n");
return 1;
}
else printf("AD HOC Module loaded\n");
if(sceUtilityLoadNetModule(PSP_NET_MODULE_COMMON)<0)
{
printf("Error loading COMMON module\n");
return 1;
}
else printf("COMMON Module loaded\n");
if(sceUtilityLoadNetModule(PSP_NET_MODULE_INET)<0)
{
printf("Error loading INET module\n");
return 1;
}
else printf("INET Module loaded\n");
if( sceUtilitySetNetParam(PSP_NETPARAM_NAME,"Adhoc1") !=0){
printf("Error setting LAN parameters\n");
return 1;
}
else printf("LAN parameters set\n");
if( sceUtilitySetNetParam(PSP_NETPARAM_SSID,"Comet") !=0){
printf("Error setting LAN parameters\n");
return 1;
}
else printf("LAN parameters set\n");
//check+=sceUtilitySetNetParam(PSP_NETPARAM_IS_STATIC_IP,1);
if( sceUtilitySetNetParam(PSP_NETPARAM_IP,"192.168.1.1") !=0){
printf("Error setting LAN parameters\n");
return 1;
}
else printf("LAN parameters set\n");
if( sceUtilitySetNetParam(PSP_NETPARAM_NETMASK,"255.255.255.0") !=0){
printf("Error setting LAN parameters\n");
return 1;
}
else printf("LAN parameters set\n");
if(check!=0) {
printf("Error setting LAN parameters\n");
return 1;
}
else printf("LAN parameters set\n");
if(sceUtilityCheckNetParam(conf)!=0)
{
printf("Error in LAN parameters\n");
return 1;
}
else printf("LAN parameters checked\n");
if(sceUtilityCreateNetParam(conf)!=0)
{
printf("Error creating configuration\n");
return 1;
}
else {
printf("LAN parameters set with success!!!\n");
}
sceUtilityUnloadNetModule(PSP_NET_MODULE_ADHOC);
sceDisplayWaitVblankStart();
return 0;
}
Rad
Please read this thread:
http://forums.ps2dev.org/viewtopic.php?t=2471
The regular PSP internet APIs and sample code will work just as well for a WiFi 'adhoc' connection between two PSPs or a PSP and another WiFi device.
You have to set it up for a non-DHCP connection etc. You can do this with the standard Network settings options (no custom programming required).
Communication will be TCP/IP or UDP/IP just like normal.
Ignore anything related to the PSP game-sharing adhoc mode. That's used in PSP->PSP game communication for commercial games, but is not well documented and not useful for homebrew.
http://forums.ps2dev.org/viewtopic.php?t=2471
The regular PSP internet APIs and sample code will work just as well for a WiFi 'adhoc' connection between two PSPs or a PSP and another WiFi device.
You have to set it up for a non-DHCP connection etc. You can do this with the standard Network settings options (no custom programming required).
Communication will be TCP/IP or UDP/IP just like normal.
Ignore anything related to the PSP game-sharing adhoc mode. That's used in PSP->PSP game communication for commercial games, but is not well documented and not useful for homebrew.