Skip to content

Commit bd8001b

Browse files
committed
Change isAvailable() to return false if numEnums=0; this is what other SDKs do
1 parent e701006 commit bd8001b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

aravisApp/src/arvFeature.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ bool arvFeature::isImplemented() {
3131
}
3232

3333
bool arvFeature::isAvailable() {
34+
// Other SDKs return isAvailable=false for enum features with no available enum values, and ADGenICam relies on this.
35+
// Return false if numEnums is 0.
36+
if (ARV_IS_GC_ENUMERATION(mNode)) {
37+
guint numEnums;
38+
ArvGcEnumeration *enumeration = (ARV_GC_ENUMERATION (mNode));
39+
arv_gc_enumeration_dup_available_int_values(enumeration, &numEnums, NULL);
40+
if (numEnums == 0) {
41+
printf("arvFeature::isAvailable() returning false for %s because numEnums=0\n", mFeatureName.c_str());
42+
return false;
43+
}
44+
}
3445
return arv_gc_feature_node_is_available(ARV_GC_FEATURE_NODE(mNode), NULL);
3546
}
3647

0 commit comments

Comments
 (0)