Link to home
Start Free TrialLog in
Avatar of detox1978
detox1978Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Hex to binary

Hi All,

I am trying to pair my Wii remote to and an nvidia shield.  But I don't know the bluetooth pin.

After reading several articles online it says I need to calculate it based on the MAC address.


The PIN-Code is the binary bluetooth address of the wii remote backwards. Following a short piece of C code to calculate the PIN:

Lets assume the Wiimote has the bluetooth address "00:1E:35:3B:7E:6D". If you want the PIN for bluetooth pairing in a simple string, do the following:

char pin[6];
pin[0] = 0x6D;
pin[1] = 0x7E;
pin[2] = 0x3B;
pin[3] = 0x35;
pin[4] = 0x1E;
pin[5] = 0x00;

Now "pin" contains your bluetooth pin that should be used for pairing your devices.

http://wiibrew.org/wiki/Wiimote#Bluetooth_Pairing

Could someone help me work out what the pin should be?  I've tried several online calculator but suspect I'm doing it wrong.

The MAC addresses for my two Wii controllers are;

00:19:1D:C6:EE:61
00:19:1D:B5:57:89


Many thanks
Avatar of Dr. Klahn
Dr. Klahn

I suspect that there's more to it than this, because the method described produces very non-standard and non-printable characters that are not suitable to being typed on a standard keyboard.

00:19:1D:C6:EE:61

Reverse to 61, EE, C6, 1D, 19, 00

Look up in the ASCII code table:

61 = a, EE = î, C6 = Æ, 1D = the nonprintable GS character, 19 = the nonprintable EM character
have you tried this?


Start up your Bluetooth software and have it search for a device.
Hold down the 1 and 2 buttons on the Wii Remote. You should see the LEDs at the bottom start flashing. Do not let go of these buttons until this procedure is complete.
Avatar of detox1978

ASKER

Hi Peter, it still prompts for a PIN.  This seems to be mandatory on android since 4.2
For 00:19:1D:C6:EE:61:
char pin[6];
pin[0] = 0x61;
pin[1] = 0xEE;
pin[2] = 0xC6;
pin[3] = 0x1D;
pin[4] = 0x19;
pin[5] = 0x00;

Open in new window


and for 00:19:1D:B5:57:89:

char pin[6];
pin[0] = 0x89;
pin[1] = 0x57;
pin[2] = 0xB5;
pin[3] = 0x1D;
pin[4] = 0x19;
pin[5] = 0x00;

Open in new window

Thanks Ben.  The OS is android so to type the PIN in it would be in ASCII?  Any idea what i would type in?
yes actually on mobile had results in PS on my OS will have to post in a bit
ASKER CERTIFIED SOLUTION
Avatar of Ben Personick (Previously QCubed)
Ben Personick (Previously QCubed)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial