|
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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <e32cmn.h> |
|
20 |
|
21 #include "muslogger.h" |
|
22 #include "musmanagerserveritcutility.h" |
|
23 |
|
24 // --------------------------------------------------------------------------- |
|
25 // MusManagerServerItcUtility::WriteAvailabilityL |
|
26 // --------------------------------------------------------------------------- |
|
27 // |
|
28 void MusManagerServerItcUtility::WriteAvailabilityL( |
|
29 const RMessage2& aMessage, |
|
30 TInt aAvailability ) |
|
31 { |
|
32 TPckg<TInt> capPckg( aAvailability ); |
|
33 WriteL( |
|
34 EMusManagerIpcArgAvailability, |
|
35 aMessage, |
|
36 capPckg ); |
|
37 } |
|
38 |
|
39 |
|
40 // --------------------------------------------------------------------------- |
|
41 // MusManagerServerItcUtility::WriteAvailabilityReportL |
|
42 // --------------------------------------------------------------------------- |
|
43 // |
|
44 void MusManagerServerItcUtility::WriteAvailabilityReportL( |
|
45 const RMessage2& aMessage, |
|
46 TInt aAvailability ) |
|
47 { |
|
48 TPckg<TInt> capPckg( aAvailability ); |
|
49 WriteL( |
|
50 EMusManagerIpcArgAvailabilityStatus, |
|
51 aMessage, |
|
52 capPckg ); |
|
53 } |
|
54 // --------------------------------------------------------------------------- |
|
55 // MusManagerServerItcUtility::ReadChannelIdL |
|
56 // --------------------------------------------------------------------------- |
|
57 // |
|
58 TUid MusManagerServerItcUtility::ReadChannelIdL( |
|
59 const RMessage2& aMessage ) |
|
60 { |
|
61 TPckgBuf<TUid> uidPckg; |
|
62 aMessage.ReadL( |
|
63 EMusManagerIpcArgChannelUid, |
|
64 uidPckg ); |
|
65 |
|
66 return uidPckg(); |
|
67 } |
|
68 |
|
69 // --------------------------------------------------------------------------- |
|
70 // MusManagerServerItcUtility::ReadCommandL |
|
71 // --------------------------------------------------------------------------- |
|
72 // |
|
73 TInt MusManagerServerItcUtility::ReadCommandL( |
|
74 const RMessage2& aMessage ) |
|
75 { |
|
76 TPckgBuf<TInt> intPckg; |
|
77 aMessage.ReadL( |
|
78 EMusManagerIpcArgCommandType, |
|
79 intPckg ); |
|
80 |
|
81 return intPckg(); |
|
82 } |
|
83 |
|
84 |
|
85 |
|
86 // --------------------------------------------------------------------------- |
|
87 // MusManagerServerItcUtility::ReadRequestStatusL |
|
88 // --------------------------------------------------------------------------- |
|
89 // |
|
90 TRequestStatus MusManagerServerItcUtility::ReadRequestStatusL( |
|
91 const RMessage2& aMessage ) |
|
92 { |
|
93 TPckgBuf<TInt> intPckg; |
|
94 aMessage.ReadL( |
|
95 EMusManagerIpcArgRequestStatus, |
|
96 intPckg ); |
|
97 |
|
98 return TRequestStatus( intPckg() ); |
|
99 } |
|
100 |
|
101 // --------------------------------------------------------------------------- |
|
102 // MusManagerServerItcUtility::ReadUseCaseL |
|
103 // --------------------------------------------------------------------------- |
|
104 // |
|
105 TInt MusManagerServerItcUtility::ReadUseCaseL( |
|
106 const RMessage2& aMessage ) |
|
107 { |
|
108 TPckgBuf<TInt> intPckg; |
|
109 aMessage.ReadL( |
|
110 EMusManagerIpcArgUseCase, |
|
111 intPckg ); |
|
112 |
|
113 return intPckg(); |
|
114 } |
|
115 |
|
116 // ---------------------------------------------------------------------------- |
|
117 // MusManagerServerItcUtility::WriteL |
|
118 // ---------------------------------------------------------------------------- |
|
119 // |
|
120 void MusManagerServerItcUtility::WriteL ( |
|
121 TMusManagerIpcArguments aIndex, |
|
122 const RMessage2& aMessage, |
|
123 const TDesC8& aDes) |
|
124 { |
|
125 TInt length = aMessage.GetDesMaxLength( aIndex ); |
|
126 |
|
127 if (length < 0) |
|
128 { |
|
129 User::Leave( KErrArgument ); |
|
130 } |
|
131 if (length < aDes.Length()) |
|
132 { |
|
133 User::Leave( KErrOverflow ); |
|
134 } |
|
135 |
|
136 aMessage.WriteL( aIndex, aDes ); |
|
137 } |
|
138 |
|
139 |
|
140 |