wifi info on the connection : sceNetApctlGetInfo

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
pspZorba
Posts: 156
Joined: Sat Sep 22, 2007 11:45 am
Location: NY

wifi info on the connection : sceNetApctlGetInfo

Post by pspZorba »

Hi all,

I am playing with the wifi, and for sure there is a lack of documentation and infos on some parts.

I didn't find much information on sceNetApctlGetInfo and its parameters (less than 15 threads with the keyword..), so I investigate and what I understood is below:

You may have 18 codes, here are my #define

Code: Select all

#define PSP_CONSTATE_PROFILE_NAME       0   /*string */
#define PSP_CONSTATE_BSSID              1   /*u8 [6] */
#define PSP_CONSTATE_SSID               2   /*string */
#define PSP_CONSTATE_UNK1               3   /*u32*/
#define PSP_CONSTATE_UNK2               4   /*u32*/
#define PSP_CONSTATE_STRENGTH           5   /*u8*/
#define PSP_CONSTATE_CHANNEL            6   /*u8*/
#define PSP_CONSTATE_UNK4               7   /*u8*/
#define PSP_CONSTATE_IP                 8   /*string */
#define PSP_CONSTATE_SUBNETMASK         9   /*string */
#define PSP_CONSTATE_GATEWAY           10   /*string */
#define PSP_CONSTATE_PRIMDNS           11   /*string */
#define PSP_CONSTATE_SECDNS            12   /*string */
#define PSP_CONSTATE_USEPROXY          13   /*u32*/
#define PSP_CONSTATE_PROXYURL          14   /*string */
#define PSP_CONSTATE_PROXYPORT         15   /*u16*/
#define PSP_CONSTATE_UNK5              16   /*u32*/
#define PSP_CONSTATE_STARTBROWSER      17   /*u32*/
#define PSP_CONSTATE_UNK6              18   /*u32*/
There are still 5 codes that I don't know what they are for, even if I think I have the good type.

here is my class

Code: Select all

class ZBnetConnectionState
{
protected:

    string name;            //name of the ocnfiguration used
    u8 bssid[6];            //mac address of the access point
    string ssid;            //ssid

    u32 unk1;               //? for me it is always 12
    u32 unk2;               //? for me it is always 1

    u8 strength;            //signal strength in %

    u8 channel;             //channel
    u8 unk4;                //? for me it is always 1

    string ip;              //PSP's ip
    string subNetMask;      //subnet mask
    string gateway;         //gateway
    string primaryDns;      //primary DNS
    string secondaryDns;    //secondary DNS

    u32 useProxy;           //should I use a Proxy : 1 => yes   0=> no
    string proxyUrl;        //proxy url
    u16  proxyPort;         //proxy port

    u32 unk5;               //? for me it is always 0
    u32  startBrowser;      //should a browser be started
    u32 unk6;               //? for me it is always 0

public:
        //Ctor and Dtor
    virtual ~ZBnetConnectionState () {};
    ZBnetConnectionState() {} ;

    int load( void);
    void display( void);
};

Well I hope that could help and if anyone knows what are the codes 3,4 , 7, 16, 18 are for, I am interested.
--pspZorba--
NO to K1.5 !
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

Hi Zorba.

I have:

PSP_CONSTATE_UNK1 as PSP_CONSTATE_SSID_LENGTH.
PSP_CONSTATE_UNK2 as PSP_CONSTATE_SECURITY_TYPE (0 for none, 1 for WEP, 2 for WPA).
PSP_CONSTATE_UNK4 as PSP_CONSTATE_POWER_SAVE.
PSP_CONSTATE_UNK5 as PSP_CONSTATE_8021_EAP_TYPE (0 is none, 1 is EAP-MD5).
PSP_CONSTATE_UNK6 as PSP_CONSTATE_WIFISP (see psputility_netconf.h for details).

These may be incorrect, I must admit I didn't test them extensively.

Also, for the string lengths...

PSP_CONSTATE_PROFILE_NAME seems to be 64.
PSP_CONSTATE_SSID seems to be 32.
PSP_CONSTATE_IP, PSP_CONSTATE_SUBNETMASK, PSP_CONSTATE_GATEWAY, PSP_CONSTATE_PRIMDNS & PSP_CONSTATE_SECDNS are all 16.
PSP_CONSTATE_PROXYURL seems to be 128.

Hope this helps.

PS. What happened to PSP_CONSTATE_UNK3? ;)
pspZorba
Posts: 156
Joined: Sat Sep 22, 2007 11:45 am
Location: NY

Post by pspZorba »

cool !

Thank you Insert_witty_name

For PSP_CONSTATE_SSID_LENGTH I was thinking of that but I beleived it was a coincidence.

( unk3 was found just before I post ;-) )

the lenghts you have are fine for me.

Does someone could add the below defines and struct in the svn, I guess pspnet_apctl.h is the best place:

Code: Select all

#define PSP_CONSTATE_PROFILE_NAME       0   /*char [64] */
#define PSP_CONSTATE_BSSID              1   /*u8 [6] */
#define PSP_CONSTATE_SSID               2   /*char [32] */
#define PSP_CONSTATE_SSID_LENGTH        3   /*u32*/
#define PSP_CONSTATE_SECURITY_TYPE      4   /*u32*/
#define PSP_CONSTATE_STRENGTH           5   /*u8*/
#define PSP_CONSTATE_CHANNEL            6   /*u8*/
#define PSP_CONSTATE_POWER_SAVE         7   /*u8*/
#define PSP_CONSTATE_IP                 8   /*char[16] */
#define PSP_CONSTATE_SUBNETMASK         9   /*char[16]*/
#define PSP_CONSTATE_GATEWAY           10   /*char[16]*/
#define PSP_CONSTATE_PRIMDNS           11   /*char[16] */
#define PSP_CONSTATE_SECDNS            12   /*char[16] */
#define PSP_CONSTATE_USEPROXY          13   /*u32*/
#define PSP_CONSTATE_PROXYURL          14   /*char[128] */
#define PSP_CONSTATE_PROXYPORT         15   /*u16*/
#define PSP_CONSTATE_8021_EAP_TYPE     16   /*u32*/
#define PSP_CONSTATE_STARTBROWSER      17   /*u32*/
#define PSP_CONSTATE_WIFISP            18   /*u32*/


typedef struct pspNetConnectionState
{
    char name[64+1];          /*name of the ocnfiguration used*/
    u8 bssid[6];              /*mac address of the access point*/
    char ssid[32+1];          /*ssid*/

    u32 ssidLength;           /*ssid string length*/
    u32 securityType;         /*(0 for none, 1 for WEP, 2 for WPA). */

    u8 strength;              /*signal strength in %*/

    u8 channel;               /*channel*/
    u8 powerSave;             /*1 on, 0 off*/

    char ip[16+1];            /*PSP's ip*/
    char subNetMask[16+1];    /*subnet mask*/
    char gateway[16+1];       /*gateway*/
    char primaryDns[16+1];    /*primary DNS*/
    char secondaryDns[16+1];  /*secondary DNS*/

    u32 useProxy;             /*should I use a Proxy : 1 => yes   0=> no*/
    char proxyUrl[128+1];     /*proxy url*/
    u16  proxyPort;           /*proxy port*/

    u32 eapType;              /*(0 is none, 1 is EAP-MD5)*/
    u32  startBrowser;        /*should a browser be started*/
    u32 wifisp;               /* Set to 1 to allow connections to Wifi service providers (WISP) */
}pspNetConnectionState;
edit: I added +1 to the lenght of char[] for the 0 ( I am no more used to C string ;-))
--pspZorba--
NO to K1.5 !
Post Reply