Arti3DPlayer / USBDeviceSwift

wrapper for IOKit.usb and IOKit.hid written on pure Swift that allows you convenient work with USB devices
MIT License
290 stars 55 forks source link

BSD Path of a mounted USB device #19

Open iboy opened 4 years ago

iboy commented 4 years ago

Hi, is it possible to get the BSD Path of a mounted USB device by using / adapting this code? I've researched various interconnected stackoverflow responses:

https://stackoverflow.com/questions/40008280/usb-device-path-in-swift/46319129#46319129 https://stackoverflow.com/questions/39003986/usb-connection-delegate-on-swift/39026607#39026607 https://stackoverflow.com/questions/34628464/how-to-implement-ioservicematchingcallback-in-swift/39662693

Some posts mention BSD path. I can't see a straightforward kUSB key for it, to add it.

Currently, app gets the path by associating it with a mount notification - but that fails when a device is already connected when the app launches.

Having access to the BSD path / mount path in USBDevice would be super useful?

Thanks,

Ian Grant