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

l1394_fcpnode.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           l1394_fcpnode.h  -  description
00003                              -------------------
00004     begin                : Tue Oct 24 2000
00005     copyright            : (C) 2000-2004 by Michael Repplinger
00006     email                : repplinger@cs.uni-sb.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef L1394FCPNODE_H
00019 #define L1394FCPNODE_H
00020 
00021 #include "l1394_node.h"
00022 #include "l1394_device.h"
00023 #include "l1394_dviso.h"
00024 
00025 namespace L1394{
00026 
00027 /*! \class FcpNode
00028   * \ingroup L1394_Node
00029   * \brief This class represents a node using the FCP protocol to control a device.
00030   * (normally AV/C nodes)
00031   *
00032   * A FcpNode stores up to 8 subunits in an array. The subunit itself
00033   * stores a pointer to a specific device.(see also class Subunit).<BR>
00034   * This class implements also functions to send commands to a node and gets
00035   * information about the Unit and subunits.
00036   *
00037   * For more information about FCP protocol see IEEE specification.
00038   * For more information about AV/C see 'AV/C Digital Interface Command Set
00039   * General specification'.
00040   *@author Michael Repplinger
00041   */
00042 
00043 class FcpNode : public Node  {
00044 
00045 public:
00046 /*! \name FcpNode constructor
00047   * These functions creates the FcpNode objects.
00048   */
00049 //@{
00050 /*! \fn FcpNode(const u_int32_t node_id, const Card* parent)
00051   * \brief Constructor
00052   * \param node_id : the current node-id by instantiating the object
00053    * \param parent  : pointer to the parent_node
00054   */
00055   FcpNode(const u_int32_t node_id, const Card* parent);
00056 
00057 /*! \fn ~FcpNode()
00058   * \brief Destructor
00059   */
00060   virtual ~FcpNode();
00061 //@}
00062 
00063 /*! \name Fcp specific transactions and functions
00064   *  These functions send a command, based on the
00065   *  FCP protocol, to a FcpNode and return the response.
00066   */
00067 //@{
00068 /*! \fn send(const Quadlet& command) const
00069  *  \brief This method sends a Quadlet (4 bytes) to this node using FCP protocol.
00070  *  \param command  : Quadlet with the command
00071  *  \return Quadlet : The response quadlet.
00072  */
00073   Quadlet send(const Quadlet& command) const;
00074 
00075 
00076 /*! \fn send(const QArray& command) const
00077   * \brief This method sends an array of Quadlets to this node, using FCP protocol.
00078   * \param command : QArray with the extended command
00079   * \return QArray : The response QArray.
00080   */
00081   QArray send(const QArray& command) const;
00082 
00083 
00084 /*! \fn decode(const QArray& value) const
00085   * \brief This method decodes a response and returns the response-code as string.
00086   * \param value  : QArray that should be decoded
00087   * \return char* : pointer to the response
00088   */
00089   const  char* decode(const QArray& value) const {return decode(value.getQuadlet(0));};
00090 
00091 
00092 /*! \fn decode(const Quadlet& value) const
00093   * \brief This method decodes a response and returns as string.
00094   * \param value  : Quadlet that should be decoded
00095   * \return char* : pointer to the response
00096   */
00097   const char* decode(const Quadlet& value) const;
00098 //@}
00099 
00100 
00101 /** \name Unit/Subunit information
00102   *  These functions return some Unit and Subunit informations.
00103   */
00104 //@{
00105 /*! \fn getSubunitCount() const
00106   * \brief This functions return the count of subunits.
00107   * \return int : integer value with subunit count
00108   */
00109   int getSubunitCount() const {return subunit_count;}
00110 
00111 
00112 /*! \fn getSubunitInfo(int subunit)
00113   * \brief This method returns the subunit information from the i-th subunit.
00114   * \param subunit : integer value for the subunit
00115   * \return QArray : with the subunit information.
00116   */
00117   QArray getSubunitInfo(int subunit);
00118 
00119 
00120 /*! \fn getUnitInfo()
00121   * \brief This method returns the unit information block.
00122   * \return QArray : returns the unit information block
00123   */
00124   QArray getUnitInfo();
00125 
00126 
00127 /*! \fn findSubunit(const int subunit_type) const
00128   * \brief This method returns the subunit with a specific type.
00129   *  \param subunit_type : integer value with the subunit_type
00130   * \return Subunit* : pointer to Subunit object with type subunit_type, NULL if no Subunit
00131   * with this type exist.
00132   */
00133   Device* findSubunit(const int subunit_type) const;
00134 
00135 
00136 /*! \fn getDeviceArray() const
00137   * \brief This method return an array with size 8.
00138   *
00139   *  The array contain pointer to the subunits of an AvcNode. If an AvcNode has
00140   * less than 8 subunits the array is filled with NULL.
00141   * \return Subunit** : pointer to the Subunit array
00142   */
00143   Device** getDeviceArray() const {return device_array;}
00144 
00145 
00146 /*! \fn getIsoObject() const
00147   * \brief This method returns a DvIso-object
00148   * \return Iso* : pointer to the ISO-object, or NULL.
00149   */
00150   Iso* getIsoObject()       const {return dv_iso;}
00151 //@}
00152 
00153 private:
00154 
00155 //disabled Copy constructor
00156   FcpNode(const FcpNode&);
00157 
00158 /*! \fn createSubunitList()
00159   * \brief This method create the subunits
00160   */
00161   void createSubunitList();
00162 
00163   internal::CsrRom *rom_info;
00164 
00165 //Device **device_array;
00166   Device** device_array;
00167   static const char* subunit_type[];
00168 
00169   u_int32_t subunit_count;
00170 
00171   internal::DvIso* dv_iso;
00172   raw1394handle_t dv_iso_handler;
00173 };
00174 }
00175 #endif

Generated on Wed Aug 24 00:36:40 2005 for L1394 by doxygen 1.4.2
L1394 library (NMM) grahics.cs.uni-sb.de/~repplix/l1394_home/