Added support for the Sony Playstation Move navigation controller, and maybe it's alternative one...main
if ((buttons & 0x04) && !(buttons_prev & 0x04)) show_changed_data = !show_changed_data; | if ((buttons & 0x04) && !(buttons_prev & 0x04)) show_changed_data = !show_changed_data; | ||||
// See about maybe pair... | // See about maybe pair... | ||||
if ((buttons & 0x10000) && !(buttons_prev & 0x10000) && (buttons & 0x0001)) { | |||||
if ((buttons & 0x10000) && !(buttons_prev & 0x10000) && (buttons & 0x0C01)) { | |||||
// PS button just pressed and select button pressed act like PS4 share like... | // PS button just pressed and select button pressed act like PS4 share like... | ||||
// Note: you can use either R1 or L1 with the PS button, to work with Sony Move Navigation... | |||||
Serial.print("\nPS3 Pairing Request"); | Serial.print("\nPS3 Pairing Request"); | ||||
if (!last_bdaddr[0] && !last_bdaddr[1] && !last_bdaddr[2] && !last_bdaddr[3] && !last_bdaddr[4] && !last_bdaddr[5]) { | if (!last_bdaddr[0] && !last_bdaddr[1] && !last_bdaddr[2] && !last_bdaddr[3] && !last_bdaddr[4] && !last_bdaddr[5]) { | ||||
Serial.println(" - failed - no Bluetooth adapter has been plugged in"); | Serial.println(" - failed - no Bluetooth adapter has been plugged in"); |
println(" got report descriptor"); | println(" got report descriptor"); | ||||
parse(); | parse(); | ||||
queue_Data_Transfer(in_pipe, report, in_size, this); | queue_Data_Transfer(in_pipe, report, in_size, this); | ||||
if (device->idVendor == 0x054C && device->idProduct == 0x0268) { | |||||
if (device->idVendor == 0x054C && | |||||
((device->idProduct == 0x0268) || (device->idProduct == 0x042F) || (device->idProduct == 0x03D5))) { | |||||
println("send special PS3 feature command"); | println("send special PS3 feature command"); | ||||
mk_setup(setup, 0x21, 9, 0x03F4, 0, 4); // ps3 tell to send report 1? | mk_setup(setup, 0x21, 9, 0x03F4, 0, 4); // ps3 tell to send report 1? | ||||
static uint8_t ps3_feature_F4_report[] = {0x42, 0x0c, 0x00, 0x00}; | static uint8_t ps3_feature_F4_report[] = {0x42, 0x0c, 0x00, 0x00}; |
{ 0x045e, 0x02ea, XBOXONE, false },{ 0x045e, 0x02dd, XBOXONE, false }, | { 0x045e, 0x02ea, XBOXONE, false },{ 0x045e, 0x02dd, XBOXONE, false }, | ||||
{ 0x045e, 0x0719, XBOX360, false}, | { 0x045e, 0x0719, XBOX360, false}, | ||||
{ 0x054C, 0x0268, PS3, true}, | { 0x054C, 0x0268, PS3, true}, | ||||
{ 0x054C, 0x042F, PS3, true}, // PS3 Navigation controller | |||||
{ 0x054C, 0x03D5, PS3, true}, // PS3 Motion controller | |||||
{ 0x054C, 0x05C4, PS4, true}, {0x054C, 0x09CC, PS4, true } | { 0x054C, 0x05C4, PS4, true}, {0x054C, 0x09CC, PS4, true } | ||||
}; | }; | ||||
} else if (strncmp((const char *)remoteName, "PLAYSTATION(R)3", 15) == 0) { | } else if (strncmp((const char *)remoteName, "PLAYSTATION(R)3", 15) == 0) { | ||||
DBGPrintf(" JoystickController::mapNameToJoystickType %x %s - set to PS3\n", (uint32_t)this, remoteName); | DBGPrintf(" JoystickController::mapNameToJoystickType %x %s - set to PS3\n", (uint32_t)this, remoteName); | ||||
joystickType_ = PS3; | joystickType_ = PS3; | ||||
} else if (strncmp((const char *)remoteName, "Navigation Controller", 21) == 0) { | |||||
DBGPrintf(" JoystickController::mapNameToJoystickType %x %s - set to PS3\n", (uint32_t)this, remoteName); | |||||
joystickType_ = PS3; | |||||
} else if (strncmp((const char *)remoteName, "Xbox Wireless", 13) == 0) { | } else if (strncmp((const char *)remoteName, "Xbox Wireless", 13) == 0) { | ||||
DBGPrintf(" JoystickController::mapNameToJoystickType %x %s - set to XBOXONE\n", (uint32_t)this, remoteName); | DBGPrintf(" JoystickController::mapNameToJoystickType %x %s - set to XBOXONE\n", (uint32_t)this, remoteName); | ||||
joystickType_ = XBOXONE; | joystickType_ = XBOXONE; |