I want to:
connect to AP->Send a POST to a site->Write answer from site->Quit
This is the main (i'm omitting all the pspsdk includes):
Code: Select all
#include "common.h"
PSP_MODULE_INFO("Platform_test", 0, 0, 71);
int main()
{
Plaform_Core_Setup_Callbacks();
pspDebugScreenInit();
pspDebugScreenClear();
char out[1001];
printf("Connecting to AP...\n");
Platform_Core_Connect_To_Apctl(0);
printf("Sending post...\n");
Platform_Common_SendPOST("www.codeforfun.it","prova.php","user=roby65","a=a",out);
printf("Result:%s\n",out);
sceKernelDelayThread(5*1000*1000);
}
This is for the callbacks:
Code: Select all
int Plaform_Core_Exit_Callback(int arg1, int arg2, void *common)
{
sceKernelExitGame();
return 0;
}
int Plaform_Core_Callback_Thread(SceSize args, void *argp)
{
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", Plaform_Core_Exit_Callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
int Plaform_Core_Setup_Callbacks(void)
{
int thid = 0;
thid = sceKernelCreateThread("update_thread", Plaform_Core_Callback_Thread, 0x11, 0xFA0, 0, 0);
if (thid >= 0)
sceKernelStartThread(thid, 0, 0);
return thid;
}
ps: when i press home and i try to quit the game, the psp crashes.