50 #if defined (PLAYER_STATIC)
51 #define PLAYERCORE_EXPORT
52 #elif defined (playercore_EXPORTS)
53 #define PLAYERCORE_EXPORT __declspec (dllexport)
55 #define PLAYERCORE_EXPORT __declspec (dllimport)
58 #define PLAYERCORE_EXPORT
61#include <libplayerinterface/player.h>
62#include <libplayercore/message.h>
64#define LOCALHOST_ADDR 16777343
158 bool threaded =
true);
192 double* timestamp = NULL,
193 bool threaded =
true);
209 return(((addr1.
host == addr2.
host) ||
210 ((addr1.
host == 0) && (addr2.
host == LOCALHOST_ADDR)) ||
211 ((addr1.
host == LOCALHOST_ADDR) && (addr2.
host == 0))) &&
Encapsulates a device (i.e., a driver bound to an interface)
Definition device.h:75
static bool MatchDeviceAddress(player_devaddr_t addr1, player_devaddr_t addr2)
Compare two addresses.
Definition device.h:201
Message * Request(QueuePointer &resp_queue, uint8_t type, uint8_t subtype, void *src, size_t deprecated, double *timestamp, bool threaded=true)
Make a request of another device.
pthread_mutex_t accessMutex
Mutex used to lock access, via Lock() and Unlock(), to device internals, like the list of subscribed ...
Definition device.h:242
Driver * driver
Pointer to the underlying driver.
Definition device.h:237
void PutMsg(QueuePointer &resp_queue, uint8_t type, uint8_t subtype, void *src, size_t deprecated, double *timestamp)
Send a message to this device.
QueuePointer * queues
Linked list of subscribed queues.
Definition device.h:231
QueuePointer InQueue
Pointer to the underlying driver's queue.
Definition device.h:228
size_t len_queues
Length of queues.
Definition device.h:234
void Lock(void)
Lock access to driver internals.
player_devaddr_t addr
Address for this device.
Definition device.h:221
Device * next
Next entry in the device table (this is a linked-list)
Definition device.h:218
void PutMsg(QueuePointer &resp_queue, player_msghdr_t *hdr, void *src, bool copy=true)
Send a message to this device (short form)
int Unsubscribe(QueuePointer &sub_queue)
Unsubscribe the given queue from this device.
void Unlock(void)
Unlock access to driver internals.
Message * TimedRequest(QueuePointer &resp_queue, uint8_t type, uint8_t subtype, void *src, double timeout=0, double *timestamp=NULL, bool threaded=true)
Make a request of another device with a timeout.
Device(player_devaddr_t addr, Driver *driver)
Constructor.
int Subscribe(QueuePointer &sub_queue)
Subscribe the given queue to this device.
Base class for all drivers.
Definition driver.h:109
Reference-counted message objects.
Definition message.h:133
An autopointer for the message queue.
Definition message.h:74
#define PLAYER_MAX_DRIVER_STRING_LEN
Maximum length for a driver name.
Definition player.h:72
A device address.
Definition player.h:146
uint16_t index
Which device of that interface.
Definition player.h:155
uint32_t robot
The "robot" or device collection in which the device resides.
Definition player.h:151
uint32_t host
The "host" on which the device resides.
Definition player.h:148
uint16_t interf
The interface provided by the device; must be one of PLAYER_*_CODE.
Definition player.h:153
Generic message header.
Definition player.h:162