First public contribution.
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_TCommConfigV02Data.h"
21 _LIT(KCmdConstructor, "new");
22 _LIT(KCmdDestructor, "~");
23 _LIT(KCmdiTxShutdownTimeout, "iTxShutdownTimeout");
25 _LIT(KFldExpected, "expected");
26 _LIT(KFldValue, "value");
28 _LIT(KLogError, "Error=%d");
31 //////////////////////////////////////////////////////////////////////
32 // Construction/Destruction
33 //////////////////////////////////////////////////////////////////////
35 CT_TCommConfigV02Data::CT_TCommConfigV02Data()
36 : CT_TCommConfigV01Data()
41 CT_TCommConfigV02Data::~CT_TCommConfigV02Data()
49 void CT_TCommConfigV02Data::DestroyData()
55 TDes8* CT_TCommConfigV02Data::Descriptor()
57 * Return a pointer to the buffer
59 * @return pointer to the buffer
65 TAny* CT_TCommConfigV02Data::GetObject()
67 * Return a pointer to the object that the data wraps
69 * @return pointer to the object that the data wraps
75 TBool CT_TCommConfigV02Data::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
77 * Process a command read from the ini file
79 * @param aCommand The command to process
80 * @param aSection The section in the ini containing data for the command
81 * @param aAsyncErrorIndex Command index for async calls to return errors to
83 * @return ETrue if the command is processed
85 * @leave System wide error
91 if ( aCommand==KCmdConstructor )
93 err=DoCmdConstructor();
95 else if ( aCommand==KCmdDestructor )
99 else if ( aCommand==KCmdiTxShutdownTimeout )
101 DoCmdiTxShutdownTimeout(aSection);
105 err=CT_TCommConfigV01Data::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
110 ERR_PRINTF2(KLogError, err);
117 TCommConfigV01& CT_TCommConfigV02Data::GetCommConfigV01()
119 return (*iCommConfig2)();
122 TCommConfigV02& CT_TCommConfigV02Data::GetCommConfigV02()
124 return (*iCommConfig2)();
127 TInt CT_TCommConfigV02Data::DoCmdConstructor()
130 TRAPD(err, iCommConfig2=new (ELeave) TCommConfig2());
131 iCommConfig2->FillZ();
135 void CT_TCommConfigV02Data::DoCmdDestructor()
140 void CT_TCommConfigV02Data::DoCmdiTxShutdownTimeout(const TDesC& aSection)
142 TInt actual=GetCommConfigV02().iTxShutdownTimeout;
143 INFO_PRINTF2(_L("iTxShutdownTimeout : %d"), actual);
146 if( GetIntFromConfig(aSection, KFldExpected(), expected) )
148 if ( expected!=actual )
150 ERR_PRINTF1(_L("Expected Value does not match actual"));
151 SetBlockResult(EFail);
156 if( GetIntFromConfig(aSection, KFldValue(), value) )
158 GetCommConfigV02().iTxShutdownTimeout=value;