HIDDriverKit

RSS for tag

Develop drivers for devices that users interact with using HIDDriverKit.

HIDDriverKit Documentation

Posts under HIDDriverKit tag

18 Posts
Sort by:
Post not yet marked as solved
2 Replies
943 Views
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.
Posted
by
Post marked as solved
2 Replies
655 Views
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
Posted
by
Post not yet marked as solved
0 Replies
377 Views
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.
Posted
by
Post not yet marked as solved
0 Replies
501 Views
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?
Posted
by
Post not yet marked as solved
0 Replies
380 Views
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.
Posted
by
Post not yet marked as solved
0 Replies
465 Views
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)
Posted
by
Post marked as solved
1 Replies
569 Views
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?
Posted
by
Post marked as solved
2 Replies
450 Views
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 */
Posted
by
Post not yet marked as solved
0 Replies
319 Views
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?
Posted
by
Post not yet marked as solved
1 Replies
316 Views
I am porting some code with heavy use of stdlib and CF. Linking against CF produces the error: CoreFoundation is not available when building for DriverKit. I get errors like error: no member named 'clock_t' in the global namespace. What is the correct approach here? Could I statically link stdlib? Should I move my processing code to a separate process? Related: https://stackoverflow.com/questions/61797150/can-i-use-stl-in-a-driverkit-driver/61820426#61820426
Posted
by
Post not yet marked as solved
0 Replies
273 Views
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.
Posted
by
Post not yet marked as solved
1 Replies
214 Views
we are developing USB hid library to interact with HID device, however we're facing on memory lacking when we calling IOCreatePlugInInterfaceForService then calling IODestroyPlugInInterface, the memory is not released and each time of calling it take about 0.3 MB Ram, after long time running, the program crash because runout of memory. what should we do in this case to avoid memory leak? // Create a device interface/HANDLE static BOOL CreateHidDeviceInterface(io_object_t deviceObject, HANDLE* pHandle) { BOOL retVal = FALSE; IOCFPlugInInterface** ppPluginInterface = NULL; SInt32 score = 0; IOReturn pluginResult; HRESULT interfaceResult; // Create a plugin so we can create an interface pluginResult = IOCreatePlugInInterfaceForService(deviceObject, kIOHIDDeviceUserClientTypeID, kIOCFPlugInInterfaceID, &ppPluginInterface, &score); if (pluginResult == kIOReturnSuccess) { // Create the interface (HANDLE) interfaceResult = (*ppPluginInterface)->QueryInterface(ppPluginInterface, CFUUIDGetUUIDBytes(kIOHIDDeviceInterfaceID), (void**)pHandle); if (interfaceResult == S_OK) { retVal = TRUE; } IODestroyPlugInInterface(ppPluginInterface); } return retVal; }
Posted
by
Post not yet marked as solved
1 Replies
193 Views
Hi there! I'm currently new to Mac OS dev (coming from a history of Linux dev). I have an external BT keyboard and a couple keys are mapped differently than my Mac keyboard (§ to ` for example). I'm wondering if it's possible to write a kernel extension that detects the key sent from the BT keyboard and remap the key code. I don't really know whether this is possible and if it is, where to look in the ecosystem. It's a bit different from Linux. Thank you!
Posted
by
Post not yet marked as solved
0 Replies
110 Views
How could I turn a stream of HID reports I have on stdout into a HID (that would eg appear to hidutil)?
Posted
by
Post not yet marked as solved
0 Replies
98 Views
Hi everyone, I am developing a virtual keyboard device connected to an iOS device by Bluetooth. And how to press any special characters by HID usage. I have tried all combinations of keys option + shift + key or option + key but there aren't any characters that I want Particularly, I want to press the character '@' in the Lithuanian language for iOS devices by Bluetooth virtual keyboard. Are there any combinations of keys to press these special characters? Dien Vu
Posted
by
Post not yet marked as solved
0 Replies
103 Views
It occurs only in m1 macbookPro. Panic does not occur in intel macbook. Load my Product EndpointSecurity using NSEndpointSecurityEarlyBoot. Install karabiner. Reboot After the reboot is completed, a panic occurs before 1 minute later.(100%) forever rebooting There is a singularity here. If EndpointSecurity calls the es_subscribe() function, no panic occurs. Here's the question. To use NSEndpointySecurityEarlyBoot, must the es_subscribe() function be called at least once unconditionally? If the es_subscribe() is not called, is the panicking behavior normal? For reference, system diagnostic logs cannot be collected.  This is because panic occurs forever when rebooting.
Posted
by
Post not yet marked as solved
1 Replies
52 Views
I have a driver that is not much more than the sample code for a USB mouse. I am able to get the driver to match with my device (Logitech G600 mouse), and I can see logging inside my handleReport() function, but dispatchRelativePointerEvent does not seem to cause any effect, although it returns KERN_SUCCESS. I've tried it with both SUPERDISPATCH and without (it isn't clear to me if the superclass method needs to be called in the kernel or not in this case), and by subclassing both IOUserHIDEventService and IOUserHIDEventDriver. Below is my handleReport function. Thanks in advance for any assistance, and this is on macOS Ventura Beta 2 void G600Driver::handleReport(uint64_t timestamp,                               uint8_t *report,                               uint32_t reportLength,                               IOHIDReportType type,                               uint32_t reportID) {   kern_return_t kr = dispatchRelativePointerEvent(timestamp, -10, -10, 0, 0, SUPERDISPATCH);   DRLOG("ret: %d", kr); }```
Posted
by