Unique identifier of a MIDI device

Hello,

I need to know what is a unique identifier of a MIDI device (source/destination). Important note: I want to get the same ID when a device is reconnected (unplugged and then plugged again).

The main candidate is kMIDIPropertyUniqueID property. But I don't know if it meets the requirement above or not. Additional question: is it always available for any endpoint?

Also there is kMIDIPropertyDeviceID property. What about it?

And one more option is just MIDIEndpointRef returned by MIDIGetSource or MIDIGetDestination.

So what is the proper way to get ID which persists between device reconnections?

Unique identifier of a MIDI device
 
 
Q