wbr914 Class Reference

List of all members.

Public Member Functions

 wbr914 (ConfigFile *cf, int section)
virtual ~wbr914 ()
 Clean up any resources.
virtual int Subscribe (player_devaddr_t id)
 Subscribe to this driver.
virtual int Unsubscribe (player_devaddr_t id)
 Unsubscribe from this driver.
virtual void Main ()
 Main method for driver thread.
virtual int Setup ()
 Initialize the driver.
virtual int Shutdown ()
 Finalize the driver.
virtual int ProcessMessage (MessageQueue *resp_queue, player_msghdr *hdr, void *data)
 Message handler.

Member Function Documentation

void wbr914::Main (  )  [virtual]

Main method for driver thread.

drivers have their own thread of execution, created using StartThread(); this is the entry point for the driver thread, and must be overloaded by all threaded drivers.

Reimplemented from Driver.

References MessageQueue::Empty(), Driver::InQueue, PLAYER_MSG0, Driver::ProcessMessages(), and Driver::Unlock().

int wbr914::ProcessMessage ( MessageQueue resp_queue,
player_msghdr hdr,
void *  data 
) [virtual]

Message handler.

This function is called once for each message in the incoming queue. Reimplement it to provide message handling. Return 0 if you handled the message and -1 otherwise

Parameters:
resp_queue The queue to which any response should go.
hdr The message header
data The message body

Reimplemented from Driver.

References PLAYER_MSGTYPE_CMD, PLAYER_MSGTYPE_REQ, and player_msghdr::type.

int wbr914::Setup (  )  [virtual]

Initialize the driver.

This function is called with the first client subscribes; it MUST be implemented by the driver.

Returns:
Returns 0 on success.

Implements Driver.

References PLAYER_MSG0.

int wbr914::Shutdown (  )  [virtual]

Finalize the driver.

This function is called with the last client unsubscribes; it MUST be implemented by the driver.

Returns:
Returns 0 on success.

Implements Driver.

References Driver::StopThread().

Referenced by ~wbr914().

int wbr914::Subscribe ( player_devaddr_t  addr  )  [virtual]

Subscribe to this driver.

The Subscribe() and Unsubscribe() methods are used to control subscriptions to the driver; a driver MAY override them, but usually won't.

Parameters:
addr Address of the device to subscribe to (the driver may have more than one interface).
Returns:
Returns 0 on success.

Reimplemented from Driver.

References Device::MatchDeviceAddress().

int wbr914::Unsubscribe ( player_devaddr_t  addr  )  [virtual]

Unsubscribe from this driver.

The Subscribe() and Unsubscribe() methods are used to control subscriptions to the driver; a driver MAY override them, but usually won't.

Parameters:
addr Address of the device to unsubscribe from (the driver may have more than one interface).
Returns:
Returns 0 on success.

Reimplemented from Driver.

References Device::MatchDeviceAddress().


The documentation for this class was generated from the following files:

Last updated 12 September 2005 21:38:45