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,6 +963,7 @@ listAttributes (IMAQdxSession session)
IMAQdxAttributeInformation *info = attributeInfoArray + i;
g_assert (info);
if (info->Readable) {
rval =
IMAQdxGetAttribute (session, info->Name, IMAQdxValueTypeString,
attributeString);
@ -970,6 +971,9 @@ listAttributes (IMAQdxSession session)
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" : "-",
info->Writable ? "W" : "-", attributeTypeStrings[info->Type],
attributeString);