Jump to content

wetpaste

Members
  • Posts

    2
  • Joined

  • Last visited

wetpaste's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Yes, those are all true. It is a strange situation. It does work sometimes. I noticed this because i was in an area with about 20 access points with the same name, when it tried to connect to one of the weaker ones, it would fail, so i wanted some kind of way to try again, but when I call it again, it immediately fails. This also happens when im on my home wifi sometimes, where it can be weak in certain parts of the house. But if there is a single strong connection, i can connect, no problem there. It is just strange because when i call WifiAssocStatus again after trying to connect again after a failed attempt, it immediately exits with the same failure status, rather than going through the whole connection process. Basically im saying that the status doesn't seem to reset when you use autoconnect for the second time. I thought of resetting it manually somehow but that seems hackish at best. EDIT: if you want to see what i mean, try putting a loop around the last part of your example that asks if you want to try again, like i was doing. On first connection attempt, put the DS in the fridge. Then it will fail, then try again out of the fridge and see if it tries to connect again, or if it restarts immediately.
  2. I am playing around with some of the library functions and I have a little loop that is supposed to establish a connection to an access point. It looks like this: int simpleWFCconnect(){ // simple WFC connect: Wifi_AutoConnect(); // request connect while(1) { int i=Wifi_AssocStatus(); // check status if(i==ASSOCSTATUS_ASSOCIATED) { iprintf("Connected successfully! With IP %lu\n", Wifi_GetIP()); return 0; } if(i==ASSOCSTATUS_CANNOTCONNECT) { iprintf("Could not connect! Press \"A\" to try again\n"); iprintf("\"B\" to cancel\n"); while (1){ scanKeys(); u16 keys = keysDown(); if (keys & KEY_A){ /* note: I am just trying this to see if it fixes the problem with the Wifi_AssocStatus function */ Wifi_DisconnectAP(); return simpleWFCconnect(); } if (keys & KEY_B){ return -1; } } } } } If the operation fails because it couldn't connect, I would like it to ask the user if they would like to try connecting again (i do this recursively, maybe there is a better way). The problem is, that after it fails once, I try to connect and the associated status is not updated. This sends me immediately into the second conditional. I'm not exactly sure where I am going wrong, any ideas? I also tried adding Wifi_DisconnectAP() (as can be seen in the code example) to see if this would bring things back to a normal state. -thanks
×
×
  • Create New...