Convert Wiimote MAC Address to PIN from C++ to Python or Javascript

Convert Wiimote MAC Address to PIN from C++ to Python or Javascript

Referring to https://wiibrew.org/wiki/Wiimote:

The PIN-Code is the binary bluetooth address of the wiimote backwards.

Below seems to be an updated version of what was said above (same source):

If connecting by holding down the 1+2 buttons, the PIN is the bluetooth address of the wiimote backwards, if connecting by pressing the sync button on the back of the wiimote, then the PIN is the bluetooth address of the host backwards.

So both original C and your Python code is correct. In fact, resulting string is not supposed to be readable at all (and always have 6 characters, printable or not). Its up to WiiMote driver to invert MAC string and send it back, as is everything described on that page. So if you are not writing WiiMote driver, find one for your system (on Linux it is already included as BlueZ plugin and should work out-of-box).

Convert Wiimote MAC Address to PIN from C++ to Python or Javascript

Leave a Reply

Your email address will not be published.