mmserv/radioutility/radioserver/Session/Src/RadioSession.cpp
changeset 20 b67dd1fc57c5
parent 0 71ca22bcf22a
child 46 0ac9a5310753
equal deleted inserted replaced
19:4a629bc82c5e 20:b67dd1fc57c5
    23 #include    "RadioSession.h"
    23 #include    "RadioSession.h"
    24 #include    "RadioClientServer.h"
    24 #include    "RadioClientServer.h"
    25 #include	"RadioRequest.h"
    25 #include	"RadioRequest.h"
    26 #include	"RadioEventHandler.h"
    26 #include	"RadioEventHandler.h"
    27 #include    "RadioDebug.h"
    27 #include    "RadioDebug.h"
       
    28 #include    "trace.h"
    28 
    29 
    29 // CONSTANTS
    30 // CONSTANTS
    30 // Index to list of asynchronous requests that generates response to MRadioObserver.
    31 // Index to list of asynchronous requests that generates response to MRadioObserver.
    31 const TInt KReqInternal				 = 0;
    32 const TInt KReqInternal				 = 0;
    32 const TInt KReqRequestTunerControl   = 1;
    33 const TInt KReqRequestTunerControl   = 1;
    52 // Returns: TInt: KErrNone (0) if no error
    53 // Returns: TInt: KErrNone (0) if no error
    53 // -----------------------------------------------------------------------------
    54 // -----------------------------------------------------------------------------
    54 //
    55 //
    55 static TInt StartServer()
    56 static TInt StartServer()
    56 	{
    57 	{
    57 	RADIO_RDEBUG(_L("[RADIO-SESS] StartServer()"));
    58     FUNC_LOG;
    58 
    59 
    59     const TUidType serverUid(KNullUid, KNullUid, KRadioServerUid3);
    60     const TUidType serverUid(KNullUid, KNullUid, KRadioServerUid3);
    60 
    61 
    61 	// We just create a new server process. Simultaneous launching of two such
    62 	// We just create a new server process. Simultaneous launching of two such
    62 	// processes should be detected when the second one attempts to create
    63 	// processes should be detected when the second one attempts to create
    64     RProcess server;
    65     RProcess server;
    65     TInt r = server.Create(KRadioServerImg, KNullDesC, serverUid);
    66     TInt r = server.Create(KRadioServerImg, KNullDesC, serverUid);
    66 
    67 
    67     if ( r != KErrNone )
    68     if ( r != KErrNone )
    68 	    {
    69 	    {
    69 		RADIO_RDEBUG_INT(_L("[RADIO-SESS] server.Create() failed [%d]"), r);
    70 		INFO_1("server.Create() failed [%d]", r);
    70         return r;
    71         return r;
    71 	    }
    72 	    }
    72 	TRequestStatus stat;
    73 	TRequestStatus stat;
    73 	server.Rendezvous(stat);
    74 	server.Rendezvous(stat);
    74 	if ( stat != KRequestPending )
    75 	if ( stat != KRequestPending )
    89 	}
    90 	}
    90 
    91 
    91 // ============================ MEMBER FUNCTIONS ===============================
    92 // ============================ MEMBER FUNCTIONS ===============================
    92 
    93 
    93 // -----------------------------------------------------------------------------
    94 // -----------------------------------------------------------------------------
       
    95 // RRadioSession::NewL
       
    96 // Two-phased constructor except no need for ConstrucL
       
    97 // -----------------------------------------------------------------------------
       
    98 //
       
    99 EXPORT_C RRadioSession* RRadioSession::NewL()
       
   100     {
       
   101     FUNC_LOG;
       
   102     RRadioSession* self = new (ELeave) RRadioSession();
       
   103     return self;
       
   104     }
       
   105 
       
   106 // -----------------------------------------------------------------------------
    94 // RRadioSession::RRadioSession
   107 // RRadioSession::RRadioSession
    95 // C++ default constructor can NOT contain any code, that
   108 // C++ default constructor can NOT contain any code, that
    96 // might leave.
   109 // might leave.
    97 // -----------------------------------------------------------------------------
   110 // -----------------------------------------------------------------------------
    98 //
   111 //
   101 		iDestinationPckg(TMMFMessageDestination(KRadioServerInterfaceUid, KRadioServerObjectHandle)),
   114 		iDestinationPckg(TMMFMessageDestination(KRadioServerInterfaceUid, KRadioServerObjectHandle)),
   102 		iObserver(NULL),
   115 		iObserver(NULL),
   103 		iPrimaryClient(EFalse),
   116 		iPrimaryClient(EFalse),
   104 		iRdsNotify(EFalse)
   117 		iRdsNotify(EFalse)
   105     {
   118     {
       
   119     FUNC_LOG;
   106     }
   120     }
   107 
   121 
   108 // -----------------------------------------------------------------------------
   122 // -----------------------------------------------------------------------------
   109 // RRadioSession::Connect
   123 // RRadioSession::Connect
   110 // Create a client-side session. Start the server if not started already.
   124 // Create a client-side session. Start the server if not started already.
   112 //
   126 //
   113 EXPORT_C TInt RRadioSession::Connect(
   127 EXPORT_C TInt RRadioSession::Connect(
   114 	MRadioObserver& aObserver,
   128 	MRadioObserver& aObserver,
   115 	TBool aPrimaryClient )
   129 	TBool aPrimaryClient )
   116 	{
   130 	{
   117 	RADIO_RDEBUG(_L("[RADIO-SESS] Connect() entry"));
   131     FUNC_LOG;
   118 	// check if already connected
   132 	// check if already connected
   119 	if ( iConnected )
   133 	if ( iConnected )
   120 		{
   134 		{
   121 		RADIO_RDEBUG(_L("[RADIO-SESS] Connect(): already connected"));
   135 		INFO("already connected");
   122 		return KErrAlreadyExists;
   136 		return KErrAlreadyExists;
   123 		}
   137 		}
   124 
   138 
   125    	TInt retry = KRadioStartRetry;
   139    	TInt retry = KRadioStartRetry;
   126    	TInt err = KErrGeneral;
   140    	TInt err = KErrGeneral;
   145 			}
   159 			}
   146    		}
   160    		}
   147 
   161 
   148 	if ( err != KErrNone )
   162 	if ( err != KErrNone )
   149 		{
   163 		{
   150 		RADIO_RDEBUG_INT(_L("[RADIO-SESS] Connect(): Unable to start server [%d]"), err);
   164 		INFO_1("Unable to start server [%d]", err);
   151 		return err;
   165 		return err;
   152 		}
   166 		}
   153 
   167 
   154 	// Create active object request handlers and add it to scheduler
   168 	// Create active object request handlers and add it to scheduler
   155 	TRAP(err, StartRequestHandlersL(aObserver));
   169 	TRAP(err, StartRequestHandlersL(aObserver));
   175 		}
   189 		}
   176 	else
   190 	else
   177 		{
   191 		{
   178 		iRequests.ResetAndDestroy();
   192 		iRequests.ResetAndDestroy();
   179 		}
   193 		}
   180 
   194 	INFO_1("exit err=[%d]", err);
   181 	RADIO_RDEBUG_INT(_L("[RADIO-SESS] Connect() exit err=[%d]"), err);
       
   182 	return err;
   195 	return err;
   183 	}
   196 	}
   184 
   197 
   185 // -----------------------------------------------------------------------------
   198 // -----------------------------------------------------------------------------
   186 // RRadioSession::Version
   199 // RRadioSession::Version
   187 // -----------------------------------------------------------------------------
   200 // -----------------------------------------------------------------------------
   188 //
   201 //
   189 EXPORT_C TVersion RRadioSession::Version() const
   202 EXPORT_C TVersion RRadioSession::Version() const
   190 	{
   203 	{
       
   204     FUNC_LOG;
   191 	return(TVersion(KRadioServerVersionMajor, KRadioServerVersionMinor, KRadioServerVersionBuild));
   205 	return(TVersion(KRadioServerVersionMajor, KRadioServerVersionMinor, KRadioServerVersionBuild));
   192 	}
   206 	}
   193 
   207 
   194 // -----------------------------------------------------------------------------
   208 // -----------------------------------------------------------------------------
   195 // RRadioSession::Close
   209 // RRadioSession::Close
   196 // -----------------------------------------------------------------------------
   210 // -----------------------------------------------------------------------------
   197 //
   211 //
   198 EXPORT_C void RRadioSession::Close()
   212 EXPORT_C void RRadioSession::Close()
   199 	{
   213 	{
   200 	RADIO_RDEBUG(_L("[RADIO-SESS] Close() entry"));
   214     FUNC_LOG;
   201 	iRequests.ResetAndDestroy();
   215 	iRequests.ResetAndDestroy();
   202 	iRequests.Close();
   216 	iRequests.Close();
   203 
   217 
   204 	iEventHandlers.ResetAndDestroy();
   218 	iEventHandlers.ResetAndDestroy();
   205 	iEventHandlers.Close();
   219 	iEventHandlers.Close();
   214 			{
   228 			{
   215 			SendReceive(ERadioServRemovePrimaryClient, TIpcArgs(&iDestinationPckg));
   229 			SendReceive(ERadioServRemovePrimaryClient, TIpcArgs(&iDestinationPckg));
   216 			}
   230 			}
   217 		RSessionBase::Close();
   231 		RSessionBase::Close();
   218 		}
   232 		}
   219 	RADIO_RDEBUG(_L("[RADIO-SESS] Close() exit"));
       
   220 	}
   233 	}
   221 
   234 
   222 //********** TunerUtility control begins
   235 //********** TunerUtility control begins
   223 
   236 
   224 // -----------------------------------------------------------------------------
   237 // -----------------------------------------------------------------------------
   226 // -----------------------------------------------------------------------------
   239 // -----------------------------------------------------------------------------
   227 //
   240 //
   228 EXPORT_C void RRadioSession::RequestTunerControl(
   241 EXPORT_C void RRadioSession::RequestTunerControl(
   229 	TRsTuner aTuner )
   242 	TRsTuner aTuner )
   230 	{
   243 	{
   231 	RADIO_RDEBUG(_L("[RADIO-SESS] RequestTunerControl()"));
       
   232 	if ( iConnected )
   244 	if ( iConnected )
   233 		{
   245 		{
   234 		if ( iRequests[KReqRequestTunerControl]->IsActive() )
   246 		if ( iRequests[KReqRequestTunerControl]->IsActive() )
   235 			{
   247 			{
   236 			iRequests[KReqRequestTunerControl]->Cancel();
   248 			iRequests[KReqRequestTunerControl]->Cancel();
   251 // -----------------------------------------------------------------------------
   263 // -----------------------------------------------------------------------------
   252 //
   264 //
   253 EXPORT_C TInt RRadioSession::GetTunerCapabilities(
   265 EXPORT_C TInt RRadioSession::GetTunerCapabilities(
   254 	TRsTunerCapabilities& aCaps ) const
   266 	TRsTunerCapabilities& aCaps ) const
   255 	{
   267 	{
   256 	RADIO_RDEBUG(_L("[RADIO-SESS] GetTunerCapabilities()"));
       
   257 	if ( iConnected )
   268 	if ( iConnected )
   258 		{
   269 		{
   259 		TPckg<TRsTunerCapabilities> caps(aCaps);
   270 		TPckg<TRsTunerCapabilities> caps(aCaps);
   260 		return SendReceive(ERadioServGetTunerCapabilities,
   271 		return SendReceive(ERadioServGetTunerCapabilities,
   261 						   TIpcArgs(&iDestinationPckg, &caps));
   272 						   TIpcArgs(&iDestinationPckg, &caps));
   271 // -----------------------------------------------------------------------------
   282 // -----------------------------------------------------------------------------
   272 //
   283 //
   273 EXPORT_C TInt RRadioSession::EnableTunerInOfflineMode(
   284 EXPORT_C TInt RRadioSession::EnableTunerInOfflineMode(
   274 	TBool aEnable )
   285 	TBool aEnable )
   275 	{
   286 	{
   276 	RADIO_RDEBUG_INT(_L("[RADIO-SESS] EnableTunerInOfflineMode() [%d]"), aEnable);
   287     FUNC_LOG;
   277 	if ( iConnected )
   288 	if ( iConnected )
   278 		{
   289 		{
   279 		return SendReceive(ERadioServEnableTunerInOfflineMode,
   290 		return SendReceive(ERadioServEnableTunerInOfflineMode,
   280     					   TIpcArgs(&iDestinationPckg, aEnable));
   291     					   TIpcArgs(&iDestinationPckg, aEnable));
   281 		}
   292 		}
   290 // -----------------------------------------------------------------------------
   301 // -----------------------------------------------------------------------------
   291 //
   302 //
   292 EXPORT_C void RRadioSession::SetFrequencyRange(
   303 EXPORT_C void RRadioSession::SetFrequencyRange(
   293 	TRsFrequencyRange aRange )
   304 	TRsFrequencyRange aRange )
   294 	{
   305 	{
   295 	RADIO_RDEBUG_INT(_L("[RADIO-SESS] SetFrequencyRange() [%d]"), aRange);
   306     FUNC_LOG;
   296 	if ( iConnected )
   307 	if ( iConnected )
   297 		{
   308 		{
   298 		if ( iRequests[KReqSetFrequencyRange]->IsActive() )
   309 		if ( iRequests[KReqSetFrequencyRange]->IsActive() )
   299 			{
   310 			{
   300 			iRequests[KReqSetFrequencyRange]->Cancel();
   311 			iRequests[KReqSetFrequencyRange]->Cancel();
   314 // RRadioSession::CancelSetFrequencyRange
   325 // RRadioSession::CancelSetFrequencyRange
   315 // -----------------------------------------------------------------------------
   326 // -----------------------------------------------------------------------------
   316 //
   327 //
   317 EXPORT_C void RRadioSession::CancelSetFrequencyRange()
   328 EXPORT_C void RRadioSession::CancelSetFrequencyRange()
   318 	{
   329 	{
   319 	RADIO_RDEBUG(_L("[RADIO-SESS] CancelSetFrequencyRange()"));
   330     FUNC_LOG;
   320 	if ( iConnected && iRequests[KReqSetFrequencyRange]->IsActive() )
   331 	if ( iConnected && iRequests[KReqSetFrequencyRange]->IsActive() )
   321 		{
   332 		{
   322 		iRequests[KReqSetFrequencyRange]->Cancel();
   333 		iRequests[KReqSetFrequencyRange]->Cancel();
   323 		}
   334 		}
   324 	}
   335 	}
   330 EXPORT_C TInt RRadioSession::GetFrequencyRange(
   341 EXPORT_C TInt RRadioSession::GetFrequencyRange(
   331 	TRsFrequencyRange& aRange,
   342 	TRsFrequencyRange& aRange,
   332 	TInt& aMinFreq,
   343 	TInt& aMinFreq,
   333 	TInt& aMaxFreq) const
   344 	TInt& aMaxFreq) const
   334 	{
   345 	{
   335 	RADIO_RDEBUG(_L("[RADIO-SESS] GetFrequencyRange()"));
   346     FUNC_LOG;
   336 	if ( iConnected )
   347 	if ( iConnected )
   337 		{
   348 		{
   338 		TPckg<TRsFrequencyRange> range(aRange);
   349 		TPckg<TRsFrequencyRange> range(aRange);
   339 		TPckg<TInt> min(aMinFreq);
   350 		TPckg<TInt> min(aMinFreq);
   340 		TPckg<TInt> max(aMaxFreq);
   351 		TPckg<TInt> max(aMaxFreq);
   352 // -----------------------------------------------------------------------------
   363 // -----------------------------------------------------------------------------
   353 //
   364 //
   354 EXPORT_C void RRadioSession::SetFrequency(
   365 EXPORT_C void RRadioSession::SetFrequency(
   355 	TInt aFrequency )
   366 	TInt aFrequency )
   356 	{
   367 	{
   357 	RADIO_RDEBUG_INT(_L("[RADIO-SESS] SetFrequency() [%d]"), aFrequency);
   368     FUNC_LOG;
   358 	if ( iConnected )
   369 	if ( iConnected )
   359 		{
   370 		{
   360 		if ( iRequests[KReqSetFrequency]->IsActive() )
   371 		if ( iRequests[KReqSetFrequency]->IsActive() )
   361 			{
   372 			{
   362 			iRequests[KReqSetFrequency]->Cancel();
   373 			iRequests[KReqSetFrequency]->Cancel();
   376 // RRadioSession::CancelSetFrequency
   387 // RRadioSession::CancelSetFrequency
   377 // -----------------------------------------------------------------------------
   388 // -----------------------------------------------------------------------------
   378 //
   389 //
   379 EXPORT_C void RRadioSession::CancelSetFrequency()
   390 EXPORT_C void RRadioSession::CancelSetFrequency()
   380 	{
   391 	{
   381 	RADIO_RDEBUG(_L("[RADIO-SESS] CancelSetFrequency()"));
   392     FUNC_LOG;
   382 	if ( iConnected && iRequests[KReqSetFrequency]->IsActive() )
   393 	if ( iConnected && iRequests[KReqSetFrequency]->IsActive() )
   383 		{
   394 		{
   384 		iRequests[KReqSetFrequency]->Cancel();
   395 		iRequests[KReqSetFrequency]->Cancel();
   385 		}
   396 		}
   386 	}
   397 	}
   390 // -----------------------------------------------------------------------------
   401 // -----------------------------------------------------------------------------
   391 //
   402 //
   392 EXPORT_C TInt RRadioSession::GetFrequency(
   403 EXPORT_C TInt RRadioSession::GetFrequency(
   393 	TInt& aFrequency ) const
   404 	TInt& aFrequency ) const
   394 	{
   405 	{
   395 	RADIO_RDEBUG(_L("[RADIO-SESS] GetFrequency()"));
   406     FUNC_LOG;
   396 	if ( iConnected )
   407 	if ( iConnected )
   397 		{
   408 		{
   398 		TPckg<TInt> frequency(aFrequency);
   409 		TPckg<TInt> frequency(aFrequency);
   399 		return SendReceive(ERadioServGetFrequency,
   410 		return SendReceive(ERadioServGetFrequency,
   400 						   TIpcArgs(&iDestinationPckg, &frequency));
   411 						   TIpcArgs(&iDestinationPckg, &frequency));
   409 // RRadioSession::StationSeek
   420 // RRadioSession::StationSeek
   410 // -----------------------------------------------------------------------------
   421 // -----------------------------------------------------------------------------
   411 EXPORT_C void RRadioSession::StationSeek(
   422 EXPORT_C void RRadioSession::StationSeek(
   412 	TBool aUpwards )
   423 	TBool aUpwards )
   413 	{
   424 	{
   414 	RADIO_RDEBUG_INT(_L("[RADIO-SESS] StationSeek() [%d]"), aUpwards);
   425     FUNC_LOG;
   415 	if ( iConnected )
   426 	if ( iConnected )
   416 		{
   427 		{
   417 		if ( iRequests[KReqStationSeek]->IsActive() )
   428 		if ( iRequests[KReqStationSeek]->IsActive() )
   418 			{
   429 			{
   419 			iRequests[KReqStationSeek]->Cancel();
   430 			iRequests[KReqStationSeek]->Cancel();
   432 // -----------------------------------------------------------------------------
   443 // -----------------------------------------------------------------------------
   433 // RRadioSession::CancelStationSeek
   444 // RRadioSession::CancelStationSeek
   434 // -----------------------------------------------------------------------------
   445 // -----------------------------------------------------------------------------
   435 EXPORT_C void RRadioSession::CancelStationSeek()
   446 EXPORT_C void RRadioSession::CancelStationSeek()
   436 	{
   447 	{
   437 	RADIO_RDEBUG(_L("[RADIO-SESS] CancelStationSeek()"));
   448     FUNC_LOG;
   438 	if ( iConnected && iRequests[KReqStationSeek]->IsActive() )
   449 	if ( iConnected && iRequests[KReqStationSeek]->IsActive() )
   439 		{
   450 		{
   440 		iRequests[KReqStationSeek]->Cancel();
   451 		iRequests[KReqStationSeek]->Cancel();
   441 		}
   452 		}
   442 	}
   453 	}
   445 // RRadioSession::GetSignalStrength
   456 // RRadioSession::GetSignalStrength
   446 // -----------------------------------------------------------------------------
   457 // -----------------------------------------------------------------------------
   447 EXPORT_C TInt RRadioSession::GetSignalStrength(
   458 EXPORT_C TInt RRadioSession::GetSignalStrength(
   448 	TInt& aSignalStrength ) const
   459 	TInt& aSignalStrength ) const
   449 	{
   460 	{
   450 	RADIO_RDEBUG(_L("[RADIO-SESS] GetSignalStrength()"));
   461     FUNC_LOG;
   451 	if ( iConnected )
   462 	if ( iConnected )
   452 		{
   463 		{
   453 		TPckg<TInt> strength(aSignalStrength);
   464 		TPckg<TInt> strength(aSignalStrength);
   454 		return SendReceive(ERadioServGetSignalStrength,
   465 		return SendReceive(ERadioServGetSignalStrength,
   455 						   TIpcArgs(&iDestinationPckg, &strength));
   466 						   TIpcArgs(&iDestinationPckg, &strength));
   464 // RRadioSession::GetMaxSignalStrength
   475 // RRadioSession::GetMaxSignalStrength
   465 // -----------------------------------------------------------------------------
   476 // -----------------------------------------------------------------------------
   466 EXPORT_C TInt RRadioSession::GetMaxSignalStrength(
   477 EXPORT_C TInt RRadioSession::GetMaxSignalStrength(
   467 	TInt& aMaxSignalStrength ) const
   478 	TInt& aMaxSignalStrength ) const
   468 	{
   479 	{
   469 	RADIO_RDEBUG(_L("[RADIO-SESS] GetMaxSignalStrength()"));
   480     FUNC_LOG;
   470 	if ( iConnected )
   481 	if ( iConnected )
   471 		{
   482 		{
   472 		TPckg<TInt> maxStrength(aMaxSignalStrength);
   483 		TPckg<TInt> maxStrength(aMaxSignalStrength);
   473 		return SendReceive(ERadioServGetMaxSignalStrength,
   484 		return SendReceive(ERadioServGetMaxSignalStrength,
   474 						   TIpcArgs(&iDestinationPckg, &maxStrength));
   485 						   TIpcArgs(&iDestinationPckg, &maxStrength));
   483 // RRadioSession::GetStereoMode
   494 // RRadioSession::GetStereoMode
   484 // -----------------------------------------------------------------------------
   495 // -----------------------------------------------------------------------------
   485 EXPORT_C TInt RRadioSession::GetStereoMode(
   496 EXPORT_C TInt RRadioSession::GetStereoMode(
   486 	TBool& aStereo ) const
   497 	TBool& aStereo ) const
   487 	{
   498 	{
   488 	RADIO_RDEBUG(_L("[RADIO-SESS] GetStereoMode()"));
   499     FUNC_LOG;
   489 	if ( iConnected )
   500 	if ( iConnected )
   490 		{
   501 		{
   491 		TPckg<TBool> stereo(aStereo);
   502 		TPckg<TBool> stereo(aStereo);
   492 		return SendReceive(ERadioServGetStereoMode,
   503 		return SendReceive(ERadioServGetStereoMode,
   493 						   TIpcArgs(&iDestinationPckg, &stereo));
   504 						   TIpcArgs(&iDestinationPckg, &stereo));
   502 // RRadioSession::ForceMonoReception
   513 // RRadioSession::ForceMonoReception
   503 // -----------------------------------------------------------------------------
   514 // -----------------------------------------------------------------------------
   504 EXPORT_C TInt RRadioSession::ForceMonoReception(
   515 EXPORT_C TInt RRadioSession::ForceMonoReception(
   505 	TBool aForcedMono )
   516 	TBool aForcedMono )
   506 	{
   517 	{
   507 	RADIO_RDEBUG_INT(_L("[RADIO-SESS] ForceMonoReception() [%d]"), aForcedMono);
   518     FUNC_LOG;
   508 	if ( iConnected )
   519 	if ( iConnected )
   509 		{
   520 		{
   510 		return SendReceive(ERadioServForceMonoReception,
   521 		return SendReceive(ERadioServForceMonoReception,
   511 						   TIpcArgs(&iDestinationPckg, aForcedMono));
   522 						   TIpcArgs(&iDestinationPckg, aForcedMono));
   512 		}
   523 		}
   520 // RRadioSession::GetForceMonoReception
   531 // RRadioSession::GetForceMonoReception
   521 // -----------------------------------------------------------------------------
   532 // -----------------------------------------------------------------------------
   522 EXPORT_C TInt RRadioSession::GetForceMonoReception(
   533 EXPORT_C TInt RRadioSession::GetForceMonoReception(
   523 	TBool& aForcedMono ) const
   534 	TBool& aForcedMono ) const
   524 	{
   535 	{
   525 	RADIO_RDEBUG(_L("[RADIO-SESS] GetForceMonoReception()"));
   536     FUNC_LOG;
   526 	if ( iConnected )
   537 	if ( iConnected )
   527 		{
   538 		{
   528 		TPckg<TBool> mono(aForcedMono);
   539 		TPckg<TBool> mono(aForcedMono);
   529 		return SendReceive(ERadioServGetForceMonoReception,
   540 		return SendReceive(ERadioServGetForceMonoReception,
   530 						   TIpcArgs(&iDestinationPckg, &mono));
   541 						   TIpcArgs(&iDestinationPckg, &mono));
   539 // RRadioSession::SetSquelch
   550 // RRadioSession::SetSquelch
   540 // -----------------------------------------------------------------------------
   551 // -----------------------------------------------------------------------------
   541 EXPORT_C TInt RRadioSession::SetSquelch(
   552 EXPORT_C TInt RRadioSession::SetSquelch(
   542 	TBool aEnabled )
   553 	TBool aEnabled )
   543 	{
   554 	{
   544 	RADIO_RDEBUG_INT(_L("[RADIO-SESS] SetSquelch() [%d]"), aEnabled);
   555     FUNC_LOG;
   545 	if ( iConnected )
   556 	if ( iConnected )
   546 		{
   557 		{
   547 		return SendReceive(ERadioServSetSquelch,
   558 		return SendReceive(ERadioServSetSquelch,
   548 						   TIpcArgs(&iDestinationPckg, aEnabled));
   559 						   TIpcArgs(&iDestinationPckg, aEnabled));
   549 		}
   560 		}
   557 // RRadioSession::GetSquelch
   568 // RRadioSession::GetSquelch
   558 // -----------------------------------------------------------------------------
   569 // -----------------------------------------------------------------------------
   559 EXPORT_C TInt RRadioSession::GetSquelch(
   570 EXPORT_C TInt RRadioSession::GetSquelch(
   560 	TBool& aSquelch ) const
   571 	TBool& aSquelch ) const
   561 	{
   572 	{
   562 	RADIO_RDEBUG(_L("[RADIO-SESS] GetSquelch()"));
   573     FUNC_LOG;
   563 	if ( iConnected )
   574 	if ( iConnected )
   564 		{
   575 		{
   565 		TPckg<TBool> squelch(aSquelch);
   576 		TPckg<TBool> squelch(aSquelch);
   566 		return SendReceive(ERadioServGetSquelch,
   577 		return SendReceive(ERadioServGetSquelch,
   567 						   TIpcArgs(&iDestinationPckg, &squelch));
   578 						   TIpcArgs(&iDestinationPckg, &squelch));
   578 // RRadioSession::PlayerState
   589 // RRadioSession::PlayerState
   579 // -----------------------------------------------------------------------------
   590 // -----------------------------------------------------------------------------
   580 EXPORT_C TInt RRadioSession::PlayerState(
   591 EXPORT_C TInt RRadioSession::PlayerState(
   581 	TRsPlayerState& aState ) const
   592 	TRsPlayerState& aState ) const
   582 	{
   593 	{
   583 	RADIO_RDEBUG(_L("[RADIO-SESS] GetPlayerState()"));
   594     FUNC_LOG;
   584 	if ( iConnected )
   595 	if ( iConnected )
   585 		{
   596 		{
   586 		TPckg<TRsPlayerState> state(aState);
   597 		TPckg<TRsPlayerState> state(aState);
   587 		return SendReceive(ERadioServGetPlayerState,
   598 		return SendReceive(ERadioServGetPlayerState,
   588 						   TIpcArgs(&iDestinationPckg, &state));
   599 						   TIpcArgs(&iDestinationPckg, &state));
   596 // -----------------------------------------------------------------------------
   607 // -----------------------------------------------------------------------------
   597 // RRadioSession::Play
   608 // RRadioSession::Play
   598 // -----------------------------------------------------------------------------
   609 // -----------------------------------------------------------------------------
   599 EXPORT_C void RRadioSession::Play()
   610 EXPORT_C void RRadioSession::Play()
   600 	{
   611 	{
   601 	RADIO_RDEBUG(_L("[RADIO-SESS] Play()"));
   612     FUNC_LOG;
   602 	if ( iConnected )
   613 	if ( iConnected )
   603 		{
   614 		{
   604 		if ( iRequests[KReqPlay]->IsActive() )
   615 		if ( iRequests[KReqPlay]->IsActive() )
   605 			{
   616 			{
   606 			// Already active; ignore.
   617 			// Already active; ignore.
   617 // RRadioSession::Stop
   628 // RRadioSession::Stop
   618 // -----------------------------------------------------------------------------
   629 // -----------------------------------------------------------------------------
   619 EXPORT_C void RRadioSession::Stop(
   630 EXPORT_C void RRadioSession::Stop(
   620 	TBool aIfOnlyPrimaryClient )
   631 	TBool aIfOnlyPrimaryClient )
   621 	{
   632 	{
   622 	RADIO_RDEBUG_INT(_L("[RADIO-SESS] Stop() [%d]"), aIfOnlyPrimaryClient);
   633     FUNC_LOG;
   623 	if ( iConnected )
   634 	if ( iConnected )
   624 		{
   635 		{
   625 		TInt err = Send(ERadioServStop,
   636 		TInt err = Send(ERadioServStop,
   626 						TIpcArgs(&iDestinationPckg, aIfOnlyPrimaryClient));
   637 						TIpcArgs(&iDestinationPckg, aIfOnlyPrimaryClient));
   627 		if (err != KErrNone)
   638 		if (err != KErrNone)
   628 			{
   639 			{
   629 			RADIO_RDEBUG_INT(_L("[RADIO-SESS] Stop() - err[%d]"), err);
   640 			INFO_1("err[%d]", err);
   630 			}
   641 			}
   631 		}
   642 		}
   632 	}
   643 	}
   633 
   644 
   634 // -----------------------------------------------------------------------------
   645 // -----------------------------------------------------------------------------
   635 // RRadioSession::GetMaxVolume
   646 // RRadioSession::GetMaxVolume
   636 // -----------------------------------------------------------------------------
   647 // -----------------------------------------------------------------------------
   637 EXPORT_C TInt RRadioSession::GetMaxVolume(
   648 EXPORT_C TInt RRadioSession::GetMaxVolume(
   638     TInt& aMaxVolume ) const
   649     TInt& aMaxVolume ) const
   639 	{
   650 	{
   640 	RADIO_RDEBUG(_L("[RADIO-SESS] GetMaxVolume()"));
   651     FUNC_LOG;
   641 	if ( iConnected )
   652 	if ( iConnected )
   642 		{
   653 		{
   643 		TPckg<TInt> maxVolume(aMaxVolume);
   654 		TPckg<TInt> maxVolume(aMaxVolume);
   644 		return SendReceive(ERadioServGetMaxVolume,
   655 		return SendReceive(ERadioServGetMaxVolume,
   645 						   TIpcArgs(&iDestinationPckg, &maxVolume));
   656 						   TIpcArgs(&iDestinationPckg, &maxVolume));
   654 // RRadioSession::SetVolume
   665 // RRadioSession::SetVolume
   655 // -----------------------------------------------------------------------------
   666 // -----------------------------------------------------------------------------
   656 EXPORT_C TInt RRadioSession::SetVolume(
   667 EXPORT_C TInt RRadioSession::SetVolume(
   657 	TInt aVolume )
   668 	TInt aVolume )
   658 	{
   669 	{
   659 	RADIO_RDEBUG_INT(_L("[RADIO-SESS] SetVolume() [%d]"), aVolume);
   670     FUNC_LOG;
   660 	if ( iConnected )
   671 	if ( iConnected )
   661 		{
   672 		{
   662 		return SendReceive(ERadioServSetVolume,
   673 		return SendReceive(ERadioServSetVolume,
   663 						   TIpcArgs(&iDestinationPckg, aVolume));
   674 						   TIpcArgs(&iDestinationPckg, aVolume));
   664 		}
   675 		}
   672 // RRadioSession::GetVolume
   683 // RRadioSession::GetVolume
   673 // -----------------------------------------------------------------------------
   684 // -----------------------------------------------------------------------------
   674 EXPORT_C TInt RRadioSession::GetVolume(
   685 EXPORT_C TInt RRadioSession::GetVolume(
   675 	TInt& aVolume ) const
   686 	TInt& aVolume ) const
   676 	{
   687 	{
   677 	RADIO_RDEBUG(_L("[RADIO-SESS] GetVolume()"));
   688     FUNC_LOG;
   678 	if ( iConnected )
   689 	if ( iConnected )
   679 		{
   690 		{
   680 		TPckg<TInt> volume(aVolume);
   691 		TPckg<TInt> volume(aVolume);
   681 		return SendReceive(ERadioServGetVolume,
   692 		return SendReceive(ERadioServGetVolume,
   682 						   TIpcArgs(&iDestinationPckg, &volume));
   693 						   TIpcArgs(&iDestinationPckg, &volume));
   691 // RRadioSession::SetVolumeRamp
   702 // RRadioSession::SetVolumeRamp
   692 // -----------------------------------------------------------------------------
   703 // -----------------------------------------------------------------------------
   693 EXPORT_C TInt RRadioSession::SetVolumeRamp(
   704 EXPORT_C TInt RRadioSession::SetVolumeRamp(
   694 	const TTimeIntervalMicroSeconds& aRampInterval )
   705 	const TTimeIntervalMicroSeconds& aRampInterval )
   695 	{
   706 	{
   696 	RADIO_RDEBUG(_L("[RADIO-SESS] SetVolumeRamp()"));
   707     FUNC_LOG;
   697 	if ( iConnected )
   708 	if ( iConnected )
   698 		{
   709 		{
   699 		TPckgBuf<TTimeIntervalMicroSeconds> interval(aRampInterval);
   710 		TPckgBuf<TTimeIntervalMicroSeconds> interval(aRampInterval);
   700 		return SendReceive(ERadioServSetVolumeRamp,
   711 		return SendReceive(ERadioServSetVolumeRamp,
   701 						   TIpcArgs(&iDestinationPckg, &interval));
   712 						   TIpcArgs(&iDestinationPckg, &interval));
   710 // RRadioSession::Mute
   721 // RRadioSession::Mute
   711 // -----------------------------------------------------------------------------
   722 // -----------------------------------------------------------------------------
   712 EXPORT_C TInt RRadioSession::Mute(
   723 EXPORT_C TInt RRadioSession::Mute(
   713 	TBool aMute )
   724 	TBool aMute )
   714 	{
   725 	{
   715 	RADIO_RDEBUG_INT(_L("[RADIO-SESS] Mute() [%d]"), aMute);
   726     FUNC_LOG;
   716 	if ( iConnected )
   727 	if ( iConnected )
   717 		{
   728 		{
   718 		return SendReceive(ERadioServSetMute,
   729 		return SendReceive(ERadioServSetMute,
   719 						   TIpcArgs(&iDestinationPckg, aMute));
   730 						   TIpcArgs(&iDestinationPckg, aMute));
   720 		}
   731 		}
   728 // RRadioSession::GetMuteStatus
   739 // RRadioSession::GetMuteStatus
   729 // -----------------------------------------------------------------------------
   740 // -----------------------------------------------------------------------------
   730 EXPORT_C TInt RRadioSession::GetMuteStatus(
   741 EXPORT_C TInt RRadioSession::GetMuteStatus(
   731 	TBool& aMute ) const
   742 	TBool& aMute ) const
   732 	{
   743 	{
   733 	RADIO_RDEBUG(_L("[RADIO-SESS] Mute()"));
   744     FUNC_LOG;
   734 	if ( iConnected )
   745 	if ( iConnected )
   735 		{
   746 		{
   736 		TPckg<TBool> mute(aMute);
   747 		TPckg<TBool> mute(aMute);
   737 		return SendReceive(ERadioServGetMuteStatus,
   748 		return SendReceive(ERadioServGetMuteStatus,
   738 						   TIpcArgs(&iDestinationPckg, &mute));
   749 						   TIpcArgs(&iDestinationPckg, &mute));
   748 // -----------------------------------------------------------------------------
   759 // -----------------------------------------------------------------------------
   749 EXPORT_C TInt RRadioSession::SetBalance(
   760 EXPORT_C TInt RRadioSession::SetBalance(
   750 	TInt aLeftPercentage,
   761 	TInt aLeftPercentage,
   751 	TInt aRightPercentage )
   762 	TInt aRightPercentage )
   752 	{
   763 	{
   753 	RADIO_RDEBUG_INT2(_L("[RADIO-SESS] SetBalance() left=[%d] right=[%d]"), aLeftPercentage, aRightPercentage);
   764     FUNC_LOG;
   754 	if ( iConnected )
   765 	if ( iConnected )
   755 		{
   766 		{
   756 		return SendReceive(ERadioServSetBalance,
   767 		return SendReceive(ERadioServSetBalance,
   757 						   TIpcArgs(&iDestinationPckg, aLeftPercentage, aRightPercentage));
   768 						   TIpcArgs(&iDestinationPckg, aLeftPercentage, aRightPercentage));
   758 		}
   769 		}
   768 //
   779 //
   769 EXPORT_C TInt RRadioSession::GetBalance(
   780 EXPORT_C TInt RRadioSession::GetBalance(
   770 	TInt& aLeftPercentage,
   781 	TInt& aLeftPercentage,
   771 	TInt& aRightPercentage ) const
   782 	TInt& aRightPercentage ) const
   772 	{
   783 	{
   773 	RADIO_RDEBUG(_L("[RADIO-SESS] GetBalance()"));
   784     FUNC_LOG;
   774 	if ( iConnected )
   785 	if ( iConnected )
   775 		{
   786 		{
   776 		TPckg<TInt> left(aLeftPercentage);
   787 		TPckg<TInt> left(aLeftPercentage);
   777 		TPckg<TInt> right(aRightPercentage);
   788 		TPckg<TInt> right(aRightPercentage);
   778 		return SendReceive(ERadioServGetBalance,
   789 		return SendReceive(ERadioServGetBalance,
   791 // -----------------------------------------------------------------------------
   802 // -----------------------------------------------------------------------------
   792 //
   803 //
   793 EXPORT_C TInt RRadioSession::GetRdsCapabilities(
   804 EXPORT_C TInt RRadioSession::GetRdsCapabilities(
   794 	TRsRdsCapabilities& aCaps ) const
   805 	TRsRdsCapabilities& aCaps ) const
   795 	{
   806 	{
   796 	RADIO_RDEBUG(_L("[RADIO-SESS] GetRdsCapabilities()"));
   807     FUNC_LOG;
   797 	if ( iConnected )
   808 	if ( iConnected )
   798 		{
   809 		{
   799 		TPckg<TRsRdsCapabilities> caps(aCaps);
   810 		TPckg<TRsRdsCapabilities> caps(aCaps);
   800 		return SendReceive(ERadioServGetRdsCapabilities,
   811 		return SendReceive(ERadioServGetRdsCapabilities,
   801 						   TIpcArgs(&iDestinationPckg, &caps));
   812 						   TIpcArgs(&iDestinationPckg, &caps));
   811 // -----------------------------------------------------------------------------
   822 // -----------------------------------------------------------------------------
   812 //
   823 //
   813 EXPORT_C TInt RRadioSession::GetRdsSignalStatus(
   824 EXPORT_C TInt RRadioSession::GetRdsSignalStatus(
   814 	TBool& aRdsSignal ) const
   825 	TBool& aRdsSignal ) const
   815     {
   826     {
   816     RADIO_RDEBUG(_L("[RADIO-SESS] GetRdsSignalStatus()"));
   827     FUNC_LOG;
   817 	if ( iConnected )
   828 	if ( iConnected )
   818 		{
   829 		{
   819 		TPckg<TBool> signal(aRdsSignal);
   830 		TPckg<TBool> signal(aRdsSignal);
   820 		return SendReceive(ERadioServGetRdsSignalStatus,
   831 		return SendReceive(ERadioServGetRdsSignalStatus,
   821 						   TIpcArgs(&iDestinationPckg, &signal));
   832 						   TIpcArgs(&iDestinationPckg, &signal));
   831 // -----------------------------------------------------------------------------
   842 // -----------------------------------------------------------------------------
   832 //
   843 //
   833 EXPORT_C TInt RRadioSession::NotifyRdsDataChange(
   844 EXPORT_C TInt RRadioSession::NotifyRdsDataChange(
   834 	TRsRdsData aRdsData )
   845 	TRsRdsData aRdsData )
   835 	{
   846 	{
   836 	RADIO_RDEBUG_INT(_L("[RADIO-SESS] NotifyRdsDataChange() [%d]"), aRdsData.iRdsFunctions);
   847     FUNC_LOG;
   837 	if ( !iConnected )
   848 	if ( !iConnected )
   838 		{
   849 		{
   839 		return KErrDisconnected;
   850 		return KErrDisconnected;
   840 		}
   851 		}
   841 
   852 
   845 		}
   856 		}
   846 
   857 
   847 	TRAPD(err, StartRdsEventHandlersL(aRdsData.iRdsFunctions));
   858 	TRAPD(err, StartRdsEventHandlersL(aRdsData.iRdsFunctions));
   848 	if ( err != KErrNone )
   859 	if ( err != KErrNone )
   849 		{
   860 		{
   850 		RADIO_RDEBUG_INT(_L("[RADIO-SESS] NotifyRdsDataChange() err=[%d]"), err);
   861 		INFO_1("err=[%d]", err);
   851 		return err;
   862 		return err;
   852 		}
   863 		}
   853 	err = SendReceive(ERadioServNotifyRdsDataChange,
   864 	err = SendReceive(ERadioServNotifyRdsDataChange,
   854 					  TIpcArgs(&iDestinationPckg));
   865 					  TIpcArgs(&iDestinationPckg));
   855 	if ( err == KErrNone )
   866 	if ( err == KErrNone )
   863 // RRadioSession::CancelNotifyRdsDataChange
   874 // RRadioSession::CancelNotifyRdsDataChange
   864 // -----------------------------------------------------------------------------
   875 // -----------------------------------------------------------------------------
   865 //
   876 //
   866 EXPORT_C void RRadioSession::CancelNotifyRdsDataChange()
   877 EXPORT_C void RRadioSession::CancelNotifyRdsDataChange()
   867     {
   878     {
   868     RADIO_RDEBUG(_L("[RADIO-SESS] CancelNotifyRdsDataChange()"));
   879     FUNC_LOG;
   869 	if ( iConnected && iRdsNotify )
   880 	if ( iConnected && iRdsNotify )
   870 		{
   881 		{
   871 		iRdsEventHandlers.ResetAndDestroy();
   882 		iRdsEventHandlers.ResetAndDestroy();
   872 		SendReceive(ERadioServCancelNotifyRdsDataChange,
   883 		SendReceive(ERadioServCancelNotifyRdsDataChange,
   873 					TIpcArgs(&iDestinationPckg));
   884 					TIpcArgs(&iDestinationPckg));
   879 // -----------------------------------------------------------------------------
   890 // -----------------------------------------------------------------------------
   880 //
   891 //
   881 EXPORT_C TInt RRadioSession::NotifyRadioTextPlusChange(
   892 EXPORT_C TInt RRadioSession::NotifyRadioTextPlusChange(
   882 	RArray<TInt>& /*aRtPlusClasses*/ )
   893 	RArray<TInt>& /*aRtPlusClasses*/ )
   883 	{
   894 	{
   884 	RADIO_RDEBUG(_L("[RADIO-SESS] NotifyRadioTextPlusChange()"));
   895     FUNC_LOG;
   885 	return KErrNotSupported;
   896 	return KErrNotSupported;
   886 	}
   897 	}
   887 
   898 
   888 // -----------------------------------------------------------------------------
   899 // -----------------------------------------------------------------------------
   889 // RRadioSession::CancelNotifyRadioTextPlusChange
   900 // RRadioSession::CancelNotifyRadioTextPlusChange
   890 // -----------------------------------------------------------------------------
   901 // -----------------------------------------------------------------------------
   891 //
   902 //
   892 EXPORT_C void RRadioSession::CancelNotifyRadioTextPlusChange()
   903 EXPORT_C void RRadioSession::CancelNotifyRadioTextPlusChange()
   893 	{
   904 	{
   894 	RADIO_RDEBUG(_L("[RADIO-SESS] CancelNotifyRadioTextPlusChange()"));
   905     FUNC_LOG;
   895 	// NotifyRadioTextPlusChange is not supported
   906 	// NotifyRadioTextPlusChange is not supported
   896 	}
   907 	}
   897 
   908 
   898 // -----------------------------------------------------------------------------
   909 // -----------------------------------------------------------------------------
   899 // RRadioSession::SetAutomaticSwitching
   910 // RRadioSession::SetAutomaticSwitching
   900 // -----------------------------------------------------------------------------
   911 // -----------------------------------------------------------------------------
   901 //
   912 //
   902 EXPORT_C TInt RRadioSession::SetAutomaticSwitching(
   913 EXPORT_C TInt RRadioSession::SetAutomaticSwitching(
   903 	TBool aAuto )
   914 	TBool aAuto )
   904 	{
   915 	{
   905 	RADIO_RDEBUG_INT(_L("[RADIO-SESS] SetAutomaticSwitching() [%d]"), aAuto);
   916     FUNC_LOG;
   906 	if ( iConnected )
   917 	if ( iConnected )
   907 		{
   918 		{
   908 		return SendReceive(ERadioServSetAutomaticSwitching,
   919 		return SendReceive(ERadioServSetAutomaticSwitching,
   909 						   TIpcArgs(&iDestinationPckg, aAuto));
   920 						   TIpcArgs(&iDestinationPckg, aAuto));
   910 		}
   921 		}
   919 // -----------------------------------------------------------------------------
   930 // -----------------------------------------------------------------------------
   920 //
   931 //
   921 EXPORT_C TInt RRadioSession::GetAutomaticSwitching(
   932 EXPORT_C TInt RRadioSession::GetAutomaticSwitching(
   922 	TBool& aAuto )
   933 	TBool& aAuto )
   923 	{
   934 	{
   924     RADIO_RDEBUG(_L("[RADIO-SESS] GetAutomaticSwitching()"));
   935     FUNC_LOG;
   925 	if ( iConnected )
   936 	if ( iConnected )
   926 		{
   937 		{
   927 		TPckg<TBool> autoSwitching(aAuto);
   938 		TPckg<TBool> autoSwitching(aAuto);
   928 		return SendReceive(ERadioServGetAutomaticSwitching,
   939 		return SendReceive(ERadioServGetAutomaticSwitching,
   929 						   TIpcArgs(&iDestinationPckg, &autoSwitching));
   940 						   TIpcArgs(&iDestinationPckg, &autoSwitching));
   938 // RRadioSession::CancelAFSearch
   949 // RRadioSession::CancelAFSearch
   939 // -----------------------------------------------------------------------------
   950 // -----------------------------------------------------------------------------
   940 //
   951 //
   941 EXPORT_C void RRadioSession::CancelAFSearch()
   952 EXPORT_C void RRadioSession::CancelAFSearch()
   942 	{
   953 	{
   943    	RADIO_RDEBUG(_L("[RADIO-SESS] CancelAFSearch()"));
   954     FUNC_LOG;
   944 	if ( iConnected )
   955 	if ( iConnected )
   945 		{
   956 		{
   946 		SendReceive(ERadioServCancelAFSearch, TIpcArgs(&iDestinationPckg));
   957 		SendReceive(ERadioServCancelAFSearch, TIpcArgs(&iDestinationPckg));
   947 		}
   958 		}
   948 	}
   959 	}
   952 // -----------------------------------------------------------------------------
   963 // -----------------------------------------------------------------------------
   953 //
   964 //
   954 EXPORT_C TInt RRadioSession::SetAutomaticTrafficAnnouncement(
   965 EXPORT_C TInt RRadioSession::SetAutomaticTrafficAnnouncement(
   955 	TBool /*aAuto*/ )
   966 	TBool /*aAuto*/ )
   956 	{
   967 	{
   957 	RADIO_RDEBUG(_L("[RADIO-SESS] SetAutomaticTrafficAnnouncement()"));
   968     FUNC_LOG;
   958 	return KErrNotSupported;
   969 	return KErrNotSupported;
   959 	}
   970 	}
   960 
   971 
   961 // -----------------------------------------------------------------------------
   972 // -----------------------------------------------------------------------------
   962 // RRadioSession::GetAutomaticTrafficAnnouncement
   973 // RRadioSession::GetAutomaticTrafficAnnouncement
   963 // -----------------------------------------------------------------------------
   974 // -----------------------------------------------------------------------------
   964 //
   975 //
   965 EXPORT_C TInt RRadioSession::GetAutomaticTrafficAnnouncement(
   976 EXPORT_C TInt RRadioSession::GetAutomaticTrafficAnnouncement(
   966 	TBool& /*aAuto*/ )
   977 	TBool& /*aAuto*/ )
   967 	{
   978 	{
   968     RADIO_RDEBUG(_L("[RADIO-SESS] GetAutomaticTrafficAnnouncement()"));
   979     FUNC_LOG;
   969 	return KErrNotSupported;
   980 	return KErrNotSupported;
   970    	}
   981    	}
   971 
   982 
   972 // -----------------------------------------------------------------------------
   983 // -----------------------------------------------------------------------------
   973 // RRadioSession::StationSeekByPTY
   984 // RRadioSession::StationSeekByPTY
   975 //
   986 //
   976 EXPORT_C void RRadioSession::StationSeekByPTY(
   987 EXPORT_C void RRadioSession::StationSeekByPTY(
   977 	TRsRdsProgrammeType aPty,
   988 	TRsRdsProgrammeType aPty,
   978 	TBool aSeekUp )
   989 	TBool aSeekUp )
   979    	{
   990    	{
   980    	RADIO_RDEBUG_INT(_L("[RADIO-SESS] StationSeekByPTY() pty=[%d]"), aPty);
   991     FUNC_LOG;
   981 	if ( iConnected )
   992 	if ( iConnected )
   982 		{
   993 		{
   983 		if ( iRequests[KReqStationSeekByPTY]->IsActive() )
   994 		if ( iRequests[KReqStationSeekByPTY]->IsActive() )
   984 			{
   995 			{
   985 			iRequests[KReqStationSeekByPTY]->Cancel();
   996 			iRequests[KReqStationSeekByPTY]->Cancel();
  1000 // -----------------------------------------------------------------------------
  1011 // -----------------------------------------------------------------------------
  1001 //
  1012 //
  1002 EXPORT_C void RRadioSession::StationSeekByTA(
  1013 EXPORT_C void RRadioSession::StationSeekByTA(
  1003 	TBool aSeekUp )
  1014 	TBool aSeekUp )
  1004    	{
  1015    	{
  1005     RADIO_RDEBUG(_L("[RADIO-SESS] StationSeekByTA()"));
  1016     FUNC_LOG;
  1006 	if ( iConnected )
  1017 	if ( iConnected )
  1007 		{
  1018 		{
  1008 		if ( iRequests[KReqStationSeekByTA]->IsActive() )
  1019 		if ( iRequests[KReqStationSeekByTA]->IsActive() )
  1009 			{
  1020 			{
  1010 			iRequests[KReqStationSeekByTA]->Cancel();
  1021 			iRequests[KReqStationSeekByTA]->Cancel();
  1025 // -----------------------------------------------------------------------------
  1036 // -----------------------------------------------------------------------------
  1026 //
  1037 //
  1027 EXPORT_C void RRadioSession::StationSeekByTP(
  1038 EXPORT_C void RRadioSession::StationSeekByTP(
  1028 	TBool aSeekUp )
  1039 	TBool aSeekUp )
  1029    	{
  1040    	{
  1030     RADIO_RDEBUG(_L("[RADIO-SESS] StationSeekByTP()"));
  1041     FUNC_LOG;
  1031 	if ( iConnected )
  1042 	if ( iConnected )
  1032 		{
  1043 		{
  1033 		if ( iRequests[KReqStationSeekByTP]->IsActive() )
  1044 		if ( iRequests[KReqStationSeekByTP]->IsActive() )
  1034 			{
  1045 			{
  1035 			iRequests[KReqStationSeekByTP]->Cancel();
  1046 			iRequests[KReqStationSeekByTP]->Cancel();
  1049 // RRadioSession::CancelRdsStationSeek
  1060 // RRadioSession::CancelRdsStationSeek
  1050 // -----------------------------------------------------------------------------
  1061 // -----------------------------------------------------------------------------
  1051 //
  1062 //
  1052 EXPORT_C void RRadioSession::CancelRdsStationSeek()
  1063 EXPORT_C void RRadioSession::CancelRdsStationSeek()
  1053   	{
  1064   	{
  1054    	RADIO_RDEBUG(_L("[RADIO-SESS] CancelRdsStationSeek()"));
  1065     FUNC_LOG;
  1055 	if ( iConnected )
  1066 	if ( iConnected )
  1056 		{
  1067 		{
  1057 		if ( iRequests[KReqStationSeekByPTY]->IsActive() )
  1068 		if ( iRequests[KReqStationSeekByPTY]->IsActive() )
  1058 			{
  1069 			{
  1059 			iRequests[KReqStationSeekByPTY]->Cancel();
  1070 			iRequests[KReqStationSeekByPTY]->Cancel();
  1074 // -----------------------------------------------------------------------------
  1085 // -----------------------------------------------------------------------------
  1075 //
  1086 //
  1076 EXPORT_C void RRadioSession::GetFreqByPTY(
  1087 EXPORT_C void RRadioSession::GetFreqByPTY(
  1077 	TRsRdsProgrammeType /*aPty*/ )
  1088 	TRsRdsProgrammeType /*aPty*/ )
  1078 	{
  1089 	{
  1079   	RADIO_RDEBUG(_L("[RADIO-SESS] GetFreqByPTY()"));
  1090     FUNC_LOG;
  1080 	iRequests[KReqInternal]->CompleteRequest(ERadioServGetFreqByPTY, KErrNotSupported);
  1091 	iRequests[KReqInternal]->CompleteRequest(ERadioServGetFreqByPTY, KErrNotSupported);
  1081   	}
  1092   	}
  1082 
  1093 
  1083 // -----------------------------------------------------------------------------
  1094 // -----------------------------------------------------------------------------
  1084 // RRadioSession::CancelGetFreqByPTY
  1095 // RRadioSession::CancelGetFreqByPTY
  1085 // -----------------------------------------------------------------------------
  1096 // -----------------------------------------------------------------------------
  1086 //
  1097 //
  1087 EXPORT_C void RRadioSession::CancelGetFreqByPTY()
  1098 EXPORT_C void RRadioSession::CancelGetFreqByPTY()
  1088 	{
  1099 	{
  1089 	RADIO_RDEBUG(_L("[RADIO-SESS] CancelGetFreqByPTY()"));
  1100     FUNC_LOG;
  1090 	// GetFreqByPTY is not supported
  1101 	// GetFreqByPTY is not supported
  1091 	}
  1102 	}
  1092 
  1103 
  1093 // -----------------------------------------------------------------------------
  1104 // -----------------------------------------------------------------------------
  1094 // RRadioSession::GetFreqByTA
  1105 // RRadioSession::GetFreqByTA
  1095 // -----------------------------------------------------------------------------
  1106 // -----------------------------------------------------------------------------
  1096 //
  1107 //
  1097 EXPORT_C void RRadioSession::GetFreqByTA()
  1108 EXPORT_C void RRadioSession::GetFreqByTA()
  1098 	{
  1109 	{
  1099     RADIO_RDEBUG(_L("[RADIO-SESS] GetFreqByTA()"));
  1110     FUNC_LOG;
  1100 	iRequests[KReqInternal]->CompleteRequest(ERadioServGetFreqByTA, KErrNotSupported);
  1111 	iRequests[KReqInternal]->CompleteRequest(ERadioServGetFreqByTA, KErrNotSupported);
  1101     }
  1112     }
  1102 
  1113 
  1103 // -----------------------------------------------------------------------------
  1114 // -----------------------------------------------------------------------------
  1104 // RRadioSession::CancelGetFreqByTA
  1115 // RRadioSession::CancelGetFreqByTA
  1105 // -----------------------------------------------------------------------------
  1116 // -----------------------------------------------------------------------------
  1106 //
  1117 //
  1107 EXPORT_C void RRadioSession::CancelGetFreqByTA()
  1118 EXPORT_C void RRadioSession::CancelGetFreqByTA()
  1108     {
  1119     {
  1109     RADIO_RDEBUG(_L("[RADIO-SESS] CancelGetFreqByTA()"));
  1120     FUNC_LOG;
  1110     // GetFreqByTA is not supported
  1121     // GetFreqByTA is not supported
  1111 	}
  1122 	}
  1112 
  1123 
  1113 // -----------------------------------------------------------------------------
  1124 // -----------------------------------------------------------------------------
  1114 // RRadioSession::GetPSByPTY
  1125 // RRadioSession::GetPSByPTY
  1115 // -----------------------------------------------------------------------------
  1126 // -----------------------------------------------------------------------------
  1116 //
  1127 //
  1117 EXPORT_C void RRadioSession::GetPSByPTY(
  1128 EXPORT_C void RRadioSession::GetPSByPTY(
  1118 	TRsRdsProgrammeType /*aPty*/ )
  1129 	TRsRdsProgrammeType /*aPty*/ )
  1119     {
  1130     {
  1120     RADIO_RDEBUG(_L("[RADIO-SESS] GetPSByPTY()"));
  1131     FUNC_LOG;
  1121 	iRequests[KReqInternal]->CompleteRequest(ERadioServGetPSByPTY, KErrNotSupported);
  1132 	iRequests[KReqInternal]->CompleteRequest(ERadioServGetPSByPTY, KErrNotSupported);
  1122     }
  1133     }
  1123 
  1134 
  1124 // -----------------------------------------------------------------------------
  1135 // -----------------------------------------------------------------------------
  1125 // RRadioSession::CancelGetPSByPTY
  1136 // RRadioSession::CancelGetPSByPTY
  1126 // -----------------------------------------------------------------------------
  1137 // -----------------------------------------------------------------------------
  1127 //
  1138 //
  1128 EXPORT_C void RRadioSession::CancelGetPSByPTY()
  1139 EXPORT_C void RRadioSession::CancelGetPSByPTY()
  1129     {
  1140     {
  1130     RADIO_RDEBUG(_L("[RADIO-SESS] CancelGetPSByPTY()"));
  1141     FUNC_LOG;
  1131     // GetPSByPTY is not supported
  1142     // GetPSByPTY is not supported
  1132 	}
  1143 	}
  1133 
  1144 
  1134 // -----------------------------------------------------------------------------
  1145 // -----------------------------------------------------------------------------
  1135 // RRadioSession::GetPSByTA
  1146 // RRadioSession::GetPSByTA
  1136 // -----------------------------------------------------------------------------
  1147 // -----------------------------------------------------------------------------
  1137 //
  1148 //
  1138 EXPORT_C void RRadioSession::GetPSByTA()
  1149 EXPORT_C void RRadioSession::GetPSByTA()
  1139     {
  1150     {
  1140     RADIO_RDEBUG(_L("[RADIO-SESS] GetPSByTA()"));
  1151     FUNC_LOG;
  1141 	iRequests[KReqInternal]->CompleteRequest(ERadioServGetPSByTA, KErrNotSupported);
  1152 	iRequests[KReqInternal]->CompleteRequest(ERadioServGetPSByTA, KErrNotSupported);
  1142     }
  1153     }
  1143 
  1154 
  1144 // -----------------------------------------------------------------------------
  1155 // -----------------------------------------------------------------------------
  1145 // RRadioSession::CancelGetPSByTA
  1156 // RRadioSession::CancelGetPSByTA
  1146 // -----------------------------------------------------------------------------
  1157 // -----------------------------------------------------------------------------
  1147 //
  1158 //
  1148 EXPORT_C void RRadioSession::CancelGetPSByTA()
  1159 EXPORT_C void RRadioSession::CancelGetPSByTA()
  1149     {
  1160     {
  1150     RADIO_RDEBUG(_L("[RADIO-SESS] CancelGetPSByTA()"));
  1161     FUNC_LOG;
  1151     // GetPSByTA is not supported
  1162     // GetPSByTA is not supported
  1152 	}
  1163 	}
  1153 
  1164 
  1154 // -----------------------------------------------------------------------------
  1165 // -----------------------------------------------------------------------------
  1155 // RRadioSession::GetProgrammeIdentification
  1166 // RRadioSession::GetProgrammeIdentification
  1156 // -----------------------------------------------------------------------------
  1167 // -----------------------------------------------------------------------------
  1157 //
  1168 //
  1158 EXPORT_C TInt RRadioSession::GetProgrammeIdentification(
  1169 EXPORT_C TInt RRadioSession::GetProgrammeIdentification(
  1159 	TInt& aPi )
  1170 	TInt& aPi )
  1160     {
  1171     {
  1161  	RADIO_RDEBUG(_L("[RADIO-SESS] GetProgrammeIdentification()"));
  1172     FUNC_LOG;
  1162 	if ( iConnected )
  1173 	if ( iConnected )
  1163 		{
  1174 		{
  1164 		TPckg<TInt> pi(aPi);
  1175 		TPckg<TInt> pi(aPi);
  1165 		return SendReceive(ERadioServGetProgrammeIdentification,
  1176 		return SendReceive(ERadioServGetProgrammeIdentification,
  1166 						   TIpcArgs(&iDestinationPckg, &pi));
  1177 						   TIpcArgs(&iDestinationPckg, &pi));
  1176 // -----------------------------------------------------------------------------
  1187 // -----------------------------------------------------------------------------
  1177 //
  1188 //
  1178 EXPORT_C TInt RRadioSession::GetProgrammeType(
  1189 EXPORT_C TInt RRadioSession::GetProgrammeType(
  1179 	TRsRdsProgrammeType& aPty )
  1190 	TRsRdsProgrammeType& aPty )
  1180     {
  1191     {
  1181   	RADIO_RDEBUG(_L("[RADIO-SESS] GetProgrammeType()"));
  1192     FUNC_LOG;
  1182 	if ( iConnected )
  1193 	if ( iConnected )
  1183 		{
  1194 		{
  1184 		TPckg<TRsRdsProgrammeType> pty(aPty);
  1195 		TPckg<TRsRdsProgrammeType> pty(aPty);
  1185 		return SendReceive(ERadioServGetProgrammeType,
  1196 		return SendReceive(ERadioServGetProgrammeType,
  1186 						   TIpcArgs(&iDestinationPckg, &pty));
  1197 						   TIpcArgs(&iDestinationPckg, &pty));
  1196 // -----------------------------------------------------------------------------
  1207 // -----------------------------------------------------------------------------
  1197 //
  1208 //
  1198 EXPORT_C TInt RRadioSession::GetProgrammeService(
  1209 EXPORT_C TInt RRadioSession::GetProgrammeService(
  1199 	TRsRdsPSName& aPs )
  1210 	TRsRdsPSName& aPs )
  1200     {
  1211     {
  1201  	RADIO_RDEBUG(_L("[RADIO-SESS] GetProgrammeService()"));
  1212     FUNC_LOG;
  1202 	if ( iConnected )
  1213 	if ( iConnected )
  1203 		{
  1214 		{
  1204 		TPckg<TRsRdsPSName> ps(aPs);
  1215 		TPckg<TRsRdsPSName> ps(aPs);
  1205 		return SendReceive(ERadioServGetProgrammeService,
  1216 		return SendReceive(ERadioServGetProgrammeService,
  1206 						   TIpcArgs(&iDestinationPckg, &ps));
  1217 						   TIpcArgs(&iDestinationPckg, &ps));
  1216 // -----------------------------------------------------------------------------
  1227 // -----------------------------------------------------------------------------
  1217 //
  1228 //
  1218 EXPORT_C TInt RRadioSession::GetRadioText(
  1229 EXPORT_C TInt RRadioSession::GetRadioText(
  1219 	TRsRdsRadioText& aRt )
  1230 	TRsRdsRadioText& aRt )
  1220 	{
  1231 	{
  1221 	RADIO_RDEBUG(_L("[RADIO-SESS] GetRadioText()"));
  1232     FUNC_LOG;
  1222 	if ( iConnected )
  1233 	if ( iConnected )
  1223 		{
  1234 		{
  1224 		TPckg<TRsRdsRadioText> rt(aRt);
  1235 		TPckg<TRsRdsRadioText> rt(aRt);
  1225 		return SendReceive(ERadioServGetRadioText,
  1236 		return SendReceive(ERadioServGetRadioText,
  1226 						   TIpcArgs(&iDestinationPckg, &rt));
  1237 						   TIpcArgs(&iDestinationPckg, &rt));
  1237 //
  1248 //
  1238 EXPORT_C TInt RRadioSession::GetRadioTextPlus(
  1249 EXPORT_C TInt RRadioSession::GetRadioTextPlus(
  1239 	TRsRdsRTplusClass /*aRtPlusClass*/,
  1250 	TRsRdsRTplusClass /*aRtPlusClass*/,
  1240 	TRsRdsRadioText& /*aRtPlusData*/ )
  1251 	TRsRdsRadioText& /*aRtPlusData*/ )
  1241 	{
  1252 	{
  1242 	RADIO_RDEBUG(_L("[RADIO-SESS] GetRadioText()"));
  1253     FUNC_LOG;
  1243 	return KErrNotSupported;
  1254 	return KErrNotSupported;
  1244 	}
  1255 	}
  1245 
  1256 
  1246 // -----------------------------------------------------------------------------
  1257 // -----------------------------------------------------------------------------
  1247 // RRadioSession::GetClockTime
  1258 // RRadioSession::GetClockTime
  1248 // -----------------------------------------------------------------------------
  1259 // -----------------------------------------------------------------------------
  1249 //
  1260 //
  1250 EXPORT_C TInt RRadioSession::GetClockTime(
  1261 EXPORT_C TInt RRadioSession::GetClockTime(
  1251 	TDateTime& aCt )
  1262 	TDateTime& aCt )
  1252 	{
  1263 	{
  1253     RADIO_RDEBUG(_L("[RADIO-SESS] GetClockTime()"));
  1264     FUNC_LOG;
  1254 	if ( iConnected )
  1265 	if ( iConnected )
  1255 		{
  1266 		{
  1256 		TPckg<TDateTime> ct(aCt);
  1267 		TPckg<TDateTime> ct(aCt);
  1257 		return SendReceive(ERadioServGetClockTime,
  1268 		return SendReceive(ERadioServGetClockTime,
  1258 						   TIpcArgs(&iDestinationPckg, &ct));
  1269 						   TIpcArgs(&iDestinationPckg, &ct));
  1268 // -----------------------------------------------------------------------------
  1279 // -----------------------------------------------------------------------------
  1269 //
  1280 //
  1270 EXPORT_C TInt RRadioSession::GetTrafficAnnouncementStatus(
  1281 EXPORT_C TInt RRadioSession::GetTrafficAnnouncementStatus(
  1271 	TBool& aTaStatus )
  1282 	TBool& aTaStatus )
  1272 	{
  1283 	{
  1273 	RADIO_RDEBUG(_L("[RADIO-SESS] GetTrafficAnnouncementStatus()"));
  1284     FUNC_LOG;
  1274 	if ( iConnected )
  1285 	if ( iConnected )
  1275 		{
  1286 		{
  1276 		TPckg<TBool> taStatus(aTaStatus);
  1287 		TPckg<TBool> taStatus(aTaStatus);
  1277 		return SendReceive(ERadioServGetTrafficAnnouncementStatus,
  1288 		return SendReceive(ERadioServGetTrafficAnnouncementStatus,
  1278 						   TIpcArgs(&iDestinationPckg, &taStatus));
  1289 						   TIpcArgs(&iDestinationPckg, &taStatus));
  1288 // -----------------------------------------------------------------------------
  1299 // -----------------------------------------------------------------------------
  1289 //
  1300 //
  1290 EXPORT_C TInt RRadioSession::GetTrafficProgrammeStatus(
  1301 EXPORT_C TInt RRadioSession::GetTrafficProgrammeStatus(
  1291 	TBool& aTpStatus )
  1302 	TBool& aTpStatus )
  1292 	{
  1303 	{
  1293 	RADIO_RDEBUG(_L("[RADIO-SESS] GetTrafficProgrammeStatus()"));
  1304     FUNC_LOG;
  1294 	if ( iConnected )
  1305 	if ( iConnected )
  1295 		{
  1306 		{
  1296 		TPckg<TBool> tpStatus(aTpStatus);
  1307 		TPckg<TBool> tpStatus(aTpStatus);
  1297 		return SendReceive(ERadioServGetTrafficProgrammeStatus,
  1308 		return SendReceive(ERadioServGetTrafficProgrammeStatus,
  1298 						   TIpcArgs(&iDestinationPckg, &tpStatus));
  1309 						   TIpcArgs(&iDestinationPckg, &tpStatus));
  1310 	const TMMFMessageDestinationPckg& aDestination,
  1321 	const TMMFMessageDestinationPckg& aDestination,
  1311 	TInt aFunction,
  1322 	TInt aFunction,
  1312 	const TDesC8& aDataTo1,
  1323 	const TDesC8& aDataTo1,
  1313 	const TDesC8& aDataTo2 )
  1324 	const TDesC8& aDataTo2 )
  1314 	{
  1325 	{
  1315 	RADIO_RDEBUG(_L("[RADIO-SESS] CustomCommandSync NoReturn()"));
  1326     FUNC_LOG;
  1316 	if ( iConnected )
  1327 	if ( iConnected )
  1317 		{
  1328 		{
  1318 		return SendReceive(aFunction, TIpcArgs(&aDestination, &aDataTo1, &aDataTo2));
  1329 		return SendReceive(aFunction, TIpcArgs(&aDestination, &aDataTo1, &aDataTo2));
  1319 		}
  1330 		}
  1320 	else
  1331 	else
  1331 	TInt aFunction,
  1342 	TInt aFunction,
  1332 	const TDesC8& aDataTo1,
  1343 	const TDesC8& aDataTo1,
  1333 	const TDesC8& aDataTo2,
  1344 	const TDesC8& aDataTo2,
  1334 	TDes8& aDataFrom )
  1345 	TDes8& aDataFrom )
  1335 	{
  1346 	{
  1336 	RADIO_RDEBUG(_L("[RADIO-SESS] CustomCommandSync Return()"));
  1347     FUNC_LOG;
  1337 	if ( iConnected )
  1348 	if ( iConnected )
  1338 		{
  1349 		{
  1339 		return SendReceive(aFunction, TIpcArgs(&aDestination, &aDataTo1, &aDataTo2, &aDataFrom));
  1350 		return SendReceive(aFunction, TIpcArgs(&aDestination, &aDataTo1, &aDataTo2, &aDataFrom));
  1340 		}
  1351 		}
  1341 	else
  1352 	else
  1352 	TInt aFunction,
  1363 	TInt aFunction,
  1353 	const TDesC8& aDataTo1,
  1364 	const TDesC8& aDataTo1,
  1354 	const TDesC8& aDataTo2,
  1365 	const TDesC8& aDataTo2,
  1355 	TRequestStatus& aStatus )
  1366 	TRequestStatus& aStatus )
  1356 	{
  1367 	{
  1357 	RADIO_RDEBUG(_L("[RADIO-SESS] CustomCommandAsync NoReturn()"));
  1368     FUNC_LOG;
  1358 	if ( iConnected )
  1369 	if ( iConnected )
  1359 		{
  1370 		{
  1360 		SendReceive(aFunction, TIpcArgs(&aDestination, &aDataTo1, &aDataTo2), aStatus);
  1371 		SendReceive(aFunction, TIpcArgs(&aDestination, &aDataTo1, &aDataTo2), aStatus);
  1361 		}
  1372 		}
  1362 	else
  1373 	else
  1375 	const TDesC8& aDataTo1,
  1386 	const TDesC8& aDataTo1,
  1376 	const TDesC8& aDataTo2,
  1387 	const TDesC8& aDataTo2,
  1377 	TDes8& aDataFrom,
  1388 	TDes8& aDataFrom,
  1378 	TRequestStatus& aStatus )
  1389 	TRequestStatus& aStatus )
  1379 	{
  1390 	{
  1380 	RADIO_RDEBUG(_L("[RADIO-SESS] CustomCommandAsync Return()"));
  1391     FUNC_LOG;
  1381 	if ( iConnected )
  1392 	if ( iConnected )
  1382 		{
  1393 		{
  1383 		SendReceive(aFunction, TIpcArgs(&aDestination, &aDataTo1, &aDataTo2, &aDataFrom), aStatus);
  1394 		SendReceive(aFunction, TIpcArgs(&aDestination, &aDataTo1, &aDataTo2, &aDataFrom), aStatus);
  1384 		}
  1395 		}
  1385 	else
  1396 	else
  1394 // -----------------------------------------------------------------------------
  1405 // -----------------------------------------------------------------------------
  1395 //
  1406 //
  1396 void RRadioSession::CancelRequest(
  1407 void RRadioSession::CancelRequest(
  1397 	TInt aRequest )
  1408 	TInt aRequest )
  1398 	{
  1409 	{
  1399 	RADIO_RDEBUG_INT(_L("[RADIO-SESS] CancelRequest(): [%d]"), aRequest);
  1410     FUNC_LOG;
       
  1411 	INFO_1("aRequest: [%d]", aRequest);
  1400 	if ( iConnected )
  1412 	if ( iConnected )
  1401 		{
  1413 		{
  1402 		SendReceive(ERadioServCancel, TIpcArgs(&iDestinationPckg, aRequest));
  1414 		SendReceive(ERadioServCancel, TIpcArgs(&iDestinationPckg, aRequest));
  1403 		}
  1415 		}
  1404 	}
  1416 	}
  1411 // -----------------------------------------------------------------------------
  1423 // -----------------------------------------------------------------------------
  1412 //
  1424 //
  1413 void RRadioSession::StartRequestHandlersL(
  1425 void RRadioSession::StartRequestHandlersL(
  1414 	MRadioObserver& aObserver )
  1426 	MRadioObserver& aObserver )
  1415 	{
  1427 	{
  1416 	RADIO_RDEBUG(_L("[RADIO-SESS] StartRequestHandlersL()"));
  1428     FUNC_LOG;
  1417 
       
  1418 	CRadioRequest* req = NULL;
  1429 	CRadioRequest* req = NULL;
  1419 
  1430 
  1420 	req = CRadioRequest::NewLC(*this, aObserver, ERadioServNone);
  1431 	req = CRadioRequest::NewLC(*this, aObserver, ERadioServNone);
  1421 	User::LeaveIfError( iRequests.Append(req) );
  1432 	User::LeaveIfError( iRequests.Append(req) );
  1422 	CleanupStack::Pop( req );
  1433 	CleanupStack::Pop( req );
  1459 // -----------------------------------------------------------------------------
  1470 // -----------------------------------------------------------------------------
  1460 //
  1471 //
  1461 void RRadioSession::StartEventHandlersL(
  1472 void RRadioSession::StartEventHandlersL(
  1462 	MRadioObserver& aEventObserver )
  1473 	MRadioObserver& aEventObserver )
  1463 	{
  1474 	{
  1464 	RADIO_RDEBUG(_L("[RADIO-SESS] StartEventHandlersL()"));
  1475     FUNC_LOG;
  1465 
  1476 
  1466 	CRadioEventHandler* handler = NULL;
  1477 	CRadioEventHandler* handler = NULL;
  1467 
  1478 
  1468 	handler = CRadioEventHandler::NewLC(aEventObserver, *this, ERadioServPsPlayerState);
  1479 	handler = CRadioEventHandler::NewLC(aEventObserver, *this, ERadioServPsPlayerState);
  1469 	User::LeaveIfError( iEventHandlers.Append(handler) );
  1480 	User::LeaveIfError( iEventHandlers.Append(handler) );
  1515 // -----------------------------------------------------------------------------
  1526 // -----------------------------------------------------------------------------
  1516 //
  1527 //
  1517 void RRadioSession::StartRdsEventHandlersL(
  1528 void RRadioSession::StartRdsEventHandlersL(
  1518 	TUint32 aRdsFunction )
  1529 	TUint32 aRdsFunction )
  1519 	{
  1530 	{
  1520 	RADIO_RDEBUG(_L("[RADIO-SESS] StartRdsEventHandlersL()"));
  1531     FUNC_LOG;
  1521 
  1532 
  1522 	iRdsEventHandlers.ResetAndDestroy();
  1533 	iRdsEventHandlers.ResetAndDestroy();
  1523 	CRadioEventHandler* handler = NULL;
  1534 	CRadioEventHandler* handler = NULL;
  1524 
  1535 
  1525 	// If RDS notification started always return the latest RdsSignalStatus
  1536 	// If RDS notification started always return the latest RdsSignalStatus