Skip to content
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

Added windows support for Logitech G533 #208

Merged
merged 1 commit into from
Apr 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/devices/logitech_g533.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ void g533_init(struct device** device)

strncpy(device_g533.device_name, "Logitech G533", sizeof(device_g533.device_name));

device_g533.capabilities = B(CAP_SIDETONE) | B(CAP_BATTERY_STATUS);
device_g533.request_battery = &g533_request_battery;
device_g533.send_sidetone = &g533_send_sidetone;
device_g533.capabilities = B(CAP_SIDETONE) | B(CAP_BATTERY_STATUS);
device_g533.capability_details[CAP_SIDETONE] = (struct capability_detail) { .usagepage = 0xff00, .usageid = 0x1, .interface = 3 };
device_g533.capability_details[CAP_BATTERY_STATUS] = (struct capability_detail) { .usagepage = 0xff43, .usageid = 0x202, .interface = 3 };
device_g533.request_battery = &g533_request_battery;
device_g533.send_sidetone = &g533_send_sidetone;

*device = &device_g533;
}
Expand Down Expand Up @@ -80,11 +82,11 @@ static int g533_request_battery(hid_device* device_handle)
if (r == 0)
return HSC_READ_TIMEOUT;

//Headset offline
// Headset offline
if (data_read[2] == 0xFF)
return HSC_ERROR;

//6th byte is state; 0x1 for idle, 0x3 for charging
// 6th byte is state; 0x1 for idle, 0x3 for charging
uint8_t state = data_read[6];
if (state == 0x03)
return BATTERY_CHARGING;
Expand Down