root/trunk/libffado/src/libavc/descriptors/avc_descriptor_cmd.h

Revision 824, 3.1 kB (checked in by wagi, 15 years ago)

- moved cmd_serialize.h Util:: namespace to Util::Cmd:: in order to avoid ambiguities with serialize.h
- bebob: enhanced mixer stuff added (not finished)

Line 
1 /*
2  * Copyright (C) 2005-2007 by Pieter Palmers
3  *
4  * This file is part of FFADO
5  * FFADO = Free Firewire (pro-)audio drivers for linux
6  *
7  * FFADO is based upon FreeBoB
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  *
22  */
23
24 #ifndef AVCDESCRIPTORCMD_H
25 #define AVCDESCRIPTORCMD_H
26
27 #include "../general/avc_generic.h"
28
29 #include <libavc1394/avc1394.h>
30
31 namespace AVC {
32
33
34 // defined in avc1394.h
35 // #define AVC1394_CMD_OPEN_DESCRIPTOR         0x08
36 // #define AVC1394_CMD_READ_DESCRIPTOR         0x09
37 // #define AVC1394_CMD_WRITE_DESCRIPTOR        0x0A
38 // #define AVC1394_CMD_SEARCH_DESCRIPTOR       0x0B
39 // #define AVC1394_CMD_OBJECT_NUMBER_SELECT    0x0D
40
41 // not yet defined
42 #define AVC1394_CMD_CREATE_DESCRIPTOR       0x0C
43 #define AVC1394_CMD_OPEN_INFOBLOCK          0x05
44 #define AVC1394_CMD_READ_INFOBLOCK          0x06
45 #define AVC1394_CMD_WRITE_INFOBLOCK         0x07
46
47 class AVCDescriptorSpecifier;
48
49 class OpenDescriptorCmd: public AVCCommand
50 {
51 public:
52     enum EMode {
53         eClose = 0x00,
54         eRead  = 0x01,
55         eWrite = 0x03,
56     };
57    
58     enum EStatus {
59         eReady          = 0x00,
60         eReadOpened     = 0x01,
61         eNonExistent    = 0x04,
62         eListOnly       = 0x05,
63         eAtCapacity     = 0x11,
64         eWriteOpened    = 0x33,
65     };
66  
67     OpenDescriptorCmd(Ieee1394Service& );
68     virtual ~OpenDescriptorCmd();
69
70     virtual bool serialize( Util::Cmd::IOSSerialize& se );
71     virtual bool deserialize( Util::Cmd::IISDeserialize& de );
72
73     virtual bool clear();
74
75     virtual const char* getCmdName() const
76     { return "OpenDescriptorCmd"; }
77
78     virtual void setMode( enum EMode m ) {m_mode=m;};
79     AVCDescriptorSpecifier *m_specifier;
80     enum EMode m_mode;
81
82     byte_t m_status;
83     byte_t m_reserved;
84     uint16_t m_locked_node_id;
85    
86 private:
87 };
88
89 class ReadDescriptorCmd: public AVCCommand
90 {
91 public:
92     enum EReadStatus {
93         eComplete     = 0x10,
94         eMoreToRead   = 0x11,
95         eTooLarge     = 0x12,
96         eInvalid      = 0xFF,
97     };
98
99     ReadDescriptorCmd(Ieee1394Service& ieee1394service);
100     virtual ~ReadDescriptorCmd();
101
102     virtual bool serialize( Util::Cmd::IOSSerialize& se );
103     virtual bool deserialize( Util::Cmd::IISDeserialize& de );
104    
105     virtual bool clear();
106    
107     enum EReadStatus getStatus();
108
109     virtual const char* getCmdName() const
110     { return "ReadDescriptorCmd"; }
111    
112     byte_t   m_status;
113     byte_t   m_reserved;
114     uint16_t m_data_length;
115     uint16_t m_address;
116    
117     byte_t *m_data;
118    
119     AVCDescriptorSpecifier *m_specifier;
120 private:
121
122 };
123
124 }
125
126 #endif // AVCDESCRIPTORCMD_H
Note: See TracBrowser for help on using the browser.