HIDDriverKit

RSS for tag

Develop drivers for devices that users interact with using HIDDriverKit.

Posts under HIDDriverKit tag

70 Posts

Post

Replies

Boosts

Views

Activity

DriverKit Communicating a SwiftUI APP
I read the example "Communicating Between a DriverKit Extension and a Client App". https://developer.apple.com/documentation/driverkit/communicating_between_a_driverkit_extension_and_a_client_app But I still don't know, can I communicate with DriverKit through SwiftUI APP? Instead of using IOServiceOpen in CppUserClient, can I use IOServiceOpen in SwiftUI APP like this? Or are there other options?
1
0
1.8k
Mar ’22
Can I write my own HIDServiceFilter or communicate with existing ones?
I want to update the HIDPointerAccelerationTable which is used inside IOHIDPointerScrollFilter. Using the following does not seem to work (I am guessing there is a whitelist of properties that are passed down the stack): hidutil property --matching '{"ProductID":0x47}' --set '{"HIDPointerAccelerationTable":0}' I verify that nothing happens by monitoring this log stream: sudo log stream --level trace --predicate 'subsystem == "com.apple.iohid"' I cannot see where this is instantiated in the open-source code, although I do know that it is a CFPlugin. Not being able to update this property means I would have to reimplement the IOHIDPointerScrollFilter as part of a DriverKit driver, but its looking like a big task because DriverKit doesn't suppose CF/stdlib stuff. Is there a way to update the HIDPointerAccelerationTable property in IOHIDPointerScrollFilter? Can I write my own HIDServiceFilter? How can I register it? Or is this just an internal thing.
1
0
1k
Jan ’22
HIDDriverKit driver fails to dispatch events
HI, I have a simple IOUserHIDEventDriver derived class for a regular mouse which *only* logs messages for the incoming HID reports. The driver successfully loads when the USB transmitter is plugged in and I can receive the HID reports. I can also see that dispatchRelativePointerEvent()(for testing I overrode this method) is being called in response to the HID reports. But the cursor refuses to move! It's as if the dispatch function fails to push the HID reports back into the subsystem for further processing. I do have SIP disabled (or else the driver won't be loaded). I tried running the app (which loads the driver) from /Applications, but that doesn't work either. My entitlements all look fine too. What could be going on? TIA
2
0
1.5k
Jan ’22
Use different class for .iig
My .iig file looks like this, I need to use different class IOUserHIDEventService and IOUserClient. How to modify the class of .llg? Use two different class functions in public: DriverKit.iig #ifndef DriverKit_h #define DriverKit_h #include <Availability.h> #include <DriverKit/IOService.iig> #include <HIDDriverKit/IOUserHIDEventService.iig> class IOHIDElement; class IOHIDDigitizerCollection; class DriverKit: public IOUserHIDEventService { public:   virtual bool init() override;   virtual void free() override;   virtual kern_return_t Start(IOService * provider) override; .......   ....... #endif /* DriverKit_h */
2
0
1.6k
Jan ’22
Is absolute bluetooth mouse movements supported in iOS 13 ?
Is absolute mouse positioning supported over bluetooth in IOS ? I've successfully created a bluetooth mouse emulator (using a Bluefruit NRF52832) which is working with the Assistive Touch bluetooth device feature added in iOS 13. Currently I can only emulate relative mouse positions. Eg. I can only signal the mouse to (pseudo code here) 'movemouse up 10 units' 'movemouse right 10 units', etc.. What I'm hoping to do is'move the mouse in absolute coordinates. eg 'movemouse to X,Y' (where X.Y are absolute screen coordinates' Is it possible to use Absolute Mouse coordinates via bluetooth with IoS ? .. Any references, code fragments appreciatedjc Additional details.. What I tried was changing the HID report frame in the Bluefruit Arduino package from Adafruit (line 138 in BleHIDAdafruit.cpp ). from  SELECT ALL | TOGGLE FULL SIZE HIDINPUT    ( HIDDATA | HIDVARIABLE | HIDRELATIVE ), to SELECT ALL | TOGGLE FULL SIZE HIDINPUT    ( HIDDATA | HIDVARIABLE | HID_ABSOLUTE ), which I believe is the right thing to do.. the mouse no longer moves on my IPAD. Any thoughts ? Note I've tried asking this in the Adafruit forums with no response.
2
0
1.9k
Sep ’21
ClientApp disconnect from SystemExtension when signed
hi I developed an app that has an HID system extension, in debugging mode everything work fine, extension installed and the app connects to it and work but when I signed the app, everything was ruined, the app just can install system extension but can't connect to it system extension entitle ment <key>com.apple.developer.driverkit</key> <true/> <key>com.apple.developer.driverkit.family.hid.device</key> <true/> <key>com.apple.developer.driverkit.family.hid.eventservice</key> <true/> <key>com.apple.developer.driverkit.family.hid.virtual.device</key> <true/> <key>com.apple.developer.driverkit.transport.hid</key> <true/> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.files.user-selected.read-only</key> <true/> <key>com.apple.security.network.client</key> <true/> <key>com.apple.security.network.server</key> <true/> app entitlement <key>com.apple.developer.driverkit.userclient-access</key> <array> <string>com.[TeamName].[ExtensionName]</string> </array> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.developer.system-extension.install</key> <true/> <key>com.apple.security.files.user-selected.read-write</key> <true/> <key>com.apple.security.network.client</key> <true/> <key>com.apple.security.network.server</key> <true/> seems to can connect to SystemExtension com.apple.developer.driverkit.userclient-access is necessary but if I don't remove this from app entitlement the code signature will be invalid part codes to connect to SystemExtension static const char* dextIdentifier = "[driver bundle identifier]"; // this maybe should change to com.[TeamName].[DriverName] when app want to publish(i don't know) softu2f_ctx *softu2f_init(softu2f_init_flags flags) { softu2f_ctx *ctx = NULL; io_service_t service = IO_OBJECT_NULL; io_iterator_t iterator = IO_OBJECT_NULL; kern_return_t ret; int err; // Find driver. ret = IOServiceGetMatchingServices(kIOMasterPortDefault, IOServiceNameMatching(dextIdentifier), &iterator); if (ret != kIOReturnSuccess) { syslog(LOG_WARNING, "u2f: cant find services"); goto fail; } while ((service = IOIteratorNext(iterator)) != IO_OBJECT_NULL) { ret = IOServiceOpen(service, mach_task_self(), 0, &ctx->con); if(ret != kIOReturnSuccess) { syslog(LOG_WARNING, "u2f: cant open service"); break; } else{ syslog(LOG_WARNING, "u2f: opened service"); } IOObjectRelease(service); } Note: when the app was signed the iterator was been 0 (and should not be) Note: the entitlement about DriverKit was granted (maybe the problem is userclient-access not granted)
1
0
819
Aug ’21
How to send PAGE_UP / PAGE_DOWN over BLE HID to IOS?
I am creating a BLE HID keyboard based on a Nordic nRF52840 chip. I can send most keys just fine. But sending the HID Keyboard code PAGE_UP / PAGE_DOWN / HOME / END is not working. On other commercial keyboard these key are "send" in combinations of the Fn key and the ARROW keys. Can anyone tell me how to "send" these keys to IOS? Or how to send the "Fn key" so that I can send the arrow keys thereafter.
0
0
848
Aug ’21
Prevent HID Manager from Loading a USB Device
I've done extensive reading on this, but I'm still stumped. I'm trying to call USBInterfaceOpen for a USB Device that I need direct read/write access to, but I get an exclusive access error. There seem to be 2 possibilities here: 1) use the HID interface or 2) do a codeless kext to get to the device before OS X's HID Manager does. So possibility 1 is not going to work, it's not recognized as a storage or network device and nothing is created in the /dev tree that would allow standard POSIX calls. And possibility 2 is not going well. Apple seems to have really locked things down, and I get "Bad code signature" errors when loading trying to load my codeless kext (with just a .plist): Authenticating extension failed: Bad code signature" UserInfo={NSLocalizedDescription=Authenticating extension failed: Kext com.blackrock.cerestim v1.0.0 in codeless kext bundle com.blackrock.cerestim at /private/var/db/KernelExtensionManagement/Staging/com.blackrock.cerestim.ohqHdy/Cerestim.kext: I am really stuck. Is there any simple way of preventing an HID takeover of this device?
0
0
901
Aug ’21
HID Digitizer
Hi, Does anyone know if macOS supports an external trackpad other than the MagicTrackpad which use the HID Digitizer ? If yes, it will be very useful for me to know the HID Digitizer descriptor format that need to be exposed by the external trackpad. Thanks in advance. David.
1
0
849
Aug ’21
DriverKit Communicating a SwiftUI APP
I read the example "Communicating Between a DriverKit Extension and a Client App". https://developer.apple.com/documentation/driverkit/communicating_between_a_driverkit_extension_and_a_client_app But I still don't know, can I communicate with DriverKit through SwiftUI APP? Instead of using IOServiceOpen in CppUserClient, can I use IOServiceOpen in SwiftUI APP like this? Or are there other options?
Replies
1
Boosts
0
Views
1.8k
Activity
Mar ’22
Can I write my own HIDServiceFilter or communicate with existing ones?
I want to update the HIDPointerAccelerationTable which is used inside IOHIDPointerScrollFilter. Using the following does not seem to work (I am guessing there is a whitelist of properties that are passed down the stack): hidutil property --matching '{"ProductID":0x47}' --set '{"HIDPointerAccelerationTable":0}' I verify that nothing happens by monitoring this log stream: sudo log stream --level trace --predicate 'subsystem == "com.apple.iohid"' I cannot see where this is instantiated in the open-source code, although I do know that it is a CFPlugin. Not being able to update this property means I would have to reimplement the IOHIDPointerScrollFilter as part of a DriverKit driver, but its looking like a big task because DriverKit doesn't suppose CF/stdlib stuff. Is there a way to update the HIDPointerAccelerationTable property in IOHIDPointerScrollFilter? Can I write my own HIDServiceFilter? How can I register it? Or is this just an internal thing.
Replies
1
Boosts
0
Views
1k
Activity
Jan ’22
HIDDriverKit driver fails to dispatch events
HI, I have a simple IOUserHIDEventDriver derived class for a regular mouse which *only* logs messages for the incoming HID reports. The driver successfully loads when the USB transmitter is plugged in and I can receive the HID reports. I can also see that dispatchRelativePointerEvent()(for testing I overrode this method) is being called in response to the HID reports. But the cursor refuses to move! It's as if the dispatch function fails to push the HID reports back into the subsystem for further processing. I do have SIP disabled (or else the driver won't be loaded). I tried running the app (which loads the driver) from /Applications, but that doesn't work either. My entitlements all look fine too. What could be going on? TIA
Replies
2
Boosts
0
Views
1.5k
Activity
Jan ’22
Use different class for .iig
My .iig file looks like this, I need to use different class IOUserHIDEventService and IOUserClient. How to modify the class of .llg? Use two different class functions in public: DriverKit.iig #ifndef DriverKit_h #define DriverKit_h #include <Availability.h> #include <DriverKit/IOService.iig> #include <HIDDriverKit/IOUserHIDEventService.iig> class IOHIDElement; class IOHIDDigitizerCollection; class DriverKit: public IOUserHIDEventService { public:   virtual bool init() override;   virtual void free() override;   virtual kern_return_t Start(IOService * provider) override; .......   ....... #endif /* DriverKit_h */
Replies
2
Boosts
0
Views
1.6k
Activity
Jan ’22
HID touch input device support
After some iOS version, HID touch does not recognize so needs to install an extra touch driver on iOS(suppose it is after Big SUR iOS...) Is there any way to use HID touch function without installing touch driver?
Replies
0
Boosts
0
Views
1.2k
Activity
Jan ’22
Is absolute bluetooth mouse movements supported in iOS 13 ?
Is absolute mouse positioning supported over bluetooth in IOS ? I've successfully created a bluetooth mouse emulator (using a Bluefruit NRF52832) which is working with the Assistive Touch bluetooth device feature added in iOS 13. Currently I can only emulate relative mouse positions. Eg. I can only signal the mouse to (pseudo code here) 'movemouse up 10 units' 'movemouse right 10 units', etc.. What I'm hoping to do is'move the mouse in absolute coordinates. eg 'movemouse to X,Y' (where X.Y are absolute screen coordinates' Is it possible to use Absolute Mouse coordinates via bluetooth with IoS ? .. Any references, code fragments appreciatedjc Additional details.. What I tried was changing the HID report frame in the Bluefruit Arduino package from Adafruit (line 138 in BleHIDAdafruit.cpp ). from  SELECT ALL | TOGGLE FULL SIZE HIDINPUT    ( HIDDATA | HIDVARIABLE | HIDRELATIVE ), to SELECT ALL | TOGGLE FULL SIZE HIDINPUT    ( HIDDATA | HIDVARIABLE | HID_ABSOLUTE ), which I believe is the right thing to do.. the mouse no longer moves on my IPAD. Any thoughts ? Note I've tried asking this in the Adafruit forums with no response.
Replies
2
Boosts
0
Views
1.9k
Activity
Sep ’21
ClientApp disconnect from SystemExtension when signed
hi I developed an app that has an HID system extension, in debugging mode everything work fine, extension installed and the app connects to it and work but when I signed the app, everything was ruined, the app just can install system extension but can't connect to it system extension entitle ment <key>com.apple.developer.driverkit</key> <true/> <key>com.apple.developer.driverkit.family.hid.device</key> <true/> <key>com.apple.developer.driverkit.family.hid.eventservice</key> <true/> <key>com.apple.developer.driverkit.family.hid.virtual.device</key> <true/> <key>com.apple.developer.driverkit.transport.hid</key> <true/> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.files.user-selected.read-only</key> <true/> <key>com.apple.security.network.client</key> <true/> <key>com.apple.security.network.server</key> <true/> app entitlement <key>com.apple.developer.driverkit.userclient-access</key> <array> <string>com.[TeamName].[ExtensionName]</string> </array> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.developer.system-extension.install</key> <true/> <key>com.apple.security.files.user-selected.read-write</key> <true/> <key>com.apple.security.network.client</key> <true/> <key>com.apple.security.network.server</key> <true/> seems to can connect to SystemExtension com.apple.developer.driverkit.userclient-access is necessary but if I don't remove this from app entitlement the code signature will be invalid part codes to connect to SystemExtension static const char* dextIdentifier = "[driver bundle identifier]"; // this maybe should change to com.[TeamName].[DriverName] when app want to publish(i don't know) softu2f_ctx *softu2f_init(softu2f_init_flags flags) { softu2f_ctx *ctx = NULL; io_service_t service = IO_OBJECT_NULL; io_iterator_t iterator = IO_OBJECT_NULL; kern_return_t ret; int err; // Find driver. ret = IOServiceGetMatchingServices(kIOMasterPortDefault, IOServiceNameMatching(dextIdentifier), &iterator); if (ret != kIOReturnSuccess) { syslog(LOG_WARNING, "u2f: cant find services"); goto fail; } while ((service = IOIteratorNext(iterator)) != IO_OBJECT_NULL) { ret = IOServiceOpen(service, mach_task_self(), 0, &ctx->con); if(ret != kIOReturnSuccess) { syslog(LOG_WARNING, "u2f: cant open service"); break; } else{ syslog(LOG_WARNING, "u2f: opened service"); } IOObjectRelease(service); } Note: when the app was signed the iterator was been 0 (and should not be) Note: the entitlement about DriverKit was granted (maybe the problem is userclient-access not granted)
Replies
1
Boosts
0
Views
819
Activity
Aug ’21
How to send PAGE_UP / PAGE_DOWN over BLE HID to IOS?
I am creating a BLE HID keyboard based on a Nordic nRF52840 chip. I can send most keys just fine. But sending the HID Keyboard code PAGE_UP / PAGE_DOWN / HOME / END is not working. On other commercial keyboard these key are "send" in combinations of the Fn key and the ARROW keys. Can anyone tell me how to "send" these keys to IOS? Or how to send the "Fn key" so that I can send the arrow keys thereafter.
Replies
0
Boosts
0
Views
848
Activity
Aug ’21
Prevent HID Manager from Loading a USB Device
I've done extensive reading on this, but I'm still stumped. I'm trying to call USBInterfaceOpen for a USB Device that I need direct read/write access to, but I get an exclusive access error. There seem to be 2 possibilities here: 1) use the HID interface or 2) do a codeless kext to get to the device before OS X's HID Manager does. So possibility 1 is not going to work, it's not recognized as a storage or network device and nothing is created in the /dev tree that would allow standard POSIX calls. And possibility 2 is not going well. Apple seems to have really locked things down, and I get "Bad code signature" errors when loading trying to load my codeless kext (with just a .plist): Authenticating extension failed: Bad code signature" UserInfo={NSLocalizedDescription=Authenticating extension failed: Kext com.blackrock.cerestim v1.0.0 in codeless kext bundle com.blackrock.cerestim at /private/var/db/KernelExtensionManagement/Staging/com.blackrock.cerestim.ohqHdy/Cerestim.kext: I am really stuck. Is there any simple way of preventing an HID takeover of this device?
Replies
0
Boosts
0
Views
901
Activity
Aug ’21
HID Digitizer
Hi, Does anyone know if macOS supports an external trackpad other than the MagicTrackpad which use the HID Digitizer ? If yes, it will be very useful for me to know the HID Digitizer descriptor format that need to be exposed by the external trackpad. Thanks in advance. David.
Replies
1
Boosts
0
Views
849
Activity
Aug ’21