Skip to content

Commit

Permalink
Orochi V2 Support
Browse files Browse the repository at this point in the history
Adds support for both Bluetooth and Receiver connections

DPI Stage support was excluded as librazermacos does not yet support the feature. I'm working on it though :)
  • Loading branch information
WrathofthePast committed Feb 26, 2022
1 parent 03d09ec commit 6cdb3c5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/include/razermouse_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
#define USB_DEVICE_ID_RAZER_NAGA_LEFT_HANDED_2020 0x008D
#define USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL_2021 0x0098
#define USB_DEVICE_ID_RAZER_BASILISK_V3 0x0099
#define USB_DEVICE_ID_RAZER_OROCHI_V2_RECEIVER 0x0094
#define USB_DEVICE_ID_RAZER_OROCHI_V2 0x0095

/* Each keyboard report has 90 bytes*/
#define RAZER_REPORT_LEN 0x5A
Expand Down
2 changes: 2 additions & 0 deletions src/lib/razerdevice.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ bool is_mouse(IOUSBDeviceInterface **usb_dev)
case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL_2021:
case USB_DEVICE_ID_RAZER_BASILISK_V3:
case USB_DEVICE_ID_RAZER_BASILISK_ESSENTIAL:
case USB_DEVICE_ID_RAZER_OROCHI_V2_RECEIVER:
case USB_DEVICE_ID_RAZER_OROCHI_V2_BLUETOOTH:
return true;
}

Expand Down
10 changes: 10 additions & 0 deletions src/lib/razermouse_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ static int razer_get_report(IOUSBDeviceInterface **usb_dev, struct razer_report
break;

case USB_DEVICE_ID_RAZER_ATHERIS_RECEIVER:
case USB_DEVICE_ID_RAZER_OROCHI_V2_RECEIVER:
case USB_DEVICE_ID_RAZER_OROCHI_V2_BLUETOOTH:
return razer_get_usb_response(usb_dev, 0x00, request_report, 0x00, response_report, RAZER_ATHERIS_RECEIVER_WAIT_MIN_US);
break;

Expand Down Expand Up @@ -1706,6 +1708,8 @@ ssize_t razer_attr_read_get_battery(IOUSBDeviceInterface **usb_dev, char *buf)
case USB_DEVICE_ID_RAZER_ATHERIS_RECEIVER:
case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER:
case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED:
case USB_DEVICE_ID_RAZER_OROCHI_V2_RECEIVER:
case USB_DEVICE_ID_RAZER_OROCHI_V2_BLUETOOTH:
report.transaction_id.id = 0x1f;
break;
}
Expand All @@ -1729,6 +1733,8 @@ ssize_t razer_attr_read_is_charging(IOUSBDeviceInterface **usb_dev, char *buf)
// Wireless mice that don't support is_charging
// Use AA batteries
case USB_DEVICE_ID_RAZER_ATHERIS_RECEIVER:
case USB_DEVICE_ID_RAZER_OROCHI_V2_RECEIVER:
case USB_DEVICE_ID_RAZER_OROCHI_V2_BLUETOOTH:
return sprintf(buf, "0\n");
break;

Expand Down Expand Up @@ -1803,6 +1809,8 @@ ushort razer_attr_read_poll_rate(IOUSBDeviceInterface **usb_dev)
case USB_DEVICE_ID_RAZER_ATHERIS_RECEIVER:
case USB_DEVICE_ID_RAZER_BASILISK_V2:
case USB_DEVICE_ID_RAZER_BASILISK_V3:
case USB_DEVICE_ID_RAZER_OROCHI_V2_RECEIVER:
case USB_DEVICE_ID_RAZER_OROCHI_V2_BLUETOOTH:
report.transaction_id.id = 0x1f;
break;
}
Expand Down Expand Up @@ -1894,6 +1902,8 @@ void razer_attr_write_poll_rate(IOUSBDeviceInterface **usb_dev, ushort polling_r
case USB_DEVICE_ID_RAZER_ATHERIS_RECEIVER:
case USB_DEVICE_ID_RAZER_BASILISK_V2:
case USB_DEVICE_ID_RAZER_BASILISK_V3:
case USB_DEVICE_ID_RAZER_OROCHI_V2_RECEIVER:
case USB_DEVICE_ID_RAZER_OROCHI_V2_BLUETOOTH:
report.transaction_id.id = 0x1f;
break;
}
Expand Down

0 comments on commit 6cdb3c5

Please sign in to comment.