libtunes: If default tune does not exist

return -EINVAL
This commit is contained in:
Simone Guscetti
2018-01-29 09:45:59 -05:00
committed by Daniel Agar
parent 915f728145
commit f63be6b055
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -78,7 +78,7 @@ void Tunes::config_tone()
_octave = _default_octave;
}
void Tunes::set_control(const tune_control_s &tune_control)
int Tunes::set_control(const tune_control_s &tune_control)
{
bool reset_playing_tune = false;
@@ -120,8 +120,10 @@ void Tunes::set_control(const tune_control_s &tune_control)
} else {
PX4_WARN("Tune ID not recognized.");
return -EINVAL;
}
return OK;
}
void Tunes::set_string(const char *string)
+2 -2
View File
@@ -65,10 +65,10 @@ public:
/**
* Set tune to be played.
*
* @param tune_control struct containig the uORB message
* @return return -EINVAL if the default tune does not exist.
*/
void set_control(const tune_control_s &tune_control);
int set_control(const tune_control_s &tune_control);
/**
* Parse a tune string, formatted with the syntax of the Microsoft GWBasic/QBasic.