WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Writing to the WiiMote
Goto page Previous  1, 2
 
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Remote and Nunchuck
View previous topic :: View next topic  
Author Message
CarlKenner
Site Admin


Joined: 29 Nov 2006
Posts: 614

Digg It
PostPosted: Fri Dec 22, 2006 7:50 pm    Post subject:

chikin, don't do that! I tried that in GlovePIE 0.23 or something like that and it was a disaster. Most people couldn't accesss it because it skipped their one and only wiimote.

Instead I just number the wiimotes in the opposite order, from last to first, so that way the fake wiimotes all seem to end up at the end. It still thinks there are more wiimotes than there actually are on some computers, but nobody has noticed.

I'm not using Bluetooth or Sockets. I'm using HID. I'm using a delphi component, which I haven't looked at in detail, so I can't explain exactly how to do the low-level HID stuff. But I am writing 22 bytes to the HID device handle as though it was a file (even when the reports are less than 22 bytes). Unless the Bluetooth Fix menu is used, in which case I try HidD_SetOutputReport (if it exists, XP only) to send 22 bytes, and then only if HidD_SetOutputReport fails (or doesn't exist) I write to it like a file.

HidD_SetOutputReport fails but returns success on BlueSoleil, so the fix won't work on bluesoleil, which is why I default to the original behaviour.
Back to top
View user's profile Send private message Send e-mail
Dodger_



Joined: 21 Dec 2006
Posts: 15

Digg It
PostPosted: Fri Dec 22, 2006 8:19 pm    Post subject:

Yeah, I've been working out exactly what I have to do for C# or C++ and I'm well on my way now. I figured you might say you were using the same or similar HID component for Delphi that the WiinRemote author uses. I've found some useful articles that describe the low level HID process that I'll have to go through and I think I understand how the BlueSoleil SDK will have to fit into the picture for dynamic controller addition/removal.
Back to top
View user's profile Send private message
Kevin



Joined: 20 Dec 2006
Posts: 3

Digg It
PostPosted: Fri Dec 22, 2006 11:45 pm    Post subject:

Thanks for the responses, guys. It looks like chikin was right - you don't have to write the header byte when using writefile.

Now that I can write data, I'll clean up the code and share it Smile
Back to top
View user's profile Send private message Visit poster's website
Kevin



Joined: 20 Dec 2006
Posts: 3

Digg It
PostPosted: Sat Dec 23, 2006 9:52 am    Post subject:

I've got a preliminary C++ wiimote wrapper working for Win32 (Bluesoliel).

You can get the source code from my blog. I can't post URLs here yet, so go to my webcomic (Simulated Comic Product), click on blog, and it should be the most recent post.
Back to top
View user's profile Send private message Visit poster's website
Dodger_



Joined: 21 Dec 2006
Posts: 15

Digg It
PostPosted: Sat Dec 23, 2006 2:09 pm    Post subject:

Thanks for posting that Kevin! I was hung up on how to figure out what the correct device to open is because I didn't see how to get the vendor id/product id. Now that I've seen that you have to actually use CreateFile() first and THEN check the vid/pid, it's pretty clear now.
Back to top
View user's profile Send private message
Dodger_



Joined: 21 Dec 2006
Posts: 15

Digg It
PostPosted: Mon Dec 25, 2006 6:34 am    Post subject:

Is anyone attempting to use Windows HID and BlueSoleil with C++ or C#? I'm having difficulties finding the Wiimote using this method. I've talked to someone else and with the default Microsoft stack, the vendor and product ids appear properly, but they do not appear to with BlueSoleil. Can anyone else confirm this?
Back to top
View user's profile Send private message
Dodger_



Joined: 21 Dec 2006
Posts: 15

Digg It
PostPosted: Tue Dec 26, 2006 2:58 am    Post subject:

Well, I figured it out. ULONG in C/C++ is not ulong in C#. Ooops.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Remote and Nunchuck All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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