This feature allows the user to:
Feature related parameters |
XI_PRM_DEVICE_USER_ID |
DeviceUserID
Setting and getting the User ID:
// set name "left" to the camera
#define DEF_NAME "left"
xiSetParamString(h,XI_PRM_DEVICE_USER_ID,DEF_NAME,sizeof(DEF_NAME));
// check if the name is the same
char name[100]="";
xiGetParamString(h,XI_PRM_DEVICE_USER_ID,name,sizeof(name));
if (0==strcmp(name,DEF_NAME))
{
printf("Success of setting/getting User ID\n");
}
Opening the camera by User ID:
// open the camera by ID
char name[100]="left";
if (XI_OK == xiOpenDeviceBy(XI_OPEN_BY_USER_ID, name, &xiHandle))
{
// now the camera is opened and ready to work
}