First, sorry for my english... ;)
Second, I'm making a program that scans wlans in firmware 3.40OE-A (It works fine jejeje)
BUT....
My problem is that i can't save the A.P. that i found.
I use that function:
Code: Select all
int CreateConnection(struct ConnectionSettings *settings)
{
struct SceCtrlLatch latch;
int i;
// Check to see if the connection is already used, if it is warn the user
if(sceUtilityCheckNetParam(settings->ConnectionNum) == 0)
{
// We already have a connection here, let see what the user wants to do
pspDebugScreenPrintf("Unable to restore \"%s\" to connection number %d\n",
settings->data[PSP_NETPARAM_NAME].asString, settings->ConnectionNum);
pspDebugScreenPrintf(" Press CROSS to overrite the connection\n");
pspDebugScreenPrintf(" Press CIRCLE to next available connection number\n");
pspDebugScreenPrintf(" Press TRIANGLE to ignore skip this access point\n");
for(;;)
{
sceCtrlReadLatch(&latch);
if(latch.uiMake & PSP_CTRL_CROSS)
{
// Delete and continue
if(sceUtilityDeleteNetParam(settings->ConnectionNum) != 0)
{
pspDebugScreenPrintf("ERR: Unable to delete net settings\n");
return -1;
}
break;
}
if(latch.uiMake & PSP_CTRL_CIRCLE)
{
int found = 0;
for(i=0; i<100; i++)
{
if(sceUtilityCheckNetParam(i) != 0)
{
// Copy the new connection number and continue
settings->ConnectionNum = i;
found = 1;
break;
}
}
if(!found)
{
pspDebugScreenPrintf("ERR: Unable to find a free net connection\n");
return -1;
}
break;
}
if(latch.uiMake & PSP_CTRL_TRIANGLE)
{
return -1;
}
}
}
int rc = sceUtilityCreateNetParam(settings->ConnectionNum);
if(rc < 0)
{
pspDebugScreenPrintf("ERR: Unable to create net param, rc=%x\n", rc);
return rc;
}
pspDebugScreenPrintf("Creating connection %s, number=%d\n", settings->data[PSP_NETPARAM_NAME].asString, settings->ConnectionNum);
pspDebugScreenPrintf(" SSID=%s\n", settings->data[PSP_NETPARAM_SSID].asString);
int settingNum;
for(settingNum=0; settingNum<GetNetparamCount(); settingNum++)
{
rc = sceUtilitySetNetParam(settingNum, &(settings->data[settingNum]));
if(rc<0)
{
pspDebugScreenPrintf("ERR: Failed to set entry 0x%x, rc=0x%x\n", settingNum, rc);
sceUtilityDeleteNetParam(settings->ConnectionNum);
return rc;
}
}
rc = sceUtilityCopyNetParam(0, settings->ConnectionNum);
if(rc<0)
{
pspDebugScreenPrintf("ERR: Failed to copy net param, rc=0x%x\n", rc);
sceUtilityDeleteNetParam(settings->ConnectionNum);
return rc;
}
pspDebugScreenPrintf("Done creating access point\n");
return rc;
}
sceUtilityDeleteNetParam ----> works fine
sceUtilityCreateNetParam ---> work???
sceUtilitySetNetParam ---> work???
sceUtilityCopyNetParam ---> doesn't work???
When I run that code, it might work but it doesn't work.
Besides, it crash my PSP WLAN Configuration and i MUST reset the default configuration.
I test that code in a PSP with 1.50 Firmware and It works like a charm but i NEED to make it works in a 3.40OE-A!!!
Can SOMEBODY HELP ME??????????????
A lot of thanks
_AngeL_