Maybe one more question.
I was able to get RawUsbDevice using IOServiceAddMatchingNotification and now have basic stuff like VendorID, ProductID, SerialNo etc.
How to get bsd name for this object or even mount point like /Volumes/Kindle/ in Sandboxed app?
Earlier I was able to read bsd name using system profiler, but this particular data is not available when Sandbox is used.
I can read mount point using mountedVolumeURLsIncludingResourceValuesForKeys on NSFileManager but can't match mount point to specific RawUsbDevice gathered from IOKIt.
Post
Replies
Boosts
Views
Activity
Thank you very much - very helpful :)
I've already made some progress yesterday in terms of discovering devices.
I'll go further with this.
Ok so here is the whole idea.
Right now we have working code for that solution, but it isn't code compliant with AppStore
Here are some specs:
MacOS app available in AppStore - our current code is working without sandbox
App will be connecting with Kindle devices. Amazon currently is using both approaches - file system (older devices), MTP (new devices)
App needs to detect Kindle device - both types as described above
I have PoC for MTP solution using libmtp library, now looking for a solution for a generic Kindle
I need to read attached device serial number to identify it in our system
Ability to download/upload files from specific directory on device
So in general app is:
Listening if some usb devices are connecting
Checking if it is old type Kindle device using FS or new one using MTP
Reading serial number to identify device
Copying/deleting/reading files from documents
I've seen that there is for instance app called Commander One in AppStore which is working with USB and have most of the functions above. Only reading serial number is missing there.
I saw they are using IOKit somehow, but I'm not sure it is used for this.
For generic Kindle, right now we are using system_profiler SPUSBDataType -xml for detection
I would be happy to hear if you have a recommendation for APIs that are compatible with AppStore's policy.