Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

L1394::Card Class Reference
[L1394_Node]

This class represents a FireWire card. More...

#include <l1394_card.h>

Inheritance diagram for L1394::Card:

L1394::Node List of all members.

Public Member Functions

virtual void makeNodeList (raw1394handle_t)
 This method creates the internal node list.
int requestIsoChannel () const
int requestIsoChannel (const u_int32_t) const
void releaseIsoChannel (const u_int32_t) const
Camera constructor
These functions creates the Card objects.

 Card (const u_int32_t card_id, const u_int32_t node_id, raw1394handle_t default_handle)
 constructor
virtual ~Card ()
 destroy an 1394 Card object
Access the connected nodes
These functions access the connected nodes on a FireWire card. All functions search only on this card.

NodegetNode (const u_int64_t guid) const
 This method searches a Node with a certain guid.
list< Node * > getAllNodes (const int node_type) const
 This method searches all nodes with a certain type and returns a STL-list.
NodefindNode (const int node_type) const
 This method searches the first node with a certain node type.
Node ** getNodeArray () const
 This method returns the array of all nodes on the card.
NodegetExplicitNode (const int i) const
 This method returns the i'th node on the card.
bool nodeExist (const u_int64_t guid) const
 This method tests if a node with a certain guid is connected to this card.
NodegetBusMaster () const
 This method returns the actual Bus-Master node. The busmaster can change after bus reset.
Card specific information
These functions return some card specific information.

u_int32_t getNodeCount () const
 This method returns the number of connected nodes.
u_int32_t getCardID () const
 This method returns the card-id.
raw1394handle_t getDefaultHandle () const
 This method returns the current default-handler (obsolete).
internal::BusTopologygetBusTopology () const
 This method returns the actual BusTopology.
void printNodeList () const
 prints the device list of a card to standard output
QArraygetTopoMap () const
 This method returns the actual topology map.
int reset () const
 resets the bus
Transaction object
These methods access the Transaction object of a card.

const internal::TransactionrequestTransaction () const
 This method returns the Transaction object of a Card.
void releaseTransaction () const
 This method releases the Transaction object.

Protected Member Functions

u_int64_t readAGuid (const int node)
 This method reads the GUID of a node connected to this card direct from CSR.
void readTopoMap ()
 This method reads the Topologie map.

Detailed Description

This class represents a FireWire card.

A Card manages up to 64 (pointer of) Nodes in an array. The Nodes are stored in a global internal::NodeContainer except Nodes with a physical layer only, so called PhyNodes(because there is no way to identify them). PhyNodes are deleted after every bus reset (and recreate if they are always connected to the FireWire bus.)

To guarantee that every node connected to the bus is represented by one L1394 node the Card searches the global internal::NodeContainer for an existing object. So its possible to connect one device to multiple cards and work always with the same object.

Every card object provides a Transaction object (wrapper class for libraw1394) that can be used to send asynchone transactions.

This class provides also functions to find and get Nodes, but they search on the current card only. The Card returns objects from type L1394::Node, so you need to cast the L1394 nodes to the correct type if you need.
To find and get nodes you should use the functions from class Session.

Author:
Michael Repplinger

Definition at line 60 of file l1394_card.h.


Constructor & Destructor Documentation

L1394::Card::Card const u_int32_t  card_number,
const u_int32_t  node_number,
raw1394handle_t  default_handle
 

constructor

Parameters:
card_number : specify the card number.
node_number : specify the node_number by creating this object
default_handle,: pointer to the default handle for this node

Definition at line 25 of file l1394_card.cpp.

References L1394::_Card, L1394::internal::NodeContainer::getNodeContainer(), and L1394::internal::NodeContainer::insert().

L1394::Card::~Card  )  [virtual]
 

destroy an 1394 Card object

Definition at line 66 of file l1394_card.cpp.

References L1394::NODE_DESTROY, L1394::internal::NodeContainer::release(), and L1394::internal::NodeContainer::removeNode().


Member Function Documentation

L1394::Card::findNode const int  node_type  )  const
 

This method searches the first node with a certain node type.

This method searches only on this card.

Parameters:
node_type : integer value with the node type (defined in class Node)
Returns:
Node* : pointer to the first node with this node_type, NULL if no node exist on this card.

Definition at line 190 of file l1394_card.cpp.

L1394::Card::getAllNodes const int  node_type  )  const
 

This method searches all nodes with a certain type and returns a STL-list.

This method searches only on this card.

Parameters:
node_type : integer for type of the nodes.
Returns:
list<Node*> : stl_list with Nodes from type node_type

Definition at line 224 of file l1394_card.cpp.

L1394::Card::getBusMaster  )  const [inline]
 

This method returns the actual Bus-Master node. The busmaster can change after bus reset.

Returns:
Node* : pointer to the actual busmaster.

Definition at line 154 of file l1394_card.h.

L1394::Card::getBusTopology  )  const [inline]
 

This method returns the actual BusTopology.

An object of this class stores the actual Topo Map as QArray and as tree. The bustopology changes after every bus reset.

Returns:
internal::BusTopology* : pointer to the actual BusTopology

Definition at line 188 of file l1394_card.h.

L1394::Card::getCardID  )  const [inline]
 

This method returns the card-id.

Definition at line 172 of file l1394_card.h.

Referenced by SimpleEventHandle::busreset().

L1394::Card::getDefaultHandle  )  const [inline]
 

This method returns the current default-handler (obsolete).

Definition at line 178 of file l1394_card.h.

L1394::Card::getExplicitNode const int  i  )  const [inline]
 

This method returns the i'th node on the card.

Parameters:
i : for the i'th node.
Returns:
Node* : pointer to the Node, NULL if no node with this id exist.

Definition at line 136 of file l1394_card.h.

Referenced by L1394::Session::getAllDevices().

L1394::Card::getNode const u_int64_t  guid  )  const
 

This method searches a Node with a certain guid.

This method searches only on this card.

Parameters:
guid : the guid of the node
Returns:
Node* : pointer to the node, NULL if the node doesn't exist on this card.

Definition at line 198 of file l1394_card.cpp.

L1394::Card::getNodeArray  )  const [inline]
 

This method returns the array of all nodes on the card.

The node_array stores all Nodes connected to this card. The array has length 64 and is filled up with NULL-pointer, if it contains less than 64 nodes. The content of this array can change after bus reset.

Returns:
Node** : pointer to the Node array with size 64.

Definition at line 128 of file l1394_card.h.

L1394::Card::getNodeCount  )  const [inline]
 

This method returns the number of connected nodes.

Returns:
int : value with node count (between 1..64)

Definition at line 166 of file l1394_card.h.

L1394::Card::getTopoMap  )  const [inline]
 

This method returns the actual topology map.

Returns:
QArray* : pointer to the topology map

Definition at line 201 of file l1394_card.h.

L1394::Card::makeNodeList raw1394handle_t   )  [virtual]
 

This method creates the internal node list.

Definition at line 101 of file l1394_card.cpp.

References L1394::internal::NodeFactory::createNode(), L1394::internal::NodeContainer::getNode(), L1394::internal::NodeFactory::getNodeFactory(), L1394::internal::NodeContainer::insert(), nodeExist(), printNodeList(), readAGuid(), readTopoMap(), L1394::internal::NodeContainer::release(), releaseTransaction(), and requestTransaction().

L1394::Card::nodeExist const u_int64_t  guid  )  const
 

This method tests if a node with a certain guid is connected to this card.

This method searches only on this card.

Parameters:
guid : the guid of the node
Returns:
bool : value true for node exist, else false.

Definition at line 184 of file l1394_card.cpp.

References L1394::internal::NodeContainer::nodeExist().

Referenced by makeNodeList().

L1394::Card::printNodeList  )  const
 

prints the device list of a card to standard output

Definition at line 89 of file l1394_card.cpp.

Referenced by makeNodeList().

L1394::Card::readAGuid const int  node  )  [protected]
 

This method reads the GUID of a node connected to this card direct from CSR.

Returns:
u_int64_t : Return the GUID.

Definition at line 205 of file l1394_card.cpp.

References L1394::QArray::getQuadlet(), L1394::QArray::getSize(), L1394::internal::Transaction::read(), and L1394::Quadlet::toInt().

Referenced by makeNodeList().

L1394::Card::readTopoMap  )  [protected]
 

This method reads the Topologie map.

Definition at line 234 of file l1394_card.cpp.

References L1394::Quadlet::getBitRange(), L1394::QArray::insert(), and L1394::internal::Transaction::read().

Referenced by makeNodeList().

void L1394::Card::releaseIsoChannel const   u_int32_t  )  const
 

Definition at line 301 of file l1394_card.cpp.

References L1394::Quadlet::getBit(), and L1394::Quadlet::setBit().

L1394::Card::releaseTransaction  )  const
 

This method releases the Transaction object.

Definition at line 262 of file l1394_card.cpp.

References L1394::ThreadMutex::unlock().

Referenced by makeNodeList().

int L1394::Card::requestIsoChannel const   u_int32_t  )  const
 

Definition at line 279 of file l1394_card.cpp.

References L1394::Quadlet::getBit(), L1394_FAILED, and L1394::Quadlet::setBit().

int L1394::Card::requestIsoChannel  )  const
 

Definition at line 267 of file l1394_card.cpp.

References L1394_FAILED.

L1394::Card::requestTransaction  )  const
 

This method returns the Transaction object of a Card.

This method is for internal use. You should use the Node memberfunctions read, write and lock. Remark: The Transaction object must be released before any Node can request it again. So if you must use this method you MUST call the method releaseTransaction() to release the Transaction object.

Definition at line 256 of file l1394_card.cpp.

References L1394::ThreadMutex::lock().

Referenced by makeNodeList().

int L1394::Card::reset  )  const
 

resets the bus

Definition at line 317 of file l1394_card.cpp.

References L1394_FAILED, and L1394_SUCCESS.


The documentation for this class was generated from the following files:
Generated on Wed Aug 24 00:36:43 2005 for L1394 by doxygen 1.4.2
L1394 library (NMM) grahics.cs.uni-sb.de/~repplix/l1394_home/