Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
a98643cb
Commit
a98643cb
authored
6 years ago
by
Hamish Willee
Committed by
Beat Küng
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add tune control docs as options
parent
629933d0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/systemcmds/tune_control/tune_control.cpp
+36
-16
36 additions, 16 deletions
src/systemcmds/tune_control/tune_control.cpp
with
36 additions
and
16 deletions
src/systemcmds/tune_control/tune_control.cpp
+
36
−
16
View file @
a98643cb
...
...
@@ -44,6 +44,8 @@
#include
<string.h>
#include
<unistd.h>
#include
<px4_module.h>
#include
<lib/tunes/tunes.h>
#include
<uORB/topics/tune_control.h>
...
...
@@ -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 <default tunes>] [-f <frequency>] [-d <duration>] [-s <strength>] [-m < melody>]
\n
"
"
\n
"
"
\t
-t <system tunes>
\t
Play a predefined system tune (default=1)
\n
"
"
\t
-f <frequency>
\t\t
Frequency from 0-20kHz
\n
"
"
\t
-d <duration>
\t\t
Duration of the tone in us
\n
"
"
\t
-s <strength>
\t\t
Strength of the tone between 0-100
\n
"
"
\t
-m <melody>
\t\t
Melody in a string form ex:
\"
MFT200e8a8a
\"\n
"
"
\n
"
"tune_control stop
\t\t
Stops 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
,
"<string> - 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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment