Fawkes API Fawkes Development Version
qa_remote_beep.cpp
1
2/***************************************************************************
3 * qa_beep.cpp - Order beep via remote b
4 *
5 * Created: Sun Apr 11 22:21:58 2010
6 * Copyright 2006-2010 Tim Niemueller [www.niemueller.de]
7 *
8 ****************************************************************************/
9
10/* This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. A runtime exception applies to
14 * this software (see LICENSE.GPL_WRE file mentioned below for details).
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Library General Public License for more details.
20 *
21 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22 */
23
24/// @cond QA
25
26#include <blackboard/remote.h>
27#include <interfaces/SwitchInterface.h>
28#include <utils/system/argparser.h>
29
30#include <cstdio>
31
32using namespace fawkes;
33
34int
35main(int argc, char **argv)
36{
37 ArgumentParser argp(argc, argv, "01f:d:");
38
39 BlackBoard * rbb = new RemoteBlackBoard("localhost", 1910);
41
42 if (argp.has_arg("1")) {
44 } else if (argp.has_arg("0")) {
46 } else if (argp.has_arg("d")) {
47 if (!argp.has_arg("f")) {
48 printf("Argument -d requires to have -f as well\n");
49 } else {
50 float d = argp.parse_float("d");
51 float f = argp.parse_float("f");
53 }
54 } else if (argp.has_arg("f")) {
55 float f = argp.parse_float("f");
57 }
58
59 rbb->close(si);
60 delete rbb;
61}
62
63/// @endcond
Parse command line arguments.
Definition: argparser.h:64
The BlackBoard abstract class.
Definition: blackboard.h:46
virtual Interface * open_for_reading(const char *interface_type, const char *identifier, const char *owner=NULL)=0
Open interface for reading.
virtual void close(Interface *interface)=0
Close interface.
unsigned int msgq_enqueue(Message *message, bool proxy=false)
Enqueue message at end of queue.
Definition: interface.cpp:915
Remote BlackBoard.
Definition: remote.h:50
DisableSwitchMessage Fawkes BlackBoard Interface Message.
EnableDurationMessage Fawkes BlackBoard Interface Message.
EnableSwitchMessage Fawkes BlackBoard Interface Message.
SetMessage Fawkes BlackBoard Interface Message.
SwitchInterface Fawkes BlackBoard Interface.
Fawkes library namespace.