Author Topic: Getting started  (Read 6837 times)

Offline Snafu

  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
on: March 16, 2008, 07:26:56 PM
Hi!
I'm new to the real application programming as I have only done websites (php + mysql, css, html, js, as) before. I'd like to know how to get things started with the wiimote.
I somehow seem not to be able in finding a proper guide on how to get going with the wiimote.
I've figured out to set up 2 bluetooth connections for input and output to the wiimote both with l2cap  with one running on psm 0x11 and one on psm 0x13.
However, that is as far as I got until now.
Does the wiimote have any handshake that you have to go through at startup? If yes, what data does it expect / send?
As far as I've understood the wiibrew wiimote site you have to send commands as the first byte containing the report id and the following bytes containing the data.
So turning on the 1st LED should be in C like ...
Goddamn no wonder it didn't work. Forgot the bluetooth header all the time. I've you have any handy tutorials / links please still post them.
Code: [Select]
unsigned char buf[3];
buf[0] = 0x52; // data output
buf[1] = 0x11; // LED reportID
buf[2] = 0x10; // player 1 LED

send(out_socket, &buf, 3, 0); // out_socket = outgoing bluetooth connection socket
... correct?

Have mercy, I'm a newbie :)

Cheers
Snafu
« Last Edit: March 16, 2008, 07:51:27 PM by Snafu »



Offline inio

  • Wiki Admin
  • *
  • Posts: 124
  • Karma: +5/-0
    • View Profile
    • my Wii Remote projects
Reply #1 on: March 16, 2008, 09:20:37 PM
There's no handshake besides opening the l2cap channels.  The Wii does some memory reads (documented here) but those aren't required.  Setting the LEDs is the logical first thing to do.  Your HID header (0x52) looks right.



Offline Snafu

  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Reply #2 on: March 17, 2008, 01:33:27 PM
Thanks for your post.
Got it working now. I forgot the bluetooth header (0x52) before, thats why it didn't work.
I'm going to use the wiiuse library but I always wan't to do things myself first so I know whats going on.