mmserv/radioutility/radioserver/Server/Src/RadioServerFMTuner.cpp
changeset 0 71ca22bcf22a
child 6 e35735ece90c
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:  This class implements an interface to FM tuner.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include    "RadioServerFmTuner.h"
       
    22 #include    "RadioDebug.h"
       
    23 
       
    24 // ============================ MEMBER FUNCTIONS ===============================
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // CRadioServerFMTuner::CRadioServerFMTuner
       
    28 // C++ default constructor can NOT contain any code, that
       
    29 // might leave.
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 CRadioServerFMTuner::CRadioServerFMTuner(
       
    33 	MRadioServerFMTunerObserver& aObserver )
       
    34 	:	CActive(EPriorityStandard),
       
    35 		iObserver(aObserver),
       
    36 		iFmTunerQue(_FOFF( TRadioFmTunerData, iLink )),
       
    37 		iFmTunerData(NULL)
       
    38     {
       
    39     }
       
    40 
       
    41 // -----------------------------------------------------------------------------
       
    42 // CRadioServerFMTuner::ConstructL
       
    43 // Symbian 2nd phase constructor can leave.
       
    44 // -----------------------------------------------------------------------------
       
    45 //
       
    46 void CRadioServerFMTuner::ConstructL()
       
    47     {
       
    48 	RADIO_RDEBUG(_L("[RADIO-SVR] CRadioServerFMTuner::ConstructL()"));
       
    49 	CActiveScheduler::Add(this);
       
    50     }
       
    51 
       
    52 // -----------------------------------------------------------------------------
       
    53 // CRadioServerFMTuner::NewL
       
    54 // Two-phased constructor.
       
    55 // -----------------------------------------------------------------------------
       
    56 //
       
    57 CRadioServerFMTuner* CRadioServerFMTuner::NewL(
       
    58 	MRadioServerFMTunerObserver& aObserver )
       
    59     {
       
    60     CRadioServerFMTuner* self = new( ELeave ) CRadioServerFMTuner(aObserver);
       
    61     CleanupStack::PushL(self);
       
    62     self->ConstructL();
       
    63     CleanupStack::Pop(self);
       
    64     return self;
       
    65     }
       
    66 
       
    67 // Destructor
       
    68 CRadioServerFMTuner::~CRadioServerFMTuner()
       
    69     {
       
    70 	RADIO_RDEBUG(_L("[RADIO-SVR] CRadioServerFMTuner::~CRadioServerFMTuner()"));
       
    71 	if ( IsActive() )
       
    72 		{
       
    73 		Cancel();
       
    74 		}
       
    75 
       
    76 	while ( !iFmTunerQue.IsEmpty() )
       
    77 		{
       
    78 		iFmTunerData = iFmTunerQue.First();
       
    79 		iFmTunerQue.Remove(*iFmTunerData);
       
    80 		delete iFmTunerData;
       
    81 		}
       
    82     }
       
    83 
       
    84 // -----------------------------------------------------------------------------
       
    85 // CRadioServerFMTuner::TunerOnComplete
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 void CRadioServerFMTuner::TunerOnComplete(
       
    89 	TFMRadioTunerError aError )
       
    90     {
       
    91 	CompleteNotification(ETunerEventTunerOn, aError);
       
    92     }
       
    93 
       
    94 // -----------------------------------------------------------------------------
       
    95 // CRadioServerFMTuner::TunerOffComplete
       
    96 // -----------------------------------------------------------------------------
       
    97 //
       
    98 void CRadioServerFMTuner::TunerOffComplete(
       
    99 	TFMRadioTunerError aError )
       
   100     {
       
   101 	CompleteNotification(ETunerEventTunerOff, aError);
       
   102     }
       
   103 
       
   104 // -----------------------------------------------------------------------------
       
   105 // CRadioServerFMTuner::SetFrequencyRangeComplete
       
   106 // -----------------------------------------------------------------------------
       
   107 //
       
   108 void CRadioServerFMTuner::SetFrequencyRangeComplete(
       
   109 	TFMRadioTunerError aError )
       
   110     {
       
   111 	CompleteNotification(ETunerEventSetFrequencyRange, aError);
       
   112     }
       
   113 
       
   114 // -----------------------------------------------------------------------------
       
   115 // CRadioServerFMTuner::SetFrequencyComplete
       
   116 // -----------------------------------------------------------------------------
       
   117 //
       
   118 void CRadioServerFMTuner::SetFrequencyComplete(
       
   119 	TFMRadioTunerError aError )
       
   120     {
       
   121 	CompleteNotification(ETunerEventSetFrequency, aError);
       
   122     }
       
   123 
       
   124 // -----------------------------------------------------------------------------
       
   125 // CRadioServerFMTuner::StationSeekComplete
       
   126 // -----------------------------------------------------------------------------
       
   127 //
       
   128 void CRadioServerFMTuner::StationSeekComplete(
       
   129 	TFMRadioTunerError aError,
       
   130 	TInt aFrequency )
       
   131     {
       
   132 	iFrequency = aFrequency;
       
   133 	CompleteNotification(ETunerEventStationSeek, aError);
       
   134     }
       
   135 
       
   136 // -----------------------------------------------------------------------------
       
   137 // CRadioServerFMTuner::AudioModeComplete
       
   138 // -----------------------------------------------------------------------------
       
   139 //
       
   140 void CRadioServerFMTuner::AudioModeComplete(
       
   141 	TFMRadioTunerError aError,
       
   142 	TFMRadioAudioMode aMode )
       
   143     {
       
   144 	iMode = aMode;
       
   145 	CompleteNotification(ETunerEventAudioMode, aError);
       
   146     }
       
   147 
       
   148 // -----------------------------------------------------------------------------
       
   149 // CRadioServerFMTuner::SetAudioModeComplete
       
   150 // -----------------------------------------------------------------------------
       
   151 //
       
   152 void CRadioServerFMTuner::SetAudioModeComplete(
       
   153 	TFMRadioTunerError aError )
       
   154     {
       
   155 	CompleteNotification(ETunerEventSetAudioMode, aError);
       
   156     }
       
   157 
       
   158 // -----------------------------------------------------------------------------
       
   159 // CRadioServerFMTuner::MaxSignalStrengthComplete
       
   160 // -----------------------------------------------------------------------------
       
   161 //
       
   162 void CRadioServerFMTuner::MaxSignalStrengthComplete(
       
   163 	TFMRadioTunerError aError,
       
   164 	TInt aStrength )
       
   165     {
       
   166 	iStrength = aStrength;
       
   167 	CompleteNotification(ETunerEventMaxSignalStrength, aError);
       
   168     }
       
   169 
       
   170 // -----------------------------------------------------------------------------
       
   171 // CRadioServerFMTuner::SignalStrengthComplete
       
   172 // -----------------------------------------------------------------------------
       
   173 //
       
   174 void CRadioServerFMTuner::SignalStrengthComplete(
       
   175 	TFMRadioTunerError aError,
       
   176 	TInt aStrength )
       
   177     {
       
   178 	iStrength = aStrength;
       
   179 	CompleteNotification(ETunerEventSignalStrength, aError);
       
   180     }
       
   181 
       
   182 // -----------------------------------------------------------------------------
       
   183 // CRadioServerFMTuner::SquelchComplete
       
   184 // -----------------------------------------------------------------------------
       
   185 //
       
   186 void CRadioServerFMTuner::SquelchComplete(
       
   187 	TFMRadioTunerError aError,
       
   188 	TBool aEnabled )
       
   189 	{
       
   190 	iEnabled = aEnabled;
       
   191 	CompleteNotification(ETunerEventSquelch, aError);
       
   192 	}
       
   193 
       
   194 // -----------------------------------------------------------------------------
       
   195 // CRadioServerFMTuner::SetSquelchComplete
       
   196 // -----------------------------------------------------------------------------
       
   197 //
       
   198 void CRadioServerFMTuner::SetSquelchComplete(
       
   199 	TFMRadioTunerError aError )
       
   200 	{
       
   201 	CompleteNotification(ETunerEventSetSquelch, aError);
       
   202 	}
       
   203 
       
   204 // -----------------------------------------------------------------------------
       
   205 // CRadioServerFMTuner::BufferFilled
       
   206 // -----------------------------------------------------------------------------
       
   207 //
       
   208 void CRadioServerFMTuner::BufferFilled(
       
   209 	TDes8& /*aBuffer*/ )
       
   210 	{
       
   211 	// Not supported
       
   212 	}
       
   213 
       
   214 // -----------------------------------------------------------------------------
       
   215 // CRadioServerFMTuner::RadioEventAntennaStatusChange
       
   216 // -----------------------------------------------------------------------------
       
   217 //
       
   218 void CRadioServerFMTuner::RadioEventAntennaStatusChange(
       
   219 	TBool aAttached )
       
   220 	{
       
   221 	iAttached = aAttached;
       
   222 	CompleteNotification(ETunerEventAntennaStatusChange);
       
   223 	}
       
   224 
       
   225 #ifdef RD_FM_RADIO_ENHANCEMENTS
       
   226 
       
   227 // -----------------------------------------------------------------------------
       
   228 // CRadioServerFMTuner::RadioEventTunerControlChange
       
   229 // -----------------------------------------------------------------------------
       
   230 //
       
   231 void CRadioServerFMTuner::RadioEventTunerControlChange(
       
   232 	TInt aError )
       
   233 	{
       
   234 	CompleteNotification(ETunerEventTunerControlChange, aError);
       
   235 	}
       
   236 
       
   237 // -----------------------------------------------------------------------------
       
   238 // CRadioServerFMTuner::StationSeekByPTYComplete
       
   239 // -----------------------------------------------------------------------------
       
   240 //
       
   241 void CRadioServerFMTuner::StationSeekByPTYComplete(
       
   242 	TInt aError,
       
   243 	TInt aFrequency )
       
   244 	{
       
   245 	iFrequency = aFrequency;
       
   246 	CompleteNotification(ETunerEventStationSeekByPTY, aError);
       
   247 	}
       
   248 
       
   249 // -----------------------------------------------------------------------------
       
   250 // CRadioServerFMTuner::StationSeekByTAComplete
       
   251 // -----------------------------------------------------------------------------
       
   252 //
       
   253 void CRadioServerFMTuner::StationSeekByTAComplete(
       
   254 	TInt aError,
       
   255 	TInt aFrequency )
       
   256 	{
       
   257 	iFrequency = aFrequency;
       
   258 	CompleteNotification(ETunerEventStationSeekByTA, aError);
       
   259 	}
       
   260 
       
   261 // -----------------------------------------------------------------------------
       
   262 // CRadioServerFMTuner::StationSeekByTPComplete
       
   263 // -----------------------------------------------------------------------------
       
   264 //
       
   265 void CRadioServerFMTuner::StationSeekByTPComplete(
       
   266 	TInt aError,
       
   267 	TInt aFrequency )
       
   268 	{
       
   269 	iFrequency = aFrequency;
       
   270 	CompleteNotification(ETunerEventStationSeekByTP, aError);
       
   271 	}
       
   272 
       
   273 // -----------------------------------------------------------------------------
       
   274 // CRadioServerFMTuner::GetFreqByPTYComplete
       
   275 // -----------------------------------------------------------------------------
       
   276 //
       
   277 void CRadioServerFMTuner::GetFreqByPTYComplete(
       
   278 	TInt /*aError*/,
       
   279 	RArray<TInt>& /*aFreqList*/ )
       
   280 	{
       
   281 	// Not supported
       
   282 	}
       
   283 
       
   284 // -----------------------------------------------------------------------------
       
   285 // CRadioServerFMTuner::GetFreqByTAComplete
       
   286 // -----------------------------------------------------------------------------
       
   287 //
       
   288 void CRadioServerFMTuner::GetFreqByTAComplete(
       
   289 	TInt /*aError*/,
       
   290 	RArray<TInt>& /*aFreqList*/ )
       
   291 	{
       
   292 	// Not supported
       
   293 	}
       
   294 
       
   295 // -----------------------------------------------------------------------------
       
   296 // CRadioServerFMTuner::GetPSByPTYComplete
       
   297 // -----------------------------------------------------------------------------
       
   298 //
       
   299 void CRadioServerFMTuner::GetPSByPTYComplete(
       
   300 	TInt /*aError*/,
       
   301 	RArray<TRdsPSName>& /*aPsList*/ )
       
   302 	{
       
   303 	// Not supported
       
   304 	}
       
   305 
       
   306 // -----------------------------------------------------------------------------
       
   307 // CRadioServerFMTuner::GetPSByTAComplete
       
   308 // -----------------------------------------------------------------------------
       
   309 //
       
   310 void CRadioServerFMTuner::GetPSByTAComplete(
       
   311 	TInt /*aError*/,
       
   312 	RArray<TRdsPSName>& /*aPsList*/ )
       
   313 	{
       
   314 	// Not supported
       
   315 	}
       
   316 
       
   317 // -----------------------------------------------------------------------------
       
   318 // CRadioServerFMTuner::RdsDataPI
       
   319 // -----------------------------------------------------------------------------
       
   320 //
       
   321 void CRadioServerFMTuner::RdsDataPI(
       
   322 	TInt aPi )
       
   323 	{
       
   324 	iObserver.RdsDataPI(aPi);
       
   325 	}
       
   326 
       
   327 // -----------------------------------------------------------------------------
       
   328 // CRadioServerFMTuner::RdsDataPTY
       
   329 // -----------------------------------------------------------------------------
       
   330 //
       
   331 void CRadioServerFMTuner::RdsDataPTY(
       
   332 	TRdsProgrammeType aPty )
       
   333 	{
       
   334 	iObserver.RdsDataPTY(aPty);
       
   335 	}
       
   336 
       
   337 // -----------------------------------------------------------------------------
       
   338 // CRadioServerFMTuner::RdsDataPS
       
   339 // -----------------------------------------------------------------------------
       
   340 //
       
   341 void CRadioServerFMTuner::RdsDataPS(
       
   342 	TRdsPSName& aPs )
       
   343 	{
       
   344 	iObserver.RdsDataPS(aPs);
       
   345 	}
       
   346 
       
   347 // -----------------------------------------------------------------------------
       
   348 // CRadioServerFMTuner::RdsDataRT
       
   349 // -----------------------------------------------------------------------------
       
   350 //
       
   351 void CRadioServerFMTuner::RdsDataRT(
       
   352 	TRdsRadioText& aRt,
       
   353 	RArray<TRdsRTplusTag>& aRTplusTags )
       
   354 	{
       
   355 	iObserver.RdsDataRT(aRt, aRTplusTags);
       
   356 	}
       
   357 
       
   358 // -----------------------------------------------------------------------------
       
   359 // CRadioServerFMTuner::RdsDataCT
       
   360 // -----------------------------------------------------------------------------
       
   361 //
       
   362 void CRadioServerFMTuner::RdsDataCT(
       
   363 	TDateTime& aCt )
       
   364 	{
       
   365 	iObserver.RdsDataCT(aCt);
       
   366 	}
       
   367 
       
   368 // -----------------------------------------------------------------------------
       
   369 // CRadioServerFMTuner::RdsDataTA
       
   370 // -----------------------------------------------------------------------------
       
   371 //
       
   372 void CRadioServerFMTuner::RdsDataTA(
       
   373 	TBool aTaOn )
       
   374 	{
       
   375 	iObserver.RdsDataTA(aTaOn);
       
   376 	}
       
   377 
       
   378 // -----------------------------------------------------------------------------
       
   379 // CRadioServerFMTuner::RdsSearchBeginAF
       
   380 // -----------------------------------------------------------------------------
       
   381 //
       
   382 void CRadioServerFMTuner::RdsSearchBeginAF()
       
   383 	{
       
   384 	iObserver.RdsSearchBeginAF();
       
   385 	}
       
   386 
       
   387 // -----------------------------------------------------------------------------
       
   388 // CRadioServerFMTuner::RdsSearchEndAF
       
   389 // -----------------------------------------------------------------------------
       
   390 //
       
   391 void CRadioServerFMTuner::RdsSearchEndAF(
       
   392 	TInt aError,
       
   393 	TInt aFrequency )
       
   394 	{
       
   395 	iObserver.RdsSearchEndAF(aError, aFrequency);
       
   396 	}
       
   397 
       
   398 // -----------------------------------------------------------------------------
       
   399 // CRadioServerFMTuner::RdsStationChangeTA
       
   400 // -----------------------------------------------------------------------------
       
   401 //
       
   402 void CRadioServerFMTuner::RdsStationChangeTA(
       
   403 	TInt /*aFrequency*/ )
       
   404 	{
       
   405 	// Not supported
       
   406 	}
       
   407 
       
   408 // -----------------------------------------------------------------------------
       
   409 // CRadioServerFMTuner::RdsEventSignalChange
       
   410 // -----------------------------------------------------------------------------
       
   411 //
       
   412 void CRadioServerFMTuner::RdsEventSignalChange(
       
   413 	TBool aSignal )
       
   414 	{
       
   415 	iObserver.RdsEventSignalChange(aSignal);
       
   416 	}
       
   417 
       
   418 #endif //RD_FM_RADIO_ENHANCEMENTS
       
   419 
       
   420 
       
   421 // -----------------------------------------------------------------------------
       
   422 // CRadioServerFMTuner::DoCancel
       
   423 // -----------------------------------------------------------------------------
       
   424 //
       
   425 void CRadioServerFMTuner::DoCancel()
       
   426     {
       
   427     }
       
   428 
       
   429 // -----------------------------------------------------------------------------
       
   430 // CRadioServerFMTuner::RunL
       
   431 // -----------------------------------------------------------------------------
       
   432 //
       
   433 void CRadioServerFMTuner::RunL()
       
   434     {
       
   435 	RADIO_RDEBUG_INT2(_L("[RADIO-SVR] CRadioServerFMTuner::RunL(): Err[%d] Event[%d]"), iFmTunerData->iError, iFmTunerData->iEvent);
       
   436 	TInt error = MapTunerError(iFmTunerData->iError);
       
   437 	switch ( iFmTunerData->iEvent )
       
   438 		{
       
   439 		case ETunerEventTunerOn:
       
   440 			iObserver.TunerOnComplete(error);
       
   441 			break;
       
   442 		case ETunerEventTunerOff:
       
   443 			iObserver.TunerOffComplete(error);
       
   444 			break;
       
   445 		case ETunerEventSetFrequencyRange:
       
   446 			iObserver.SetFrequencyRangeComplete(error);
       
   447 			break;
       
   448 		case ETunerEventSetFrequency:
       
   449 			iObserver.SetFrequencyComplete(error);
       
   450 			break;
       
   451 		case ETunerEventStationSeek:
       
   452 			iObserver.StationSeekComplete(error, iFrequency);
       
   453 			break;
       
   454 		case ETunerEventAudioMode:
       
   455 			if ( iMode == EFMRadioAudioStereo )
       
   456 				{
       
   457 				iObserver.AudioModeComplete(error, ETrue);
       
   458 				}
       
   459 			else
       
   460 				{
       
   461 				iObserver.AudioModeComplete(error, EFalse);
       
   462 				}
       
   463 			break;
       
   464 		case ETunerEventSetAudioMode:
       
   465 			iObserver.SetAudioModeComplete(error);
       
   466 			break;
       
   467 		case ETunerEventMaxSignalStrength:
       
   468 			iObserver.MaxSignalStrengthComplete(error, iStrength);
       
   469 			break;
       
   470 		case ETunerEventSignalStrength:
       
   471 			iObserver.SignalStrengthComplete(error, iStrength);
       
   472 			break;
       
   473 		case ETunerEventSquelch:
       
   474 			iObserver.SquelchComplete(error, iEnabled);
       
   475 			break;
       
   476 		case ETunerEventSetSquelch:
       
   477 			iObserver.SetSquelchComplete(error);
       
   478 			break;
       
   479 		case ETunerEventAntennaStatusChange:
       
   480 			iObserver.RadioEventAntennaStatusChange(iAttached);
       
   481 			break;
       
   482 		case ETunerEventTunerControlChange:
       
   483 			iObserver.RadioEventTunerControlChange(error);
       
   484 			break;
       
   485 		case ETunerEventStationSeekByPTY:
       
   486 			iObserver.StationSeekByPTYComplete(error, iFrequency);
       
   487 			break;
       
   488 		case ETunerEventStationSeekByTA:
       
   489 			iObserver.StationSeekByTAComplete(error, iFrequency);
       
   490 			break;
       
   491 		case ETunerEventStationSeekByTP:
       
   492 			iObserver.StationSeekByTPComplete(error, iFrequency);
       
   493 			break;
       
   494 		default:
       
   495 			RADIO_RDEBUG(_L("[RADIO-SVR] CRadioServerFMTuner::RunL(): ERROR case default !!!"));
       
   496 			break;
       
   497 		}
       
   498 	ProcessNextItemInQueue();
       
   499 	}
       
   500 
       
   501 // -----------------------------------------------------------------------------
       
   502 // CRadioServerFMTuner::CompleteNotification
       
   503 // This method completes the request status and sets the object active
       
   504 // to provide asynchronous behavior.
       
   505 // -----------------------------------------------------------------------------
       
   506 //
       
   507 void CRadioServerFMTuner::CompleteNotification(
       
   508 	TTunerEvent aEvent,
       
   509 	TFMRadioTunerError aError )
       
   510     {
       
   511 	TRadioFmTunerData* data = NULL;
       
   512 	TRAPD(err, data = new (ELeave) TRadioFmTunerData);
       
   513 	if ( err != KErrNone )
       
   514 		{
       
   515 		RADIO_RDEBUG_INT(_L("[RADIO-SVR] CRadioServerFMTuner::CompleteNotification(): Err[%d]"), err);
       
   516 		return;
       
   517 		}
       
   518 	data->iEvent = aEvent;
       
   519 	data->iError = aError;
       
   520 	if ( iFmTunerData )
       
   521 		{
       
   522 		// Outstanding request exits; add it to the queue
       
   523 		iFmTunerQue.AddLast(*data);
       
   524 		}
       
   525 	else
       
   526 		{
       
   527 		// Set the current outstanding request
       
   528 		iFmTunerData = data;
       
   529 		TRequestStatus* stat = &iStatus;
       
   530 		User::RequestComplete(stat, KErrNone);
       
   531 		SetActive();
       
   532 		}
       
   533     }
       
   534 
       
   535 // ----------------------------------------------------
       
   536 // CRadioServer::ProcessNextItemInQueue
       
   537 // ----------------------------------------------------
       
   538 //
       
   539 void CRadioServerFMTuner::ProcessNextItemInQueue()
       
   540 	{
       
   541 	delete iFmTunerData;
       
   542 	iFmTunerData = NULL;
       
   543 	if ( !iFmTunerQue.IsEmpty() )
       
   544 		{
       
   545 		// there is at least one element in the linked list
       
   546 		TRadioFmTunerData* data;
       
   547 		data = iFmTunerQue.First();
       
   548 		iFmTunerQue.Remove(*data);
       
   549 		iFmTunerData = data;
       
   550 		TRequestStatus* stat = &iStatus;
       
   551 		User::RequestComplete(stat, KErrNone);
       
   552 		SetActive();
       
   553 		}
       
   554 	}
       
   555 
       
   556 // ----------------------------------------------------
       
   557 // CRadioServerFMTuner::MapTunerError
       
   558 // ----------------------------------------------------
       
   559 //
       
   560 TInt CRadioServerFMTuner::MapTunerError(
       
   561 	TFMRadioTunerError aError )
       
   562 	{
       
   563 	TInt err;
       
   564 	switch ( aError )
       
   565 		{
       
   566 		case KFMRadioErrHardwareFaulty:
       
   567 		case KRdsErrHardwareFaulty:
       
   568 			err = KRadioServErrHardwareFaulty;
       
   569 			break;
       
   570 		case KFMRadioErrTuning:
       
   571 			err = KRadioServErrTuning;
       
   572 			break;
       
   573 		case KFMRadioErrFrequencyOutOfBandRange:
       
   574 			err = KRadioServErrFrequencyOutOfBandRange;
       
   575 			break;
       
   576 		case KFMRadioErrFrequencyNotValid:
       
   577 			err = KRadioServErrFrequencyNotValid;
       
   578 			break;
       
   579 		case KFMRadioErrNotPermittedInCurrentState:
       
   580 		case KRdsErrNotPermittedInCurrentState:
       
   581 			err = KRadioServErrNotPermittedInCurrentState;
       
   582 			break;
       
   583 		case KFMRadioErrDuplicateRequest:
       
   584 		case KRdsErrDuplicateRequest:
       
   585 			err = KRadioServErrDuplicateRequest;
       
   586 			break;
       
   587 		case KFMRadioErrAntennaNotConnected:
       
   588 			err = KRadioServErrAntennaNotConnected;
       
   589 			break;
       
   590 		case KFMRadioErrFmTransmitterActive:
       
   591 			err = KRadioServErrFmTransmitterActive;
       
   592 			break;
       
   593 		default:
       
   594 			err = aError;
       
   595 			break;
       
   596 		}
       
   597 	RADIO_RDEBUG_INT2(_L("[RADIO-SVR] CRadioServerFMTuner::MapTunerError() [%d-%d]"), aError, err);
       
   598 	return err;
       
   599 	}
       
   600 
       
   601 //  End of File