}
- (id)initWithDevice:(IOHIDDeviceRef)dev {
if ((self = [super initWithName:nil did:nil base:nil])) {
self.device = dev;
self.productName = (__bridge NSString *)IOHIDDeviceGetProperty(dev, CFSTR(kIOHIDProductKey));
}
- (id)initWithDevice:(IOHIDDeviceRef)dev {
if ((self = [super initWithName:nil did:nil base:nil])) {
self.device = dev;
self.productName = (__bridge NSString *)IOHIDDeviceGetProperty(dev, CFSTR(kIOHIDProductKey));
- vendorId = [(__bridge NSNumber *)IOHIDDeviceGetProperty(dev, CFSTR(kIOHIDVendorIDKey)) intValue];
- productId = [(__bridge NSNumber *)IOHIDDeviceGetProperty(dev, CFSTR(kIOHIDProductIDKey)) intValue];
+ _vendorId = [(__bridge NSNumber *)IOHIDDeviceGetProperty(dev, CFSTR(kIOHIDVendorIDKey)) intValue];
+ _productId = [(__bridge NSNumber *)IOHIDDeviceGetProperty(dev, CFSTR(kIOHIDProductIDKey)) intValue];
- return [NSString stringWithFormat: @"%d:%d:%d", vendorId, productId, _index];
+ return [NSString stringWithFormat: @"%d:%d:%d", _vendorId, _productId, _index];