root/trunk/libfreebob/src/libfreebobavc/avc_extended_cmd_generic.h

Revision 125, 7.5 kB (checked in by wagi, 18 years ago)

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /* avc_extended_cmd_generic.h
2  * Copyright (C) 2005 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 AVCEXTENDEDCMDGENERIC_H
22 #define AVCEXTENDEDCMDGENERIC_H
23
24 #include "avc_generic.h"
25
26 ////////////////////////////////////////////////////////////
27
28 class PlugAddressData : public IBusData {
29 };
30
31 ////////////////////////////////////////////////////////////
32
33 class UnitPlugAddress : public PlugAddressData
34 {
35 public:
36     enum EPlugType {
37         ePT_PCR              = 0x00,
38         ePT_ExternalPlug     = 0x01,
39         ePT_AsynchronousPlug = 0x02,
40     };
41
42     UnitPlugAddress( EPlugType plugType,  plug_type_t plugId );
43     virtual ~UnitPlugAddress();
44
45     virtual bool serialize( IOSSerialize& se );
46     virtual bool deserialize( IISDeserialize& de );
47     virtual UnitPlugAddress* clone() const;
48
49     plug_id_t   m_plugType;
50     plug_type_t m_plugId;
51     reserved_t  m_reserved;
52 };
53
54 ////////////////////////////////////////////////////////////
55
56 class SubunitPlugAddress : public PlugAddressData
57 {
58 public:
59     SubunitPlugAddress( plug_id_t plugId );
60     virtual ~SubunitPlugAddress();
61
62     virtual bool serialize( IOSSerialize& se );
63     virtual bool deserialize( IISDeserialize& de );
64     virtual SubunitPlugAddress* clone() const;
65
66     plug_id_t m_plugId;
67     reserved_t m_reserved0;
68     reserved_t m_reserved1;
69 };
70
71
72 ////////////////////////////////////////////////////////////
73
74 class FunctionBlockPlugAddress : public PlugAddressData
75 {
76 public:
77     FunctionBlockPlugAddress( function_block_type_t functionBlockType,
78                               function_block_id_t functionBlockId,
79                               plug_id_t plugId );
80     virtual ~FunctionBlockPlugAddress();
81
82     virtual bool serialize( IOSSerialize& se );
83     virtual bool deserialize( IISDeserialize& de );
84     virtual FunctionBlockPlugAddress* clone() const;
85
86     function_block_type_t m_functionBlockType;
87     function_block_id_t   m_functionBlockId;
88     plug_id_t             m_plugId;
89 };
90
91 ////////////////////////////////////////////////////////////
92 ////////////////////////////////////////////////////////////
93
94 class UnitPlugSpecificDataPlugAddress : public PlugAddressData
95 {
96 public:
97     enum EPlugType {
98         ePT_PCR              = 0x00,
99         ePT_ExternalPlug     = 0x01,
100         ePT_AsynchronousPlug = 0x02,
101     };
102
103     UnitPlugSpecificDataPlugAddress( EPlugType plugType,
104                                      plug_type_t plugId );
105     virtual ~UnitPlugSpecificDataPlugAddress();
106
107     virtual bool serialize( IOSSerialize& se );
108     virtual bool deserialize( IISDeserialize& de );
109     virtual UnitPlugSpecificDataPlugAddress* clone() const;
110
111     plug_type_t m_plugType;
112     plug_id_t   m_plugId;
113     reserved_t  m_reserved0;
114     reserved_t  m_reserved1;
115     reserved_t  m_reserved2;
116 };
117
118 ////////////////////////////////////////////////////////////
119
120 class SubunitPlugSpecificDataPlugAddress : public PlugAddressData
121 {
122 public:
123     SubunitPlugSpecificDataPlugAddress( AVCCommand::ESubunitType subunitType,
124                                         subunit_id_t subunitId,
125                                         plug_id_t plugId );
126     virtual ~SubunitPlugSpecificDataPlugAddress();
127
128     virtual bool serialize( IOSSerialize& se );
129     virtual bool deserialize( IISDeserialize& de );
130     virtual SubunitPlugSpecificDataPlugAddress* clone() const;
131
132     subunit_type_t m_subunitType;
133     subunit_id_t   m_subunitId;
134     plug_id_t      m_plugId;
135     reserved_t     m_reserved0;
136     reserved_t     m_reserved1;
137 };
138
139 ////////////////////////////////////////////////////////////
140
141 class FunctionBlockPlugSpecificDataPlugAddress : public PlugAddressData
142 {
143 public:
144     FunctionBlockPlugSpecificDataPlugAddress( AVCCommand::ESubunitType subunitType,
145                                               subunit_id_t subunitId,
146                                               function_block_type_t functionBlockType,
147                                               function_block_id_t functionBlockId,
148                                               plug_id_t plugId);
149     virtual ~FunctionBlockPlugSpecificDataPlugAddress();
150
151     virtual bool serialize( IOSSerialize& se );
152     virtual bool deserialize( IISDeserialize& de );
153     virtual FunctionBlockPlugSpecificDataPlugAddress* clone() const;
154
155     subunit_type_t        m_subunitType;
156     subunit_id_t          m_subunitId;
157     function_block_type_t m_functionBlockType;
158     function_block_id_t   m_functionBlockId;
159     plug_id_t             m_plugId;
160 };
161
162 ////////////////////////////////////////////////////////////
163 ////////////////////////////////////////////////////////////
164
165 class PlugAddress : public IBusData {
166 public:
167     enum EPlugDirection {
168         ePD_Input  = 0x00,
169         ePD_Output = 0x01,
170     };
171
172     enum EPlugAddressMode {
173         ePAM_Unit          = 0x00,
174         ePAM_Subunit       = 0x01,
175         ePAM_FunctionBlock = 0x02,
176     };
177
178     PlugAddress( EPlugDirection plugDirection,
179                  EPlugAddressMode plugAddressMode,
180                  UnitPlugAddress& unitPlugAddress );
181     PlugAddress( EPlugDirection plugDirection,
182                  EPlugAddressMode plugAddressMode,
183                  SubunitPlugAddress& subUnitPlugAddress );
184     PlugAddress( EPlugDirection plugDirection,
185                  EPlugAddressMode plugAddressMode,
186                  FunctionBlockPlugAddress& functionBlockPlugAddress );
187     PlugAddress( const PlugAddress& pa );
188
189     virtual ~PlugAddress();
190
191     virtual bool serialize( IOSSerialize& se );
192     virtual bool deserialize( IISDeserialize& de );
193
194     virtual PlugAddress* clone() const;
195
196     plug_direction_t    m_plugDirection;
197     plug_address_mode_t m_addressMode;
198     PlugAddressData*    m_plugAddressData;
199 };
200
201 ////////////////////////////////////////////////////////////
202
203 class PlugAddressSpecificData : public IBusData {
204 public:
205     enum EPlugDirection {
206         ePD_Input  = 0x00,
207         ePD_Output = 0x01,
208     };
209
210     enum EPlugAddressMode {
211         ePAM_Unit          = 0x00,
212         ePAM_Subunit       = 0x01,
213         ePAM_FunctionBlock = 0x02,
214     };
215
216     PlugAddressSpecificData( EPlugDirection plugDirection,
217                              EPlugAddressMode plugAddressMode,
218                              UnitPlugSpecificDataPlugAddress& unitPlugAddress );
219     PlugAddressSpecificData( EPlugDirection plugDirection,
220                              EPlugAddressMode plugAddressMode,
221                              SubunitPlugSpecificDataPlugAddress& subUnitPlugAddress );
222     PlugAddressSpecificData( EPlugDirection plugDirection,
223                              EPlugAddressMode plugAddressMode,
224                              FunctionBlockPlugSpecificDataPlugAddress& functionBlockPlugAddress );
225      PlugAddressSpecificData( const  PlugAddressSpecificData& pa );
226
227     virtual ~PlugAddressSpecificData();
228
229     virtual bool serialize( IOSSerialize& se );
230     virtual bool deserialize( IISDeserialize& de );
231
232     virtual PlugAddressSpecificData* clone() const;
233
234     plug_direction_t    m_plugDirection;
235     plug_address_mode_t m_addressMode;
236     PlugAddressData*    m_plugAddressData;
237 };
238
239
240 #endif
Note: See TracBrowser for help on using the browser.