Welcome! Log In Create A New Profile

Advanced

Some help with my first homebrew wii programs

Posted by datalogger 
PS
February 11, 2010 09:02AM
Here is the last example from Ersek (I think he's in Budapest, Hungry)

This I got from a non-wii site, just someone trying to help.
Maybe someone else can make some use of this.

It seemed to almost work...


#define MAXDEVICES 10u

/* Device identifier of the device we care about, or whatever. */
static const u8 mycod[] = { 0xAAu, 0xBBu, 0xCCu };

/*
  Return value:
    negative : device found, print error
    0        : no device found / device not found
    positive : device found and printed (no trailing newline)
*/
static int
print_it(void)
{
  u8 max_cnt,
      flush;
  s32 inq_res;
  struct inquiry_info info[MAXDEVICES];

  /* Set up as appropriate, for example: */
  max_cnt = MAXDEVICES;
  flush = ...;

  inq_res = bte_inquiry(info, max_cnt, flush);

  /*
    Check inq_res. I guess it returns the number of devices found,
    or a negative value in case of error. If it succeeds, search for
    the device you're interested in based on "cod" or whatever, and
    print its address.
  */

  if (0 < inq_res) {
    unsigned devidx;

    for (devidx = 0u; devidx < (unsigned)inq_res; ++devidx) {
      if (0 == memcmp(info[devidx].cod, mycod, sizeof mycod)) {
        const u8 *addr;

        addr = info[devidx].bdaddr.addr;
        return fprintf(stdout, "%02x:%02x:%02x:%02x:%02x:%02x",
            (unsigned)addr[0], (unsigned)addr[1], (unsigned)addr[2],
            (unsigned)addr[3], (unsigned)addr[4], (unsigned)addr[5]);
      }
    }
  }

  return 0;
}
Re: Some help with my first homebrew wii programs
February 12, 2010 10:25AM
The reason why you are not getting much help with this is because you are trying to do something which isn't easy. Almost everyone uses the WPAD library, which doesn't expose the IDs in any way. So your best bet would be to change the WPAD library, which isn't an easy task for someone just starting with programming.
Re: Some help with my first homebrew wii programs
February 13, 2010 04:02AM
I received several messages from people asking me to finish this project.

Sorry to say, I cannot.

It’s not because I don’t want to, it’s because I don’t know how to make it work.

I received a message from Michael Laforest (the creator of wiiuse) and he said he had no idea how to make this work on the wii. (on the PC, yes)
If he can’t do it, who am I kidding by trying?

Daid’s information above is correct about how WPADS cannot display the BT address.
Several people that, unlike me, really know how to read C source have told me they agree with his statement.
It’s just not going to happen with what's availible to the wii as of now.


On the plus side, I did figure out a way to do exactly what I wanted (but not on the wii).
I did it using a PC, a USB Bluetooth adapter and a copy of Bluesoleil.

Sure, it’s not as cool as it would be on the wii, it’s not HomeBrew like I wanted, but it shows the wiimotes ID with no problems.

Thanks to all

Peace!



Edited 2 time(s). Last edit at 02/13/2010 04:06AM by datalogger.
Sorry, only registered users may post in this forum.

Click here to login