Dev (#6) - my cwiid_mesg_callback_t doesn't get called (#113) - Message List

my cwiid_mesg_callback_t doesn't get called

I'm trying to use cwiid in my code. It seems I can connect to the wiimote, but the message callback never gets called. Here's what I'm doing:

fRemote = cwiid_open (&bdaddr, 0);

if (fRemote != (cwiid_wiimote_t*)NULL) {

res = cwiid_set_mesg_callback (fRemote, msgCallback);

if (res == 0)

res = cwiid_set_rpt_mode (fRemote, CWIID_RPT_STATUS | CWIID_RPT_BTN);

if (res == 0)

res = cwiid_request_status (fRemote);

}

I trace these calls, they are all executed and return 0 (no error). But then I press the wii buttons but my "msgCallback" never gets called.

I tried the wmgui demo and it works fine (buttons get highlighted on the GUI).

What am I missing ?

Thanks for any help,

François

  • Message #24424

    Found the problem: needed to set the CWIID_FLAG_MESG_IFC flag on the wiimote connexion:

    fRemote = cwiid_open (&bdaddr, CWIID_FLAG_MESG_IFC);

Subscriptions