diff --git a/libraries/AP_Param/AP_Param.cpp b/libraries/AP_Param/AP_Param.cpp index 3ae155c8b4..e5e97d2f11 100644 --- a/libraries/AP_Param/AP_Param.cpp +++ b/libraries/AP_Param/AP_Param.cpp @@ -825,7 +825,7 @@ AP_Param::find_group(const char *name, uint16_t vindex, ptrdiff_t group_offset, // Find a variable by name. // AP_Param * -AP_Param::find(const char *name, enum ap_var_type *ptype) +AP_Param::find(const char *name, enum ap_var_type *ptype, uint16_t *flags) { for (uint16_t i=0; i<_num_vars; i++) { uint8_t type = _var_info[i].type; @@ -840,6 +840,9 @@ AP_Param::find(const char *name, enum ap_var_type *ptype) } AP_Param *ap = find_group(name + len, i, 0, group_info, ptype); if (ap != nullptr) { + if (flags != nullptr) { + *flags = group_info->flags; + } return ap; } // we continue looking as we want to allow top level diff --git a/libraries/AP_Param/AP_Param.h b/libraries/AP_Param/AP_Param.h index 58e4d5b565..67ae8d5f76 100644 --- a/libraries/AP_Param/AP_Param.h +++ b/libraries/AP_Param/AP_Param.h @@ -252,10 +252,11 @@ public: /// If the variable has no name, it cannot be found by this interface. /// /// @param name The full name of the variable to be found. + /// @param flags If non-null will be filled with parameter flags /// @return A pointer to the variable, or nullptr if /// it does not exist. /// - static AP_Param * find(const char *name, enum ap_var_type *ptype); + static AP_Param * find(const char *name, enum ap_var_type *ptype, uint16_t *flags = nullptr); /// set a default value by name ///