Skip to content

Commit

Permalink
Change isAvailable() to return false if numEnums=0; this is what othe…
Browse files Browse the repository at this point in the history
…r SDKs do
  • Loading branch information
MarkRivers committed Sep 30, 2024
1 parent e701006 commit bd8001b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions aravisApp/src/arvFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ bool arvFeature::isImplemented() {
}

bool arvFeature::isAvailable() {
// Other SDKs return isAvailable=false for enum features with no available enum values, and ADGenICam relies on this.
// Return false if numEnums is 0.
if (ARV_IS_GC_ENUMERATION(mNode)) {
guint numEnums;
ArvGcEnumeration *enumeration = (ARV_GC_ENUMERATION (mNode));
arv_gc_enumeration_dup_available_int_values(enumeration, &numEnums, NULL);
if (numEnums == 0) {
printf("arvFeature::isAvailable() returning false for %s because numEnums=0\n", mFeatureName.c_str());
return false;
}
}
return arv_gc_feature_node_is_available(ARV_GC_FEATURE_NODE(mNode), NULL);
}

Expand Down

0 comments on commit bd8001b

Please sign in to comment.