niimaqdx: only query attributes that are actually readable

This commit is contained in:
Joshua M. Doe 2013-01-29 14:07:34 -05:00
parent e9755b0b00
commit b7e1085885

View File

@ -963,13 +963,17 @@ listAttributes (IMAQdxSession session)
IMAQdxAttributeInformation *info = attributeInfoArray + i; IMAQdxAttributeInformation *info = attributeInfoArray + i;
g_assert (info); g_assert (info);
rval = if (info->Readable) {
IMAQdxGetAttribute (session, info->Name, IMAQdxValueTypeString, rval =
attributeString); IMAQdxGetAttribute (session, info->Name, IMAQdxValueTypeString,
if (rval != IMAQdxErrorSuccess) { attributeString);
GST_WARNING ("Failed to read value of attribute %s", info->Name); if (rval != IMAQdxErrorSuccess) {
continue; GST_WARNING ("Failed to read value of attribute %s", info->Name);
} continue;
}
} else
attributeString[0] = 0;
printf ("%s, %s/%s, %s, %s\n", info->Name, info->Readable ? "R" : "-", printf ("%s, %s/%s, %s, %s\n", info->Name, info->Readable ? "R" : "-",
info->Writable ? "W" : "-", attributeTypeStrings[info->Type], info->Writable ? "W" : "-", attributeTypeStrings[info->Type],
attributeString); attributeString);