-
Notifications
You must be signed in to change notification settings - Fork 39
HID: sony: Enable Bluetooth Gasia third-party PS3 controllers #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1067,8 +1067,27 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev) | |
| static int sixaxis_set_operational_bt(struct hid_device *hdev) | ||
| { | ||
| unsigned char buf[] = { 0xf4, 0x42, 0x03, 0x00, 0x00 }; | ||
| return hid_hw_raw_request(hdev, buf[0], buf, sizeof(buf), | ||
| HID_FEATURE_REPORT, HID_REQ_SET_REPORT); | ||
| unsigned char ack; | ||
| unsigned char enable_gasia[] = { | ||
| 0xA2, | ||
| 0x01, | ||
| 0x00, 0x00, 0x00, 0x00, 0x00, /* rumble values [0x00, right-timeout, right-force, left-timeout, left-force] */ | ||
| 0x00, 0x00, 0x00, 0x00, 0x02, /* 0x02=LED1 .. 0x10=LED4 */ | ||
| 0xff, 0x27, 0x10, 0x00, 0x32, /* LED 4 */ | ||
| 0xff, 0x27, 0x10, 0x00, 0x32, /* LED 3 */ | ||
| 0xff, 0x27, 0x10, 0x00, 0x32, /* LED 2 */ | ||
| 0xff, 0x27, 0x10, 0x00, 0x32, /* LED 1 */ | ||
| 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 0x00, 0x00, 0x00 | ||
| }; | ||
|
|
||
| ack = hid_hw_raw_request(hdev, buf[0], buf, sizeof(buf), HID_FEATURE_REPORT, HID_REQ_SET_REPORT); | ||
|
|
||
| hid_hw_raw_request(hdev, enable_gasia[0], enable_gasia, sizeof(enable_gasia), HID_FEATURE_REPORT, HID_REQ_SET_REPORT); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens if we send this request to a controller that does not support it? Do we get a bad
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this doesn't matter since you don't have
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This hack is based on https://github.com/supertypo/qtsixa/commit/bbcc5c36d1f317509c39e9e84e77599fea4d81ed |
||
|
|
||
| return ack; | ||
| } | ||
|
|
||
| /* | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declaring a variable here will cause a compiler warning. It needs to be declared at the beginning with the rest of the variables.