Device Class Reference
#include <device.h>
Detailed Description
Encapsulates a device (i.e., a driver bound to an interface).A device describes an instantiated driver/interface combination. Drivers may support more than one interface, and hence appear more than once in the device table.
Public Member Functions | |
| Device (player_devaddr_t addr, Driver *driver) | |
| Constructor. | |
| ~Device () | |
| Destructor. | |
| int | Subscribe (MessageQueue *sub_queue) |
| Subscribe the given queue to this device. | |
| int | Unsubscribe (MessageQueue *sub_queue) |
| Unsubscribe the given queue from this device. | |
| void | PutMsg (MessageQueue *resp_queue, uint8_t type, uint8_t subtype, void *src, size_t len, double *timestamp) |
| Send a message to this device. | |
| void | PutMsg (MessageQueue *resp_queue, player_msghdr_t *hdr, void *src) |
| Send a message to this device (short form). | |
| Message * | Request (MessageQueue *resp_queue, uint8_t type, uint8_t subtype, void *src, size_t len, double *timestamp, bool threaded=true) |
| Make a request of another device. | |
Static Public Member Functions | |
| static bool | MatchDeviceAddress (player_devaddr_t addr1, player_devaddr_t addr2) |
| Compare two addresses. | |
Public Attributes | |
| Device * | next |
| Next entry in the device table (this is a linked-list). | |
| player_devaddr_t | addr |
| Address for this device. | |
| char | drivername [PLAYER_MAX_DRIVER_STRING_LEN] |
| The string name for the underlying driver. | |
| Driver * | driver |
| Pointer to the underlying driver. | |
| MessageQueue ** | queues |
| Linked list of subscribed queues. | |
| size_t | len_queues |
Length of queues. | |
Constructor & Destructor Documentation
|
||||||||||||
|
Constructor.
|
Member Function Documentation
|
||||||||||||
|
Compare two addresses. This static method returns true if all 4 components of the two addresses match exactly. It's useful in Driver::ProcessMessage when you're deciding how to handle a message. |
|
||||||||||||||||
|
Send a message to this device (short form). This form of PutMsg is useful if you already have the message header assembled (e.g., when you're forwarding a message).
|
|
||||||||||||||||||||||||||||
|
Send a message to this device. This method is the basic way of sending a message to a device. The header will be assembled and the message will get pushed on to the underlying driver's InQueue.
|
|
||||||||||||||||||||||||||||||||
|
Make a request of another device. This method send a request message to a device and waits for the reply.
|
|
|
Subscribe the given queue to this device.
|
|
|
Unsubscribe the given queue from this device.
|
The documentation for this class was generated from the following file:
