IOUSBHost

RSS for tag

Create host-mode user space drivers for USB devices using IOUSBHost.

IOUSBHost Documentation

Posts under IOUSBHost tag

15 Posts
Sort by:
Post not yet marked as solved
0 Replies
135 Views
Hi, does anyone know if IOUSBDeviceInterface187 and IOUSBInterfaceInterface190 interfaces will be available on application level next years and there is no any deprecation plans ? Common Recommendations are to use USBDriverKit, but is there a real need to complicate USB communication in this way?
Posted
by Farquaad.
Last updated
.
Post not yet marked as solved
0 Replies
139 Views
大家好,我正在尝试制作一个关于如何检测手机屏幕前是否有物体的演示。如果有物体,屏幕将显示红色,如果没有物体,则显示绿色。这可能需要调用距离传感器,但我不知道如何调用它。希望大家能给我一个回应。谢谢。
Posted
by Esoting.
Last updated
.
Post not yet marked as solved
1 Replies
100 Views
I searched for MFi's authentication information, but did not specify the need to add an MFI chip to the USB-C interface. Have you resolved the communication issue between the APP and external USBC?
Posted
by kindwu.
Last updated
.
Post not yet marked as solved
0 Replies
306 Views
When the product of USB drive we made connected to iPhone 15, what should we set for TransportComponentName? Should we set ‘USB Connector’ for TransportComponentName? The default value is 'Lightning Connector' before. But how about the Type-C port of iPhone 15 now?
Posted
by Alex_Kuo.
Last updated
.
Post not yet marked as solved
0 Replies
163 Views
Greetings. I'm trying to build an Apple Silicon driver for a Roland keyboard which is no longer supported by the manufacturer. The most recent official driver is from 2010. From my limited understanding of the Apple documentation, it seems to be telling me that I need to build a codeless dext which overrides some sort of base class. The keyboard uses bog standard USB 1.0 to communicate with the host. Total newb in the driver area so if anyone could point me in the right direction on where to start I would be totally grateful.
Posted
by OldBrian.
Last updated
.
Post not yet marked as solved
0 Replies
161 Views
I'm working on hardware that communicates wireless and wired with mobile systems. Anything non-i[Pad]OS we can connect via USB and achieve great bandwidth, in situations where this is necessary. Since i[pad]OS does not support FTDI class compliant devices through USB (and also omits the IOUSB framework), I wonder whether we have a way to "work around" this, e.g. how about (ab)using another protocol that i[pad]OS allows? Concretely, would you think it's possible to tunnel our serial data stream via USBHID?
Posted Last updated
.
Post not yet marked as solved
0 Replies
253 Views
Hi. I wish I'd found a way to determine the USB hub port to which an iPad is connected, even if it means creating a one-time mapping of identifiers and ports beforehand. I thought I'd find some hardware identifiers that might help, but they appear to fluctuate depending on how the iPad carts are connected to the Mac. Is there anything reliable to achieve the desired result? Thanks for your insights. Franck
Posted
by FranckOS.
Last updated
.
Post not yet marked as solved
1 Replies
309 Views
Can anyone advise, or give example of, communicating large (>128 byte) incoming buffers from a dext to a user-space app? My specific situation is interrupt reads from a USB device. These return reports which are too large to fit into the asyncData field of an AsyncCompletion call. Apple's CommunicatingBetweenADriverKitExtensionAndAClientApp sample shows examples of returning a "large" struct, but the example is synchronous. The asynchronous example returns data by copying into a IOUserClientAsyncArgumentsArray, which isn't very big. I can allocate a single buffer larger than 4K in user space, and communicate that buffer to my driver as an IOMemoryDescriptor when I set up my async callback. The driver retains the descriptor, maps it into its memory space and can thus write into it when the hardware returns interrupt data. The driver then calls AsyncCompletion, which will cause my user-side callback to be called, so the user side software knows that there's new data available in the previously allocated buffer. That's fine, it works, but there are data race problems - since USB interrupt reads complete whenever the hardware has provided data, incoming completions happen at unpredictable times, so the shared buffer contents could change while the user side code is examining them. Is there an example somewhere of how to deal with this? Can I allocate memory on the driver side on demand, create an IOMemoryDescriptor for it and return that descriptor packed inside the asyncData? If so, how does the driver know when it can relinquish that memory? I have a feeling there's something here I just don't understand...
Posted
by ssmith_c.
Last updated
.
Post not yet marked as solved
0 Replies
342 Views
this is a repost with more appropriate tags. The original is here: https://developer.apple.com/forums/thread/744268 Can anyone advise, or give example of, communicating large (>128 byte) incoming buffers from a dext to a user-space app? My specific situation is interrupt reads from a USB device. These return reports which are too large to fit into the asyncData field of an AsyncCompletion call. Apple's CommunicatingBetweenADriverKitExtensionAndAClientApp sample shows examples of returning a "large" struct, but the example is synchronous. The asynchronous example returns data by copying into a IOUserClientAsyncArgumentsArray, which isn't very big. I can allocate a single buffer larger than 4K in user space, and communicate that buffer to my driver as an IOMemoryDescriptor when I set up my async callback. The driver retains the descriptor, maps it into its memory space and can thus write into it when the hardware returns interrupt data. The driver then calls AsyncCompletion, which will cause my user-side callback to be called, so the user side software knows that there's new data available in the previously allocated buffer. That's fine, it works, but there are data race problems - since USB interrupt reads complete whenever the hardware has provided data, incoming completions happen at unpredictable times, so the shared buffer contents could change while the user side code is examining them. Is there an example somewhere of how to deal with this? Can I allocate memory on the driver side on demand, create an IOMemoryDescriptor for it and return that descriptor packed inside the asyncData? If so, how does the driver know when it can relinquish that memory? I have a feeling there's something here I just don't understand...
Posted
by ssmith_c.
Last updated
.
Post not yet marked as solved
2 Replies
434 Views
I am currently in the process of developing a DEXT for a USB based external mass storage device using the USBDriverKit framework. IOUSBHostInterface is used as the provider to communicate with the interface's endpoints and I am successful in it. As per the IOUSBHostInterface documentation, To use a host interface object, call Open to create a new session between the interface and your driver. After successfully opening your session, you can request information from the interface and set up pipes to communicate with the interface's endpoints. Remember to close the session you opened in the Stop method of your driver. However, calling Open gains exclusive access to the USB interface and does not allow other services to access the interface. Also, to let go of the exclusive access, Close method can be called but in the Stop method which is called only once during the lifecycle of the extension (when the DEXT is unloaded). As a result of this, Apple's mass storage related KEXTs (media and partition related specifically) do not match the interface and so the filesystem of the drive in question does not get mounted whenever the DEXT has matched the interface. Is this exclusive access a limitation of USBDriverkit or is there any way to get around this issue in this case?
Posted Last updated
.
Post marked as solved
5 Replies
661 Views
Hi. I have a class-compliant usb device which announces its serial number as m4121095, as per its kUSBSerialNumberString property. However, the file name it is provided is tty.usbmodemm41210951 – it's the serial number with an additional 1 at the end. What is the meaning of this appendage? (I'm tempted to believe that the 1 at the end is there in the unlikely case another device with the same SN is connected, but there's no way to test this possibility). In the end, I would like to obtain a filename that is guaranteed to be representing a connection to exactly this device. Can I assume that the filename of a device that follows the same protocol of serial numbering will be consistently appended with a number that can in some way be inferred? Thank you.
Posted
by plaukiu.
Last updated
.
Post not yet marked as solved
1 Replies
738 Views
I am writing a C program on Mac that calls the libUSB API. However, I found some performance differences between the same programs on MAC x64 and MAC M2 systems. Program on Mac m2 call libusb_control_transfer() function is much slower than programs on Mac x64. For example, running a program on Mac x64 takes 3 seconds to complete a function, while on Mac m2 it takes 10 seconds. I try to count the number of times a program calls libusb_control_transfer() and the time it takes each time, and finally calculate the average time it takes to call libusb_control_transfer(). The following figure shows the performance of the program on Mac m2.(Unit is us per time) The following figure shows the performance of the program on Mac x64. (Unit is us per time) The difference in average time spent calling a function has reached over 10 times. Is this performance gap caused by the USB driver or the libUSB library? Thanks.
Posted
by gorilla.
Last updated
.
Post not yet marked as solved
0 Replies
796 Views
Seems like both Dropbox and Google Drive has a pretty sad implementation/bug that acquire exclusive access to USB devices that expose MTP (media transfer protocol). The way google and dropbox did it is just wrong as they 1) should ask for permission for reading data on new devices, 2) not open the usb device in exclusive mode... 3) make use of MTP's Multi-Session mode. Well, as it will take them about 4.5 years to correct this, I wonder if there is a way for a app-store/user-space application in macOS 11/12/13 (big sur, monterey, ventura) to do the following: Detect if there is another app that has exclusive lock to a specific usb device Get the name of the app so that an alert could say, "please quit google-drive for this to work..." Release the exclusive lock, i.e. hand over the usb peripheral to my application
Posted
by dankey.
Last updated
.