Update contrib.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
18 #include "T_TCommCapsV03Data.h"
21 _LIT(KCmdConstructor, "new");
22 _LIT(KCmdDestructor, "~");
23 _LIT(KCmdiBreakSupported, "iBreakSupported");
25 _LIT(KFldExpected, "expected");
27 _LIT(KLogError, "Error=%d");
30 //////////////////////////////////////////////////////////////////////
31 // Construction/Destruction
32 //////////////////////////////////////////////////////////////////////
34 CT_TCommCapsV03Data::CT_TCommCapsV03Data()
35 : CT_TCommCapsV02Data()
40 CT_TCommCapsV03Data::~CT_TCommCapsV03Data()
48 void CT_TCommCapsV03Data::DestroyData()
54 TDes8* CT_TCommCapsV03Data::Descriptor()
56 * Return a pointer to the buffer
58 * @return pointer to the buffer
64 TAny* CT_TCommCapsV03Data::GetObject()
66 * Return a pointer to the object that the data wraps
68 * @return pointer to the object that the data wraps
74 TBool CT_TCommCapsV03Data::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
76 * Process a command read from the ini file
78 * @param aCommand The command to process
79 * @param aSection The section in the ini containing data for the command
80 * @param aAsyncErrorIndex Command index for async calls to return errors to
82 * @return ETrue if the command is processed
84 * @leave System wide error
90 if ( aCommand==KCmdConstructor )
92 err=DoCmdConstructor();
94 else if ( aCommand==KCmdDestructor )
98 else if ( aCommand==KCmdiBreakSupported )
100 DoCmdiBreakSupported(aSection);
104 ret=CT_TCommCapsV02Data::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
109 ERR_PRINTF2(KLogError, err);
116 TCommCapsV01& CT_TCommCapsV03Data::GetCommCapsV01()
118 return (*iCommCaps3)();
121 TCommCapsV02& CT_TCommCapsV03Data::GetCommCapsV02()
123 return (*iCommCaps3)();
126 TCommCapsV03& CT_TCommCapsV03Data::GetCommCapsV03()
128 return (*iCommCaps3)();
131 TInt CT_TCommCapsV03Data::DoCmdConstructor()
134 TRAPD(err, iCommCaps3=new (ELeave) TCommCaps3());
139 void CT_TCommCapsV03Data::DoCmdDestructor()
144 void CT_TCommCapsV03Data::DoCmdiBreakSupported(const TDesC& aSection)
146 TBool actual=GetCommCapsV03().iBreakSupported;
147 INFO_PRINTF2(_L("iBreakSupported : 0x%X"), actual);
150 if ( GetBoolFromConfig(aSection, KFldExpected(), expected) )
152 if ( expected!=actual )
154 ERR_PRINTF1(_L("Expected Value does not match actual"));
155 SetBlockResult(EFail);