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 

Troubles in WLAN routines

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



Joined: 12 Jul 2006
Posts: 160

PostPosted: Sat Jul 21, 2007 8:56 pm    Post subject: Troubles in WLAN routines Reply with quote

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
View user's profile Send private message
guyver2



Joined: 10 Jul 2007
Posts: 5

PostPosted: Sun Jul 22, 2007 6:23 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Sun Jul 22, 2007 8:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Xfacter



Joined: 28 Feb 2007
Posts: 9

PostPosted: Sun Jul 22, 2007 5:02 pm    Post subject: Reply with quote

I was having the same problem. I put pspSdkInetInit in my user thread (instead of the kernel thread) and it worked.
Back to top
View user's profile Send private message AIM Address MSN Messenger
guyver2



Joined: 10 Jul 2007
Posts: 5

PostPosted: Sun Jul 22, 2007 6:35 pm    Post subject: Reply with quote

thank you, I'll try that
_________________
Psp prog
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
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