浏览代码

Add Sony 0x042f PlayStation Move navigation controller

Added support for the Sony Playstation Move navigation controller,
and maybe it's alternative one...
main
Kurt Eckhardt 5 年前
父节点
当前提交
3a467a8e88
共有 3 个文件被更改,包括 9 次插入2 次删除
  1. +2
    -1
      examples/Bluetooth/JoystickBT/JoystickBT.ino
  2. +2
    -1
      hid.cpp
  3. +5
    -0
      joystick.cpp

+ 2
- 1
examples/Bluetooth/JoystickBT/JoystickBT.ino 查看文件

@@ -255,8 +255,9 @@ void displayPS3Data()
if ((buttons & 0x04) && !(buttons_prev & 0x04)) show_changed_data = !show_changed_data;

// 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...
// Note: you can use either R1 or L1 with the PS button, to work with Sony Move Navigation...
Serial.print("\nPS3 Pairing Request");
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");

+ 2
- 1
hid.cpp 查看文件

@@ -165,7 +165,8 @@ void USBHIDParser::control(const Transfer_t *transfer)
println(" got report descriptor");
parse();
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");
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};

+ 5
- 0
joystick.cpp 查看文件

@@ -41,6 +41,8 @@ JoystickController::product_vendor_mapping_t JoystickController::pid_vid_mapping
{ 0x045e, 0x02ea, XBOXONE, false },{ 0x045e, 0x02dd, XBOXONE, false },
{ 0x045e, 0x0719, XBOX360, false},
{ 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 }
};

@@ -921,6 +923,9 @@ bool JoystickController::mapNameToJoystickType(const uint8_t *remoteName)
} else if (strncmp((const char *)remoteName, "PLAYSTATION(R)3", 15) == 0) {
DBGPrintf(" JoystickController::mapNameToJoystickType %x %s - set to PS3\n", (uint32_t)this, remoteName);
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) {
DBGPrintf(" JoystickController::mapNameToJoystickType %x %s - set to XBOXONE\n", (uint32_t)this, remoteName);
joystickType_ = XBOXONE;

正在加载...
取消
保存