mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Simplified paring with Wiimote and Wii U Pro Controller
This commit is contained in:
parent
bbfd49310c
commit
9781bbab33
1 changed files with 11 additions and 19 deletions
30
BTD.cpp
30
BTD.cpp
|
@ -932,27 +932,19 @@ void BTD::hci_pin_code_request_reply() {
|
||||||
hcibuf[6] = disc_bdaddr[3];
|
hcibuf[6] = disc_bdaddr[3];
|
||||||
hcibuf[7] = disc_bdaddr[4];
|
hcibuf[7] = disc_bdaddr[4];
|
||||||
hcibuf[8] = disc_bdaddr[5];
|
hcibuf[8] = disc_bdaddr[5];
|
||||||
if (pairWithWii && !wiiUProController) {
|
if (pairWithWii) {
|
||||||
hcibuf[9] = 6; // Pin length is the length of the bt address
|
hcibuf[9] = 6; // Pin length is the length of the Bluetooth address
|
||||||
hcibuf[10] = disc_bdaddr[0]; // The pin is the Wiimotes bt address backwards
|
if(wiiUProController) {
|
||||||
hcibuf[11] = disc_bdaddr[1];
|
|
||||||
hcibuf[12] = disc_bdaddr[2];
|
|
||||||
hcibuf[13] = disc_bdaddr[3];
|
|
||||||
hcibuf[14] = disc_bdaddr[4];
|
|
||||||
hcibuf[15] = disc_bdaddr[5];
|
|
||||||
for (uint8_t i = 16; i < 26; i++)
|
|
||||||
hcibuf[i] = 0x00; // The rest should be 0
|
|
||||||
} else if (pairWithWii && wiiUProController) {
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
Notify(PSTR("\r\nParing with Wii U Pro Controller"), 0x80);
|
Notify(PSTR("\r\nParing with Wii U Pro Controller"), 0x80);
|
||||||
#endif
|
#endif
|
||||||
hcibuf[9] = 6; // Pin length is the length of the bt address
|
for(uint8_t i = 0; i < 6; i++)
|
||||||
hcibuf[10] = my_bdaddr[0]; // The pin is the Bluetooth dongles bt address backwards
|
hcibuf[10 + i] = my_bdaddr[i]; // The pin is the Bluetooth dongles Bluetooth address backwards
|
||||||
hcibuf[11] = my_bdaddr[1];
|
}
|
||||||
hcibuf[12] = my_bdaddr[2];
|
else {
|
||||||
hcibuf[13] = my_bdaddr[3];
|
for(uint8_t i = 0; i < 6; i++)
|
||||||
hcibuf[14] = my_bdaddr[4];
|
hcibuf[10 + i] = disc_bdaddr[i]; // The pin is the Wiimote's Bluetooth address backwards
|
||||||
hcibuf[15] = my_bdaddr[5];
|
}
|
||||||
for (uint8_t i = 16; i < 26; i++)
|
for (uint8_t i = 16; i < 26; i++)
|
||||||
hcibuf[i] = 0x00; // The rest should be 0
|
hcibuf[i] = 0x00; // The rest should be 0
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue