forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Ad hoc network

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
charafe



Joined: 06 Feb 2007
Posts: 12

PostPosted: Mon Mar 05, 2007 8:28 pm    Post subject: Ad hoc network Reply with quote

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
_________________
Rad
Back to top
View user's profile Send private message
charafe



Joined: 06 Feb 2007
Posts: 12

PostPosted: Thu Mar 08, 2007 3:30 am    Post subject: Reply with quote

[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:

Quote:
What modules to use?

We have to look in utility Directory Reference.
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:

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
Back to top
View user's profile Send private message
PspPet



Joined: 30 Mar 2005
Posts: 210

PostPosted: Sat Mar 10, 2007 9:12 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group