btdevice = (Device_t*)driver; // remember this way | btdevice = (Device_t*)driver; // remember this way | ||||
return true; | return true; | ||||
} | } | ||||
if (remoteName && (strncmp((const char *)remoteName, "PLAYSTATION(R)3 Controller", 26) == 0)) { | |||||
if (remoteName && (strncmp((const char *)remoteName, "PLAYSTATION(R)3", 15) == 0)) { | |||||
DBGPrintf("JoystickController::claim_bluetooth TRUE PS3 hack...\n"); | DBGPrintf("JoystickController::claim_bluetooth TRUE PS3 hack...\n"); | ||||
btdriver_ = driver; | btdriver_ = driver; | ||||
btdevice = (Device_t*)driver; // remember this way | btdevice = (Device_t*)driver; // remember this way | ||||
DBGPrintf(" JoystickController::remoteNameComplete %s - set to PS4\n", remoteName); | DBGPrintf(" JoystickController::remoteNameComplete %s - set to PS4\n", remoteName); | ||||
special_process_required = SP_NEED_CONNECT; // We need to force this. | special_process_required = SP_NEED_CONNECT; // We need to force this. | ||||
joystickType = PS4; | joystickType = PS4; | ||||
} else if (strncmp((const char *)remoteName, "PLAYSTATION(R)3 Controller", 26) == 0) { | |||||
} else if (strncmp((const char *)remoteName, "PLAYSTATION(R)3", 15) == 0) { | |||||
DBGPrintf(" JoystickController::remoteNameComplete %s - set to PS3\n", remoteName); | DBGPrintf(" JoystickController::remoteNameComplete %s - set to PS3\n", remoteName); | ||||
special_process_required = SP_PS3_IDS; // PS3 maybe needs different IDS. | special_process_required = SP_PS3_IDS; // PS3 maybe needs different IDS. | ||||
joystickType = PS3; | joystickType = PS3; |
{ | { | ||||
USBHDBGSerial.printf("Keyboard Controller::claim_bluetooth - Class %x\n", bluetooth_class); | USBHDBGSerial.printf("Keyboard Controller::claim_bluetooth - Class %x\n", bluetooth_class); | ||||
if ((((bluetooth_class & 0xff00) == 0x2500) || (((bluetooth_class & 0xff00) == 0x500))) && (bluetooth_class & 0x40)) { | if ((((bluetooth_class & 0xff00) == 0x2500) || (((bluetooth_class & 0xff00) == 0x500))) && (bluetooth_class & 0x40)) { | ||||
if (remoteName && (strncmp((const char *)remoteName, "PLAYSTATION(R)3 Controller", 26) == 0)) { | |||||
if (remoteName && (strncmp((const char *)remoteName, "PLAYSTATION(R)3", 15) == 0)) { | |||||
USBHDBGSerial.printf("KeyboardController::claim_bluetooth Reject PS3 hack\n"); | USBHDBGSerial.printf("KeyboardController::claim_bluetooth Reject PS3 hack\n"); | ||||
return false; | return false; | ||||
} | } | ||||
bool KeyboardController::remoteNameComplete(const uint8_t *remoteName) | bool KeyboardController::remoteNameComplete(const uint8_t *remoteName) | ||||
{ | { | ||||
// Real Hack some PS3 controllers bluetoot class is keyboard... | // Real Hack some PS3 controllers bluetoot class is keyboard... | ||||
if (strncmp((const char *)remoteName, "PLAYSTATION(R)3 Controller", 26) == 0) { | |||||
if (strncmp((const char *)remoteName, "PLAYSTATION(R)3", 15) == 0) { | |||||
USBHDBGSerial.printf(" KeyboardController::remoteNameComplete %s - Oops PS3 unclaim\n", remoteName); | USBHDBGSerial.printf(" KeyboardController::remoteNameComplete %s - Oops PS3 unclaim\n", remoteName); | ||||
return false; | return false; | ||||
} | } |