P2OS Class Reference

List of all members.

Public Member Functions

 P2OS (ConfigFile *cf, int section)
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.
void CMUcamReset (bool doLock=true)
void CMUcamTrack (int rmin=0, int rmax=0, int gmin=0, int gmax=0, int bmin=0, int bmax=0)
void CMUcamStartTracking (bool doLock=true)
void CMUcamStopTracking (bool doLock=true)

Member Function Documentation

void P2OS::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_devaddr::interf, Driver::Lock(), Driver::ProcessMessages(), and Driver::Unlock().

int P2OS::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 P2OS::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_devaddr::interf, PLAYER_ERROR1, and PLAYER_MSG1.

int P2OS::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().

int P2OS::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(), and Driver::Subscribe().

int P2OS::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(), and Driver::Unsubscribe().


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

Last updated 12 September 2005 21:38:45