Firmware
Functions
px4_cli.h File Reference

Helper methods for command-line parameters. More...

Go to the source code of this file.

Functions

int px4_get_parameter_value (const char *option, int &value)
 Parse a CLI argument to an integer. More...
 

Detailed Description

Helper methods for command-line parameters.

Function Documentation

§ px4_get_parameter_value()

int px4_get_parameter_value ( const char *  option,
int &  value 
)

Parse a CLI argument to an integer.

There are 2 valid formats:

  • 'p:<param_name>' in this case the parameter is loaded from an integer parameter
  • <int> an integer value, so just a string to integer conversion is done
    Parameters
    optionCLI argument
    valuereturned value
    Returns
    0 on success, -errno otherwise