diff --git a/src/systemcmds/tune_control/tune_control.cpp b/src/systemcmds/tune_control/tune_control.cpp index 74ddec7104..ef66941e76 100644 --- a/src/systemcmds/tune_control/tune_control.cpp +++ b/src/systemcmds/tune_control/tune_control.cpp @@ -44,6 +44,8 @@ #include #include +#include + #include #include @@ -62,22 +64,40 @@ extern "C" { static void usage() { - PX4_INFO( - "External tune control for testing.\n\n" - "For information about tune format/system tunes see:\n" - "https://github.com/PX4/Firmware/blob/master/src/lib/tunes/tune_definition.desc.\n\n" - "Usage:\n" - "tune_control play [-t ] [-f ] [-d ] [-s ] [-m < melody>]\n" - "\n" - "\t-t \tPlay a predefined system tune (default=1)\n" - "\t-f \t\tFrequency from 0-20kHz\n" - "\t-d \t\tDuration of the tone in us\n" - "\t-s \t\tStrength of the tone between 0-100\n" - "\t-m \t\tMelody in a string form ex: \"MFT200e8a8a\"\n" - "\n" - "tune_control stop \t\tStops playback, useful for repeated tunes\n" - ); + PRINT_MODULE_DESCRIPTION( + R"DESCR_STR( +### Description + +Command-line tool to control & test the (external) tunes. + +Tunes are used to provide audible notification and warnings (e.g. when the system arms, gets position lock, etc.). +The tool requires that a driver is running that can handle the tune_control uorb topic. + +Information about the tune format and predefined system tunes can be found here: +https://github.com/PX4/Firmware/blob/master/src/lib/tunes/tune_definition.desc + +### Examples + +Play system tune #2: + + tune_control play -t 2 + + +)DESCR_STR"); + + + PRINT_MODULE_USAGE_NAME("tune_control", "system"); + PRINT_MODULE_USAGE_COMMAND_DESCR("play","Play system tune, tone, or melody"); + PRINT_MODULE_USAGE_PARAM_INT('t', 1, 1, 21, "Play predefined system tune", true); + PRINT_MODULE_USAGE_PARAM_INT('f', 0, 0, 22, "Frequency of tone in Hz (0-22kHz)", true); + PRINT_MODULE_USAGE_PARAM_INT('d', 1, 1, 21, "Duration of tone in us", true); + PRINT_MODULE_USAGE_PARAM_INT('s', 40, 0, 100, "Strength of tone (0-100)", true); + PRINT_MODULE_USAGE_PARAM_STRING('m', nullptr, " - e.g. \"MFT200e8a8a\"", + "Melody in string form", true); + PRINT_MODULE_USAGE_COMMAND_DESCR("libtest","Test library"); + PRINT_MODULE_USAGE_COMMAND_DESCR("stop","Stop playback (use for repeated tunes)"); + } static void publish_tune_control(tune_control_s &tune_control)