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 

Check if WLAN is active?

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



Joined: 28 Nov 2009
Posts: 27

PostPosted: Fri Feb 25, 2011 11:26 am    Post subject: Check if WLAN is active? Reply with quote

I essentially need to check if the WLAN switch is on, and the LED powered on as well. I need to see if there's an active connection between the access point and the PSP. How can I check?
Back to top
View user's profile Send private message
Alberto



Joined: 12 Feb 2007
Posts: 63
Location: Sofia

PostPosted: Sat Feb 26, 2011 9:36 am    Post subject: Re: Check if WLAN is active? Reply with quote

gotmilk065 wrote:
I essentially need to check if the WLAN switch is on


to check this you need to write a kernel prx that reads the buttons (basically the same you would do in your usermode prx, but kernel mode returns also special keys, such as WLAN switch, UMD switch, etc.).

gotmilk065 wrote:
, and the LED powered on as well.


I know there is some function to retrieve the LED statuses, maybe even in the sdk samples... I'm sure I've seen some code somewhere, but can't remember.

gotmilk065 wrote:
I need to see if there's an active connection between the access point and the PSP. How can I check?


pinging the router?

HTH

Cheers, A.
Back to top
View user's profile Send private message
Criptych



Joined: 12 Sep 2009
Posts: 87

PostPosted: Sun Mar 13, 2011 9:16 am    Post subject: Reply with quote

Here's the method I use, seems to work well enough.

Code:
int apIsConnected()
{
    int state;

    if(sceNetApctlGetState(&state) < 0)
        return 0;

    return state == PSP_NET_APCTL_STATE_GOT_IP;
}

_________________
PSP-2001 // CFW 6.60 ME-1.2 and GCLite // Genesis Competition Entry
"So, we meet again: for the first time, for the last time." —Spaceballs
Back to top
View user's profile Send private message
Alberto



Joined: 12 Feb 2007
Posts: 63
Location: Sofia

PostPosted: Sun Mar 13, 2011 9:53 pm    Post subject: Reply with quote

Criptych wrote:
Here's the method I use, seems to work well enough.

Code:
int apIsConnected()
{
    int state;

    if(sceNetApctlGetState(&state) < 0)
        return 0;

    return state == PSP_NET_APCTL_STATE_GOT_IP;
}


well, considering the names of function and state constant, I desume it is exactly what is needed to know if the PSP got connected with the access point.

Cheers, A.
Back to top
View user's profile Send private message
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