41 #ifndef YOCTO_BUZZER_H 42 #define YOCTO_BUZZER_H 55 #define Y_FREQUENCY_INVALID (YAPI_INVALID_DOUBLE) 56 #define Y_VOLUME_INVALID (YAPI_INVALID_UINT) 57 #define Y_PLAYSEQSIZE_INVALID (YAPI_INVALID_UINT) 58 #define Y_PLAYSEQMAXSIZE_INVALID (YAPI_INVALID_UINT) 59 #define Y_PLAYSEQSIGNATURE_INVALID (YAPI_INVALID_UINT) 60 #define Y_COMMAND_INVALID (YAPI_INVALID_STRING) 73 #pragma option push -w-8022 117 int set_frequency(
double newval);
119 {
return this->set_frequency(newval); }
128 double get_frequency(
void);
131 {
return this->get_frequency(); }
140 int get_volume(
void);
143 {
return this->get_volume(); }
154 int set_volume(
int newval);
156 {
return this->set_volume(newval); }
165 int get_playSeqSize(
void);
168 {
return this->get_playSeqSize(); }
177 int get_playSeqMaxSize(
void);
180 {
return this->get_playSeqMaxSize(); }
192 int get_playSeqSignature(
void);
195 {
return this->get_playSeqSignature(); }
197 string get_command(
void);
200 {
return this->get_command(); }
202 int set_command(
const string& newval);
204 {
return this->set_command(newval); }
233 static YBuzzer* FindBuzzer(
string func);
251 virtual int sendCommand(
string command);
262 virtual int addFreqMoveToPlaySeq(
int freq,
int msDelay);
273 virtual int addPulseToPlaySeq(
int freq,
int msDuration);
285 virtual int addVolMoveToPlaySeq(
int volume,
int msDuration);
300 virtual int addNotesToPlaySeq(
string notes);
310 virtual int startPlaySeq(
void);
318 virtual int stopPlaySeq(
void);
326 virtual int resetPlaySeq(
void);
334 virtual int oncePlaySeq(
void);
346 virtual int pulse(
int frequency,
int duration);
358 virtual int freqMove(
int frequency,
int duration);
370 virtual int volumeMove(
int volume,
int duration);
385 virtual int playNotes(
string notes);
400 {
return this->nextBuzzer();}
411 static YBuzzer* FirstBuzzer(
void);
void(* YBuzzerValueCallback)(YBuzzer *func, const string &functionValue)
static const string COMMAND_INVALID
YBuzzer * yFirstBuzzer(void)
YBuzzer * yFindBuzzer(const string &func)
#define YAPI_INVALID_UINT
static YBuzzer * FindBuzzer(string func)
virtual int _parseAttr(YJSONObject *json_val)
YBuzzerValueCallback _valueCallbackBuzzer
ROSLIB_DECL std::string command(const std::string &cmd)
int setFrequency(double newval)
int playSeqSignature(void)
static YBuzzer * FirstBuzzer(void)
static YBuzzer * Find(string func)
virtual int registerValueCallback(YFunctionValueCallback callback)
static const double FREQUENCY_INVALID
#define YOCTO_CLASS_EXPORT
int setVolume(int newval)
static YBuzzer * First(void)
int setCommand(const string &newval)
virtual int _invokeValueCallback(string value)