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

Revision 1498, 3.0 kB (checked in by ppalmers, 15 years ago)

Merge all changes from 2.0 branch into trunk (since r1361). This _should_ contain all forward merges done in the mean time. At this moment in time both branches should be in sync.

Line 
1 /*
2  * Copyright (C) 2005-2008 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 2 of the License, or
12  * (at your option) version 3 of the License.
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 namespace AVC {
30
31 #define AVC1394_CMD_OPEN_DESCRIPTOR         0x08
32 #define AVC1394_CMD_READ_DESCRIPTOR         0x09
33 #define AVC1394_CMD_WRITE_DESCRIPTOR        0x0A
34 #define AVC1394_CMD_SEARCH_DESCRIPTOR       0x0B
35 #define AVC1394_CMD_OBJECT_NUMBER_SELECT    0x0D
36
37 #define AVC1394_CMD_CREATE_DESCRIPTOR       0x0C
38 #define AVC1394_CMD_OPEN_INFOBLOCK          0x05
39 #define AVC1394_CMD_READ_INFOBLOCK          0x06
40 #define AVC1394_CMD_WRITE_INFOBLOCK         0x07
41
42 class AVCDescriptorSpecifier;
43
44 class OpenDescriptorCmd: public AVCCommand
45 {
46 public:
47     enum EMode {
48         eClose = 0x00,
49         eRead  = 0x01,
50         eWrite = 0x03,
51     };
52    
53     enum EStatus {
54         eReady          = 0x00,
55         eReadOpened     = 0x01,
56         eNonExistent    = 0x04,
57         eListOnly       = 0x05,
58         eAtCapacity     = 0x11,
59         eWriteOpened    = 0x33,
60     };
61  
62     OpenDescriptorCmd(Ieee1394Service& );
63     virtual ~OpenDescriptorCmd();
64
65     virtual bool serialize( Util::Cmd::IOSSerialize& se );
66     virtual bool deserialize( Util::Cmd::IISDeserialize& de );
67
68     virtual bool clear();
69
70     virtual const char* getCmdName() const
71     { return "OpenDescriptorCmd"; }
72
73     virtual void setMode( enum EMode m ) {m_mode=m;};
74     AVCDescriptorSpecifier *m_specifier;
75     enum EMode m_mode;
76
77     byte_t m_status;
78     byte_t m_reserved;
79     uint16_t m_locked_node_id;
80    
81 private:
82 };
83
84 class ReadDescriptorCmd: public AVCCommand
85 {
86 public:
87     enum EReadStatus {
88         eComplete     = 0x10,
89         eMoreToRead   = 0x11,
90         eTooLarge     = 0x12,
91         eInvalid      = 0xFF,
92     };
93
94     ReadDescriptorCmd(Ieee1394Service& ieee1394service);
95     virtual ~ReadDescriptorCmd();
96
97     virtual bool serialize( Util::Cmd::IOSSerialize& se );
98     virtual bool deserialize( Util::Cmd::IISDeserialize& de );
99    
100     virtual bool clear();
101    
102     enum EReadStatus getStatus();
103
104     virtual const char* getCmdName() const
105     { return "ReadDescriptorCmd"; }
106    
107     byte_t   m_status;
108     byte_t   m_reserved;
109     uint16_t m_data_length;
110     uint16_t m_address;
111    
112     byte_t *m_data;
113    
114     AVCDescriptorSpecifier *m_specifier;
115 private:
116
117 };
118
119 }
120
121 #endif // AVCDESCRIPTORCMD_H
Note: See TracBrowser for help on using the browser.