176 // |
176 // |
177 TUpnpErrorCode CUpnpTmClientProfileService::SetClientProfileActionL( CUpnpAction* aAction ) |
177 TUpnpErrorCode CUpnpTmClientProfileService::SetClientProfileActionL( CUpnpAction* aAction ) |
178 { |
178 { |
179 OstTraceFunctionEntry0( CUPNPTMCLIENTPROFILESERVICE_SETCLIENTPROFILEACTIONL_ENTRY ); |
179 OstTraceFunctionEntry0( CUPNPTMCLIENTPROFILESERVICE_SETCLIENTPROFILEACTIONL_ENTRY ); |
180 TUint profileIdInt; |
180 TUint profileIdInt; |
181 // Validates the input parameter(profileID) |
181 // Fetch the value for profile ID argument |
182 if ( ConvertDescriptorToInt( aAction->ArgumentValue(KProfileId), profileIdInt ) != KErrNone ) |
182 TLex8 lex( aAction->ArgumentValue(KProfileId) ); |
183 { |
183 lex.Val(profileIdInt); |
184 OstTrace1( TRACE_ERROR, CUPNPTMCLIENTPROFILESERVICE_SETCLIENTPROFILEACTIONL, "CUpnpTmClientProfileService::SetClientProfileActionL;profileIdInt=%d", profileIdInt ); |
184 OstTrace1( TRACE_ERROR, CUPNPTMCLIENTPROFILESERVICE_SETCLIENTPROFILEACTIONL, "CUpnpTmClientProfileService::SetClientProfileActionL;profileIdInt=%d", profileIdInt ); |
185 return EInvalidArgs; // invalid profile ID |
185 |
186 } |
186 // Fetch the value for client profile argument |
187 const TDesC8& clientProfile = aAction->ArgumentValue(KClientProfile); |
187 const TDesC8& clientProfile = aAction->ArgumentValue(KClientProfile); |
188 |
188 |
189 RBuf8 resultProfileBuf; |
189 RBuf8 resultProfileBuf; |
190 TTerminalModeErrorCode ret = iTmServerImpl.SetClientProfile( profileIdInt,clientProfile,resultProfileBuf ); |
190 TTerminalModeErrorCode ret = iTmServerImpl.SetClientProfile( profileIdInt,clientProfile,resultProfileBuf ); |
191 if ( ret != ETerminalModeSuccess ) |
191 if ( ret != ETerminalModeSuccess ) |
209 // |
209 // |
210 TUpnpErrorCode CUpnpTmClientProfileService::GetClientProfileActionL( CUpnpAction* aAction ) |
210 TUpnpErrorCode CUpnpTmClientProfileService::GetClientProfileActionL( CUpnpAction* aAction ) |
211 { |
211 { |
212 OstTraceFunctionEntry0( CUPNPTMCLIENTPROFILESERVICE_GETCLIENTPROFILEACTIONL_ENTRY ); |
212 OstTraceFunctionEntry0( CUPNPTMCLIENTPROFILESERVICE_GETCLIENTPROFILEACTIONL_ENTRY ); |
213 TUint profileIdInt; |
213 TUint profileIdInt; |
214 // Validates the input parameter(profileID) |
214 // Fetch the value for profile ID argument |
215 if ( ConvertDescriptorToInt( aAction->ArgumentValue(KProfileId), profileIdInt ) != KErrNone ) |
215 TLex8 lex( aAction->ArgumentValue(KProfileId) ); |
216 { |
216 lex.Val(profileIdInt); |
217 OstTrace1( TRACE_ERROR, CUPNPTMCLIENTPROFILESERVICE_GETCLIENTPROFILEACTIONL, "CUpnpTmClientProfileService::GetClientProfileActionL;profileIdInt=%d", profileIdInt ); |
217 OstTrace1( TRACE_ERROR, CUPNPTMCLIENTPROFILESERVICE_GETCLIENTPROFILEACTIONL, "CUpnpTmClientProfileService::GetClientProfileActionL;profileIdInt=%d", profileIdInt ); |
218 return EInvalidArgs; // invalid profile ID |
218 |
219 } |
|
220 |
|
221 RBuf8 resultProfileBuf; |
219 RBuf8 resultProfileBuf; |
222 TTerminalModeErrorCode ret = iTmServerImpl.GetClientProfile(profileIdInt,resultProfileBuf ); |
220 TTerminalModeErrorCode ret = iTmServerImpl.GetClientProfile(profileIdInt,resultProfileBuf ); |
223 |
221 |
224 if ( ret != ETerminalModeSuccess ) |
222 if ( ret != ETerminalModeSuccess ) |
225 { |
223 { |
245 OstTraceFunctionEntry0( CUPNPTMCLIENTPROFILESERVICE_UNUSEDPROFILEIDEVENTL_ENTRY ); |
243 OstTraceFunctionEntry0( CUPNPTMCLIENTPROFILESERVICE_UNUSEDPROFILEIDEVENTL_ENTRY ); |
246 SetStateVariableL( KArgTypeUnusedProfileIds, aUnusedProfileIdBuffer, EFalse); |
244 SetStateVariableL( KArgTypeUnusedProfileIds, aUnusedProfileIdBuffer, EFalse); |
247 OstTraceFunctionExit0( CUPNPTMCLIENTPROFILESERVICE_UNUSEDPROFILEIDEVENTL_EXIT ); |
245 OstTraceFunctionExit0( CUPNPTMCLIENTPROFILESERVICE_UNUSEDPROFILEIDEVENTL_EXIT ); |
248 } |
246 } |
249 |
247 |
250 // --------------------------------------------------------------------------------- |
|
251 // CUpnpTmClientProfileService::ConvertDescriptorToInt |
|
252 // Utility method to convert descriptor to integer |
|
253 // @param aDes descriptor |
|
254 // @param[out] aIntVal Integer value |
|
255 // @return Returns error code |
|
256 // --------------------------------------------------------------------------------- |
|
257 // |
|
258 TInt CUpnpTmClientProfileService::ConvertDescriptorToInt( const TDesC8& aDes, TUint& aIntVal ) |
|
259 { |
|
260 OstTraceFunctionEntry0( CUPNPTMCLIENTPROFILESERVICE_CONVERTDESCRIPTORTOINT_ENTRY ); |
|
261 aIntVal = KErrNone; |
|
262 TLex8 lex( aDes ); |
|
263 OstTrace1( TRACE_NORMAL, CUPNPTMCLIENTPROFILESERVICE_CONVERTDESCRIPTORTOINT, "CUpnpTmClientProfileService::ConvertDescriptorToInt;aIntVal=%u", aIntVal ); |
|
264 OstTraceFunctionExit0( CUPNPTMCLIENTPROFILESERVICE_CONVERTDESCRIPTORTOINT_EXIT ); |
|
265 return lex.Val(aIntVal); |
|
266 } |
|
267 |
|
268 //End of File |
248 //End of File |