Replies: 2 comments 2 replies
-
This sounds like some Electron-specific behavior. What I assume is more likely, is that your Electron application creates some kind of a container or a sandbox which doesn't have the permission to use HID devices. |
Beta Was this translation helpful? Give feedback.
-
There are some electron examples from the node-hid project and other places. You may want to give it a try. |
Beta Was this translation helpful? Give feedback.
-
Mac OS X Version:12.4
Electron Version:13.6.7
Node.js Version :14.17.3
hidapi: Latest Version
I used the HidAPI function in V8 C++ to open the device for Node.js on the Electron platform, and I want to make hid_send_feature_report() to command the device,
first apply hid_enumerate with VID and PID to get the specified device
The receiver applies the path to the Function of hid_open_path(), but the result of Return Value is NULL (0),
After a further check for the Function of hid_open_path(), IOHIDDeviceOpen in the subroutine, the returned value is e00002e2, defined as kIOReturnNotPermitted
This only happens if Electron-Builder is packaged into an universal file, but if Electron is packaged separately into x86 (Intel) and arm64 (Apple) or if VSCode is used for debugging, the function of hid_open_path() can be successfully opened. ( The above app all have permission to open through Input Monitoring of macOS)
May I ask if I want to package it into one universal file, what can I do to be able to succesfully open it?
Beta Was this translation helpful? Give feedback.
All reactions