root/trunk/libffado/src/fireworks/efc/efc_avc_cmd.cpp

Revision 668, 2.1 kB (checked in by ppalmers, 13 years ago)

fix small bug in ECHO mixer commands

Line 
1 /*
2  * Copyright (C) 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 library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License version 2.1, as published by the Free Software Foundation;
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21  * MA 02110-1301 USA
22  */
23
24 #include "efc_avc_cmd.h"
25
26 #include <netinet/in.h>
27 #include <iostream>
28
29 using namespace std;
30 using namespace AVC;
31
32 namespace FireWorks {
33
34 EfcOverAVCCmd::EfcOverAVCCmd(Ieee1394Service& ieee1394service)
35     : VendorDependentCmd( ieee1394service )
36     , m_dummy_1 ( 0 )
37     , m_dummy_2 ( 0 )
38     , m_cmd( NULL )
39 {
40     m_companyId=0x0;
41 }
42
43 EfcOverAVCCmd::~EfcOverAVCCmd()
44 {
45 }
46
47 bool
48 EfcOverAVCCmd::serialize( Util::IOSSerialize& se )
49 {
50     if (m_cmd==NULL) {
51         debugError("no child EFC command");
52         return false;
53     }
54     bool result=true;
55     result &= VendorDependentCmd::serialize( se );
56    
57     result &= se.write(m_dummy_1, "Dummy byte 1");
58     result &= se.write(m_dummy_2, "Dummy byte 1");
59
60     result &= m_cmd->serialize( se );
61
62     if(!result) {
63         debugWarning("Serialization failed\n");
64     }
65
66     return result;
67 }
68
69 bool
70 EfcOverAVCCmd::deserialize( Util::IISDeserialize& de )
71 {
72     if (m_cmd==NULL) {
73         debugError("no child EFC command");
74         return false;
75     }
76     bool result=true;
77     result &= VendorDependentCmd::deserialize( de );
78    
79     result &= de.read(&m_dummy_1);
80     result &= de.read(&m_dummy_2);
81
82     result &= m_cmd->deserialize( de );
83    
84     if(!result) {
85         debugWarning("Deserialization failed\n");
86     }
87    
88     return result;
89 }
90
91 } // namespace FireWorks
Note: See TracBrowser for help on using the browser.