Skip to content

Commit

Permalink
[macOS] Fix VID/PID for HID (dis)connect messages (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored and drashna committed Aug 20, 2019
1 parent fef9d07 commit 2119e2d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions osx/qmk_toolbox/HID.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ + (void)setupWithPrinter:(Printing *)printer {
}

static NSString * formatDevice(NSString * str, IOHIDDeviceRef device) {
return [NSString stringWithFormat:@"%@ - %@ %@ -- 0x%X:0x%X",
unsigned short vendorId = [(NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDVendorIDKey)) shortValue];
unsigned short productId = [(NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductIDKey)) shortValue];
return [NSString stringWithFormat:@"%@ - %@ %@ -- %04X:%04X",
IOHIDDeviceGetProperty(device, CFSTR(kIOHIDManufacturerKey)),
IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductKey)),
str,
(int)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDVendorIDKey)) / 256,
(int)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductIDKey)) / 256
vendorId,
productId
];
}

Expand Down

0 comments on commit 2119e2d

Please sign in to comment.