Skip to content

serial-hid: fix macOS IOKit DevSrvsID path parsing#290

Open
veliander wants to merge 1 commit into
sigrokproject:masterfrom
veliander:fix-macos-hid-path
Open

serial-hid: fix macOS IOKit DevSrvsID path parsing#290
veliander wants to merge 1 commit into
sigrokproject:masterfrom
veliander:fix-macos-hid-path

Conversation

@veliander

Copy link
Copy Markdown

Modern versions of macOS (specifically observed on Apple Silicon / M-series architecture) using hidapi return IOKit device paths utilizing the DevSrvsID:<id> format, rather than the legacy IOService:/... string.

Because DevSrvsID:<id> contains a colon but is not a pure hex string, it fails the validation loops inside get_hidapi_path_copy() and throws an Unsupported HIDAPI path format error. This completely breaks HID device enumeration (e.g., Brymen DMM adapters) on modern macOS machines.

Furthermore, prepending hid/chip/raw= wrappers causes static prefix checks to fail during string extraction.

Changes:

  • Updated get_hidapi_path_copy to check for the DevSrvsID substring, preserving it via SER_HID_RAW_PREFIX.
  • Updated extract_hidapi_path to properly locate and extract the DevSrvsID substring during the reverse extraction sequence, ignoring stacked transport wrappers.

Tested working cleanly on macOS compiling natively for arm64, successfully pairing with a Brymen BM869s adapter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant