HIDDriverKit

RSS for tag

Develop drivers for devices that users interact with using HIDDriverKit.

Posts under HIDDriverKit tag

71 Posts

Post

Replies

Boosts

Views

Activity

IOHIDDeviceSetReport only works one time
I'm using IOKit to connect to a custom USB HID device. I'm using XCode 14 and running Swift/SwiftUI. So far I have had great success reading from the device with IOHIDDeviceGetReport and this can be done repeatedly with no issues. However, when I use IOHIDDeviceSetReport, I can only successfully set the report to the device one time correctly but any subsequent call to this function would just end up with an I/O Timeout. Any calls using IOHIDDeviceGetReport still works fine so the USB Device is still functioning correctly, but I couldn't receive any additional IOHIDDeviceSetReport call. If I unplug the USB and plug it in again, I can once again successfully send a command. This is, of course, not very practical for the end user to have to unplug and plug the device in after a single set command, and I don't quite understand what's going on with this. Here's my SetOutputReport function to call the IOHIDDeviceSetReport. The IOHIDDevice must already be connected and opened before calling this function so it's not nil. I don't have this "one shot send command" problem on the PC (Windows 7, 10, 11) or Android (v.11,12,13,14) implementation of this Custom USB HID device. It seems like there's something at the lower level of IOHIDDeviceSetReport on macOS which might be done differently than what's available on the PC or Android. Many searches on the web yielded no useful results. There's an IOHIDDeviceSetReportWithCallback function and it also seems only to work one time as well. private func SetOutputReport(dev: IOHIDDevice? ,reportID: Int, data:[UInt8], reportLength: Int) -> String{ let inputReportID = reportID var buffer = data buffer[0] = UInt8(inputReportID) let bufferPointer = UnsafeMutablePointer<UInt8>.allocate(capacity: buffer.count) bufferPointer.initialize(from: &buffer, count: buffer.count) //print(bufferPointer[0]) let bufferLength: CFIndex = buffer.count var success: IOReturn = kIOReturnError if(dev != nil){ success = IOHIDDeviceSetReport(dev!, kIOHIDReportTypeOutput, CFIndex(buffer[0]), bufferPointer, bufferLength) } print("Set report result \(krToString(success))") return krToString(success) }
1
0
1.7k
Nov ’23
Connection between client and DriverKit
In a project, I'm using the DriverKit(and HIDDriverKit) framework. I have encountered a problem in the connection between the client app and the driver, which is implemented by the "IOKit" framework. By calling the function "IOServiceGetMatchingServices" the value of "iterator" returns correctly and then communication with the driver is done. However, after releasing the version on the TestFlight, on some systems, the value of the "iterator" returned 0 and it is not possible to communicate with the driver. I checked the status of the activated driver with the command "systemextensionsctl list" and there are no problems on the driver side and the values of "Enabled" and "Active" are starred. AppSandbox = True, SIP: enable ret = IOServiceGetMatchingServices(kIOMainPortDefault, IOServiceNameMatching(dextIdentifier), &iterator); if (ret != kIOReturnSuccess) { goto fail; } while ((service = IOIteratorNext(iterator)) != IO_OBJECT_NULL) { ret = IOServiceOpen(service, mach_task_self(), 0, &connection); if(ret == kIOReturnSuccess) { break; } else { syslog(LOG_WARNING, "IDmelonLog LIB: Can't open service"); } IOObjectRelease(service); }
3
0
1.4k
Nov ’23
Updated and Fixed DriverKit Example Project: macOS & iPadOS support
For those of us working on drivers for DriverKit, much of the example documentation is confusing, outdated, or just not an actual working example of the latest DriverKit feature set. This post might be of some help to you. I have published a fully working client sample app example that adds iPadOS support alongside macOS and updates to the latest driverkit version: https://github.com/DanBurkhardt/DriverKitUserClientSample This should be immediately runnable, but you will have to ensure you disable SIP and enable developer mode, as per the original README (this is required without DriverKit entitlement permission from Apple). You will also need to, of course, change the bundle ID to your own name (replace "gigabitelabs" with something that is specific to your dev account / business). Lmk if you have any issues, I'm happy to help you get this running so you can get the initial part of DriverKit testing out of the way. Happy hacking, Dan
3
1
1.2k
Oct ’23
Using DriverKit to simulate graphics tablet input
Hi, My goal is to enable this project https://github.com/evidlo/remarkable_mouse to provide native tablet inputs with full information to applications on MacOS, allowing me to reuse my reMarkable tablet for the computer instead of having to buy yet another device, such as a Wacom tablet or an iPad Pro for sidecar when the necessary hardware is already in my posession. I would like to understand whether it is possible to use DriverKit in order to simulate a graphics tablet input device with extra inputs such as pressure and tilt in user-space. Or is this something where IOKit or other comes into play, requiring the creation of a kernel space driver? In either case, what would be the right steps to take? How would I create a virtual device and what are the limitations? If you have the knowledge, how complex would you consider this project to be? The path should basically be some inter-process communication from remarkable_mouse, possibly file-based, triggering tablet events through the driver. At least in the first stage. I assume better performance would be achieved if the whole system was self-contained but porting the reMarkable communication is another challenge on its own. I am experienced developing in other environments but MacOS and driver development are fairly new to me. I've read through the documentation on how to handle the tablet events but creating them seems much murkier. I have searched around for this specific topic without getting much. An open-source tablet driver would be a great place to start but sadly I found none. I've also inquired with ChatGPT but only got high level tips and pseudocode. Any help is greatly appreciated, thank you!
0
0
1.2k
Oct ’23
DriverKit entitlement request NOT processed for months ...
Hi Apple support, We requested the DriverKit Entitlement via below link back in early June. https://developer.apple.com/contact/request/system-extension/ Unfortunately the request is NOT processed for months. Every time we check with Apple support, we just get boilerplate reply, and we have no idea whether the request is being processed or is stuck somewhere. No SLA is shared. This unexpected delay really impacts our product development/release schedule. We are anxiously finding a way to escalate. Can anyone from Apple in this forum help? I can share more details with the request. Thank you. Thanks, Jason
1
0
939
Sep ’23
com.apple.developer.hid.virtual.device entitlement in a sandboxed app
Hello! I'm curious about how com.apple.developer.hid.virtual.device entitlement works with apps. So the documentation hints that it should only be used within a driver. However, on macOS 13 I can successfully compile an app and create a virtual HID device. On earlier versions, such as macOS 12, the app crashes on launch and there's a message in the console: ASI found [libsystem_secinit.dylib] (sensitive) 'failed to compile sandbox profile /System/Library/Sandbox/Profiles/application.sb:1010:15: unbound variable: iokit-user-client-class-name ' Everything seems to be working with the sandbox turned off. Is there a way to use the aforementioned entitlement in a sandboxed app or should I fall back to DriverKit?
1
0
1.2k
Sep ’23
Pointer re-center
I am using an BLE HID mouse, and I have an option to recenter the mouse according to screen resolution that I get from an iPhone. I have 2 issues regarding this post: Getting the screen resolution of an iPhone 11 sends back the resolution of an iPhone 11 Pro and vise versa. To re-center the pointer, I send an HID movement to the iPhone, first to the corner (doesn't matter which one), second to center which is just the resolution divided by 2 on both width and height. Not consistent, but the pointer doesn't always go to the center. My questions are: Why is the resolution sends differently on these devices? Is there a correct way to center the pointer using HID movement commands?
0
0
943
Aug ’23
importing HID Driver Kit Framework
Hi everyone, I am fairly new to Apple development. I have been working on a project where I need Mac to interface with an HID device (custom device). I have successfully communicated with the device using IOKit, Core Foundation and Driver Kit frameworks by simply importing these frameworks in the project and making use of their APIs. However, my client is now asking that I develop the communication explicitly using HID Driver Kit. Bear in mind that I have not purchased the apple developer certificate nor do I have any provisional signing certificates and without any of these, Xcode was allowing me to use frameworks like IOKit, DriverKit etc. Now, when I tried importing HIDDriverKit into the project, I am not able to find this framework in the "Frameworks and Libraries" tab. How do I import this framework into my project? Do I have to purchase apple developer ID or get the provisional signing certificates or any other formalities are required? Please let me know what can be done. Any pointers or suggestions are welcome. Best, Vishnu
3
0
1.4k
Jul ’23
Getting started developing a DriverKit extension, need subscription?
Hello everyone, I am new to developing software for the MacOS platform. I have been doing so on other platforms for years and would like to know what I need to start developing a DriverKit extension, that enables me to read HID input and transform it into commands (I assume I need Xcode and I've already seen examples and some documentation to the technical side of the issue; I am having troubles wrapping my head around entitlements, App ID and the likes). I am not yet talking about distribution, let alone in the AppStore, I am just talking about developing a piece of software for a customly made device, that should appear as a HID (pointer-device with additional touch surface, buttons and the likes). Do I have to purchase an annual Apple Developer subscription right away? Or can I finish the driver and possibly a UI application for its configuration locally and then buy the subscription if I want to enroll my application in AppStore? It's a hobby project, that will be useful to at least me and such a project motivates me to go through with it, even though it is admittedly somewhat complex. Best regards, Igor.
0
0
959
Apr ’23
MI Dual Mode Wireless Mouse side buttons not working via BT connection
I am using MI dual mode mouse on my MacBook Pro 2018, OS Ventura, but the side buttons don't work when using Bluetooth. The side buttons do work well via USB dongle but not Bluetooth. I did some research and found that, the Mouse/HID descriptor send invalid code for the 2 side buttons when using BT. Anyone who might know how I can solve this issue?
6
2
5.6k
Mar ’23
Accessing an HID interface in a USB Composite Audio device
I develop an app for a USB Composite device that has an audio class 1 interface and a midi interface. USBInterfaceOpen() (part of the IOUSBInterfaceStruct800) can open the midi interface and I can send and receive raw midi messages using the USB api just fine (using libusb). I do not need to detach the kernel driver and the audio device keep working. We want to change our product so that it is an audio class 2 device and has a HID interface. When I use USBInterfaceOpen() on the HID interface, it returns with the error another process has device opened for exclusive access It is very odd that MacOS will let an application open a midi interface that MacOS does have a driver loaded for (its internal midi driver) but MacOS will not allow an application to open a HID interface in a USB Composite device with audio class 2 unless the application first detaches the kernel driver causing all audio function to stop. The app must be able to control the product while at the same time audio continues to function in the OS. On Windows and Linux the HID interface can be used without the audio device being removed from the OS. MacOS is prohibiting us from moving forward with this solution. Is this a bug in MacOS? Developing on MacOS is 12.5, XCode = 13.4, tried target 10.14, 11.0 and 12.0
1
0
1.3k
Jan ’23
iPad 10th Gen and IOKitLib/IOHIDManager
I'm creating an iPad room information app which needs to communicate over USB with an LED light strip. The USB controller is HID class, vendor ID is 0x20a0 and product ID is 0x41e5. It requires sending a simple feature report to control the LEDs. I've got it working on the Mac using IOKit, and compiling on the 10th gen USB C iPad using copied headers and bridging IOKitLib and IOHIDManager, but sandboxing prevents the code executing on the iPad (IOServiceOpen failed: 0xe00002e2). Is joining the MFi program really the only way to get this to get the necessary entitlements? At our current scale, we don't need to distribute in the App Store.
0
0
1.7k
Jan ’23
How to customize additional Buttons for a bluetooth device by an APP?
Hi Guys, I need to customize several keys for a bluetooth device. Sometimes the functional of the bluetooth device keys need to change, like change functional from "pgup" to "left" key. So far to customize the key it must go to the Iphone Settings=>Accessibility=>Touch=>AssistiveTouch=>Devices=>"bluetooth device name"=>Customize Additional Buttons/ Above progress is too complicated for user. I want to built an APP to simplify above progress. Currently I found the apple only provide the DriverKit Extension or HIDDriveKit for MacOS or PadOS but no IOS. Is there any methods? Thanks for the help.
0
0
2.7k
Jan ’23
Creating IOHIDEvent objects for DriverKit/IOHIDUserService
The documentation for IOHIDUserService lists the following instance method: virtual void dispatchEvent(IOHIDEvent *event); It specifically says, "You can also call it directly to dispatch events for which you create an IOHIDEvent object." I see nowhere in any documentation on the details for the IOHIDEvent class and creating your own. Google searches let me find https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-368.20/IOHIDFamily/IOHIDEvent.h.auto.html Unfortunately i see nowhere on my computer where IOHIDEvent.h exists. Is this something i'm going to have to build/pull in manually, or is there a framework that I'm just not seeing that I can pull in to create an IOHIDEvent?
1
0
2k
Oct ’22
DriverKit code signing/driver loading issues.
I have been trying to get a stub DriverKit driver loading on my computers without success. I keep getting errors regarding the code signature being invalid. I've been beating my head against the wall for a couple weeks now, so I'd appreciate the help. Layout: Standard Application that does the install/removal. BundleId (changed to protect the innocent) com.somename.someapp. Second target with DriverKit driver: com.somename.someapp.mydriver. To start out this is an IOUserHIDEventService. Question 1) I assume these need to be different with their own entitlements. Is that correct? Question 2) this is my current Entitlement layout; App has SystemExtension. Driver has DriverKit, DriverKit HID Transport, and DriverKit HID Event Service Family. Is this correct for this layout? Question 3) Does the Code Signing Identity/Profile in the Apple Developer section need to match exactly, or can that have more than what is requested? (I started equal, but gave more just to try to troubleshoot) Question 4) I have requested and have been approved to have the "Additional Capabilities" versions of the DriverKit entitlements in Identities. Do i need both checked? can I only have the distribution one? Question 5) I have SIP disabled on my machine (csrutil status shows disabled). I thought this was supposed to bypass the code signing checks? I still see the driver loading being killed because of invalid code signing. Question 6) Does the "Additional Capabilities" version of the DriverKit entitlements that I needed get get approval for bypass the need to disable SIP, or will i need to keep it off for the entirety of development? Thanks!
13
0
4.0k
Oct ’22
USBDriverKit driver not dispatching events
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); }```
4
0
2.2k
Sep ’22
More than one DriverKit module in an Application?
Since Logitech isn't updating their mouse software for M1 after almost two years, i'm going to try to make my own 'driver' for it. In doing so I want to create a virtual HID device that i can tell to send joystick button presses when I press my mouse's macro keys (G600). Looks like to do this properly i would want to create two drivers, one as an HID service IOUserHIDEventService that translates the mouse's HID reports, and an IOUserUSBHostHIDDevice that will create a new HID device with its own descriptor and reports. So that begs the question, can an application contain more than one driver module, or is it limited to one at a time?
1
0
1.4k
Sep ’22
Is absolute bluetooth mouse movements supported in ios?
am trying to send Bluetooth HID Mouse Commands. However the HTML cursor coordinates relative to device screen have no accurate impact on how Screen Cursor (Accessibility Pointer) in IOS Device moves. For example. Mouse Command: M 0 <X-Axis> <Y-Axis> 00 Values we can send (0 - 127 +ve) and (255 = -1, 254 = -2, ... 128 = -127) because bluetooth accepts unsigned integers. If my HTML Cursor is at (X=20,Y=20), How can I determine what exact value should I send to Bluetooth Screen Cursor (Accessibility Pointer) to go to exact accurate position where HTML Cursor is at.
0
0
1.7k
Aug ’22
IOHIDDeviceSetReport only works one time
I'm using IOKit to connect to a custom USB HID device. I'm using XCode 14 and running Swift/SwiftUI. So far I have had great success reading from the device with IOHIDDeviceGetReport and this can be done repeatedly with no issues. However, when I use IOHIDDeviceSetReport, I can only successfully set the report to the device one time correctly but any subsequent call to this function would just end up with an I/O Timeout. Any calls using IOHIDDeviceGetReport still works fine so the USB Device is still functioning correctly, but I couldn't receive any additional IOHIDDeviceSetReport call. If I unplug the USB and plug it in again, I can once again successfully send a command. This is, of course, not very practical for the end user to have to unplug and plug the device in after a single set command, and I don't quite understand what's going on with this. Here's my SetOutputReport function to call the IOHIDDeviceSetReport. The IOHIDDevice must already be connected and opened before calling this function so it's not nil. I don't have this "one shot send command" problem on the PC (Windows 7, 10, 11) or Android (v.11,12,13,14) implementation of this Custom USB HID device. It seems like there's something at the lower level of IOHIDDeviceSetReport on macOS which might be done differently than what's available on the PC or Android. Many searches on the web yielded no useful results. There's an IOHIDDeviceSetReportWithCallback function and it also seems only to work one time as well. private func SetOutputReport(dev: IOHIDDevice? ,reportID: Int, data:[UInt8], reportLength: Int) -&gt; String{ let inputReportID = reportID var buffer = data buffer[0] = UInt8(inputReportID) let bufferPointer = UnsafeMutablePointer&lt;UInt8&gt;.allocate(capacity: buffer.count) bufferPointer.initialize(from: &amp;buffer, count: buffer.count) //print(bufferPointer[0]) let bufferLength: CFIndex = buffer.count var success: IOReturn = kIOReturnError if(dev != nil){ success = IOHIDDeviceSetReport(dev!, kIOHIDReportTypeOutput, CFIndex(buffer[0]), bufferPointer, bufferLength) } print("Set report result \(krToString(success))") return krToString(success) }
Replies
1
Boosts
0
Views
1.7k
Activity
Nov ’23
Connection between client and DriverKit
In a project, I'm using the DriverKit(and HIDDriverKit) framework. I have encountered a problem in the connection between the client app and the driver, which is implemented by the "IOKit" framework. By calling the function "IOServiceGetMatchingServices" the value of "iterator" returns correctly and then communication with the driver is done. However, after releasing the version on the TestFlight, on some systems, the value of the "iterator" returned 0 and it is not possible to communicate with the driver. I checked the status of the activated driver with the command "systemextensionsctl list" and there are no problems on the driver side and the values of "Enabled" and "Active" are starred. AppSandbox = True, SIP: enable ret = IOServiceGetMatchingServices(kIOMainPortDefault, IOServiceNameMatching(dextIdentifier), &iterator); if (ret != kIOReturnSuccess) { goto fail; } while ((service = IOIteratorNext(iterator)) != IO_OBJECT_NULL) { ret = IOServiceOpen(service, mach_task_self(), 0, &connection); if(ret == kIOReturnSuccess) { break; } else { syslog(LOG_WARNING, "IDmelonLog LIB: Can't open service"); } IOObjectRelease(service); }
Replies
3
Boosts
0
Views
1.4k
Activity
Nov ’23
Updated and Fixed DriverKit Example Project: macOS & iPadOS support
For those of us working on drivers for DriverKit, much of the example documentation is confusing, outdated, or just not an actual working example of the latest DriverKit feature set. This post might be of some help to you. I have published a fully working client sample app example that adds iPadOS support alongside macOS and updates to the latest driverkit version: https://github.com/DanBurkhardt/DriverKitUserClientSample This should be immediately runnable, but you will have to ensure you disable SIP and enable developer mode, as per the original README (this is required without DriverKit entitlement permission from Apple). You will also need to, of course, change the bundle ID to your own name (replace "gigabitelabs" with something that is specific to your dev account / business). Lmk if you have any issues, I'm happy to help you get this running so you can get the initial part of DriverKit testing out of the way. Happy hacking, Dan
Replies
3
Boosts
1
Views
1.2k
Activity
Oct ’23
Using DriverKit to simulate graphics tablet input
Hi, My goal is to enable this project https://github.com/evidlo/remarkable_mouse to provide native tablet inputs with full information to applications on MacOS, allowing me to reuse my reMarkable tablet for the computer instead of having to buy yet another device, such as a Wacom tablet or an iPad Pro for sidecar when the necessary hardware is already in my posession. I would like to understand whether it is possible to use DriverKit in order to simulate a graphics tablet input device with extra inputs such as pressure and tilt in user-space. Or is this something where IOKit or other comes into play, requiring the creation of a kernel space driver? In either case, what would be the right steps to take? How would I create a virtual device and what are the limitations? If you have the knowledge, how complex would you consider this project to be? The path should basically be some inter-process communication from remarkable_mouse, possibly file-based, triggering tablet events through the driver. At least in the first stage. I assume better performance would be achieved if the whole system was self-contained but porting the reMarkable communication is another challenge on its own. I am experienced developing in other environments but MacOS and driver development are fairly new to me. I've read through the documentation on how to handle the tablet events but creating them seems much murkier. I have searched around for this specific topic without getting much. An open-source tablet driver would be a great place to start but sadly I found none. I've also inquired with ChatGPT but only got high level tips and pseudocode. Any help is greatly appreciated, thank you!
Replies
0
Boosts
0
Views
1.2k
Activity
Oct ’23
DriverKit entitlement request NOT processed for months ...
Hi Apple support, We requested the DriverKit Entitlement via below link back in early June. https://developer.apple.com/contact/request/system-extension/ Unfortunately the request is NOT processed for months. Every time we check with Apple support, we just get boilerplate reply, and we have no idea whether the request is being processed or is stuck somewhere. No SLA is shared. This unexpected delay really impacts our product development/release schedule. We are anxiously finding a way to escalate. Can anyone from Apple in this forum help? I can share more details with the request. Thank you. Thanks, Jason
Replies
1
Boosts
0
Views
939
Activity
Sep ’23
com.apple.developer.hid.virtual.device entitlement in a sandboxed app
Hello! I'm curious about how com.apple.developer.hid.virtual.device entitlement works with apps. So the documentation hints that it should only be used within a driver. However, on macOS 13 I can successfully compile an app and create a virtual HID device. On earlier versions, such as macOS 12, the app crashes on launch and there's a message in the console: ASI found [libsystem_secinit.dylib] (sensitive) 'failed to compile sandbox profile /System/Library/Sandbox/Profiles/application.sb:1010:15: unbound variable: iokit-user-client-class-name ' Everything seems to be working with the sandbox turned off. Is there a way to use the aforementioned entitlement in a sandboxed app or should I fall back to DriverKit?
Replies
1
Boosts
0
Views
1.2k
Activity
Sep ’23
Pointer re-center
I am using an BLE HID mouse, and I have an option to recenter the mouse according to screen resolution that I get from an iPhone. I have 2 issues regarding this post: Getting the screen resolution of an iPhone 11 sends back the resolution of an iPhone 11 Pro and vise versa. To re-center the pointer, I send an HID movement to the iPhone, first to the corner (doesn't matter which one), second to center which is just the resolution divided by 2 on both width and height. Not consistent, but the pointer doesn't always go to the center. My questions are: Why is the resolution sends differently on these devices? Is there a correct way to center the pointer using HID movement commands?
Replies
0
Boosts
0
Views
943
Activity
Aug ’23
importing HID Driver Kit Framework
Hi everyone, I am fairly new to Apple development. I have been working on a project where I need Mac to interface with an HID device (custom device). I have successfully communicated with the device using IOKit, Core Foundation and Driver Kit frameworks by simply importing these frameworks in the project and making use of their APIs. However, my client is now asking that I develop the communication explicitly using HID Driver Kit. Bear in mind that I have not purchased the apple developer certificate nor do I have any provisional signing certificates and without any of these, Xcode was allowing me to use frameworks like IOKit, DriverKit etc. Now, when I tried importing HIDDriverKit into the project, I am not able to find this framework in the "Frameworks and Libraries" tab. How do I import this framework into my project? Do I have to purchase apple developer ID or get the provisional signing certificates or any other formalities are required? Please let me know what can be done. Any pointers or suggestions are welcome. Best, Vishnu
Replies
3
Boosts
0
Views
1.4k
Activity
Jul ’23
HID driverKit Support on iPadOS?
Hi, I learned to know that PCI, USB and Audio Driver Kits are supported on iPadOS. Does anyone know when or if HID driver kit will be supported on iPadOS? Thanks, Nike
Replies
0
Boosts
1
Views
862
Activity
Jul ’23
HID support for iOS?
Hi, I wonder if there is any possibility to use HID devices on iOS (iPad) and what should I do to enable it? Develop, install existing driver or something else? Thanks a lot! Nike
Replies
0
Boosts
0
Views
1.1k
Activity
Jul ’23
Getting started developing a DriverKit extension, need subscription?
Hello everyone, I am new to developing software for the MacOS platform. I have been doing so on other platforms for years and would like to know what I need to start developing a DriverKit extension, that enables me to read HID input and transform it into commands (I assume I need Xcode and I've already seen examples and some documentation to the technical side of the issue; I am having troubles wrapping my head around entitlements, App ID and the likes). I am not yet talking about distribution, let alone in the AppStore, I am just talking about developing a piece of software for a customly made device, that should appear as a HID (pointer-device with additional touch surface, buttons and the likes). Do I have to purchase an annual Apple Developer subscription right away? Or can I finish the driver and possibly a UI application for its configuration locally and then buy the subscription if I want to enroll my application in AppStore? It's a hobby project, that will be useful to at least me and such a project motivates me to go through with it, even though it is admittedly somewhat complex. Best regards, Igor.
Replies
0
Boosts
0
Views
959
Activity
Apr ’23
MI Dual Mode Wireless Mouse side buttons not working via BT connection
I am using MI dual mode mouse on my MacBook Pro 2018, OS Ventura, but the side buttons don't work when using Bluetooth. The side buttons do work well via USB dongle but not Bluetooth. I did some research and found that, the Mouse/HID descriptor send invalid code for the 2 side buttons when using BT. Anyone who might know how I can solve this issue?
Replies
6
Boosts
2
Views
5.6k
Activity
Mar ’23
Accessing an HID interface in a USB Composite Audio device
I develop an app for a USB Composite device that has an audio class 1 interface and a midi interface. USBInterfaceOpen() (part of the IOUSBInterfaceStruct800) can open the midi interface and I can send and receive raw midi messages using the USB api just fine (using libusb). I do not need to detach the kernel driver and the audio device keep working. We want to change our product so that it is an audio class 2 device and has a HID interface. When I use USBInterfaceOpen() on the HID interface, it returns with the error another process has device opened for exclusive access It is very odd that MacOS will let an application open a midi interface that MacOS does have a driver loaded for (its internal midi driver) but MacOS will not allow an application to open a HID interface in a USB Composite device with audio class 2 unless the application first detaches the kernel driver causing all audio function to stop. The app must be able to control the product while at the same time audio continues to function in the OS. On Windows and Linux the HID interface can be used without the audio device being removed from the OS. MacOS is prohibiting us from moving forward with this solution. Is this a bug in MacOS? Developing on MacOS is 12.5, XCode = 13.4, tried target 10.14, 11.0 and 12.0
Replies
1
Boosts
0
Views
1.3k
Activity
Jan ’23
iPad 10th Gen and IOKitLib/IOHIDManager
I'm creating an iPad room information app which needs to communicate over USB with an LED light strip. The USB controller is HID class, vendor ID is 0x20a0 and product ID is 0x41e5. It requires sending a simple feature report to control the LEDs. I've got it working on the Mac using IOKit, and compiling on the 10th gen USB C iPad using copied headers and bridging IOKitLib and IOHIDManager, but sandboxing prevents the code executing on the iPad (IOServiceOpen failed: 0xe00002e2). Is joining the MFi program really the only way to get this to get the necessary entitlements? At our current scale, we don't need to distribute in the App Store.
Replies
0
Boosts
0
Views
1.7k
Activity
Jan ’23
How to customize additional Buttons for a bluetooth device by an APP?
Hi Guys, I need to customize several keys for a bluetooth device. Sometimes the functional of the bluetooth device keys need to change, like change functional from "pgup" to "left" key. So far to customize the key it must go to the Iphone Settings=>Accessibility=>Touch=>AssistiveTouch=>Devices=>"bluetooth device name"=>Customize Additional Buttons/ Above progress is too complicated for user. I want to built an APP to simplify above progress. Currently I found the apple only provide the DriverKit Extension or HIDDriveKit for MacOS or PadOS but no IOS. Is there any methods? Thanks for the help.
Replies
0
Boosts
0
Views
2.7k
Activity
Jan ’23
Creating IOHIDEvent objects for DriverKit/IOHIDUserService
The documentation for IOHIDUserService lists the following instance method: virtual void dispatchEvent(IOHIDEvent *event); It specifically says, "You can also call it directly to dispatch events for which you create an IOHIDEvent object." I see nowhere in any documentation on the details for the IOHIDEvent class and creating your own. Google searches let me find https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-368.20/IOHIDFamily/IOHIDEvent.h.auto.html Unfortunately i see nowhere on my computer where IOHIDEvent.h exists. Is this something i'm going to have to build/pull in manually, or is there a framework that I'm just not seeing that I can pull in to create an IOHIDEvent?
Replies
1
Boosts
0
Views
2k
Activity
Oct ’22
DriverKit code signing/driver loading issues.
I have been trying to get a stub DriverKit driver loading on my computers without success. I keep getting errors regarding the code signature being invalid. I've been beating my head against the wall for a couple weeks now, so I'd appreciate the help. Layout: Standard Application that does the install/removal. BundleId (changed to protect the innocent) com.somename.someapp. Second target with DriverKit driver: com.somename.someapp.mydriver. To start out this is an IOUserHIDEventService. Question 1) I assume these need to be different with their own entitlements. Is that correct? Question 2) this is my current Entitlement layout; App has SystemExtension. Driver has DriverKit, DriverKit HID Transport, and DriverKit HID Event Service Family. Is this correct for this layout? Question 3) Does the Code Signing Identity/Profile in the Apple Developer section need to match exactly, or can that have more than what is requested? (I started equal, but gave more just to try to troubleshoot) Question 4) I have requested and have been approved to have the "Additional Capabilities" versions of the DriverKit entitlements in Identities. Do i need both checked? can I only have the distribution one? Question 5) I have SIP disabled on my machine (csrutil status shows disabled). I thought this was supposed to bypass the code signing checks? I still see the driver loading being killed because of invalid code signing. Question 6) Does the "Additional Capabilities" version of the DriverKit entitlements that I needed get get approval for bypass the need to disable SIP, or will i need to keep it off for the entirety of development? Thanks!
Replies
13
Boosts
0
Views
4.0k
Activity
Oct ’22
USBDriverKit driver not dispatching events
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); }```
Replies
4
Boosts
0
Views
2.2k
Activity
Sep ’22
More than one DriverKit module in an Application?
Since Logitech isn't updating their mouse software for M1 after almost two years, i'm going to try to make my own 'driver' for it. In doing so I want to create a virtual HID device that i can tell to send joystick button presses when I press my mouse's macro keys (G600). Looks like to do this properly i would want to create two drivers, one as an HID service IOUserHIDEventService that translates the mouse's HID reports, and an IOUserUSBHostHIDDevice that will create a new HID device with its own descriptor and reports. So that begs the question, can an application contain more than one driver module, or is it limited to one at a time?
Replies
1
Boosts
0
Views
1.4k
Activity
Sep ’22
Is absolute bluetooth mouse movements supported in ios?
am trying to send Bluetooth HID Mouse Commands. However the HTML cursor coordinates relative to device screen have no accurate impact on how Screen Cursor (Accessibility Pointer) in IOS Device moves. For example. Mouse Command: M 0 <X-Axis> <Y-Axis> 00 Values we can send (0 - 127 +ve) and (255 = -1, 254 = -2, ... 128 = -127) because bluetooth accepts unsigned integers. If my HTML Cursor is at (X=20,Y=20), How can I determine what exact value should I send to Bluetooth Screen Cursor (Accessibility Pointer) to go to exact accurate position where HTML Cursor is at.
Replies
0
Boosts
0
Views
1.7k
Activity
Aug ’22