upnpavcontrolpoint/avcontrolframework/src/upnpactionresponsehandler.cpp
branchIOP_Improvements
changeset 40 08b5eae9f9ff
parent 39 6369bfd1b60d
child 41 b4d83ea1d6e2
equal deleted inserted replaced
39:6369bfd1b60d 40:08b5eae9f9ff
     1 /** @file
       
     2 * Copyright (c) 2005-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:  CUpnpActionResponseHandler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "upnpactionresponsehandler.h"
       
    21 #include "upnpavcontrolpoint.h"
       
    22 #include "upnpavcpstring.h"
       
    23 
       
    24 // CONSTANTS]
       
    25 using namespace UpnpAVCPStrings;
       
    26 
       
    27 
       
    28 // -----------------------------------------------------------------------------
       
    29 // CUpnpActionResponseHandler::CUpnpActionResponseHandler
       
    30 // C++ default constructor can NOT contain any code, that
       
    31 // might leave.
       
    32 // -----------------------------------------------------------------------------
       
    33 //
       
    34 CUpnpActionResponseHandler::CUpnpActionResponseHandler( 
       
    35             MUpnpAVControlPointObserver& aAVCPObserver, CUpnpAVControlPoint& aAVCP )
       
    36     :iAVControlPointObserver( aAVCPObserver ), iAVCP( aAVCP )
       
    37     {
       
    38 	}
       
    39 
       
    40 // -----------------------------------------------------------------------------
       
    41 // CUpnpActionResponseHandler::ConstructL
       
    42 // Symbian 2nd phase constructor can leave.
       
    43 // -----------------------------------------------------------------------------
       
    44 //
       
    45 void CUpnpActionResponseHandler::ConstructL() 
       
    46 	{
       
    47 	}
       
    48 
       
    49 // -----------------------------------------------------------------------------
       
    50 // CSuperDir::NewL
       
    51 // Two-phased constructor.
       
    52 // -----------------------------------------------------------------------------
       
    53 //
       
    54 CUpnpActionResponseHandler* CUpnpActionResponseHandler::NewL( 
       
    55             MUpnpAVControlPointObserver& aAVCPObserver,
       
    56             CUpnpAVControlPoint& aAVCP )
       
    57     {
       
    58 	CUpnpActionResponseHandler* self = new (ELeave) CUpnpActionResponseHandler( 
       
    59 	    aAVCPObserver, aAVCP );
       
    60 	CleanupStack::PushL( self );
       
    61 	self->ConstructL();
       
    62 	CleanupStack::Pop( self );
       
    63 	return self;
       
    64 	}
       
    65 
       
    66 // Destructor
       
    67 CUpnpActionResponseHandler::~CUpnpActionResponseHandler()	
       
    68 	{
       
    69 	}
       
    70 // -----------------------------------------------------------------------------
       
    71 // CUpnpActionResponseHandler::ActionResponseReceived
       
    72 // This is where action responses first came.
       
    73 // (other items were commented in a header)
       
    74 // -----------------------------------------------------------------------------
       
    75 //
       
    76 TInt CUpnpActionResponseHandler::ActionResponseReceived(CUpnpAction* aAction)
       
    77     {
       
    78     CUpnpService& service = aAction->Service();
       
    79     if( service.ServiceType().Length() <= 0 )
       
    80         {
       
    81         return KErrArgument;
       
    82         }
       
    83     TInt err( KErrNone );
       
    84     if ( service.ServiceType().Match(KRenderingControl) != KErrNotFound )
       
    85         {
       
    86         err = RenderingControlResponse(aAction);
       
    87         }
       
    88     else if ( service.ServiceType().Match(KAVTransport) != KErrNotFound )
       
    89         {
       
    90         err = AVTransportResponse(aAction);
       
    91         }
       
    92     else if ( service.ServiceType().Match(KConnectionManager) != KErrNotFound )
       
    93         {
       
    94         err = ConnectionManagerResponse(aAction);
       
    95         }
       
    96     else if ( service.ServiceType().Match(KContentDirectory) != KErrNotFound )
       
    97         {
       
    98         err = ContentDirectoryResponse(aAction);
       
    99         }
       
   100     else
       
   101         {
       
   102         err = KErrNotSupported;
       
   103         }
       
   104     return err;
       
   105     }
       
   106 // -----------------------------------------------------------------------------
       
   107 // CUpnpActionResponseHandler::RenderingControlResponse
       
   108 // This is where action responses first came.
       
   109 // (other items were commented in a header)
       
   110 // -----------------------------------------------------------------------------
       
   111 //
       
   112 TInt CUpnpActionResponseHandler::RenderingControlResponse(CUpnpAction* aAction)
       
   113     {
       
   114 	CUpnpService& service = aAction->Service();
       
   115 	if( service.ServiceType().Length() <= 0 )
       
   116 		{
       
   117 		return KErrArgument;
       
   118 		}
       
   119     const TDesC8& uuid = service.Device().Uuid();
       
   120     if (aAction->Name().Compare(KSetVolume) == 0)
       
   121         {
       
   122         iAVControlPointObserver.RcSetVolumeResponse(
       
   123              uuid,
       
   124              aAction->SessionId(),
       
   125              aAction->Error(),
       
   126              aAction->ArgumentValue( KInstanceID ),
       
   127              aAction->ArgumentValue( KChannel ),
       
   128              aAction->ArgumentValue( KDesiredVolume ) 
       
   129              );
       
   130         }		
       
   131     else if (aAction->Name().Compare(KGetVolume) == 0)
       
   132         {
       
   133         iAVControlPointObserver.RcVolumeResponse( 
       
   134              uuid,
       
   135              aAction->SessionId(),
       
   136              aAction->Error(),
       
   137              aAction->ArgumentValue( KInstanceID ),
       
   138              aAction->ArgumentValue( KChannel ),
       
   139              aAction->ArgumentValue( KCurrentVolume ) 
       
   140              );
       
   141         }    
       
   142     else if (aAction->Name().Compare(KSetMute) == 0)
       
   143         {
       
   144         iAVControlPointObserver.RcSetMuteResponse( 
       
   145              uuid,
       
   146              aAction->SessionId(),
       
   147              aAction->Error(),
       
   148              aAction->ArgumentValue( KInstanceID ),
       
   149              aAction->ArgumentValue( KChannel ),
       
   150              aAction->ArgumentValue( KDesiredMute ) 
       
   151              );
       
   152         }	
       
   153     else if (aAction->Name().Compare(KGetMute) == 0)
       
   154         {				
       
   155         iAVControlPointObserver.RcMuteResponse( 
       
   156              uuid,
       
   157              aAction->SessionId(),
       
   158              aAction->Error(),
       
   159              aAction->ArgumentValue( KInstanceID ),
       
   160              aAction->ArgumentValue( KChannel ),
       
   161              aAction->ArgumentValue( KCurrentMute ) 
       
   162              );
       
   163         }
       
   164     else
       
   165         {
       
   166         return KErrNotSupported;
       
   167         }
       
   168     return KErrNone;
       
   169     }
       
   170 // -----------------------------------------------------------------------------
       
   171 // CUpnpActionResponseHandler::AVTransportResponse
       
   172 // This is where action responses fot AV transport service are handled.
       
   173 // (other items were commented in a header)
       
   174 // -----------------------------------------------------------------------------
       
   175 //
       
   176 TInt CUpnpActionResponseHandler::AVTransportResponse(CUpnpAction* aAction)
       
   177     {
       
   178        
       
   179     CUpnpService& service = aAction->Service();
       
   180 	if( service.ServiceType().Length() <= 0 )
       
   181 		{
       
   182 		return KErrArgument;
       
   183 		}
       
   184     const TDesC8& uuid = service.Device().Uuid();
       
   185     if (aAction->Name().Compare(KSetAVTransportURI) == 0)
       
   186         {
       
   187         iAVControlPointObserver.AvtSetTransportUriResponse(
       
   188             uuid,
       
   189             aAction->SessionId(),
       
   190             aAction->Error(),
       
   191             aAction->ArgumentValue( KInstanceID ),
       
   192             aAction->ArgumentValue( KCurrentURI ),
       
   193             aAction->ArgumentValue( KCurrentURIMetaData )
       
   194             );
       
   195         }
       
   196     else if (aAction->Name().Compare(KSetNextAVTransportURI) == 0)
       
   197         {
       
   198         iAVControlPointObserver.AvtSetNextTransportUriResponse(
       
   199             uuid,
       
   200             aAction->SessionId(),
       
   201             aAction->Error(),
       
   202             aAction->ArgumentValue( KInstanceID ),
       
   203             aAction->ArgumentValue( KNextURI ),
       
   204             aAction->ArgumentValue( KNextURIMetaData )
       
   205             );
       
   206         }
       
   207     else if (aAction->Name().Compare(KGetMediaInfo) == 0)
       
   208         {
       
   209         iAVControlPointObserver.AvtMediaInfoResponse(
       
   210             uuid,
       
   211             aAction->SessionId(),
       
   212             aAction->Error(),
       
   213             aAction->ArgumentValue( KInstanceID ),
       
   214             aAction->ArgumentValue( KNrTracks ),
       
   215             aAction->ArgumentValue( KMediaDuration ),
       
   216             aAction->ArgumentValue( KCurrentURI ),
       
   217             aAction->ArgumentValue( KCurrentURIMetaData ),
       
   218             aAction->ArgumentValue( KNextURI ),
       
   219             aAction->ArgumentValue( KNextURIMetaData ),
       
   220             aAction->ArgumentValue( KPlayMedium ),
       
   221             aAction->ArgumentValue( KRecordMedium ),
       
   222             aAction->ArgumentValue( KWriteStatus )
       
   223             );
       
   224         }
       
   225     else if (aAction->Name().Compare(KGetTransportInfo) == 0)
       
   226         {			
       
   227         iAVControlPointObserver.AvtGetTransportInfoResponse(
       
   228             uuid,
       
   229             aAction->SessionId(),
       
   230             aAction->Error(),
       
   231             aAction->ArgumentValue( KInstanceID ),
       
   232             aAction->ArgumentValue( KCurrentTransportState ),
       
   233             aAction->ArgumentValue( KCurrentTransportStatus ),
       
   234             aAction->ArgumentValue( KCurrentSpeed )
       
   235             );
       
   236         }
       
   237     else if (aAction->Name().Compare(KGetPositionInfo) == 0)
       
   238         {
       
   239         iAVControlPointObserver.AvtPositionInfoResponse(
       
   240             uuid,
       
   241             aAction->SessionId(),
       
   242             aAction->Error(),
       
   243             aAction->ArgumentValue( KInstanceID ),
       
   244             aAction->ArgumentValue( KTrack ),
       
   245             aAction->ArgumentValue( KTrackDuration),
       
   246             aAction->ArgumentValue( KTrackMetaData ),
       
   247             aAction->ArgumentValue( KTrackURI ),
       
   248             aAction->ArgumentValue( KRelTime ),
       
   249             aAction->ArgumentValue( KAbsTime ),
       
   250             aAction->ArgumentValue( KRelCount ),
       
   251             aAction->ArgumentValue( KAbsCount )
       
   252             );
       
   253         }
       
   254     else if (aAction->Name().Compare(KGetDeviceCapabilities) == 0)
       
   255         {				
       
   256         iAVControlPointObserver.AvtDeviceCapabilitiesResponse(
       
   257             uuid,
       
   258             aAction->SessionId(),
       
   259             aAction->Error(),
       
   260             aAction->ArgumentValue( KInstanceID ),
       
   261             aAction->ArgumentValue( KPlayMedia ),
       
   262             aAction->ArgumentValue( KRecMedia ),
       
   263             aAction->ArgumentValue( KRecQualityMode )
       
   264             );
       
   265         }
       
   266     else if (aAction->Name().Compare(KGetTransportSettings) == 0)
       
   267         {				
       
   268         iAVControlPointObserver.AvtTransportSettingsResponse(
       
   269             uuid,
       
   270             aAction->SessionId(),
       
   271             aAction->Error(),
       
   272             aAction->ArgumentValue( KInstanceID ),
       
   273             aAction->ArgumentValue( KPlayMode ),
       
   274             aAction->ArgumentValue( KRecQualityMode )
       
   275             );
       
   276         }
       
   277     else if (aAction->Name().Compare(KStop) == 0)
       
   278         {				
       
   279         iAVControlPointObserver.AvtStopResponse(
       
   280             uuid,
       
   281             aAction->SessionId(),
       
   282             aAction->Error(),
       
   283             aAction->ArgumentValue( KInstanceID )
       
   284             );
       
   285         }
       
   286     else if (aAction->Name().Compare(KPlay) == 0)
       
   287         {				
       
   288         iAVControlPointObserver.AvtPlayResponse(
       
   289             uuid,
       
   290             aAction->SessionId(),
       
   291             aAction->Error(),
       
   292             aAction->ArgumentValue( KInstanceID ),
       
   293             aAction->ArgumentValue( KSpeed )
       
   294             );
       
   295         }
       
   296     else if (aAction->Name().Compare(KPause) == 0)
       
   297         {		
       
   298         iAVControlPointObserver.AvtPauseResponse(
       
   299             uuid,
       
   300             aAction->SessionId(),
       
   301             aAction->Error(),
       
   302             aAction->ArgumentValue( KInstanceID )
       
   303             );
       
   304         }
       
   305     else if (aAction->Name().Compare(KRecord) == 0)
       
   306         {		
       
   307         iAVControlPointObserver.AvtRecordResponse(
       
   308             uuid,
       
   309             aAction->SessionId(),
       
   310             aAction->Error(),
       
   311             aAction->ArgumentValue( KInstanceID )
       
   312             );
       
   313         }
       
   314     else if (aAction->Name().Compare(KSeek) == 0)
       
   315         {	
       
   316         iAVControlPointObserver.AvtSeekResponse(
       
   317             uuid,
       
   318             aAction->SessionId(),
       
   319             aAction->Error(),
       
   320             aAction->ArgumentValue( KInstanceID ),
       
   321             aAction->ArgumentValue( KUnit ),
       
   322             aAction->ArgumentValue( KTarget )
       
   323             );
       
   324         }
       
   325     else if (aAction->Name().Compare(KNext) == 0)
       
   326         {
       
   327         iAVControlPointObserver.AvtNextResponse(
       
   328             uuid,
       
   329             aAction->SessionId(),
       
   330             aAction->Error(),
       
   331             aAction->ArgumentValue( KInstanceID )
       
   332             );
       
   333         }
       
   334     else if (aAction->Name().Compare(KPrevious) == 0)
       
   335         {
       
   336         iAVControlPointObserver.AvtPreviousResponse(
       
   337             uuid,
       
   338             aAction->SessionId(),
       
   339             aAction->Error(),
       
   340             aAction->ArgumentValue( KInstanceID )
       
   341             );
       
   342         }
       
   343     else if (aAction->Name().Compare(KSetPlayMode) == 0)
       
   344         {
       
   345         iAVControlPointObserver.AvtSetPlayModeResponse(
       
   346             uuid,
       
   347             aAction->SessionId(),
       
   348             aAction->Error(),
       
   349             aAction->ArgumentValue( KInstanceID ),
       
   350             aAction->ArgumentValue( KNewPlayMode )
       
   351             );
       
   352         }
       
   353     else if (aAction->Name().Compare(KSetRecordQualityMode) == 0)
       
   354         {
       
   355         iAVControlPointObserver.AvtSetRecordModeResponse(
       
   356             uuid,
       
   357             aAction->SessionId(),
       
   358             aAction->Error(),
       
   359             aAction->ArgumentValue( KInstanceID ),
       
   360             aAction->ArgumentValue( KNewRecordQualityMode )
       
   361             );
       
   362         }
       
   363     else if (aAction->Name().Compare(KGetCurrentTransportActions) == 0)
       
   364         {
       
   365         iAVControlPointObserver.AvtSetPlayModeResponse(
       
   366             uuid,
       
   367             aAction->SessionId(),
       
   368             aAction->Error(),
       
   369             aAction->ArgumentValue( KInstanceID ),
       
   370             aAction->ArgumentValue( KActions )
       
   371             );
       
   372         }
       
   373     else{
       
   374         return KErrNotSupported;
       
   375         }
       
   376     return KErrNone;
       
   377     }
       
   378 // -----------------------------------------------------------------------------
       
   379 // CUpnpActionResponseHandler::ConnectionManagerResponse
       
   380 // This is where action responses for Connection Manager service are handled.
       
   381 // (other items were commented in a header)
       
   382 // -----------------------------------------------------------------------------
       
   383 //
       
   384 TInt CUpnpActionResponseHandler::ConnectionManagerResponse(CUpnpAction* aAction)
       
   385     {
       
   386     CUpnpService& service = aAction->Service();
       
   387     if( service.ServiceType().Length() <= 0 )
       
   388         {
       
   389         return KErrArgument;
       
   390         }
       
   391     const TDesC8& uuid = service.Device().Uuid();
       
   392     if (aAction->Name().Compare( KGetProtocolInfo ) == 0)
       
   393         {
       
   394         iAVControlPointObserver.CmProtocolInfoResponse(
       
   395             uuid,
       
   396             aAction->SessionId(),
       
   397             aAction->Error(),
       
   398             aAction->ArgumentValue( KSource ), 
       
   399             aAction->ArgumentValue( KSink )
       
   400             );
       
   401         }
       
   402     
       
   403     else if (aAction->Name().Compare( KPrepareForConnection ) == 0)
       
   404         {
       
   405         TLex8 connectionLex1( aAction->ArgumentValue( KConnectionId ) );
       
   406         TInt connectionId;
       
   407         connectionLex1.Val( connectionId );			
       
   408         TLex8 transportLex1( aAction->ArgumentValue( KAVTransportId ) );
       
   409         TInt transportId;
       
   410         transportLex1.Val( transportId );			
       
   411         TLex8 rscLex3( aAction->ArgumentValue( KRcsID ) );
       
   412         TInt rscId;
       
   413         rscLex3.Val( rscId );
       
   414         iAVControlPointObserver.CmPrepareResponse(
       
   415             uuid,
       
   416             aAction->SessionId(),
       
   417             aAction->Error(),
       
   418             aAction->ArgumentValue( KRemoteProtocolInfo ),
       
   419             aAction->ArgumentValue( KPeerConnectionManager ),
       
   420             aAction->ArgumentValue( KPeerConnectionId ),
       
   421             aAction->ArgumentValue( KDirection ),
       
   422             connectionId,
       
   423             transportId,
       
   424             rscId
       
   425             );
       
   426         }
       
   427     else if (aAction->Name().Compare(KConnectionComplete) == 0)
       
   428         {
       
   429         TLex8 connectionLex1( aAction->ArgumentValue( KConnectionId ) );
       
   430         TInt connectionId;
       
   431         connectionLex1.Val( connectionId );
       
   432 
       
   433         iAVControlPointObserver.CmComplete(
       
   434             uuid,
       
   435             aAction->SessionId(),
       
   436             aAction->Error(),
       
   437             connectionId
       
   438             );
       
   439         }
       
   440     else if (aAction->Name().Compare(KGetCurrentConnectionIDs) == 0)
       
   441         {
       
   442         iAVControlPointObserver.CmCurrentConnections(
       
   443             uuid,
       
   444             aAction->SessionId(),
       
   445             aAction->Error(),
       
   446             aAction->ArgumentValue( KConnectionIds )
       
   447             );
       
   448         }
       
   449     else if (aAction->Name().Compare( KGetCurrentConnectionInfo ) == 0)
       
   450         {	
       
   451         
       
   452         TLex8 rscLex3( aAction->ArgumentValue( KRcsID ) );
       
   453         TInt rscId;
       
   454         rscLex3.Val( rscId );			
       
   455         TLex8 transportLex1( aAction->ArgumentValue( KAVTransportId ) );
       
   456         TInt transportId;
       
   457         transportLex1.Val( transportId );			
       
   458         TLex8 peerLex( aAction->ArgumentValue( KPeerConnectionId ) );
       
   459         TInt peerId;
       
   460         peerLex.Val( peerId );
       
   461         
       
   462         iAVControlPointObserver.CmCurrentInfo(
       
   463             uuid,
       
   464             aAction->SessionId(),
       
   465             aAction->Error(),
       
   466             rscId, 
       
   467             transportId, 
       
   468             aAction->ArgumentValue( KProtocolInfo),
       
   469             aAction->ArgumentValue( KPeerConnectionManager), 
       
   470             peerId, 
       
   471             aAction->ArgumentValue( KDirection ), 
       
   472             aAction->ArgumentValue( KStatus )
       
   473             );
       
   474         }
       
   475     else
       
   476         {       
       
   477         return KErrNotSupported;
       
   478         }
       
   479     return KErrNone;
       
   480     }
       
   481 
       
   482 // -----------------------------------------------------------------------------
       
   483 // CUpnpActionResponseHandler::ContentDirectoryResponse
       
   484 // This is where action responses for Content Directory service are handled.
       
   485 // (other items were commented in a header)
       
   486 // -----------------------------------------------------------------------------
       
   487 //
       
   488 TInt CUpnpActionResponseHandler::ContentDirectoryResponse(CUpnpAction* aAction)
       
   489     {
       
   490     CUpnpService& service = aAction->Service();
       
   491 	if( service.ServiceType().Length() <= 0 )
       
   492 		{
       
   493 		return KErrArgument;
       
   494 		}
       
   495     const TDesC8& uuid = service.Device().Uuid();
       
   496     if (aAction->Name().Compare(KGetSearchCapabilities) == 0)
       
   497         {
       
   498         iAVControlPointObserver.CdsSearchCapabilitiesResponse(
       
   499             uuid,
       
   500             aAction->SessionId(),
       
   501             aAction->Error(),
       
   502             aAction->ArgumentValue( KSearchCaps )
       
   503             );
       
   504         }
       
   505     else if (aAction->Name().Compare(KGetSortCapabilities) == 0)
       
   506         {
       
   507         iAVControlPointObserver.CdsSortCapabilitiesResponse(
       
   508             uuid,
       
   509             aAction->SessionId(),
       
   510             aAction->Error(),
       
   511             aAction->ArgumentValue( KSortCaps )
       
   512             );
       
   513         }
       
   514     else if (aAction->Name().Compare(KGetSystemUpdateID) == 0)
       
   515         {	
       
   516         const TDesC8& systemUpdateId = aAction->ArgumentValue( KId );
       
   517         TLex8 updateidLex( systemUpdateId );
       
   518         TInt systemUpdate;
       
   519         updateidLex.Val( systemUpdate );
       
   520         
       
   521         iAVControlPointObserver.CdsSystemUpdateIdResponse(
       
   522             uuid,
       
   523             aAction->SessionId(),
       
   524             aAction->Error(),
       
   525             systemUpdate
       
   526             );
       
   527         }
       
   528     else if (aAction->Name().Compare(KBrowse) == 0)
       
   529         {		
       
   530         const TDesC8& numberReturned = aAction->ArgumentValue( KNumberReturned );
       
   531         TLex8 returnedLex( numberReturned );
       
   532         TInt numberReturnedInt;
       
   533         returnedLex.Val( numberReturnedInt );
       
   534         
       
   535         const TDesC8& totalmatches = aAction->ArgumentValue( KTotalMatches );
       
   536         TLex8 matchesLex( totalmatches );
       
   537         TInt totalMatchesInt;
       
   538         matchesLex.Val( totalMatchesInt );
       
   539         
       
   540         const TDesC8& updateId = aAction->ArgumentValue( KUpdateID );
       
   541         TLex8 updateLex( updateId );
       
   542         TInt updateIdInt;
       
   543         updateLex.Val( updateIdInt );
       
   544 
       
   545         const TDesC8& startIndex = aAction->ArgumentValue( KStartingIndex );
       
   546         TLex8 indexLex( startIndex );
       
   547         TInt indexInt;
       
   548         indexLex.Val( indexInt );
       
   549 
       
   550         const TDesC8& requestCount = aAction->ArgumentValue( KRequestedCount );
       
   551         TLex8 requestLex( requestCount );
       
   552         TInt requestInt;
       
   553         requestLex.Val( requestInt );
       
   554         
       
   555         iAVControlPointObserver.CdsBrowseResponse(
       
   556             uuid,
       
   557             aAction->SessionId(),
       
   558             aAction->Error(),
       
   559             aAction->ArgumentValue( KObjectID ),
       
   560             aAction->ArgumentValue( KBrowseFlag ),
       
   561             aAction->ArgumentValue( KFilter ),
       
   562             indexInt,
       
   563             requestInt,
       
   564             aAction->ArgumentValue( KSortCriteria ),
       
   565             aAction->ArgumentValue( KResult ),
       
   566             numberReturnedInt,
       
   567             totalMatchesInt,
       
   568             aAction->ArgumentValue( KUpdateID )
       
   569                 );
       
   570     }
       
   571     else if (aAction->Name().Compare(KSearch) == 0)
       
   572         {		
       
   573 
       
   574         const TDesC8& numberReturned = aAction->ArgumentValue( KNumberReturned );
       
   575         TLex8 returnedLex( numberReturned );
       
   576         TInt numberReturnedInt;
       
   577         returnedLex.Val( numberReturnedInt );
       
   578         
       
   579         const TDesC8& totalmatches = aAction->ArgumentValue( KTotalMatches );
       
   580         TLex8 matchesLex( totalmatches );
       
   581         TInt totalMatchesInt;
       
   582         matchesLex.Val( totalMatchesInt );
       
   583         
       
   584         const TDesC8& updateId = aAction->ArgumentValue( KUpdateID );
       
   585         TLex8 updateLex( updateId );
       
   586         TInt updateIdInt;
       
   587         updateLex.Val( updateIdInt );
       
   588 
       
   589         const TDesC8& startingIndex = aAction->ArgumentValue( KStartingIndex );
       
   590         TLex8 indexLex( startingIndex );
       
   591         TInt indexInt;
       
   592         indexLex.Val( indexInt );
       
   593 
       
   594         const TDesC8& reqCnt = aAction->ArgumentValue( KRequestedCount );
       
   595         TLex8 requestLex( reqCnt );
       
   596         TInt requestInt;
       
   597         requestLex.Val( requestInt );
       
   598         
       
   599         iAVControlPointObserver.CdsSearchResponse(
       
   600             uuid,
       
   601             aAction->SessionId(),
       
   602             aAction->Error(),
       
   603             aAction->ArgumentValue( KContainerID ),
       
   604             aAction->ArgumentValue( KSearchCriteria ),
       
   605             aAction->ArgumentValue( KFilter ),
       
   606             indexInt,
       
   607             requestInt,
       
   608             aAction->ArgumentValue( KSortCriteria ),
       
   609             aAction->ArgumentValue( KResult ),
       
   610             numberReturnedInt,
       
   611             totalMatchesInt,
       
   612             aAction->ArgumentValue( KUpdateID )
       
   613             );
       
   614         }
       
   615     else if (aAction->Name().Compare(KDestroyObject) == 0)
       
   616         {		
       
   617         iAVControlPointObserver.CdsDestroyObjectResponse(
       
   618             uuid,
       
   619             aAction->SessionId(),
       
   620             aAction->Error(),
       
   621             aAction->ArgumentValue( KObjectID )
       
   622             );
       
   623         }
       
   624     else if (aAction->Name().Compare(KUpdateObject) == 0)
       
   625         {	
       
   626         iAVControlPointObserver.CdsUpdateObjectResponse(
       
   627             uuid,
       
   628             aAction->SessionId(),
       
   629             aAction->Error(),
       
   630             aAction->ArgumentValue( KObjectID ),
       
   631             aAction->ArgumentValue( KCurrentTagValue ),
       
   632             aAction->ArgumentValue( KNewTagValue )
       
   633             );
       
   634         }
       
   635     else if (aAction->Name().Compare(KImportResource) == 0)
       
   636         {		
       
   637         iAVControlPointObserver.CdsImportResponse(
       
   638             uuid,
       
   639             aAction->SessionId(),
       
   640             aAction->Error(),
       
   641             aAction->ArgumentValue( KSourceURI ),
       
   642             aAction->ArgumentValue( KDestinationURI  ),
       
   643             aAction->ArgumentValue( KTransferID )
       
   644             );
       
   645         }
       
   646     else if (aAction->Name().Compare(KExportResource) == 0)
       
   647         {			
       
   648         iAVControlPointObserver.CdsExportResponse(
       
   649             uuid,
       
   650             aAction->SessionId(),
       
   651             aAction->Error(),
       
   652             aAction->ArgumentValue( KSourceURI ),
       
   653             aAction->ArgumentValue( KDestinationURI  ),
       
   654             aAction->ArgumentValue( KTransferID )
       
   655             );		
       
   656         }
       
   657     else if (aAction->Name().Compare(KStopTransferResource) == 0)
       
   658         {		
       
   659         iAVControlPointObserver.CdsStopTransferResponse(
       
   660             uuid,
       
   661             aAction->SessionId(),
       
   662             aAction->Error(),
       
   663             aAction->ArgumentValue( KTransferID )
       
   664             );		
       
   665         }
       
   666     else if (aAction->Name().Compare(KGetTransferProgress) == 0)
       
   667         {	
       
   668         iAVControlPointObserver.CdsCTransferProgressResponse(
       
   669             uuid,
       
   670             aAction->SessionId(),
       
   671             aAction->Error(),
       
   672             aAction->ArgumentValue( KTransferID ),
       
   673             aAction->ArgumentValue( KTransferStatus ),
       
   674             aAction->ArgumentValue( KTransferLength ),            
       
   675             aAction->ArgumentValue( KTransferTotal )
       
   676             );
       
   677         }
       
   678     else if (aAction->Name().Compare(KDeleteResource) == 0)
       
   679         {		
       
   680         iAVControlPointObserver.CdsDeleteResourceResponse(
       
   681             uuid,
       
   682             aAction->SessionId(),
       
   683             aAction->Error(),
       
   684             aAction->ArgumentValue(KResourceURI)
       
   685             );
       
   686         }
       
   687     else if (aAction->Name().Compare(KCreateReference) == 0)
       
   688         {
       
   689         iAVControlPointObserver.CdsCreateReferenceResponse(
       
   690             uuid,
       
   691             aAction->SessionId(),
       
   692             aAction->Error(),
       
   693             aAction->ArgumentValue(KContainerID), 
       
   694             aAction->ArgumentValue(KObjectID), 
       
   695             aAction->ArgumentValue(KNewID)
       
   696             );
       
   697         }
       
   698     else if (aAction->Name().Compare(KCreateObject) == 0)
       
   699         {
       
   700         iAVControlPointObserver.CdsCreateObjectResponse(
       
   701             uuid,
       
   702             aAction->SessionId(),
       
   703             aAction->Error(),
       
   704             aAction->ArgumentValue(KContainerID), 
       
   705             aAction->ArgumentValue(KElements), 
       
   706             aAction->ArgumentValue(KObjectID), 
       
   707             aAction->ArgumentValue(KResult)
       
   708             );
       
   709         }
       
   710     else
       
   711         {
       
   712         return KErrArgument;
       
   713         }
       
   714     return KErrNone;
       
   715     }
       
   716 
       
   717 //End of file