root/branches/streaming-rework/src/configrom.h

Revision 368, 3.6 kB (checked in by wagi, 17 years ago)

ConfigRom::serialize: no prefix needed for member
ConfigRom::deserialize: ieee1394service argument

no prefix needed for member
return 0 if deserializing fails

AvDevice::AvDevice?: new ctor
vDevice::serialize: comment removed
AvDevice::deserialize: config rom deserializing code added

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /* configrom.h
2  * Copyright (C) 2005,06 by Daniel Wagner
3  *
4  * This file is part of FreeBoB.
5  *
6  * FreeBoB is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * FreeBoB is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with FreeBoB; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18  * MA 02111-1307 USA.
19  */
20
21 #ifndef CONFIGROM_H
22 #define CONFIGROM_H
23
24 #include "fbtypes.h"
25 #include "csr1212.h"
26
27 #include "libutil/serialize.h"
28 #include "debugmodule/debugmodule.h"
29
30 #include <string>
31
32 class Ieee1394Service;
33
34 class ConfigRom {
35  public:
36     ConfigRom( Ieee1394Service& ieee1394service, fb_nodeid_t nodeId );
37     virtual ~ConfigRom();
38
39     bool initialize();
40
41     bool operator == ( const ConfigRom& rhs );
42
43     const fb_nodeid_t getNodeId() const;
44     const fb_octlet_t getGuid() const;
45     const Glib::ustring getModelName() const;
46     const Glib::ustring getVendorName() const;
47
48     const unsigned int getModelId() const;
49     const unsigned int getVendorId() const;
50     const unsigned int getUnitSpecifierId() const;
51     const unsigned int getUnitVersion() const;
52
53     bool isIsoResourseManager() const
54         { return m_isIsoResourceManager; }
55     bool isCycleMasterCapable() const
56         { return m_isCycleMasterCapable; }
57     bool isSupportsIsoOperations() const
58         { return m_isSupportIsoOperations; }
59     bool isBusManagerCapable() const
60         { return m_isBusManagerCapable; }
61     fb_byte_t getCycleClockAccurancy() const
62         { return m_cycleClkAcc; }
63     fb_byte_t getMaxRec() const
64         { return m_maxRec; }
65     unsigned short getAsyMaxPayload() const;
66
67     fb_quadlet_t getNodeVendorId() const
68         { return m_nodeVendorId; }
69
70     bool updatedNodeId();
71     bool setNodeId( fb_nodeid_t nodeId );
72
73     void printConfigRom() const;
74
75     bool serialize( Glib::ustring path, Util::IOSerialize& ser );
76     static ConfigRom* deserialize( Glib::ustring path,
77                                    Util::IODeserialize& deser,
78                                    Ieee1394Service& ieee1394Service );
79
80  protected:
81     void processUnitDirectory( struct csr1212_csr*    csr,
82                                struct csr1212_keyval* ud_kv,
83                                unsigned int*          id );
84
85     void processRootDirectory( struct csr1212_csr* csr );
86
87     Ieee1394Service* m_1394Service;
88     fb_nodeid_t      m_nodeId;
89     bool             m_avcDevice;
90     fb_octlet_t      m_guid;
91     Glib::ustring    m_vendorName;
92     Glib::ustring    m_modelName;
93     unsigned int     m_vendorId;
94     unsigned int     m_modelId;
95     unsigned int     m_unit_specifier_id;
96     unsigned int     m_unit_version;
97     bool             m_isIsoResourceManager;
98     bool             m_isCycleMasterCapable;
99     bool             m_isSupportIsoOperations;
100     bool             m_isBusManagerCapable;
101     fb_byte_t        m_cycleClkAcc;
102     fb_byte_t        m_maxRec;
103     fb_quadlet_t     m_nodeVendorId;
104     fb_byte_t        m_chipIdHi;
105     fb_quadlet_t     m_chipIdLow;
106
107     /* only used during parsing */
108     struct csr1212_keyval* m_vendorNameKv;
109     struct csr1212_keyval* m_modelNameKv;
110     struct csr1212_csr*    m_csr;
111
112 private:
113     ConfigRom( const ConfigRom& ); // do not allow copy ctor
114     ConfigRom();                   // ctor for deserialition
115
116     DECLARE_DEBUG_MODULE;
117 };
118
119 #endif /* CONFIGROM_H */
Note: See TracBrowser for help on using the browser.