|
[Playerstage-commit] code/player/libplayercore Makefile.am, 1.16,
1.17 device.cc, 1.18, 1.19 devicetable.cc, 1.17,
1.18 interface_util.c, 1.1, 1.2 interface_util.h, 1.4,
1.5 player.h, 1.127, 1.128
From: Brian Gerkey <gerkey@us...> - 2007-03-14 09:41
|
Update of /cvsroot/playerstage/code/player/libplayercore
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24782/libplayercore
Modified Files:
Makefile.am device.cc devicetable.cc interface_util.c
interface_util.h player.h
Log Message:
applied patches 1671417, 1660887, 1660260
Index: player.h
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayercore/player.h,v
retrieving revision 1.127
retrieving revision 1.128
diff -C2 -d -r1.127 -r1.128
*** player.h 6 Mar 2007 22:08:48 -0000 1.127
--- player.h 14 Mar 2007 16:41:51 -0000 1.128
***************
*** 966,970 ****
uint32_t data_count;
/** raw data */
! uint8_t data[PLAYER_AUDIO_WAV_BUFFER_SIZE];
/** Raw data format */
uint32_t format;
--- 966,970 ----
uint32_t data_count;
/** raw data */
! uint8_t *data;
/** Raw data format */
uint32_t format;
***************
*** 2714,2718 ****
a) median filter - PLAYER_LASER_FILTER_MEDIAN, no parameters
b) edge filter - PLAYER_LASER_FILTER_EDGE, no parameters
! c) range filter - PLAYER_LASER_FILTER_RANGE
p1 = BottomLimit (700-3000 in mm), p2 = TopLimit (700-3000 in mm)
d) mean filter - PLAYER_LASER_FILTER_MEAN
--- 2714,2718 ----
a) median filter - PLAYER_LASER_FILTER_MEDIAN, no parameters
b) edge filter - PLAYER_LASER_FILTER_EDGE, no parameters
! c) range filter - PLAYER_LASER_FILTER_RANGE
p1 = BottomLimit (700-3000 in mm), p2 = TopLimit (700-3000 in mm)
d) mean filter - PLAYER_LASER_FILTER_MEAN
Index: interface_util.c
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayercore/interface_util.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** interface_util.c 14 Feb 2007 22:59:39 -0000 1.1
--- interface_util.c 14 Mar 2007 16:41:51 -0000 1.2
***************
*** 27,30 ****
--- 27,32 ----
/* this array lists the interfaces that Player knows how to load
+ * It is important that this list is kept in strict numerical order
+ * with respect to the interface numeric codes.
*
* NOTE: the last element must be NULL
***************
*** 32,87 ****
static player_interface_t interfaces[] = {
{PLAYER_NULL_CODE, PLAYER_NULL_STRING},
! {PLAYER_LOG_CODE, PLAYER_LOG_STRING},
{PLAYER_LASER_CODE, PLAYER_LASER_STRING},
{PLAYER_BLOBFINDER_CODE, PLAYER_BLOBFINDER_STRING},
! {PLAYER_SPEECH_CODE, PLAYER_SPEECH_STRING},
{PLAYER_AUDIO_CODE, PLAYER_AUDIO_STRING},
- {PLAYER_AUDIODSP_CODE, PLAYER_AUDIODSP_STRING},
{PLAYER_FIDUCIAL_CODE, PLAYER_FIDUCIAL_STRING},
! {PLAYER_PTZ_CODE, PLAYER_PTZ_STRING},
! {PLAYER_GRIPPER_CODE, PLAYER_GRIPPER_STRING},
! {PLAYER_POWER_CODE, PLAYER_POWER_STRING},
{PLAYER_BUMPER_CODE, PLAYER_BUMPER_STRING},
! {PLAYER_AIO_CODE, PLAYER_AIO_STRING},
{PLAYER_DIO_CODE, PLAYER_DIO_STRING},
! {PLAYER_POSITION1D_CODE, PLAYER_POSITION1D_STRING},
! {PLAYER_POSITION2D_CODE, PLAYER_POSITION2D_STRING},
! {PLAYER_POSITION3D_CODE, PLAYER_POSITION3D_STRING},
! {PLAYER_SONAR_CODE, PLAYER_SONAR_STRING},
! {PLAYER_WIFI_CODE, PLAYER_WIFI_STRING},
{PLAYER_IR_CODE, PLAYER_IR_STRING},
{PLAYER_WAVEFORM_CODE, PLAYER_WAVEFORM_STRING},
{PLAYER_LOCALIZE_CODE, PLAYER_LOCALIZE_STRING},
{PLAYER_MCOM_CODE, PLAYER_MCOM_STRING},
- {PLAYER_SIMULATION_CODE, PLAYER_SIMULATION_STRING},
{PLAYER_SOUND_CODE, PLAYER_SOUND_STRING},
{PLAYER_AUDIOMIXER_CODE, PLAYER_AUDIOMIXER_STRING},
! {PLAYER_TRUTH_CODE, PLAYER_TRUTH_STRING},
! {PLAYER_GPS_CODE, PLAYER_GPS_STRING},
! {PLAYER_HEALTH_CODE, PLAYER_HEALTH_STRING},
{PLAYER_SIMULATION_CODE, PLAYER_SIMULATION_STRING},
{PLAYER_BLINKENLIGHT_CODE, PLAYER_BLINKENLIGHT_STRING},
- {PLAYER_LASER_CODE, PLAYER_LASER_STRING},
- {PLAYER_CAMERA_CODE, PLAYER_CAMERA_STRING},
- {PLAYER_BLOBFINDER_CODE, PLAYER_BLOBFINDER_STRING},
{PLAYER_NOMAD_CODE, PLAYER_NOMAD_STRING},
! {PLAYER_ENERGY_CODE, PLAYER_ENERGY_STRING},
{PLAYER_MAP_CODE, PLAYER_MAP_STRING},
{PLAYER_PLANNER_CODE, PLAYER_PLANNER_STRING},
{PLAYER_JOYSTICK_CODE, PLAYER_JOYSTICK_STRING},
{PLAYER_SPEECH_RECOGNITION_CODE, PLAYER_SPEECH_RECOGNITION_STRING},
{PLAYER_OPAQUE_CODE, PLAYER_OPAQUE_STRING},
{PLAYER_ACTARRAY_CODE, PLAYER_ACTARRAY_STRING},
{PLAYER_LIMB_CODE, PLAYER_LIMB_STRING},
{PLAYER_GRAPHICS2D_CODE, PLAYER_GRAPHICS2D_STRING},
- {PLAYER_GRAPHICS3D_CODE, PLAYER_GRAPHICS3D_STRING},
{PLAYER_RFID_CODE, PLAYER_RFID_STRING},
{PLAYER_WSN_CODE, PLAYER_WSN_STRING},
! {PLAYER_POINTCLOUD3D_CODE, PLAYER_POINTCLOUD3D_STRING},
{PLAYER_IMU_CODE, PLAYER_IMU_STRING},
{0,NULL}
};
/*
* looks through the array of available interfaces for one which the given
* name. if found, interface is filled out (the caller must provide storage)
--- 34,120 ----
static player_interface_t interfaces[] = {
{PLAYER_NULL_CODE, PLAYER_NULL_STRING},
! {PLAYER_PLAYER_CODE, PLAYER_PLAYER_STRING},
! {PLAYER_POWER_CODE, PLAYER_POWER_STRING},
! {PLAYER_GRIPPER_CODE, PLAYER_GRIPPER_STRING},
! {PLAYER_POSITION2D_CODE, PLAYER_POSITION2D_STRING},
! {PLAYER_SONAR_CODE, PLAYER_SONAR_STRING},
{PLAYER_LASER_CODE, PLAYER_LASER_STRING},
{PLAYER_BLOBFINDER_CODE, PLAYER_BLOBFINDER_STRING},
! {PLAYER_PTZ_CODE, PLAYER_PTZ_STRING},
{PLAYER_AUDIO_CODE, PLAYER_AUDIO_STRING},
{PLAYER_FIDUCIAL_CODE, PLAYER_FIDUCIAL_STRING},
! {0xFFFF, "nointerf11"},
! {PLAYER_SPEECH_CODE, PLAYER_SPEECH_STRING},
! {PLAYER_GPS_CODE, PLAYER_GPS_STRING},
{PLAYER_BUMPER_CODE, PLAYER_BUMPER_STRING},
! {PLAYER_TRUTH_CODE, PLAYER_TRUTH_STRING},
! {0xFFFF, "nointerf16"},
! {0xFFFF, "nointerf17"},
! {0xFFFF, "nointerf18"},
! {0xFFFF, "nointerf19"},
{PLAYER_DIO_CODE, PLAYER_DIO_STRING},
! {PLAYER_AIO_CODE, PLAYER_AIO_STRING},
{PLAYER_IR_CODE, PLAYER_IR_STRING},
+ {PLAYER_WIFI_CODE, PLAYER_WIFI_STRING},
{PLAYER_WAVEFORM_CODE, PLAYER_WAVEFORM_STRING},
{PLAYER_LOCALIZE_CODE, PLAYER_LOCALIZE_STRING},
{PLAYER_MCOM_CODE, PLAYER_MCOM_STRING},
{PLAYER_SOUND_CODE, PLAYER_SOUND_STRING},
+ {PLAYER_AUDIODSP_CODE, PLAYER_AUDIODSP_STRING},
{PLAYER_AUDIOMIXER_CODE, PLAYER_AUDIOMIXER_STRING},
! {PLAYER_POSITION3D_CODE, PLAYER_POSITION3D_STRING},
{PLAYER_SIMULATION_CODE, PLAYER_SIMULATION_STRING},
+ {0xFFFF, "nointerf32"},
{PLAYER_BLINKENLIGHT_CODE, PLAYER_BLINKENLIGHT_STRING},
{PLAYER_NOMAD_CODE, PLAYER_NOMAD_STRING},
! {0xFFFF, "nointerf35"},
! {0xFFFF, "nointerf36"},
! {0xFFFF, "nointerf37"},
! {0xFFFF, "nointerf38"},
! {0xFFFF, "nointerf39"},
! {PLAYER_CAMERA_CODE, PLAYER_CAMERA_STRING},
! {0xFFFF, "nointerf40"},
{PLAYER_MAP_CODE, PLAYER_MAP_STRING},
+ {0xFFFF, "nointerf41"},
{PLAYER_PLANNER_CODE, PLAYER_PLANNER_STRING},
+ {PLAYER_LOG_CODE, PLAYER_LOG_STRING},
+ {PLAYER_ENERGY_CODE, PLAYER_ENERGY_STRING},
+ {0xFFFF, "nointerf42"},
+ {0xFFFF, "nointerf43"},
{PLAYER_JOYSTICK_CODE, PLAYER_JOYSTICK_STRING},
{PLAYER_SPEECH_RECOGNITION_CODE, PLAYER_SPEECH_RECOGNITION_STRING},
{PLAYER_OPAQUE_CODE, PLAYER_OPAQUE_STRING},
+ {PLAYER_POSITION1D_CODE, PLAYER_POSITION1D_STRING},
{PLAYER_ACTARRAY_CODE, PLAYER_ACTARRAY_STRING},
{PLAYER_LIMB_CODE, PLAYER_LIMB_STRING},
{PLAYER_GRAPHICS2D_CODE, PLAYER_GRAPHICS2D_STRING},
{PLAYER_RFID_CODE, PLAYER_RFID_STRING},
{PLAYER_WSN_CODE, PLAYER_WSN_STRING},
! {PLAYER_GRAPHICS3D_CODE, PLAYER_GRAPHICS3D_STRING},
! {PLAYER_HEALTH_CODE, PLAYER_HEALTH_STRING},
{PLAYER_IMU_CODE, PLAYER_IMU_STRING},
+ {PLAYER_POINTCLOUD3D_CODE, PLAYER_POINTCLOUD3D_STRING},
{0,NULL}
};
/*
+ * A string table of the message types, used to print type strings in error
+ * messages instead of type codes.
+ * Must be kept in numerical order with respect to the numeric values of the
+ * PLAYER_MSGTYPE_ #defines.
+ */
+ static char* msgTypeStrTable[7]=
+ {
+ "", // nothing
+ "data", // PLAYER_MSGTYPE_DATA
+ "command", // PLAYER_MSGTYPE_CMD
+ "request", // PLAYER_MSGTYPE_REQ
+ "resp_ack", // PLAYER_MSGTYPE_RESP_ACK
+ "sync", // PLAYER_MSGTYPE_SYNCH
+ "resp_nack", // PLAYER_MSGTYPE_RESP_NACK
+
+ };
+
+ /*
* looks through the array of available interfaces for one which the given
* name. if found, interface is filled out (the caller must provide storage)
***************
*** 143,144 ****
--- 176,236 ----
return 0;
}
+
+ /*
+ * Returns the name of an interface given its code. The result string must
+ * not be altered.
+ */
+ const char* interf_to_str(uint16_t code)
+ {
+ // static char unknownstring[15];
+ if (code < sizeof(interfaces))
+ {
+ if (interfaces[code].interf != 0xFFFF)
+ return interfaces[code].name;
+ }
+ // snprintf (unknownstring, 15, "unknown[%d]", code);
+ return "unknown";
+ }
+
+ /*
+ * Returns the code for an interface, given a string.
+ */
+ uint16_t
+ str_to_interf(const char *name)
+ {
+ unsigned int ii;
+ for(ii=0; interfaces[ii].interf; ii++)
+ {
+ if(!strcmp(name, interfaces[ii].name))
+ return interfaces[ii].interf;
+ }
+ return 0xFFFF;
+ }
+
+ /*
+ * Returns the name of a message type given its code. The result string must
+ * not be altered.
+ */
+ const char* msgtype_to_str(uint8_t code)
+ {
+ // static char unknownstring[13];
+ if (code > 0 && code < 7)
+ return msgTypeStrTable[code];
+ // snprintf (unknownstring, 15, "unknown[%d]", code);
+ return "unknown";
+ }
+
+ /*
+ * Returns the code for a message type, given a string.
+ */
+ uint8_t
+ str_to_msgtype(const char *name)
+ {
+ unsigned int ii;
+ for(ii=1; ii < 7; ii++)
+ {
+ if(!strcmp(name, msgTypeStrTable[ii]))
+ return ii;
+ }
+ return 0xFF;
+ }
Index: interface_util.h
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayercore/interface_util.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** interface_util.h 14 Feb 2007 22:59:39 -0000 1.4
--- interface_util.h 14 Mar 2007 16:41:51 -0000 1.5
***************
*** 1,7 ****
/*
* Player - One Hell of a Robot Server
! * Copyright (C) 2000
* Brian Gerkey, Kasper Stoy, Richard Vaughan, & Andrew Howard
! *
*
* This program is free software; you can redistribute it and/or modify
--- 1,7 ----
/*
* Player - One Hell of a Robot Server
! * Copyright (C) 2000
* Brian Gerkey, Kasper Stoy, Richard Vaughan, & Andrew Howard
! *
*
* This program is free software; you can redistribute it and/or modify
***************
*** 31,35 ****
// available interfaces are stored in an array of these, defined in
// interface_util.c
! typedef struct
{
uint16_t interf;
--- 31,35 ----
// available interfaces are stored in an array of these, defined in
// interface_util.c
! typedef struct
{
uint16_t interf;
***************
*** 37,41 ****
} player_interface_t;
! /*
* looks through the array of available interfaces for one which the given
* name. if found, interface is filled out (the caller must provide storage)
--- 37,41 ----
} player_interface_t;
! /*
* looks through the array of available interfaces for one which the given
* name. if found, interface is filled out (the caller must provide storage)
***************
*** 44,48 ****
int lookup_interface(const char* name, player_interface_t* interface);
! /*
* looks through the array of available interfaces for one which the given
* code. if found, interface is filled out (the caller must provide storage)
--- 44,48 ----
int lookup_interface(const char* name, player_interface_t* interface);
! /*
* looks through the array of available interfaces for one which the given
* code. if found, interface is filled out (the caller must provide storage)
***************
*** 60,63 ****
--- 60,91 ----
lookup_interface_name(unsigned int startpos, int code);
+ /*
+ * Returns the name of an interface given its code. The result string must
+ * not be altered.
+ */
+ const char*
+ interf_to_str(uint16_t code);
+
+ /*
+ * Returns the code for an interface, given a string. If the name is not found,
+ * 0xFFFF is returned.
+ */
+ uint16_t
+ str_to_interf(const char *name);
+
+ /*
+ * Returns the name of a message type given its code. The result string must
+ * not be altered.
+ */
+ const char*
+ msgtype_to_str(uint8_t code);
+
+ /*
+ * Returns the code for a message type, given a string. If the name is not
+ * found, 0xFF is returned.
+ */
+ uint8_t
+ str_to_msgtype(const char *name);
+
#ifdef __cplusplus
}
Index: Makefile.am
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayercore/Makefile.am,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** Makefile.am 14 Feb 2007 22:59:39 -0000 1.16
--- Makefile.am 14 Mar 2007 16:41:51 -0000 1.17
***************
*** 10,14 ****
CLEANFILES = playerconfig.h playercore.pc playererror.pc
! lib_LTLIBRARIES = libplayererror.la libplayercore.la
libplayercore_la_SOURCES = driver.cc driver.h \
--- 10,14 ----
CLEANFILES = playerconfig.h playercore.pc playererror.pc
! lib_LTLIBRARIES = libplayererror.la libplayerutils.la libplayercore.la
libplayercore_la_SOURCES = driver.cc driver.h \
***************
*** 20,33 ****
message.h message.cc \
wallclocktime.cc wallclocktime.h playertime.h \
- interface_util.c interface_util.h \
plugins.cc plugins.h \
globals.cc globals.h \
addr_util.c addr_util.h
! libplayercore_la_LDFLAGS = $(PLAYER_VERSION_INFO) -rpath $(libdir) $(top_builddir)/libplayercore/libplayererror.la
! libplayercore_la_DEPENDENCIES = $(top_builddir)/libplayercore/libplayererror.la
libplayererror_la_SOURCES = error.h error.c
libplayererror_la_LDFLAGS = $(PLAYER_VERSION_INFO) -rpath $(libdir)
coreincludedir = $(includedir)/player-2.0/libplayercore
coreinclude_HEADERS = configfile.h \
--- 20,35 ----
message.h message.cc \
wallclocktime.cc wallclocktime.h playertime.h \
plugins.cc plugins.h \
globals.cc globals.h \
addr_util.c addr_util.h
! libplayercore_la_LDFLAGS = $(PLAYER_VERSION_INFO) -rpath $(libdir) $(top_builddir)/libplayercore/libplayererror.la $(top_builddir)/libplayercore/libplayerutils.la
! libplayercore_la_DEPENDENCIES = $(top_builddir)/libplayercore/libplayererror.la $(top_builddir)/libplayercore/libplayerutils.la
libplayererror_la_SOURCES = error.h error.c
libplayererror_la_LDFLAGS = $(PLAYER_VERSION_INFO) -rpath $(libdir)
+ libplayerutils_la_SOURCES = interface_util.c interface_util.h
+ libplayerutils_la_LDFLAGS = $(PLAYER_VERSION_INFO) -rpath $(libdir)
+
coreincludedir = $(includedir)/player-2.0/libplayercore
coreinclude_HEADERS = configfile.h \
Index: devicetable.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayercore/devicetable.cc,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** devicetable.cc 2 Feb 2007 20:05:09 -0000 1.17
--- devicetable.cc 14 Mar 2007 16:41:51 -0000 1.18
***************
*** 1,7 ****
/*
* Player - One Hell of a Robot Server
! * Copyright (C) 2000
* Brian Gerkey, Kasper Stoy, Richard Vaughan, & Andrew Howard
! *
*
* This program is free software; you can redistribute it and/or modify
--- 1,7 ----
/*
* Player - One Hell of a Robot Server
! * Copyright (C) 2000
* Brian Gerkey, Kasper Stoy, Richard Vaughan, & Andrew Howard
! *
*
* This program is free software; you can redistribute it and/or modify
***************
*** 24,28 ****
* $Id$
*
! * class to keep track of available devices.
*/
#include <string.h> // for strncpy(3)
--- 24,28 ----
* $Id$
*
! * class to keep track of available devices.
*/
#include <string.h> // for strncpy(3)
***************
*** 70,81 ****
}
pthread_mutex_unlock(&mutex);
!
// destroy the mutex.
pthread_mutex_destroy(&mutex);
}
!
// this is the 'base' AddDevice method, which sets all the fields
Device*
! DeviceTable::AddDevice(player_devaddr_t addr,
Driver* driver, bool havelock)
{
--- 70,81 ----
}
pthread_mutex_unlock(&mutex);
!
// destroy the mutex.
pthread_mutex_destroy(&mutex);
}
!
// this is the 'base' AddDevice method, which sets all the fields
Device*
! DeviceTable::AddDevice(player_devaddr_t addr,
Driver* driver, bool havelock)
{
***************
*** 87,91 ****
// Check for duplicate entries (not allowed)
! for(thisentry = head,preventry=NULL; thisentry;
preventry=thisentry, thisentry=thisentry->next)
{
--- 87,91 ----
// Check for duplicate entries (not allowed)
! for(thisentry = head,preventry=NULL; thisentry;
preventry=thisentry, thisentry=thisentry->next)
{
***************
*** 97,101 ****
PLAYER_ERROR4("duplicate device addr %X:%d:%s:%d",
addr.host, addr.robot,
! lookup_interface_name(0, addr.interf),
addr.index);
if(!havelock)
--- 97,101 ----
PLAYER_ERROR4("duplicate device addr %X:%d:%s:%d",
addr.host, addr.robot,
! interf_to_str(addr.interf),
addr.index);
if(!havelock)
***************
*** 103,107 ****
return(NULL);
}
!
// Create a new device entry
thisentry = new Device(addr, driver);
--- 103,107 ----
return(NULL);
}
!
// Create a new device entry
thisentry = new Device(addr, driver);
***************
*** 120,124 ****
// find a device entry, based on addr, and return the pointer (or NULL
// on failure)
! Device*
DeviceTable::GetDevice(player_devaddr_t addr, bool lookup_remote)
{
--- 120,124 ----
// find a device entry, based on addr, and return the pointer (or NULL
// on failure)
! Device*
DeviceTable::GetDevice(player_devaddr_t addr, bool lookup_remote)
{
***************
*** 151,155 ****
}
assert(thisentry);
! strncpy(thisentry->drivername, "remote",
sizeof(thisentry->drivername));
}
--- 151,155 ----
}
assert(thisentry);
! strncpy(thisentry->drivername, "remote",
sizeof(thisentry->drivername));
}
***************
*** 194,199 ****
if(thisentry->Subscribe(NULL) != 0)
{
! PLAYER_ERROR2("initial subscription failed for device %d:%d",
! thisentry->addr.interf, thisentry->addr.index);
return(-1);
}
--- 194,199 ----
if(thisentry->Subscribe(NULL) != 0)
{
! PLAYER_ERROR2("initial subscription failed for device %s:%d",
! interf_to_str(thisentry->addr.interf), thisentry->addr.index);
return(-1);
}
***************
*** 207,211 ****
// might, for example, locate the device on a remote host (in a
// transport-dependent manner).
! void
DeviceTable::AddRemoteDriverFn(remote_driver_fn_t rdf, void* arg)
{
--- 207,211 ----
// might, for example, locate the device on a remote host (in a
// transport-dependent manner).
! void
DeviceTable::AddRemoteDriverFn(remote_driver_fn_t rdf, void* arg)
{
Index: device.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayercore/device.cc,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** device.cc 2 Feb 2007 20:05:09 -0000 1.18
--- device.cc 14 Mar 2007 16:41:51 -0000 1.19
***************
*** 1,7 ****
/*
* Player - One Hell of a Robot Server
! * Copyright (C) 2000
* Brian Gerkey, Kasper Stoy, Richard Vaughan, & Andrew Howard
! *
*
* This program is free software; you can redistribute it and/or modify
--- 1,7 ----
/*
* Player - One Hell of a Robot Server
! * Copyright (C) 2000
* Brian Gerkey, Kasper Stoy, Richard Vaughan, & Andrew Howard
! *
*
* This program is free software; you can redistribute it and/or modify
***************
*** 44,47 ****
--- 44,48 ----
#include <libplayercore/globals.h>
#include <libplayercore/error.h>
+ #include <libplayercore/interface_util.h>
// Constructor
***************
*** 70,74 ****
// necessary in the future.
this->len_queues = 2;
! this->queues = (MessageQueue**)calloc(this->len_queues,
sizeof(MessageQueue*));
assert(this->queues);
--- 71,75 ----
// necessary in the future.
this->len_queues = 2;
! this->queues = (MessageQueue**)calloc(this->len_queues,
sizeof(MessageQueue*));
assert(this->queues);
***************
*** 76,80 ****
! Device::~Device()
{
if(this->driver)
--- 77,81 ----
! Device::~Device()
{
if(this->driver)
***************
*** 108,113 ****
size_t tmp = this->len_queues;
this->len_queues *= 2;
! this->queues = (MessageQueue**)realloc(this->queues,
! (this->len_queues *
sizeof(MessageQueue*)));
memset(this->queues+tmp,0,(this->len_queues-tmp)*sizeof(MessageQueue*));
--- 109,114 ----
size_t tmp = this->len_queues;
this->len_queues *= 2;
! this->queues = (MessageQueue**)realloc(this->queues,
! (this->len_queues *
sizeof(MessageQueue*)));
memset(this->queues+tmp,0,(this->len_queues-tmp)*sizeof(MessageQueue*));
***************
*** 177,188 ****
if(!this->InQueue->Push(msg))
{
! PLAYER_ERROR4("tried to push %d/%d from/onto %d/%d\n",
! hdr->type, hdr->subtype,
! hdr->addr.interf, hdr->addr.index);
}
}
! void
Device::PutMsg(MessageQueue* resp_queue,
uint8_t type,
--- 178,189 ----
if(!this->InQueue->Push(msg))
{
! PLAYER_ERROR4("tried to push %s/%d from/onto %s/%d\n",
! msgtype_to_str(hdr->type), hdr->subtype,
! interf_to_str(hdr->addr.interf), hdr->addr.index);
}
}
! void
Device::PutMsg(MessageQueue* resp_queue,
uint8_t type,
***************
*** 195,199 ****
double t;
player_msghdr_t hdr;
!
// Fill in the current time if not supplied
--- 196,200 ----
double t;
player_msghdr_t hdr;
!
// Fill in the current time if not supplied
|
| Thread | Author | Date |
|---|---|---|
| [Playerstage-commit] code/player/libplayercore Makefile.am, 1.16, 1.17 device.cc, 1.18, 1.19 devicetable.cc, 1.17, 1.18 interface_util.c, 1.1, 1.2 interface_util.h, 1.4, 1.5 player.h, 1.127, 1.128 | Brian Gerkey <gerkey@us...> |