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