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 |
#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::Cmd::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::Cmd::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 |
---|