| View previous topic :: View next topic |
| Author |
Message |
volsung Site Admin
Joined: 26 Nov 2006 Posts: 24
Digg It |
Posted: Sat Dec 02, 2006 12:41 pm Post subject: |
|
|
| Casting it to a short might not work correctly on both PPC and Intel CPUs due to the byte endianness difference. |
|
| Back to top |
|
 |
djork
Joined: 01 Dec 2006 Posts: 7
Digg It |
Posted: Sat Dec 02, 2006 3:41 pm Post subject: |
|
|
| geoff wrote: | djork:
I had a similar issue with incrimenting values but realized it was a mis-placed parenthesis.
Basically to get the button code (which you can find here) you'd want something like:
| Code: | | int button = ((unsigned int)(*(unsigned char*)(dataPointer+2)) * 0x100 + (unsigned int)(*(unsigned char*)(dataPointer+3))); |
Though that's admittedly quite ugly. Also of note is that combinations of buttons can come in any form. For instance A+B = 0x0C (cute huh?).
Still playing with this little guy. Haven't tried sending anything yet, though i'm itching to try once my brain turns back on tomorrow morning.[/url] |
Are you actually getting button codes coming across? I just get a consistently incrementing counter coming across some random channel.
Oh, I think I just realized what's going on. I'm printing out the POINTER itself, not the value, to the data in my app... duh! Let me try this again and see what's going on. I've completely ignored the dataLength parameter.
P.S. Don't you just love Objective-C message signatures? "l2capChannelData:(IOBluetoothL2CAPChannel *)l2capChannel data:(void *)dataPointer length:(size_t)dataLength"
P.P.S. My wife is addicted to the Power Throws mode in bowling. |
|
| Back to top |
|
 |
djork
Joined: 01 Dec 2006 Posts: 7
Digg It |
Posted: Sat Dec 02, 2006 4:52 pm Post subject: |
|
|
| Nevermind... it's not ready yet. |
|
| Back to top |
|
 |
lucas
Joined: 25 Nov 2006 Posts: 4
Digg It |
Posted: Sat Dec 02, 2006 6:42 pm Post subject: |
|
|
Writing reports works fine across the control channel:
| Code: | unsigned char ledReport[] = {0x52, 0x11, 0x10};
[cchan writeSync:ledReport length:3]; |
I've also turned on the motion sensor, and it is sending the expected data. |
|
| Back to top |
|
 |
djork
Joined: 01 Dec 2006 Posts: 7
Digg It |
Posted: Sat Dec 02, 2006 8:49 pm Post subject: |
|
|
| lucas wrote: | Writing reports works fine across the control channel:
| Code: | unsigned char ledReport[] = {0x52, 0x11, 0x10};
[cchan writeSync:ledReport length:3]; |
I've also turned on the motion sensor, and it is sending the expected data. |
Excellent, that's just the thing I needed. I was wondering what the proper data to send was. |
|
| Back to top |
|
 |
MrBlack08
Joined: 04 Dec 2006 Posts: 6
Digg It |
Posted: Mon Dec 04, 2006 4:58 am Post subject: |
|
|
I got my Wiimote to pair on the first try, no crashes. Good work. I am a complete idiot when it comes to scripting, coding, and programming. Basically I'm a fan of all you guys putting this project together.
Now that I have it pair with OSX what can I do? Can I use it as a mouse yet? See accel readings? Or nothing? |
|
| Back to top |
|
 |
mrdsp3cs
Joined: 04 Dec 2006 Posts: 1
Digg It |
Posted: Mon Dec 04, 2006 5:54 pm Post subject: |
|
|
I used PacketLogger to show what was being transferred between my computer and the wiimote. That spit out some hex commands for each button, there seems to be a standard one for button release. Doesn't look like the accelerometers are on, but I've heard you need to send code to the wiimote to turn them on.
Any progress getting a mapping system set up for the wiimote on OSX?
Great progress so far! |
|
| Back to top |
|
 |
|