|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <centralrepository.h> |
|
20 #include <unsafprotocolscrkeys.h> |
|
21 #include "TCmdGetUNSAFTimers.h" |
|
22 #include "TCmdSetUNSAFTimers.h" |
|
23 #include "SIPConstants.h" |
|
24 #include "CTcSIPContext.h" |
|
25 |
|
26 |
|
27 /** |
|
28 * INPUT: |
|
29 * Headers: - |
|
30 * Parameters: KParamIAPName, KParamDomainName |
|
31 * IDs: - |
|
32 * |
|
33 * OUTPUT: |
|
34 * Parameters: KParamUNSAFBindingRequestInterval, |
|
35 * KParamUNSAFUDPKeepaliveInterval |
|
36 * KParamUNSAFTCPKeepaliveInterval |
|
37 * IDs: - |
|
38 * |
|
39 * If some parameter is not present in the repository, its value is returned as |
|
40 * KErrNotFound. |
|
41 */ |
|
42 void TCmdGetUNSAFTimers::ExecuteL() |
|
43 { |
|
44 CRepository* repository = CRepository::NewLC( KCRUidUNSAFProtocols ); |
|
45 TUint32 dummyKey( 0 ); |
|
46 TInt bindingRequestInterval( KErrNotFound ); |
|
47 TInt udpKeepAliveInterval( KErrNotFound ); |
|
48 TInt tcpKeepAliveInterval( KErrNotFound ); |
|
49 User::LeaveIfError( ReadTimerValuesL( *repository, |
|
50 dummyKey, |
|
51 bindingRequestInterval, |
|
52 udpKeepAliveInterval, |
|
53 tcpKeepAliveInterval ) ); |
|
54 CleanupStack::PopAndDestroy( repository ); |
|
55 |
|
56 // -- Response creation --------------------------------------------------- |
|
57 |
|
58 AddIntegerResponseL( KParamUNSAFBindingRequestInterval, |
|
59 bindingRequestInterval ); |
|
60 AddIntegerResponseL( KParamUNSAFUDPKeepaliveInterval, |
|
61 udpKeepAliveInterval ); |
|
62 AddIntegerResponseL( KParamUNSAFTCPKeepaliveInterval, |
|
63 tcpKeepAliveInterval ); |
|
64 } |
|
65 |
|
66 TBool TCmdGetUNSAFTimers::Match( const TTcIdentifier& aId ) |
|
67 { |
|
68 return TTcSIPCommandBase::Match( aId, _L8("GetUNSAFTimers") ); |
|
69 } |
|
70 |
|
71 TTcCommandBase* TCmdGetUNSAFTimers::CreateL( MTcTestContext& aContext ) |
|
72 { |
|
73 return new( ELeave ) TCmdGetUNSAFTimers( aContext ); |
|
74 } |