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 

Utility Dialogs (netdialog) Status codes TOTALLY UNreliable

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



Joined: 03 Jun 2007
Posts: 328

PostPosted: Sat Aug 02, 2008 12:53 am    Post subject: Utility Dialogs (netdialog) Status codes TOTALLY UNreliable Reply with quote

Hello,

I am totally confused.

This is what I have

Code:


//PSP_UTILITY_DIALOG_QUIT,      /**< The dialog has been canceled and should be shut down */
//PSP_UTILITY_DIALOG_FINISHED      /**< The dialog has successfully shut down */

int done = 0;

int netDialoginit()
{
    done=0;
      pspUtilityNetconfData data;

   memset(&data, 0, sizeof(data));
   data.base.size = sizeof(data);
   data.base.language = PSP_SYSTEMPARAM_LANGUAGE_ENGLISH;
   data.base.buttonSwap = PSP_UTILITY_ACCEPT_CROSS;
   data.base.graphicsThread = 17;
   data.base.accessThread = 19;
   data.base.fontThread = 18;
   data.base.soundThread = 16;
   data.action = PSP_NETCONF_ACTION_CONNECTAP;

   struct pspUtilityNetconfAdhoc adhocparam;
   memset(&adhocparam, 0, sizeof(adhocparam));
   data.adhocparam = &adhocparam;

   sceUtilityNetconfInitStart(&data);

   while(1)
   {
      drawStuff();

      switch(sceUtilityNetconfGetStatus())
      {
         case PSP_UTILITY_DIALOG_NONE:
            break;

         case PSP_UTILITY_DIALOG_VISIBLE:
            sceUtilityNetconfUpdate(1);
            break;

         case PSP_UTILITY_DIALOG_QUIT:
            sceUtilityNetconfShutdownStart();
            done=2;
            break;

         case PSP_UTILITY_DIALOG_FINISHED:
            done = 1;
            break;

         default:
            break;
      }

      sceDisplayWaitVblankStart();
      sceGuSwapBuffers();

      if(done)
         break;
   }

   return 1;
}




Code:


main()
{
netDialoginit();
  pspDebugScreenClear();
  pspDebugScreenClear();
  if (done==1) pspDebugScreenPrintf("Connected to AP. Press X to connect to server");
  if (done==2) pspDebugScreenPrintf("Not Connected to AP! Press Rtrigger.");
}




When Done=2 is there,
it shows Not Connected to AP EVEN if it is connected.
Shows correcty when is really is Not connected (we cancelled the dialog).


When I remove the above statement. It works fine BUT it DOESNOT detect when we cancel the dialog (Press O). IT shows "Connected to AP."



HELP!!!! :(


When I
_________________
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Sat Aug 02, 2008 1:14 am    Post subject: Reply with quote

The PSP_UTILITY_DIALOG_QUIT case will match regardless of if the user cancelled or not, it's internal to how the dialog runs.

To get the actual result from the dialog, access the data.base.result member.

IIRC it's set as 0 for successfully connected, 1 if user cancelled and an error code if there was some error.
Back to top
View user's profile Send private message
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Sat Aug 02, 2008 2:46 am    Post subject: Reply with quote

Insert_witty_name wrote:
The PSP_UTILITY_DIALOG_QUIT case will match regardless of if the user cancelled or not, it's internal to how the dialog runs.

To get the actual result from the dialog, access the data.base.result member.

IIRC it's set as 0 for successfully connected, 1 if user cancelled and an error code if there was some error.


/**< The dialog has been canceled and should be shut down */

Should have been

/**< The dialog has been canceled (NOT BY USER) and should be shut down */


Would be more helpful to others.
_________________
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Back to top
View user's profile Send private message
Raphael



Joined: 17 Jan 2006
Posts: 646
Location: Germany

PostPosted: Sat Aug 02, 2008 3:03 am    Post subject: Reply with quote

KickinAezz wrote:

/**< The dialog has been canceled and should be shut down */

Should have been

/**< The dialog has been canceled (NOT BY USER) and should be shut down */


Would be more helpful to others.

That wouldn't be correct and misleading though:
IWN wrote:

The PSP_UTILITY_DIALOG_QUIT case will match regardless of if the user cancelled or not

_________________
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki

Alexander Berl
Back to top
View user's profile Send private message Visit poster's website
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