|
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 |
|
21 #include <MCESession.h> |
|
22 |
|
23 #include "MCEConstants.h" |
|
24 #include "TCmdFCGetMediaAttrLines.h" |
|
25 #include "CTcMCEContext.h" |
|
26 |
|
27 |
|
28 |
|
29 void TCmdFCGetMediaAttrLines::ExecuteL() |
|
30 { |
|
31 // ---------- Setup ------------------------------------ |
|
32 |
|
33 // Get session |
|
34 CMceSession* session = |
|
35 reinterpret_cast<CMceSession*>(GetObjectForIdL(KSessionId, ETrue)); |
|
36 |
|
37 // ---------- Execution -------------------------------- |
|
38 |
|
39 |
|
40 // ---------- Response creation ----------------------- |
|
41 |
|
42 MDesC8Array* mediaAttrLines = iContext.FC().MediaAttributeLinesL(*session); |
|
43 TCleanupItem cleanup(DeleteMediaAttrLines, mediaAttrLines); |
|
44 CleanupStack::PushL(cleanup); |
|
45 |
|
46 if ( mediaAttrLines->MdcaCount() > 0 ) |
|
47 { |
|
48 AddArrayResponseL( KResponseFCMediaAttrLines, *mediaAttrLines ); |
|
49 } |
|
50 |
|
51 CleanupStack::PopAndDestroy(mediaAttrLines); |
|
52 |
|
53 AddIdResponseL(KSessionId, *session); |
|
54 |
|
55 } |
|
56 |
|
57 TBool TCmdFCGetMediaAttrLines::Match( const TTcIdentifier& aId ) |
|
58 { |
|
59 //return TTcMceCommandBase::Match( aId, _L8("Establish") ); |
|
60 return TTcMceCommandBase::Match( aId, _L8("FCGetMediaAttributeLines") ); |
|
61 } |
|
62 |
|
63 TTcCommandBase* TCmdFCGetMediaAttrLines::CreateL( MTcTestContext& aContext ) |
|
64 { |
|
65 return new( ELeave ) TCmdFCGetMediaAttrLines( aContext ); |
|
66 } |
|
67 |
|
68 void TCmdFCGetMediaAttrLines::DeleteMediaAttrLines( TAny* ptr) |
|
69 { |
|
70 MDesC8Array* mediaAttrLines = reinterpret_cast<MDesC8Array*>(ptr); |
|
71 delete mediaAttrLines; |
|
72 } |