rpavlik/wiiuse — pull request #44 by janoc (2013-07-18 00:34:52+00:00)
Title: Fixes for the balance board and synchronous expansion handshake

Hello,

I needed the balance board again and have discovered that the current code actually didn't work with mine at all :( I have added the missing report type and corrected the handshake.

At the same time I have made the expansion handshake synchronous. The main reason for that is that the wiiuse_write_data_cb() function actually doesn't work right - it depends on its callbacks being called when the report 0x22 (write ack) is received. Unfortunately, that report is not being sent by the hw consistently, making the write code hang and break, because the callback isn't called. For ex. my BigBen balance board almost never sents this report and thus was being detected maybe once in ten attempts.

The current code is tested on Linux, with both the balance board, nunchuck and Motion Plus. I haven't touched any platform-specific code, so hopefully other platforms won't break.

The wiiuse_write_data_cb() code can be probably removed, nothing seems to be using it anymore. BTW, the wiiuse_update() function doesn't seem to be used by anything neither (??).

Regards,

Jan