mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-22 02:47:34 +08:00
Reworked MAVLink parameter interface to support new parameter storage, tested.
This commit is contained in:
@@ -193,6 +193,15 @@ param_for_index(unsigned index)
|
||||
return PARAM_INVALID;
|
||||
}
|
||||
|
||||
int
|
||||
param_get_index(param_t param)
|
||||
{
|
||||
if (handle_in_range(param))
|
||||
return (unsigned)param;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
const char *
|
||||
param_name(param_t param)
|
||||
{
|
||||
|
||||
@@ -102,6 +102,14 @@ __EXPORT unsigned param_count(void) __attribute__((const));
|
||||
*/
|
||||
__EXPORT param_t param_for_index(unsigned index) __attribute__((const));
|
||||
|
||||
/**
|
||||
* Look up the index of a parameter.
|
||||
*
|
||||
* @param param The parameter to obtain the index for.
|
||||
* @return The index, or -1 if the parameter does not exist.
|
||||
*/
|
||||
__EXPORT int param_get_index(param_t param) __attribute__((const));
|
||||
|
||||
/**
|
||||
* Obtain the name of a parameter.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user