accessoryservices/remotecontrolfw/server/src/server.cpp
branchRCL_3
changeset 10 66ecddbca914
parent 0 4e1aa6a622a0
child 20 1ddbe54d0645
equal deleted inserted replaced
9:21e939dd208a 10:66ecddbca914
   447 	LOG1(_L("\t&aSession = 0x%08x"), &aSession);
   447 	LOG1(_L("\t&aSession = 0x%08x"), &aSession);
   448 	LOGSESSIONS;
   448 	LOGSESSIONS;
   449 
   449 
   450 	ASSERT_DEBUG(iBearerManager);
   450 	ASSERT_DEBUG(iBearerManager);
   451 	iBearerManager->TargetClientAvailable(aSession.Id(), aSession.PlayerType(), aSession.PlayerSubType(), aSession.Name());
   451 	iBearerManager->TargetClientAvailable(aSession.Id(), aSession.PlayerType(), aSession.PlayerSubType(), aSession.Name());
       
   452 	if(iTspIf5)
       
   453 		{
       
   454 		iTspIf5->TargetClientAvailable(aSession.ClientInfo());
       
   455 		}
   452 
   456 
   453 	LOGSESSIONS;
   457 	LOGSESSIONS;
   454 	}
   458 	}
   455 
   459 
   456 // this function is called by the session when the client has registered its features
   460 // this function is called by the session when the client has registered its features
   521 			// We've found the session in our array.
   525 			// We've found the session in our array.
   522 
   526 
   523 			// 1. Remove the session from our array.
   527 			// 1. Remove the session from our array.
   524 			iSessions.Remove(ii);
   528 			iSessions.Remove(ii);
   525 
   529 
   526 			// 2. Tell the bearers about the session going away, if it was the 
   530 			// 2a. Tell the TSP if the session that has gone away is a target
       
   531 			if((aSession.Type() == ERemConClientTypeTarget) && iTspIf5)
       
   532 				{
       
   533 				iTspIf5->TargetClientUnavailable(aSession.ClientInfo());
       
   534 				}
       
   535 			
       
   536 			// 2b. Tell the bearers about the session going away, if it was the 
   527 			// last controller or last target.
   537 			// last controller or last target.
   528 			// If the session hasn't already set its type, then it doesn't 
   538 			// If the session hasn't already set its type, then it doesn't 
   529 			// count (we won't have told the bearers about it to begin with).
   539 			// count (we won't have told the bearers about it to begin with).
   530 			// The bearer manager maintains controller and target counts for all bearers
   540 			// The bearer manager maintains controller and target counts for all bearers
   531 			// and will tell bearers when they need to know things have changed */
   541 			// and will tell bearers when they need to know things have changed */
  1996 	
  2006 	
  1997 	iTspIf4 = reinterpret_cast<MRemConTargetSelectorPluginInterfaceV4*>(
  2007 	iTspIf4 = reinterpret_cast<MRemConTargetSelectorPluginInterfaceV4*>(
  1998 			iTsp->GetInterface(TUid::Uid(KRemConTargetSelectorInterface4))
  2008 			iTsp->GetInterface(TUid::Uid(KRemConTargetSelectorInterface4))
  1999 		);
  2009 		);
  2000 	
  2010 	
       
  2011 	iTspIf5 = reinterpret_cast<MRemConTargetSelectorPluginInterfaceV5*>(
       
  2012 			iTsp->GetInterface(TUid::Uid(KRemConTargetSelectorInterface5))
       
  2013 		);
       
  2014 	
  2001 	// If the TSP doesn't implement the required interface, panic server 
  2015 	// If the TSP doesn't implement the required interface, panic server 
  2002 	// startup.
  2016 	// startup.
  2003 	ASSERT_ALWAYS(iTspIf);
  2017 	ASSERT_ALWAYS(iTspIf);
  2004 	
  2018 	
  2005 	// We always need a V4 interface to allow simpler handling by the 
  2019 	// We always need a V4 interface to allow simpler handling by the 
  3383 
  3397 
  3384 	ASSERT_DEBUG(iTspIf4);
  3398 	ASSERT_DEBUG(iTspIf4);
  3385 	iTspIf4->SetRemoteAddressedClient(aBearerUid, *clientInfo);
  3399 	iTspIf4->SetRemoteAddressedClient(aBearerUid, *clientInfo);
  3386 	}
  3400 	}
  3387 
  3401 
       
  3402 TInt CRemConServer::RegisterLocalAddressedClientObserver(const TUid& aBearerUid)
       
  3403 	{
       
  3404 	return iTspIf5 ? iTspIf5->RegisterLocalAddressedClientObserver(aBearerUid) : KErrNotSupported;
       
  3405 	}
       
  3406 
       
  3407 TInt CRemConServer::UnregisterLocalAddressedClientObserver(const TUid& aBearerUid)
       
  3408 	{
       
  3409 	return iTspIf5 ? iTspIf5->UnregisterLocalAddressedClientObserver(aBearerUid) : KErrNotSupported;
       
  3410 	}
       
  3411 
  3388 TRemConClientId CRemConServer::ClientIdByProcessId(TProcessId aProcessId)
  3412 TRemConClientId CRemConServer::ClientIdByProcessId(TProcessId aProcessId)
  3389 	{
  3413 	{
  3390 	LOG_FUNC
  3414 	LOG_FUNC
  3391 	TRemConClientId ret = KNullClientId;
  3415 	TRemConClientId ret = KNullClientId;
  3392 	iSessionsLock.Wait();
  3416 	iSessionsLock.Wait();