wiiuse Forums

Last visit was: Tue Apr 22, 2008 8:45 pm It is currently Tue Apr 22, 2008 8:46 pm

All times are UTC




 [ 2 posts ] 
Author Message
 Post subject: [1941275] wiiuse_find() overwrites existing connections
PostPosted: Sun Apr 13, 2008 10:32 am 
Offline

Joined: Sun Apr 13, 2008 9:37 am
Posts: 3
I've noticed that when you connect to at least one wiimote, if you call wiiuse_find() again it will overwrite existing connections-- more specifically, new wiimote 1 takes the slot of already connected wiimote 1 inside of wm[].

I discovered this whilst trying to implement a 24/7 connection service (like the wii), where a thread is always searching for wiimotes to connect to; After one wiimote had connected and i tried to connect a second, wiiuse just slapped the new connection over top of the connection for the first wiimote :-\.

I think when calling wiiuse_find() is should preserve existing connections rather than blanking them.
The fix for this should be pretty simple, in wiiuse_find() as it assigns addresses to wm[x] you have it first check that wm[x] is not already discovered, and if so find one that isn't.

I've patched io_nix.c to do the above, its a basic implementation, still has things i've missed (like not resetting the bt address at the start of wiiuse_find(), etc, etc) ... but, it does allow you to find and connect to more wiimotes whilst you are already connected to some.


Top
 Profile  
 
 Post subject: Re: [1941275] wiiuse_find() overwrites existing connections
PostPosted: Sun Apr 13, 2008 4:33 pm 
Offline
Developer
User avatar

Joined: Sat Feb 03, 2007 12:11 am
Posts: 172
I responded on the tracker, please email me if interested. The code is LGPL.

_________________
Image


Top
 Profile  
 
 [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Alexa [Bot] and 0 guests


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 post attachments in this forum

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group