Update of /cvsroot/playerstage/code/player/server/drivers/shell
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4552/server/drivers/shell
Modified Files:
Tag: release-2-0-patches
Makefile.am
Added Files:
Tag: release-2-0-patches
relay.cc
Log Message:
backported lots of stuff from HEAD
--- NEW FILE: relay.cc ---
/*
* Player - One Hell of a Robot Server
* Copyright (C) 2000 Brian Gerkey & Kasper Stoy
* [EMAIL PROTECTED] [EMAIL PROTECTED]
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
/*
* $Id: relay.cc,v 1.1.2.2 2006/06/07 16:12:53 gerkey Exp $
*/
/** @ingroup drivers */
/** @{ */
/** @defgroup driver_relay relay
* @brief General-purpose communications relay driver
The @p relay driver repeats all commands it recieves as data packets to all
subscribed clients.
@par Compile-time dependencies
- none
@par Provides
- opaque interface
@par Requires
- none
@par Configuration requests
@par Configuration file options
configuration file:
@verbatim
driver
(
name "relay"
provides ["opaque:0"]
)
@author Toby Collett
*/
/** @} */
#include <stdlib.h>
#include <sys/time.h>
#include <string.h>
// we'll use the C client facilities to connect to the remote server
#include <libplayercore/playercore.h>
class Relay:public Driver
{
public:
Relay(ConfigFile* cf, int section)
: Driver(cf, section, false,
PLAYER_MSGQUEUE_DEFAULT_MAXLEN,PLAYER_OPAQUE_CODE) {};
~Relay() {};
int Setup() {return 0;};
int Shutdown() {return 0;};
private:
// MessageHandler
int ProcessMessage (MessageQueue * resp_queue, player_msghdr * hdr, void *
data);
};
// initialization function
Driver*
Relay_Init( ConfigFile* cf, int section)
{
return((Driver*)(new Relay(cf, section)));
}
// a driver registration function
void
Relay_Register(DriverTable* table)
{
table->AddDriver("relay", Relay_Init);
}
int Relay::ProcessMessage (MessageQueue * resp_queue, player_msghdr * hdr, void
* data)
{
Publish(device_addr, NULL, PLAYER_MSGTYPE_DATA, hdr->subtype, data,
hdr->size);
return 0;
}
Index: Makefile.am
===================================================================
RCS file: /cvsroot/playerstage/code/player/server/drivers/shell/Makefile.am,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -C2 -d -r1.15 -r1.15.2.1
*** Makefile.am 12 Apr 2006 13:33:31 -0000 1.15
--- Makefile.am 7 Jun 2006 16:12:53 -0000 1.15.2.1
***************
*** 7,10 ****
--- 7,13 ----
noinst_LTLIBRARIES += libdummy.la
endif
+ if INCLUDE_RELAY
+ noinst_LTLIBRARIES += librelay.la
+ endif
AM_CPPFLAGS = -g3 -Wall -I$(top_srcdir)
***************
*** 14,17 ****
--- 17,23 ----
liblogfile_la_SOURCES = writelog.cc encode.h encode.cc \
readlog_time.h readlog_time.cc readlog.cc
+ librelay_la_SOURCES = relay.cc
+
+
liblogfile_la_LDFLAGS =
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit