DACP uses albumsId and artistId too; so track id would not be enough (BTW how does Library_SetDevicePersistentId work?)
You can assign several uids to 1 track.
As for Library_SetDevicePersistentId:
1st parameter is track url.
2nd parameter is a type of uid.
You need to extend DeviceIdType enum, but please don't use 1,2,3,4 which are reserved by my plugins.
3d parameter is uid (actually any string)
You can read uid using Library_GetDevicePersistentId:
1st parameter is track url
2nd parameter is a uid type.
Also you can search tracks for uids using Library_FindDevicePersistentId:
1st parameter is an id type
2nd parameter is an array of ids.
3d parameter is a result of query with array of urls.