|
1 /* |
|
2 * Copyright (c) 2005 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 |
|
20 #include <MCESession.h> |
|
21 |
|
22 #include "MCEConstants.h" |
|
23 #include "TCmdFCSend.h" |
|
24 #include "CTcMCEContext.h" |
|
25 |
|
26 void TCmdFCSend::ExecuteL() |
|
27 { |
|
28 // ---------- Setup ------------------------------------ |
|
29 |
|
30 // Get session |
|
31 CMceSession* session = |
|
32 reinterpret_cast<CMceSession*>(GetObjectForIdL(KSessionId, ETrue)); |
|
33 |
|
34 // ---------- Execution -------------------------------- |
|
35 |
|
36 HBufC8* message = HBufCParameterL(ExtractTextL(KParamFCMessage,EFalse)); |
|
37 |
|
38 CleanupStack::PushL(message); |
|
39 |
|
40 //testing Added by chuan |
|
41 TInt fcmsgCount =0; |
|
42 fcmsgCount = ExtractIntegerL( KParamFCMessageCount, 0, EFalse ); |
|
43 if(fcmsgCount==0) |
|
44 { |
|
45 iContext.FC().SendL(*session, message); |
|
46 CleanupStack::Pop(message); |
|
47 } |
|
48 else |
|
49 { |
|
50 for ( int i=0; i< fcmsgCount; i++) |
|
51 { |
|
52 HBufC8* temp= message->AllocLC(); |
|
53 iContext.FC().SendL(*session, temp); |
|
54 CleanupStack::Pop(temp); |
|
55 } |
|
56 CleanupStack::PopAndDestroy(message); |
|
57 } |
|
58 // ---------- Response creation ----------------------- |
|
59 AddIdResponseL(KSessionId, *session); |
|
60 |
|
61 } |
|
62 |
|
63 TBool TCmdFCSend::Match( const TTcIdentifier& aId ) |
|
64 { |
|
65 return TTcMceCommandBase::Match( aId, _L8("FCSend") ); |
|
66 } |
|
67 |
|
68 TTcCommandBase* TCmdFCSend::CreateL( MTcTestContext& aContext ) |
|
69 { |
|
70 return new( ELeave ) TCmdFCSend( aContext ); |
|
71 } |