device.h
Device * next
Next entry in the device table (this is a linked-list)
Definition: device.h:218
static bool MatchMessage(player_msghdr_t *hdr, int type, int subtype, player_devaddr_t addr)
Helper for message processing.
Definition: message.h:159
double ReadFloat(int section, const char *name, double value)
Read a floating point (double) value.
virtual int MainSetup(void)
Sets up the resources needed by the driver thread.
Definition: driver.h:658
virtual void MainQuit(void)
Cleanup method for driver thread (called when main exits)
Definition: driver.h:664
uint8_t type
Message type; must be one of PLAYER_MSGTYPE_*.
Definition: player.h:166
uint32_t robot
The "robot" or device collection in which the device resides.
Definition: player.h:151
void PutMsg(QueuePointer &resp_queue, uint8_t type, uint8_t subtype, void *src, size_t deprecated, double *timestamp)
Send a message to this device.
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
static bool MatchDeviceAddress(player_devaddr_t addr1, player_devaddr_t addr2)
Compare two addresses.
Definition: device.h:201
int ReadDeviceAddr(player_devaddr_t *addr, int section, const char *name, int code, int index, const char *key)
Read a device id.
void PutMsg(QueuePointer &resp_queue, player_msghdr_t *hdr, void *src, bool copy=true)
Send a message to this device (short form)
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
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.
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.
QueuePointer InQueue
Pointer to the underlying driver's queue.
Definition: device.h:228
#define PLAYER_MAX_DRIVER_STRING_LEN
Maximum length for a driver name.
Definition: player.h:72
int Unsubscribe(QueuePointer &sub_queue)
Unsubscribe the given queue from this device.
player_devaddr_t addr
Device to which this message pertains.
Definition: player.h:164
uint16_t interf
The interface provided by the device; must be one of PLAYER_*_CODE.
Definition: player.h:153
#define PLAYER_MSGQUEUE_DEFAULT_MAXLEN
Default maximum length for a message queue.
Definition: player.h:76