root/trunk/libfreebob/src/configrom.h

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

src/libfreebobavc/serialize* moved to src/libfreebob/avc_serialize*, all includes adapted
src/bebob/bebob_serialize* moved to src/libutil/serialize*
src/libutil/serialize: use Glib::ustring instead of std::string.
src/configrom: serialize and deserialize added (not finished)
src/devicemanager: load and save cached functionality added (not finished)

various small whitespace updates (emacs lässt grüssen :))

  • 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, Util::IODeserialize& deser );
77
78  protected:
79     void processUnitDirectory( struct csr1212_csr*    csr,
80                                struct csr1212_keyval* ud_kv,
81                                unsigned int*          id );
82
83     void processRootDirectory( struct csr1212_csr* csr );
84
85     Ieee1394Service* m_1394Service;
86     fb_nodeid_t      m_nodeId;
87     bool             m_avcDevice;
88     fb_octlet_t      m_guid;
89     Glib::ustring    m_vendorName;
90     Glib::ustring    m_modelName;
91     unsigned int     m_vendorId;
92     unsigned int     m_modelId;
93     unsigned int     m_unit_specifier_id;
94     unsigned int     m_unit_version;
95     bool             m_isIsoResourceManager;
96     bool             m_isCycleMasterCapable;
97     bool             m_isSupportIsoOperations;
98     bool             m_isBusManagerCapable;
99     fb_byte_t        m_cycleClkAcc;
100     fb_byte_t        m_maxRec;
101     fb_quadlet_t     m_nodeVendorId;
102     fb_byte_t        m_chipIdHi;
103     fb_quadlet_t     m_chipIdLow;
104
105     /* only used during parsing */
106     struct csr1212_keyval* m_vendorNameKv;
107     struct csr1212_keyval* m_modelNameKv;
108     struct csr1212_csr*    m_csr;
109
110 private:
111     ConfigRom( const ConfigRom& ); // do not allow copy ctor
112     ConfigRom();                   // ctor for deserialition
113
114     DECLARE_DEBUG_MODULE;
115 };
116
117 #endif /* CONFIGROM_H */
Note: See TracBrowser for help on using the browser.