Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: location of IOKit.framework #425

Open
0xDP opened this issue May 4, 2019 · 4 comments
Open

macOS: location of IOKit.framework #425

0xDP opened this issue May 4, 2019 · 4 comments

Comments

@0xDP
Copy link

0xDP commented May 4, 2019

Hi,

according to

https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/OSX_Technology_Overview/SystemFrameworks/SystemFrameworks.html

IOKit.framework is located at "/System/Library/Frameworks/", but hidapi/mac/hid.c:hidapi_IOHIDDeviceGetService() tries to find it at "/System/Library/". That fails and at least on macOS 10.14 the fallback method seems to not working too, so that hid_enumerate() cannot determine a path. A subsequent call of hid_open() fails due to the empty path. The following patch fixes this issue for me:

--- a/hidapi/mac/hid.c
+++ b/hidapi/mac/hid.c
@@ -303,7 +303,7 @@ static io_service_t hidapi_IOHIDDeviceGe
 	 * and the fallback method will be used.
 	 */
 	if (iokit_framework == NULL) {
-		iokit_framework = dlopen("/System/Library/IOKit.framework/IOKit", RTLD_LAZY);
+		iokit_framework = dlopen("/System/Library/Frameworks/IOKit.framework/IOKit", RTLD_LAZY);
 
 		if (iokit_framework != NULL)
 			dynamic_IOHIDDeviceGetService = dlsym(iokit_framework, "IOHIDDeviceGetService");

Regards,
Dennis

@0xDP
Copy link
Author

0xDP commented May 4, 2019

Sorry, that relates to cython-hidapi.

@0xDP 0xDP closed this as completed May 4, 2019
@0xDP
Copy link
Author

0xDP commented May 4, 2019

Reopened, because this has to be fixed here (upstream) instead of in cython-hidapi.

@0xDP 0xDP reopened this May 4, 2019
@mrpippy
Copy link
Contributor

mrpippy commented May 5, 2019

Wow, I guess this is just a typo I made years ago but it somehow hasn’t caused any problems until now. Can you open a pull request with this change?

@jonathancross
Copy link

Hi @0xDP and @mrpippy -- is there any way we can get you all to move this over to the new actively maintained fork of this project at https://github.com/libusb/hidapi ? Thanks!

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

No branches or pull requests

3 participants