winebus: Report whether devices are connected over bluetooth.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56602
This commit is contained in:
Rémi Bernon 2024-05-10 16:21:00 +02:00 committed by Alexandre Julliard
parent 51bdcf8db5
commit 4ddee5a092
3 changed files with 8 additions and 2 deletions

View file

@ -285,6 +285,10 @@ static void handle_DeviceMatchingCallback(void *context, IOReturn result, void *
desc.version = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDVersionNumberKey)));
desc.uid = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDLocationIDKey)));
if ((str = IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDTransportKey))))
desc.is_bluetooth = !CFStringCompare(str, CFSTR(kIOHIDTransportBluetoothValue), 0) ||
!CFStringCompare(str, CFSTR(kIOHIDTransportBluetoothLowEnergyValue), 0);
if (desc.usages.UsagePage != HID_USAGE_PAGE_GENERIC ||
!(desc.usages.Usage == HID_USAGE_GENERIC_JOYSTICK || desc.usages.Usage == HID_USAGE_GENERIC_GAMEPAD))
{

View file

@ -1312,6 +1312,7 @@ static void udev_add_device(struct udev_device *dev, int fd)
get_device_subsystem_info(dev, "hid", &desc, &bus);
get_device_subsystem_info(dev, "input", &desc, &bus);
get_device_subsystem_info(dev, "usb", &desc, &bus);
if (bus == BUS_BLUETOOTH) desc.is_bluetooth = TRUE;
subsystem = udev_device_get_subsystem(dev);
if (!strcmp(subsystem, "hidraw"))

View file

@ -41,6 +41,7 @@ struct device_desc
USAGE_AND_PAGE usages;
BOOL is_gamepad;
BOOL is_hidraw;
BOOL is_bluetooth;
WCHAR manufacturer[MAX_PATH];
WCHAR product[MAX_PATH];
@ -150,9 +151,9 @@ enum unix_funcs
static inline const char *debugstr_device_desc(struct device_desc *desc)
{
if (!desc) return "(null)";
return wine_dbg_sprintf("{vid %04x, pid %04x, version %04x, input %d, uid %08x, usage %04x:%04x, is_gamepad %u, is_hidraw %u}",
return wine_dbg_sprintf("{vid %04x, pid %04x, version %04x, input %d, uid %08x, usage %04x:%04x, is_gamepad %u, is_hidraw %u, is_bluetooth %u}",
desc->vid, desc->pid, desc->version, desc->input, desc->uid, desc->usages.UsagePage, desc->usages.Usage,
desc->is_gamepad, desc->is_hidraw);
desc->is_gamepad, desc->is_hidraw, desc->is_bluetooth);
}
static inline BOOL is_xbox_gamepad(WORD vid, WORD pid)