1

I am trying to build a software, in Swift 3, that reads the data of a specific device. I am using some parts of this and this source code.

Currently I am able to get name of the device, using the method func name() of the first code.

Based on this, the second code will hook the connection and say to me if the device change the status. But this code needs a VID and PID that the first code doesn't provide. It uses a different way to get a value, reading the buffer and searching for values. I don't know how to do this to get other values. I tried to search something on Google but I don't found anything in Swift/Objc. I have found some codes in other languages, but I can't understand how to implement it right now.

Thank you!

Pedro Paulo Amorim
  • 1,838
  • 2
  • 27
  • 50

1 Answers1

1

If you look USB Device Path In Swift at my answer. There's a swift playground that gives you among other things the vid and pid of usb-devices. It is made as a notification thing, but when you start the USBWatcherDelegate, it gives notification for devices already there.

Johan Velthuis
  • 280
  • 3
  • 13