rpavlik/wiiuse — pull request #26 by lysannkessler (2012-11-15 10:21:19+00:00)
Title: OSX Refactoring

Based on #25, I did a lot of code refactoring, mainly to make the mac version work correctly. The code is inspired by and reuses lots of the original mac code.
Major differences are the fact that receiving data now happens in a synchronized manner, and old messages are not dropped if the poll interval is too low. This fixes #22, among other problems (crash on Mac when powering off Wiimote, ...). Also data is now sent through the interrupt channel on mac, as recommended by the Wiibrew wiki.
In wiiuseexample, I made sure that the program terminates if all wiimotes are disconnected. (This is not important for the rest to work properly, but helped me during development.)

Code-organization wise, I split up the mac implementation into different files in src/os_mac/, because it's a lot of code (compared to the other platforms' implementations).

I tested the code with real hardware (Wiimote, Motion+, Nunchuk) on Windows 8, Ubuntu 12.10, OSX 10.8 (still compiles with 10.6 SDK).