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; IMAQdxAttributeInformation *info = attributeInfoArray + i;
g_assert (info); g_assert (info);
if (info->Readable) {
rval = rval =
IMAQdxGetAttribute (session, info->Name, IMAQdxValueTypeString, IMAQdxGetAttribute (session, info->Name, IMAQdxValueTypeString,
attributeString); attributeString);
@ -970,6 +971,9 @@ listAttributes (IMAQdxSession session)
GST_WARNING ("Failed to read value of attribute %s", info->Name); GST_WARNING ("Failed to read value of attribute %s", info->Name);
continue; 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);