USBDriverKit

RSS for tag

Develop drivers for USB-based devices using USBDriverKit.

Posts under USBDriverKit tag

192 Posts

Post

Replies

Boosts

Views

Activity

USB problems with ANT+ dongle
I have just purchased MacBook Pro with M1 Pro chip. All was fine until the virtual cycling app Rouvy lost ANT+ connection to my smart trainer, cadence and heart rate data. OS is 12.6. I then discovered using System Report that if I remove the dongle it is on the end of a short USB-C to USB-A (female) cable is is not reflected in System report (leaving USB field and returning). The Rouvy app reports the dongle is disconnected. Eventually after several removals and inserting the dongle the Rouvy app see it as connected. A system restart works every time. Any ideas of how to fix this problem. Thanks Truck50
2
0
2.1k
Sep ’22
USB Serial Communication In C/C++
Hello all, I am new to using USB port communications on the Mac; and I was wondering how do I open read and write to an Arduino or similar board with C++ on the MacOS? I know how to do this in python but I HAVE to do it in C/C++ for my particular project. I have read docs like these but they are very outdated: https://developer.apple.com/library/archive/documentation/DeviceDrivers/Conceptual/USBBook/USBOverview/USBOverview.html#//apple_ref/doc/uid/TP40002644-BBIHAIAG Anything will help thanks!
1
1
4.2k
Aug ’22
DriverKit: limitations of AsyncCallback in IOConnectCallAsyncStructMethod?
We implemented communication between Swift App and DriverKit driver using IOConnectCallAsyncStructMethod. So in Swift App we have following code to setup AsyncDataCallback: func AsyncDataCallback(refcon: UnsafeMutableRawPointer?, result: IOReturn, args: UnsafeMutablePointer<UnsafeMutableRawPointer?>?, numArgs: UInt32) -> Void { // handle args } var asyncRef: [io_user_reference_t] = .init(repeating: 0, count: 8) asyncRef[kIOAsyncCalloutFuncIndex] = unsafeBitCast(AsyncDataCallback as IOAsyncCallback, to: UInt64.self) asyncRef[kIOAsyncCalloutRefconIndex] = unsafeBitCast(self, to: UInt64.self) ...... let notificationPort = IONotificationPortCreate(kIOMasterPortDefault) let machNotificationPort = IONotificationPortGetMachPort(notificationPort) let runLoopSource = IONotificationPortGetRunLoopSource(notificationPort)! CFRunLoopAddSource(CFRunLoopGetCurrent(), runLoopSource.takeUnretainedValue(), CFRunLoopMode.defaultMode) var input = "someinput".map { UInt8($0.asciiValue!) } let inputSize = input.count IOConnectCallAsyncStructMethod(             connection,             123,             machNotificationPort,             &asyncRef,             UInt32(kIOAsyncCalloutCount),             &input,             inputSize,             nil,             nil ) In the driver's ExternalMethod we save callback in ivars: ivars->callbackAction = arguments->completion; ivars->callbackAction->retain(); Next we start communication with our device in a separate thread and execute callback when we get data from device: SendDataAsync(void *data, uint32_t dataLength) { const int asyncDataCount = 16; if (ivars->callbackAction != nullptr) {         Log("SendDataAsync() - got %u bytes", dataLength);         uint64_t asyncData[asyncDataCount] = { };         asyncData[0] = dataLength;         memcpy(asyncData + 1, data, dataLength);         AsyncCompletion(ivars->callbackAction, kIOReturnSuccess, asyncData, asyncDataCount);     } Limitation 1: Our device produces data packet every 10 ms. So driver gets 100 data packets per second. Receive rate is good and we verified it by logs. However we see some delay in AsyncCallback in Swift App. It looks like async calls are queued since we see that Swift App gets callbacks for a few seconds when we stopped to send data from Driver. We measured receive rate in Swift App and it is about 50 data packets per second. So what's a minimum call rate for AsyncCompletion? Is it higher than 10 ms? Maybe there is other more efficient way to asynchronously pass data from Driver to Swift App? Limitation 2: We thought we can buffer data packets and decrease AsyncCompletion call rate. However asyncData could be only 16 of uint64_t by declaration typedef uint64_t IOUserClientAsyncArgumentsArray[16];. Size of our data packer is 112 bytes that perfectly fits to max args size(8*16 = 128 bytes). So we can't cache and send 2 data packets. How we can avoid this limitation and send more data via AsyncCompletion? Is there any other API for asynchronous communication that allows send more data back?
3
1
1.9k
Aug ’22
USBDriverKit trying to change IOProviderClass and create a IOUSBHostDevice subclass
I have a project that runs correctly when this is set in the dext Info.plist: IOClass: IOUserService IOProviderClass: IOUserResources IOUserClass: MyCustomDriver IOUserServerName: $(PRODUCT_BUNDLE_IDENTIFIER) I'm trying to adjust this so that I can do Driverkit development with USB. I've gotten my development entitlements correct (driverkit.transport.usb) and my dext is [activated, ready]. I've tried changing the IOProviderClass to IOUSBHostDevice. I've tried IOClass set to IOService as well as IOUserService. I've also added idProduct and idVendor keys to both Info.plist and the Driverkit Entitlements file. My dext is properly set up in the system with these changes, but Console.app lists that it has loaded it as a codeless dext. I need my dext implementation to execute. Does anyone have any suggestions? Thanks.
5
1
2.6k
Aug ’22
How to do async IO using IOUSBHostPipe?
We followed WWDC Session: System Extensions and DriverKit and recreated a code to do USB device communication via IOUSBHostPipe: struct MyDriver_IVars {     IOUSBHostInterface       *interface;     IOUSBHostPipe            *inPipe;     OSAction                 *ioCompleteCallback;     IOBufferMemoryDescriptor *inData;     uint16_t                  maxPacketSize; }; kern_return_t IMPL(MyDriver, Start) { ...     ivars->maxPacketSize = 64;     ret = ivars->interface->CreateIOBuffer( kIOMemoryDirectionInOut,                                            ivars->maxPacketSize,                                            &ivars->inData);     ret = CreateActionReadComplete(0, &ivars->ioCompleteCallback); ret = ivars->inPipe->AsyncIO(ivars->inData,                                  ivars->maxPacketSize,                                  ivars->ioCompleteCallback,                                  0); ... } Our Driver is started by OS when device is connected. We see that ReadComplete callback is called: void IMPL(MyDriver, ReadComplete) {     Log("ReadComplete() - status - %d; bytes count - %d", status, actualByteCount); } However it's not obvious how to read data received in this callback. I suspect that we should use IOBufferMemoryDescriptor *inData but we didn't find any good example/sample and documentation is poor. Our callback is called only once. It's not clear how to read a series of data from device? Should we create some loop and call inPipe->AsyncIO from callback? Also it would be helpful to see how to pass data to device. I hope we should fill IOBufferMemoryDescriptor *inData.
5
2
1.3k
Jul ’22
DriverKit on iOS - can't actually communicate with a driver in seed 1?
I watched the session multiple times, but it just gives a high level overview that doesn't really say much about this very exciting and complex new feature. It only mentions actually talking to the driver in passing with a single sentence "apps use the IOKit framework to open user clients". Then the presenter says for an example of that we can check out "communicating between a driverkit extension and a client app", which is a macOS app that doesn't even use IOKit, and trying to import IOKit into an iPadOS target doesn't work anyway because the framework is not there. Am I missing something, or is this simply not available in Xcode 14 seed 1? Release notes don't mention anything either, and docs are only updated to reflect that some of this stuff is now available on iPadOS 16...
7
0
2.7k
Jul ’22
IOUSBHostPipe AsynIO transfer size
I am working on a DriverKit system extension that handles some kind of USB Ethernet adapter. I'm trying to receive data from a Bulk endpoint. Each USB transfer should be up to 512kB, but the actual size of the transfer is not known in advance. What I do is the following: Allocate an IOBufferMemoryDescriptor with IOUSBHostInterface::CreateIOBuffer: ret = ivars->interface->CreateIOBuffer(kIOMemoryDirectionIn, 524288, &b->buffer); Create an OSAction to be used as transfer complete callback: ret = CreateActionReadComplete(0, &b->action); Start the I/O request: ret = ivars->pipe->AsyncIO(b->buffer, 524288, b->action, 0); At that point, I see that instead of starting a single 524288 bytes transfer, it starts 14 36864 bytes transfers and a 8192 bytes one. Which will absolutely not work with the USB device. Is there a transfer size limit I am not aware of?
0
0
764
Jul ’22
USBSerialDriverKit CH340g Not Appearing in /dev
I have a CH340g connected to my M1 MacBook Air running the latest Big Sur 11.2.3. It appeared only one time in /dev, and now will not re-appear. I've tried plugging it in to both ports, unplugging everything except for the CH340g, and also kextunload, kextload on AppleUSBSerial.kext. It does not appear in /dev Has anyone had any luck with this device? Or perhaps some advice?
6
1
5.9k
Jul ’22
Cannot include com.apple.developer.driverkit.transport.usb into provision profile
We requested com.apple.developer.driverkit.transport.usb entitlement a few days ago and it looks like it was granted since we see(can select) it at: App Id -> Additional Capabilities Tab -> DriverKit USB Transport - Vendor ID. We tried to choose both options at Additional Entitlements page Default and Driver Kit and System Extension Template for **** Mac Dev. Generated profile displays DriverKit USB Transport - Vendor ID in Enabled Capabilities in browser. However downloaded profile doesn't include com.apple.developer.driverkit.transport.usb. As a result our Driver fails to start and in Console we see: Driver: Unsatisfied entitlements: com.apple.developer.driverkit.transport.usb /Library/SystemExtensions/675FA894-8985-4D86-B0FF-B892B9AEA27B/Driver.dext/Driver signature not valid: -67671 BTW, we tried to modify existing profile and create a new one. Did we miss something? Is any way to check entitlement status with Apple support?
3
2
2.3k
Jul ’22
DriverKit by Third Party question
I understand that a Company’s hardware vendor ID is required for requesting Entitlements for DriverKit. Does this means DriverKit is only targeted for hardware vendors? Does Apple allows third party (not the hardware vendor) entitlements for DriverKit? Our company is exploring the development of generic open source drivers on iPad for label printers such as those by Zebra. Is this allowed?
1
0
1.6k
Jun ’22
IOUSBHostDevice fails and throws error in sandboxed app
I get the following errors when running the code below in a sandboxed app (it works when not sandboxed) and I have the com.apple.security.device.usb entitlement enabled. Error:Unable to open io_service_t object and create user client. with reason: IOServiceOpen failed. Error Domain=IOUSBHostErrorDomain Code=-536870174 "Failed to create IOUSBHostObject." UserInfo={NSLocalizedRecoverySuggestion=, NSLocalizedDescription=Failed to create IOUSBHostObject., NSLocalizedFailureReason=IOServiceOpen failed.} import Foundation import IOKit import IOKit.usb import IOKit.usb.IOUSBLib import IOKit.serial import IOUSBHost import IOUSBHost.IOUSBHostInterface class USBService {     enum UsbError: Error {         case noDeviceMatched         case deviceCriteriaNotUnique     }          init() {              }          func getDevice(idVendor: Int?, idProduct: Int?) throws {         let deviceSearchPattern: [IOUSBHostMatchingPropertyKey : Int] = [                    .vendorID : idVendor!,                    .productID : idProduct!,                ]                let deviceDomain = [ "IOProviderClass": "IOUSBHostDevice" ]                let searchRequest = (deviceSearchPattern as NSDictionary).mutableCopy() as! NSMutableDictionary                searchRequest.addEntries(from: deviceDomain)         let service = IOServiceGetMatchingService(kIOMasterPortDefault, searchRequest)         guard service != 0 else {                    throw UsbError.noDeviceMatched         }                       let device = try IOUSBHostDevice.init(__ioService: service, options: [], queue: nil, interestHandler: nil)                  print(device.deviceDescriptor?.pointee.idProduct)     } }
3
0
2.3k
May ’22
How to share data between iPad app and macOS app using thunderbolt
Hi folks, I'm developing a real-time audio engine that runs on macOS but has also an iPad version that enables control of the macOS app using a touch screen. I want to share control data between the iPad app and the macOS app without using Wi-Fi. As a real-time thing, it would be great to be able to use a thunderbolt cable. Is there a way of doing it? Where can I find more info? Thanks for your time.
0
0
721
Mar ’22
USB Live Stream not working in osx 12
Dear Apple Expert, Our project uses libUSB library to interact with a USB based camera device. Our application is working fine in macOS Mojave (10.14.6 ). When the new MacOS 12 beta version was made available, we tested our code. But when we try to claim the interface via "CreateInterfaceIterator" API, we are getting "kIOReturnExclusiveAccess" error code and ultimately our application fails. The failure is observed in both libUSB versions 1.0.23 and 1.0.24. Could you help us by explaining if there is change in the new OS with respect to access to USB devices?
1
0
1.9k
Mar ’22
Gravity Nova Usb C hub not showing ethernet connection
I have purchased the USB C hub by gravity and it has the ethernet port which is not appearing in my network settings. I have tried to see if it could be added but cant find anything. I have heard people talk about drivers but not sure what drivers or even if i need them. They dont say anything on the gravity website. Can anyone help?
1
0
942
Feb ’22
USB problems with ANT+ dongle
I have just purchased MacBook Pro with M1 Pro chip. All was fine until the virtual cycling app Rouvy lost ANT+ connection to my smart trainer, cadence and heart rate data. OS is 12.6. I then discovered using System Report that if I remove the dongle it is on the end of a short USB-C to USB-A (female) cable is is not reflected in System report (leaving USB field and returning). The Rouvy app reports the dongle is disconnected. Eventually after several removals and inserting the dongle the Rouvy app see it as connected. A system restart works every time. Any ideas of how to fix this problem. Thanks Truck50
Replies
2
Boosts
0
Views
2.1k
Activity
Sep ’22
How to get LUN id of SCSI connected devices
Hi all I needed some help in getting the LUN id of all devices connected to the system especially for SCSI devices. I'm not able to find any such system command or a SCSI command. Thanks in advance.
Replies
2
Boosts
0
Views
1.2k
Activity
Sep ’22
USB Serial Communication In C/C++
Hello all, I am new to using USB port communications on the Mac; and I was wondering how do I open read and write to an Arduino or similar board with C++ on the MacOS? I know how to do this in python but I HAVE to do it in C/C++ for my particular project. I have read docs like these but they are very outdated: https://developer.apple.com/library/archive/documentation/DeviceDrivers/Conceptual/USBBook/USBOverview/USBOverview.html#//apple_ref/doc/uid/TP40002644-BBIHAIAG Anything will help thanks!
Replies
1
Boosts
1
Views
4.2k
Activity
Aug ’22
DriverKit: limitations of AsyncCallback in IOConnectCallAsyncStructMethod?
We implemented communication between Swift App and DriverKit driver using IOConnectCallAsyncStructMethod. So in Swift App we have following code to setup AsyncDataCallback: func AsyncDataCallback(refcon: UnsafeMutableRawPointer?, result: IOReturn, args: UnsafeMutablePointer<UnsafeMutableRawPointer?>?, numArgs: UInt32) -> Void { // handle args } var asyncRef: [io_user_reference_t] = .init(repeating: 0, count: 8) asyncRef[kIOAsyncCalloutFuncIndex] = unsafeBitCast(AsyncDataCallback as IOAsyncCallback, to: UInt64.self) asyncRef[kIOAsyncCalloutRefconIndex] = unsafeBitCast(self, to: UInt64.self) ...... let notificationPort = IONotificationPortCreate(kIOMasterPortDefault) let machNotificationPort = IONotificationPortGetMachPort(notificationPort) let runLoopSource = IONotificationPortGetRunLoopSource(notificationPort)! CFRunLoopAddSource(CFRunLoopGetCurrent(), runLoopSource.takeUnretainedValue(), CFRunLoopMode.defaultMode) var input = "someinput".map { UInt8($0.asciiValue!) } let inputSize = input.count IOConnectCallAsyncStructMethod(             connection,             123,             machNotificationPort,             &asyncRef,             UInt32(kIOAsyncCalloutCount),             &input,             inputSize,             nil,             nil ) In the driver's ExternalMethod we save callback in ivars: ivars->callbackAction = arguments->completion; ivars->callbackAction->retain(); Next we start communication with our device in a separate thread and execute callback when we get data from device: SendDataAsync(void *data, uint32_t dataLength) { const int asyncDataCount = 16; if (ivars->callbackAction != nullptr) {         Log("SendDataAsync() - got %u bytes", dataLength);         uint64_t asyncData[asyncDataCount] = { };         asyncData[0] = dataLength;         memcpy(asyncData + 1, data, dataLength);         AsyncCompletion(ivars->callbackAction, kIOReturnSuccess, asyncData, asyncDataCount);     } Limitation 1: Our device produces data packet every 10 ms. So driver gets 100 data packets per second. Receive rate is good and we verified it by logs. However we see some delay in AsyncCallback in Swift App. It looks like async calls are queued since we see that Swift App gets callbacks for a few seconds when we stopped to send data from Driver. We measured receive rate in Swift App and it is about 50 data packets per second. So what's a minimum call rate for AsyncCompletion? Is it higher than 10 ms? Maybe there is other more efficient way to asynchronously pass data from Driver to Swift App? Limitation 2: We thought we can buffer data packets and decrease AsyncCompletion call rate. However asyncData could be only 16 of uint64_t by declaration typedef uint64_t IOUserClientAsyncArgumentsArray[16];. Size of our data packer is 112 bytes that perfectly fits to max args size(8*16 = 128 bytes). So we can't cache and send 2 data packets. How we can avoid this limitation and send more data via AsyncCompletion? Is there any other API for asynchronous communication that allows send more data back?
Replies
3
Boosts
1
Views
1.9k
Activity
Aug ’22
USBDriverKit trying to change IOProviderClass and create a IOUSBHostDevice subclass
I have a project that runs correctly when this is set in the dext Info.plist: IOClass: IOUserService IOProviderClass: IOUserResources IOUserClass: MyCustomDriver IOUserServerName: $(PRODUCT_BUNDLE_IDENTIFIER) I'm trying to adjust this so that I can do Driverkit development with USB. I've gotten my development entitlements correct (driverkit.transport.usb) and my dext is [activated, ready]. I've tried changing the IOProviderClass to IOUSBHostDevice. I've tried IOClass set to IOService as well as IOUserService. I've also added idProduct and idVendor keys to both Info.plist and the Driverkit Entitlements file. My dext is properly set up in the system with these changes, but Console.app lists that it has loaded it as a codeless dext. I need my dext implementation to execute. Does anyone have any suggestions? Thanks.
Replies
5
Boosts
1
Views
2.6k
Activity
Aug ’22
How to do async IO using IOUSBHostPipe?
We followed WWDC Session: System Extensions and DriverKit and recreated a code to do USB device communication via IOUSBHostPipe: struct MyDriver_IVars {     IOUSBHostInterface       *interface;     IOUSBHostPipe            *inPipe;     OSAction                 *ioCompleteCallback;     IOBufferMemoryDescriptor *inData;     uint16_t                  maxPacketSize; }; kern_return_t IMPL(MyDriver, Start) { ...     ivars->maxPacketSize = 64;     ret = ivars->interface->CreateIOBuffer( kIOMemoryDirectionInOut,                                            ivars->maxPacketSize,                                            &ivars->inData);     ret = CreateActionReadComplete(0, &ivars->ioCompleteCallback); ret = ivars->inPipe->AsyncIO(ivars->inData,                                  ivars->maxPacketSize,                                  ivars->ioCompleteCallback,                                  0); ... } Our Driver is started by OS when device is connected. We see that ReadComplete callback is called: void IMPL(MyDriver, ReadComplete) {     Log("ReadComplete() - status - %d; bytes count - %d", status, actualByteCount); } However it's not obvious how to read data received in this callback. I suspect that we should use IOBufferMemoryDescriptor *inData but we didn't find any good example/sample and documentation is poor. Our callback is called only once. It's not clear how to read a series of data from device? Should we create some loop and call inPipe->AsyncIO from callback? Also it would be helpful to see how to pass data to device. I hope we should fill IOBufferMemoryDescriptor *inData.
Replies
5
Boosts
2
Views
1.3k
Activity
Jul ’22
DriverKit on iOS - can't actually communicate with a driver in seed 1?
I watched the session multiple times, but it just gives a high level overview that doesn't really say much about this very exciting and complex new feature. It only mentions actually talking to the driver in passing with a single sentence "apps use the IOKit framework to open user clients". Then the presenter says for an example of that we can check out "communicating between a driverkit extension and a client app", which is a macOS app that doesn't even use IOKit, and trying to import IOKit into an iPadOS target doesn't work anyway because the framework is not there. Am I missing something, or is this simply not available in Xcode 14 seed 1? Release notes don't mention anything either, and docs are only updated to reflect that some of this stuff is now available on iPadOS 16...
Replies
7
Boosts
0
Views
2.7k
Activity
Jul ’22
IOUSBHostPipe AsynIO transfer size
I am working on a DriverKit system extension that handles some kind of USB Ethernet adapter. I'm trying to receive data from a Bulk endpoint. Each USB transfer should be up to 512kB, but the actual size of the transfer is not known in advance. What I do is the following: Allocate an IOBufferMemoryDescriptor with IOUSBHostInterface::CreateIOBuffer: ret = ivars->interface->CreateIOBuffer(kIOMemoryDirectionIn, 524288, &b->buffer); Create an OSAction to be used as transfer complete callback: ret = CreateActionReadComplete(0, &b->action); Start the I/O request: ret = ivars->pipe->AsyncIO(b->buffer, 524288, b->action, 0); At that point, I see that instead of starting a single 524288 bytes transfer, it starts 14 36864 bytes transfers and a 8192 bytes one. Which will absolutely not work with the USB device. Is there a transfer size limit I am not aware of?
Replies
0
Boosts
0
Views
764
Activity
Jul ’22
USBSerialDriverKit CH340g Not Appearing in /dev
I have a CH340g connected to my M1 MacBook Air running the latest Big Sur 11.2.3. It appeared only one time in /dev, and now will not re-appear. I've tried plugging it in to both ports, unplugging everything except for the CH340g, and also kextunload, kextload on AppleUSBSerial.kext. It does not appear in /dev Has anyone had any luck with this device? Or perhaps some advice?
Replies
6
Boosts
1
Views
5.9k
Activity
Jul ’22
Cannot include com.apple.developer.driverkit.transport.usb into provision profile
We requested com.apple.developer.driverkit.transport.usb entitlement a few days ago and it looks like it was granted since we see(can select) it at: App Id -> Additional Capabilities Tab -> DriverKit USB Transport - Vendor ID. We tried to choose both options at Additional Entitlements page Default and Driver Kit and System Extension Template for **** Mac Dev. Generated profile displays DriverKit USB Transport - Vendor ID in Enabled Capabilities in browser. However downloaded profile doesn't include com.apple.developer.driverkit.transport.usb. As a result our Driver fails to start and in Console we see: Driver: Unsatisfied entitlements: com.apple.developer.driverkit.transport.usb /Library/SystemExtensions/675FA894-8985-4D86-B0FF-B892B9AEA27B/Driver.dext/Driver signature not valid: -67671 BTW, we tried to modify existing profile and create a new one. Did we miss something? Is any way to check entitlement status with Apple support?
Replies
3
Boosts
2
Views
2.3k
Activity
Jul ’22
DriverKit entitlement request ETA
Earlier this week, I requested a DriverKit entitlement (#801892899). Just wanted to see if there was an expected ETA on such requests. Thank you, Neal
Replies
2
Boosts
1
Views
1.2k
Activity
Jun ’22
DriverKit by Third Party question
I understand that a Company’s hardware vendor ID is required for requesting Entitlements for DriverKit. Does this means DriverKit is only targeted for hardware vendors? Does Apple allows third party (not the hardware vendor) entitlements for DriverKit? Our company is exploring the development of generic open source drivers on iPad for label printers such as those by Zebra. Is this allowed?
Replies
1
Boosts
0
Views
1.6k
Activity
Jun ’22
IOUSBHostDevice fails and throws error in sandboxed app
I get the following errors when running the code below in a sandboxed app (it works when not sandboxed) and I have the com.apple.security.device.usb entitlement enabled. Error:Unable to open io_service_t object and create user client. with reason: IOServiceOpen failed. Error Domain=IOUSBHostErrorDomain Code=-536870174 "Failed to create IOUSBHostObject." UserInfo={NSLocalizedRecoverySuggestion=, NSLocalizedDescription=Failed to create IOUSBHostObject., NSLocalizedFailureReason=IOServiceOpen failed.} import Foundation import IOKit import IOKit.usb import IOKit.usb.IOUSBLib import IOKit.serial import IOUSBHost import IOUSBHost.IOUSBHostInterface class USBService {     enum UsbError: Error {         case noDeviceMatched         case deviceCriteriaNotUnique     }          init() {              }          func getDevice(idVendor: Int?, idProduct: Int?) throws {         let deviceSearchPattern: [IOUSBHostMatchingPropertyKey : Int] = [                    .vendorID : idVendor!,                    .productID : idProduct!,                ]                let deviceDomain = [ "IOProviderClass": "IOUSBHostDevice" ]                let searchRequest = (deviceSearchPattern as NSDictionary).mutableCopy() as! NSMutableDictionary                searchRequest.addEntries(from: deviceDomain)         let service = IOServiceGetMatchingService(kIOMasterPortDefault, searchRequest)         guard service != 0 else {                    throw UsbError.noDeviceMatched         }                       let device = try IOUSBHostDevice.init(__ioService: service, options: [], queue: nil, interestHandler: nil)                  print(device.deviceDescriptor?.pointee.idProduct)     } }
Replies
3
Boosts
0
Views
2.3k
Activity
May ’22
Would use usbdriverkit to monitoring all usb device action
I have a requirement where I need to monitor writes/reads from arbitrary USB devices. Can I do it with USBDriverKit?
Replies
0
Boosts
0
Views
1.3k
Activity
May ’22
The laptop's USB type C ver3.1 display port is connected to the iPhone's lightning interface
When connecting the USB type C ver3.1 display port output of a laptop to the lightning interface of an iPhone, how could I use the SW API on the iPhone to capture the image output of the laptop screen?
Replies
0
Boosts
0
Views
582
Activity
Mar ’22
How to share data between iPad app and macOS app using thunderbolt
Hi folks, I'm developing a real-time audio engine that runs on macOS but has also an iPad version that enables control of the macOS app using a touch screen. I want to share control data between the iPad app and the macOS app without using Wi-Fi. As a real-time thing, it would be great to be able to use a thunderbolt cable. Is there a way of doing it? Where can I find more info? Thanks for your time.
Replies
0
Boosts
0
Views
721
Activity
Mar ’22
Update discontinues software driver to Monterey or Big Sur
How hard would it be to use a Catalina driver for an audio interface to create a driver for Monterey or Big Sur? Tascam discontinued updates for my two interfaces (same models, used as aggregate device)
Replies
2
Boosts
0
Views
606
Activity
Mar ’22
USB Live Stream not working in osx 12
Dear Apple Expert, Our project uses libUSB library to interact with a USB based camera device. Our application is working fine in macOS Mojave (10.14.6 ). When the new MacOS 12 beta version was made available, we tested our code. But when we try to claim the interface via "CreateInterfaceIterator" API, we are getting "kIOReturnExclusiveAccess" error code and ultimately our application fails. The failure is observed in both libUSB versions 1.0.23 and 1.0.24. Could you help us by explaining if there is change in the new OS with respect to access to USB devices?
Replies
1
Boosts
0
Views
1.9k
Activity
Mar ’22
Macbook Pro Montery Lenovo ThinkPad USB-C docking
audio port not working on Lenovo docking station. Sound setting only options is "Lenovo-usb-audio". And this is not working.
Replies
0
Boosts
0
Views
772
Activity
Mar ’22
Gravity Nova Usb C hub not showing ethernet connection
I have purchased the USB C hub by gravity and it has the ethernet port which is not appearing in my network settings. I have tried to see if it could be added but cant find anything. I have heard people talk about drivers but not sure what drivers or even if i need them. They dont say anything on the gravity website. Can anyone help?
Replies
1
Boosts
0
Views
942
Activity
Feb ’22