Skip to content
Open
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
10 changes: 7 additions & 3 deletions Sources/HIDDevice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ public struct HIDDevice: Hashable, Identifiable {
/// The underlying HID device.
public let device: IOHIDDevice

/// The report size.
public let reportSize: Int
/// The input report size.
public let maxInputReportSize: Int

/// The output report size.
public let maxOutputReportSize:Int

/// The location ID of the device
public let id: Int32
Expand Down Expand Up @@ -71,7 +74,8 @@ public struct HIDDevice: Hashable, Identifiable {
self.name = IOHIDDeviceGetProperty(device, kIOHIDProductKey as CFString) as? String ?? ""
self.vendorId = IOHIDDeviceGetProperty(self.device, kIOHIDVendorIDKey as CFString) as? Int16 ?? 0
self.productId = IOHIDDeviceGetProperty(self.device, kIOHIDProductIDKey as CFString) as? Int16 ?? 0
self.reportSize = IOHIDDeviceGetProperty(self.device, kIOHIDMaxInputReportSizeKey as CFString) as? Int ?? 0
self.maxInputReportSize = IOHIDDeviceGetProperty(self.device, kIOHIDMaxInputReportSizeKey as CFString) as? Int ?? 0
self.maxOutputReportSize = IOHIDDeviceGetProperty(self.device, kIOHIDMaxOutputReportSizeKey as CFString) as? Int ?? 0

self.manufacturer = IOHIDDeviceGetProperty(self.device, kIOHIDManufacturerKey as CFString) as? String ?? ""
self.serialNumber = IOHIDDeviceGetProperty(self.device, kIOHIDSerialNumberKey as CFString) as? String ?? ""
Expand Down