|
1 /* |
|
2 * Copyright (c) 2009 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: The class provides a way to test Radio Utility's functions |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 // INCLUDES |
|
21 #include <e32cons.h> |
|
22 #include <f32file.h> |
|
23 #include <RadioUtility.h> |
|
24 #include "RadioSession.h" |
|
25 #include "TFMRadioUtility.h" |
|
26 |
|
27 class CRadioUtility; |
|
28 |
|
29 /** |
|
30 * Cause a panic |
|
31 * @param aPanic - The panic to be raised |
|
32 **/ |
|
33 GLDEF_C void Panic(TInt aPanic) |
|
34 { |
|
35 _LIT(KNameOfApp,"TRadioEngine"); |
|
36 User::Panic(KNameOfApp, aPanic); |
|
37 } |
|
38 |
|
39 /** |
|
40 * Start the BTTestHarness up. |
|
41 **/ |
|
42 void StartupL() |
|
43 { |
|
44 CActiveScheduler *pA=new(ELeave) CActiveScheduler; |
|
45 CleanupStack::PushL(pA); |
|
46 CActiveScheduler::Install(pA); |
|
47 CTRadioUtility* tester = CTRadioUtility::NewLC(); |
|
48 tester->StartTestingL(); |
|
49 CActiveScheduler::Start(); |
|
50 CleanupStack::Pop(); |
|
51 delete tester; |
|
52 tester = NULL; |
|
53 CleanupStack::PopAndDestroy(1); |
|
54 } |
|
55 |
|
56 /** |
|
57 * The main entrypoint for the application |
|
58 **/ |
|
59 GLDEF_C TInt E32Main() |
|
60 { |
|
61 |
|
62 __UHEAP_MARK; |
|
63 CTrapCleanup* cleanup=CTrapCleanup::New(); |
|
64 TRAPD(error, StartupL() ); |
|
65 |
|
66 delete cleanup; |
|
67 __UHEAP_MARKEND; |
|
68 if (error == KErrNone) |
|
69 { |
|
70 return KErrNone; |
|
71 } |
|
72 else |
|
73 { |
|
74 return error; |
|
75 } |
|
76 } |
|
77 |
|
78 /** |
|
79 * NewL method for creating new instances of this class. |
|
80 **/ |
|
81 CTRadioUtility* CTRadioUtility::NewL() |
|
82 { |
|
83 CTRadioUtility* s = CTRadioUtility::NewLC(); |
|
84 CleanupStack::Pop(); |
|
85 return s; |
|
86 } |
|
87 |
|
88 |
|
89 /** |
|
90 * NewLC method for creating new instances of this class. |
|
91 **/ |
|
92 CTRadioUtility* CTRadioUtility::NewLC() |
|
93 { |
|
94 RDebug::Print(_L("CTRadioUtility::NewLC")); |
|
95 CTRadioUtility* s = new(ELeave) CTRadioUtility(); |
|
96 CleanupStack::PushL(s); |
|
97 s->ConstructL(); |
|
98 return s; |
|
99 } |
|
100 /** |
|
101 * MRadioPlayerObserver Callback |
|
102 * |
|
103 * |
|
104 **/ |
|
105 void CTRadioUtility::MrpoStateChange( TPlayerState aState, TInt aError ) |
|
106 { |
|
107 iConsole->Printf(_L("Player State Change: %x Error Code: %x\n"),aState, aError); |
|
108 } |
|
109 |
|
110 /** |
|
111 * MRadioPlayerObserver MrpoVolumeChange Callback |
|
112 * |
|
113 * |
|
114 **/ |
|
115 void CTRadioUtility::MrpoVolumeChange( TInt aVolume ) |
|
116 { |
|
117 iConsole->Printf(_L("Volume Change: %x\n"),aVolume); |
|
118 } |
|
119 |
|
120 /** |
|
121 * MRadioPlayerObserver MrpoMuteChange Callback |
|
122 * |
|
123 * |
|
124 **/ |
|
125 void CTRadioUtility::MrpoMuteChange( TBool aMute ) |
|
126 { |
|
127 iConsole->Printf(_L("Mute Change: %x\n"),aMute); |
|
128 } |
|
129 |
|
130 /** |
|
131 * MRadioPlayerObserver MrpoBalanceChange Callback |
|
132 * |
|
133 * |
|
134 **/ |
|
135 void CTRadioUtility::MrpoBalanceChange( TInt aLeftPercentage, TInt aRightPercentage ) |
|
136 { |
|
137 iConsole->Printf(_L("Left Percentage: %x Right Percentage: %x\n"),aLeftPercentage, aRightPercentage); |
|
138 } |
|
139 |
|
140 /** |
|
141 * MRadioFmTunerObserver MrftoRequestTunerControlComplete Callback |
|
142 * |
|
143 * |
|
144 **/ |
|
145 void CTRadioUtility::MrftoRequestTunerControlComplete( TInt aError ) |
|
146 { |
|
147 iConsole->Printf(_L("Request Tuner Control Complete: %x\n"),aError); |
|
148 } |
|
149 |
|
150 /** |
|
151 * MRadioFmTunerObserver MrftoSetFrequencyRangeComplete Callback |
|
152 * |
|
153 * |
|
154 **/ |
|
155 void CTRadioUtility::MrftoSetFrequencyRangeComplete( TInt aError ) |
|
156 { |
|
157 iConsole->Printf(_L("Set Frequency Range Complete: %x\n"),aError); |
|
158 } |
|
159 |
|
160 /** |
|
161 * MRadioFmTunerObserver MrftoSetFrequencyComplete Callback |
|
162 * |
|
163 * |
|
164 **/ |
|
165 void CTRadioUtility::MrftoSetFrequencyComplete( TInt aError ) |
|
166 { |
|
167 iConsole->Printf(_L("Set Frequency Complete: %x\n"),aError); |
|
168 } |
|
169 |
|
170 /** |
|
171 * MRadioFmTunerObserver Callback |
|
172 * |
|
173 * |
|
174 **/ |
|
175 void CTRadioUtility::MrftoStationSeekComplete( TInt aError, TInt aFrequency ) |
|
176 { |
|
177 iConsole->Printf(_L("Station Seek Complete: %x Frequency: %x\n"),aError, aFrequency); |
|
178 } |
|
179 |
|
180 /** |
|
181 * MRadioFmTunerObserver MrftoFmTransmitterStatusChange Callback |
|
182 * |
|
183 * |
|
184 **/ |
|
185 void CTRadioUtility::MrftoFmTransmitterStatusChange( TBool aActive ) |
|
186 { |
|
187 iConsole->Printf(_L("Transmitter Status Change: %x\n"),aActive); |
|
188 } |
|
189 |
|
190 /** |
|
191 * MRadioFmTunerObserver MrftoAntennaStatusChange Callback |
|
192 * |
|
193 * |
|
194 **/ |
|
195 void CTRadioUtility::MrftoAntennaStatusChange( TBool aAttached ) |
|
196 { |
|
197 iConsole->Printf(_L("Antenna Status Change: %x\n"),aAttached); |
|
198 } |
|
199 |
|
200 /** |
|
201 * MRadioFmTunerObserver MrftoOfflineModeStatusChange Callback |
|
202 * |
|
203 * |
|
204 **/ |
|
205 void CTRadioUtility::MrftoOfflineModeStatusChange( TBool aOfflineMode ) |
|
206 { |
|
207 iConsole->Printf(_L("Offline Mode Change: %x\n"),aOfflineMode); |
|
208 } |
|
209 |
|
210 /** |
|
211 * MRadioFmTunerObserver MrftoFrequencyRangeChange Callback |
|
212 * |
|
213 * |
|
214 **/ |
|
215 void CTRadioUtility::MrftoFrequencyRangeChange( TFmRadioFrequencyRange aNewRange ) |
|
216 { |
|
217 iConsole->Printf(_L("Frequency Range Change: Range = %d"),aNewRange); |
|
218 } |
|
219 |
|
220 /** |
|
221 * MRadioFmTunerObserver MrftoFrequencyChange Callback |
|
222 * |
|
223 * |
|
224 **/ |
|
225 void CTRadioUtility::MrftoFrequencyChange( TInt aNewFrequency ) |
|
226 { |
|
227 iConsole->Printf(_L("Frequency Change: %x\n"),aNewFrequency); |
|
228 } |
|
229 |
|
230 /** |
|
231 * MRadioFmTunerObserver MrftoForcedMonoChange Callback |
|
232 * |
|
233 * |
|
234 **/ |
|
235 void CTRadioUtility::MrftoForcedMonoChange( TBool aForcedMono ) |
|
236 { |
|
237 iConsole->Printf(_L("Forced Mono Change: %x\n"),aForcedMono); |
|
238 } |
|
239 |
|
240 /** |
|
241 * MRadioFmTunerObserver MrftoSquelchChange Callback |
|
242 * |
|
243 * |
|
244 **/ |
|
245 void CTRadioUtility::MrftoSquelchChange( TBool aSquelch ) |
|
246 { |
|
247 iConsole->Printf(_L("Squelch Change: %x\n"),aSquelch); |
|
248 } |
|
249 |
|
250 |
|
251 /** |
|
252 * MRadioRdsTunerObserver MrroStationSeekByPTYComplete Callback |
|
253 * |
|
254 * |
|
255 **/ |
|
256 void CTRadioUtility::MrroStationSeekByPTYComplete( TInt /*aError*/, TInt aFrequency ) |
|
257 { |
|
258 iConsole->Printf(_L(" Station Seek By PTY Complete: %x\n"),aFrequency); |
|
259 } |
|
260 |
|
261 /** |
|
262 * MRadioRdsTunerObserver MrroStationSeekByTAComplete Callback |
|
263 * |
|
264 * |
|
265 **/ |
|
266 void CTRadioUtility::MrroStationSeekByTAComplete( TInt /*aError*/, TInt aFrequency ) |
|
267 { |
|
268 iConsole->Printf(_L(" Station Seek By TA Complete: %x\n"),aFrequency); |
|
269 } |
|
270 |
|
271 /** |
|
272 * MRadioRdsTunerObserver MrroStationSeekByTPComplete Callback |
|
273 * |
|
274 * |
|
275 **/ |
|
276 void CTRadioUtility::MrroStationSeekByTPComplete( TInt /*aError*/, TInt aFrequency ) |
|
277 { |
|
278 iConsole->Printf(_L(" Statio Seek TP Complete: %x\n"),aFrequency); |
|
279 } |
|
280 |
|
281 /** |
|
282 * MRadioRdsTunerObserver MrroGetFreqByPTYComplete Callback |
|
283 * |
|
284 * |
|
285 **/ |
|
286 void CTRadioUtility::MrroGetFreqByPTYComplete( TInt aError, RArray<TInt>& /*aFreqList*/ ) |
|
287 { |
|
288 iConsole->Printf(_L(" Freq By PTY Complete: %x\n"),aError); |
|
289 } |
|
290 |
|
291 /** |
|
292 * MRadioRdsTunerObserver MrroGetFreqByTAComplete Callback |
|
293 * |
|
294 * |
|
295 **/ |
|
296 void CTRadioUtility::MrroGetFreqByTAComplete( TInt aError, RArray<TInt>& /*aFreqList*/ ) |
|
297 { |
|
298 iConsole->Printf(_L(" Freq By TA Complete: %x\n"),aError); |
|
299 } |
|
300 |
|
301 /** |
|
302 * MRadioRdsTunerObserver MrroGetPSByPTYComplete Callback |
|
303 * |
|
304 * |
|
305 **/ |
|
306 void CTRadioUtility::MrroGetPSByPTYComplete( TInt aError, RArray<TRdsPSName>& /*aPsList*/ ) |
|
307 { |
|
308 iConsole->Printf(_L(" PSByPTY Complete: %x\n"),aError); |
|
309 } |
|
310 |
|
311 /** |
|
312 * MRadioRdsTunerObserver MrroGetPSByTAComplete Callback |
|
313 * |
|
314 * |
|
315 **/ |
|
316 void CTRadioUtility::MrroGetPSByTAComplete( TInt aError, RArray<TRdsPSName>& /*aPsList*/ ) |
|
317 { |
|
318 iConsole->Printf(_L(" PSByTA Complete: %x\n"),aError); |
|
319 } |
|
320 |
|
321 /** |
|
322 * MRadioRdsTunerObserver MrroRdsDataPI Callback |
|
323 * |
|
324 * |
|
325 **/ |
|
326 void CTRadioUtility::MrroRdsDataPI( TInt aPi ) |
|
327 { |
|
328 iConsole->Printf(_L(" Data PI: %x\n"),aPi); |
|
329 } |
|
330 |
|
331 /** |
|
332 * MRadioRdsTunerObserver MrroRdsDataPTY Callback |
|
333 * |
|
334 * |
|
335 **/ |
|
336 void CTRadioUtility::MrroRdsDataPTY( TRdsProgrammeType aPty ) |
|
337 { |
|
338 iConsole->Printf(_L(" Data PTY: %x\n"),aPty); |
|
339 } |
|
340 |
|
341 /** |
|
342 * MRadioRdsTunerObserver MrroRdsDataPS Callback |
|
343 * |
|
344 * |
|
345 **/ |
|
346 void CTRadioUtility::MrroRdsDataPS( TRdsPSName& /*aPs*/ ) |
|
347 { |
|
348 iConsole->Printf(_L(" Data PS:\n")); |
|
349 } |
|
350 |
|
351 /** |
|
352 * MRadioRdsTunerObserver MrroRdsDataRT Callback |
|
353 * |
|
354 * |
|
355 **/ |
|
356 void CTRadioUtility::MrroRdsDataRT( TRdsRadioText& /*aRt*/ ) |
|
357 { |
|
358 iConsole->Printf(_L(" Data RT: \n")); |
|
359 } |
|
360 |
|
361 /** |
|
362 * MRadioRdsTunerObserver MrroRdsDataRTPlus Callback |
|
363 * |
|
364 * |
|
365 **/ |
|
366 void CTRadioUtility::MrroRdsDataRTplus( TRdsRTplusClass /*aRtPlusClass*/, TRdsRadioText& /*aRtPlusData*/ ) |
|
367 { |
|
368 iConsole->Printf(_L(" Data RTPlusData: \n")); |
|
369 } |
|
370 |
|
371 /** |
|
372 * MRadioRdsTunerObserver MrroRdsDataCT Callback |
|
373 * |
|
374 * |
|
375 **/ |
|
376 void CTRadioUtility::MrroRdsDataCT( TDateTime& /*aCt*/ ) |
|
377 { |
|
378 iConsole->Printf(_L(" Data CT: \n")); |
|
379 } |
|
380 |
|
381 /** |
|
382 * MRadioRdsTunerObserver MrroRdsDataTA Callback |
|
383 * |
|
384 * |
|
385 **/ |
|
386 void CTRadioUtility::MrroRdsDataTA( TBool aTaOn ) |
|
387 { |
|
388 iConsole->Printf(_L(" Data TA: %x\n"),aTaOn); |
|
389 } |
|
390 |
|
391 /** |
|
392 * MRadioRdsTunerObserver MrroRdsSearchBeginAF Callback |
|
393 * |
|
394 * |
|
395 **/ |
|
396 void CTRadioUtility::MrroRdsSearchBeginAF() |
|
397 { |
|
398 iConsole->Printf(_L(" Search Begin AF:\n")); |
|
399 } |
|
400 |
|
401 /** |
|
402 * MRadioRdsTunerObserver MrroRdsSearchEndAF Callback |
|
403 * |
|
404 * |
|
405 **/ |
|
406 void CTRadioUtility::MrroRdsSearchEndAF( TInt /*aError*/, TInt aFrequency ) |
|
407 { |
|
408 iConsole->Printf(_L(" Search End AF: %x\n"),aFrequency); |
|
409 } |
|
410 |
|
411 /** |
|
412 * MRadioRdsTunerObserver MrroRdsStationChangeTA Callback |
|
413 * |
|
414 * |
|
415 **/ |
|
416 void CTRadioUtility::MrroRdsStationChangeTA( TInt aFrequency ) |
|
417 { |
|
418 iConsole->Printf(_L("Station Change TA: %x\n"),aFrequency); |
|
419 } |
|
420 |
|
421 /** |
|
422 * MRadioRdsTunerObserver MrroRdsEventAutomaticSwitchingChange Callback |
|
423 * |
|
424 * |
|
425 **/ |
|
426 void CTRadioUtility::MrroRdsEventAutomaticSwitchingChange( TBool aAuto ) |
|
427 { |
|
428 iConsole->Printf(_L(" Auto Switch Change: %x\n"),aAuto); |
|
429 } |
|
430 |
|
431 /** |
|
432 * MRadioRdsTunerObserver MrroRdsEventAutomaticTrafficAnnouncement Callback |
|
433 * |
|
434 * |
|
435 **/ |
|
436 void CTRadioUtility::MrroRdsEventAutomaticTrafficAnnouncement( TBool aAuto ) |
|
437 { |
|
438 iConsole->Printf(_L(" Auto TA Change: %x\n"),aAuto); |
|
439 } |
|
440 |
|
441 /** |
|
442 * MRadioRdsTunerObserver MrroRdsEventSignalChange Callback |
|
443 * |
|
444 * |
|
445 **/ |
|
446 void CTRadioUtility::MrroRdsEventSignalChange( TBool aSignal ) |
|
447 { |
|
448 iConsole->Printf(_L(" Signal Change: %x\n"),aSignal); |
|
449 } |
|
450 |
|
451 /** |
|
452 * 2nd phase constructor |
|
453 **/ |
|
454 void CTRadioUtility::ConstructL() |
|
455 { |
|
456 RDebug::Print(_L("CTRadioUtility::ConstructL()")); |
|
457 iConsole=Console::NewL(_L("CTestRadioUtility"), TSize(-1,-1)); |
|
458 iReadConsole = CTRadioUtilityConsole::NewL(this); |
|
459 TBool PrimaryClient = ETrue; |
|
460 iRadioUtility = CRadioUtility::NewL(PrimaryClient); |
|
461 iFmTunerUtility = &iRadioUtility->RadioFmTunerUtilityL(*this); |
|
462 iPlayerUtility = &iRadioUtility->RadioPlayerUtilityL(*this); |
|
463 iRdsUtility = &iRadioUtility->RadioRdsUtilityL(*this); |
|
464 } |
|
465 |
|
466 /** |
|
467 * c++ default constructor |
|
468 **/ |
|
469 CTRadioUtility::CTRadioUtility() |
|
470 { |
|
471 } |
|
472 |
|
473 /** |
|
474 * destructor |
|
475 **/ |
|
476 CTRadioUtility::~CTRadioUtility() |
|
477 { |
|
478 // iSharedDataClient.Close(); |
|
479 delete iRadioUtility; |
|
480 delete iReadConsole; |
|
481 delete iConsole; |
|
482 User::After(20000000); |
|
483 } |
|
484 |
|
485 /** |
|
486 * Simple helper method to retrieve a pointer to the console method |
|
487 * @return a pointer to the console |
|
488 **/ |
|
489 CConsoleBase* CTRadioUtility::ConsoleWin() |
|
490 { |
|
491 return iConsole; |
|
492 } |
|
493 |
|
494 // |
|
495 // |
|
496 // Tuner Utility Test Cases |
|
497 // |
|
498 // |
|
499 |
|
500 /** |
|
501 * RequestTunerControl |
|
502 * @return None |
|
503 **/ |
|
504 void CTRadioUtility::RequestTunerControl() |
|
505 { |
|
506 iFmTunerUtility->RequestTunerControl(); |
|
507 } |
|
508 |
|
509 /** |
|
510 * CloseTuner |
|
511 * @return None |
|
512 **/ |
|
513 void CTRadioUtility::CloseTuner() |
|
514 { |
|
515 //iFmTunerUtility->Close(); |
|
516 } |
|
517 |
|
518 /** |
|
519 * GetCapabilities |
|
520 * @return None |
|
521 **/ |
|
522 void CTRadioUtility::GetTunerCapabilities() |
|
523 { |
|
524 TFmTunerCapabilities Caps; |
|
525 TInt err = iFmTunerUtility->GetCapabilities(Caps); |
|
526 iConsole->Printf(_L("TunerCapabilities: %x\n"),Caps.iTunerBands); |
|
527 } |
|
528 |
|
529 /** |
|
530 * EnableTunerInOfflineMode |
|
531 * @return None |
|
532 **/ |
|
533 void CTRadioUtility::EnableTunerInOfflineMode() |
|
534 { |
|
535 TBool Enable = EFalse; |
|
536 TInt err = iFmTunerUtility->EnableTunerInOfflineMode(Enable); |
|
537 } |
|
538 |
|
539 /** |
|
540 * SetFrequencyRange |
|
541 * @return None |
|
542 **/ |
|
543 void CTRadioUtility::SetFrequencyRange() |
|
544 { |
|
545 iRange = EFmRangeJapan; |
|
546 iConsole->Printf(_L("Frequency was Japanese: %x\n"),iRange); |
|
547 TFmRadioFrequencyRange Range = EFmRangeEuroAmerica; |
|
548 iFmTunerUtility->SetFrequencyRange(Range); |
|
549 iRange = Range; |
|
550 iConsole->Printf(_L("Frequency now set to America: %x\n"),iRange); |
|
551 } |
|
552 |
|
553 /** |
|
554 * GetFrequencyRange |
|
555 * @return None |
|
556 **/ |
|
557 void CTRadioUtility::GetFrequencyRange() |
|
558 { |
|
559 TFmRadioFrequencyRange Range = EFmRangeEuroAmerica; |
|
560 TInt MinFreq; |
|
561 TInt MaxFreq; |
|
562 TInt err = iFmTunerUtility->GetFrequencyRange(Range, MinFreq, MaxFreq ); |
|
563 iConsole->Printf(_L("GetFrequncy Range: Min %x Max %x\n"),MinFreq, MaxFreq); |
|
564 } |
|
565 |
|
566 /** |
|
567 * SetFrequency |
|
568 * @return None |
|
569 **/ |
|
570 void CTRadioUtility::SetFrequency() |
|
571 { |
|
572 TInt Freq = 106100000; |
|
573 |
|
574 iFmTunerUtility->SetFrequency(Freq); |
|
575 iConsole->Printf(_L("Set Frequency to 106100000: %d\n"),Freq); |
|
576 } |
|
577 |
|
578 /** |
|
579 * GetFrequency |
|
580 * @return None |
|
581 **/ |
|
582 void CTRadioUtility::GetFrequency() |
|
583 { |
|
584 TInt Freq; |
|
585 TInt err = iFmTunerUtility->GetFrequency(Freq); |
|
586 iConsole->Printf(_L("GetFrequncy: %d\n"),Freq); |
|
587 } |
|
588 |
|
589 /** |
|
590 * StationSee |
|
591 * @return None |
|
592 **/ |
|
593 void CTRadioUtility::StationSeek() |
|
594 { |
|
595 TBool Upwards = ETrue; |
|
596 iFmTunerUtility->StationSeek(Upwards); |
|
597 } |
|
598 |
|
599 /** |
|
600 * GetSignalStrength |
|
601 * @return None |
|
602 **/ |
|
603 void CTRadioUtility::GetSignalStrength() |
|
604 { |
|
605 TInt SignalStrength; |
|
606 TInt err = iFmTunerUtility->GetSignalStrength(SignalStrength); |
|
607 iConsole->Printf(_L("GetSignalStrength: %d\n"),SignalStrength); |
|
608 } |
|
609 |
|
610 /** |
|
611 * GetMaxSignalStrength |
|
612 * @return None |
|
613 **/ |
|
614 void CTRadioUtility::GetMaxSignalStrength() |
|
615 { |
|
616 TInt SignalStrength; |
|
617 TInt err = iFmTunerUtility->GetMaxSignalStrength(SignalStrength); |
|
618 iConsole->Printf(_L("GetMaxSignalStrength: %x\n"),SignalStrength); |
|
619 } |
|
620 |
|
621 /** |
|
622 * GetStereoMode |
|
623 * @return None |
|
624 **/ |
|
625 void CTRadioUtility::GetStereoMode() |
|
626 { |
|
627 TBool Stereo; |
|
628 TInt err = iFmTunerUtility->GetStereoMode(Stereo); |
|
629 iConsole->Printf(_L("Stereo Mode: %x\n"),Stereo); |
|
630 } |
|
631 |
|
632 /** |
|
633 * ForceMonoReception |
|
634 * @return None |
|
635 **/ |
|
636 void CTRadioUtility::ForceMonoReception() |
|
637 { |
|
638 TBool ForceMono = ETrue; |
|
639 TInt err = iFmTunerUtility->ForceMonoReception(ForceMono); |
|
640 iConsole->Printf(_L("Set ForceMonoReception: %x\n"),ForceMono); |
|
641 } |
|
642 |
|
643 /** |
|
644 * GetForceMonoReception |
|
645 * @return None |
|
646 **/ |
|
647 void CTRadioUtility::GetForceMonoReception() |
|
648 { |
|
649 TBool ForceMono; |
|
650 TInt err = iFmTunerUtility->GetForcedMonoReception(ForceMono); |
|
651 iConsole->Printf(_L("GetForceMonoReception: %x\n"),ForceMono); |
|
652 } |
|
653 |
|
654 /** |
|
655 * SetSquelch |
|
656 * @return None |
|
657 **/ |
|
658 void CTRadioUtility::SetSquelch() |
|
659 { |
|
660 TBool Squelch = ETrue; |
|
661 TInt err = iFmTunerUtility->SetSquelch(Squelch); |
|
662 iConsole->Printf(_L("SetSquelch: %x\n"),Squelch); |
|
663 } |
|
664 |
|
665 /** |
|
666 * GetSquelch |
|
667 * @return None |
|
668 **/ |
|
669 void CTRadioUtility::GetSquelch() |
|
670 { |
|
671 TBool Squelch; |
|
672 TInt err = iFmTunerUtility->GetSquelch(Squelch); |
|
673 iConsole->Printf(_L("GetSquelch: %x\n"),Squelch); |
|
674 } |
|
675 |
|
676 /** |
|
677 * CancelStationSeek |
|
678 * @return None |
|
679 **/ |
|
680 void CTRadioUtility::CancelStationSeek() |
|
681 { |
|
682 iFmTunerUtility->CancelStationSeek(); |
|
683 } |
|
684 |
|
685 /** |
|
686 * CancelSetFrequencyRange |
|
687 * @return None |
|
688 **/ |
|
689 void CTRadioUtility::CancelSetFrequencyRange() |
|
690 { |
|
691 iFmTunerUtility->CancelSetFrequencyRange(); |
|
692 } |
|
693 |
|
694 /** |
|
695 * CancelSetFrequency |
|
696 * @return None |
|
697 **/ |
|
698 void CTRadioUtility::CancelSetFrequency() |
|
699 { |
|
700 iFmTunerUtility->CancelSetFrequency(); |
|
701 } |
|
702 |
|
703 |
|
704 // |
|
705 // Player Utility Test Cases |
|
706 // |
|
707 |
|
708 /** |
|
709 * Play Radio |
|
710 * @return None |
|
711 **/ |
|
712 void CTRadioUtility::Play() |
|
713 { |
|
714 iPlayerUtility->Play(); |
|
715 } |
|
716 |
|
717 /** |
|
718 * PlayerState Radio |
|
719 * @return None |
|
720 **/ |
|
721 void CTRadioUtility::PlayerState() |
|
722 { |
|
723 TPlayerState PState; |
|
724 PState = iPlayerUtility->PlayerState(); |
|
725 iConsole->Printf(_L("PlayerState: %x\n"),PState); |
|
726 } |
|
727 |
|
728 /** |
|
729 * Close Radio |
|
730 * @return None |
|
731 **/ |
|
732 void CTRadioUtility::ClosePlayer() |
|
733 { |
|
734 iPlayerUtility->Close(); |
|
735 } |
|
736 |
|
737 /** |
|
738 * Stop Radio |
|
739 * @return None |
|
740 **/ |
|
741 void CTRadioUtility::StopPlayer() |
|
742 { |
|
743 iPlayerUtility->Stop(); |
|
744 } |
|
745 |
|
746 /** |
|
747 * Mute Radio |
|
748 * @return None |
|
749 **/ |
|
750 void CTRadioUtility::Mute() |
|
751 { |
|
752 TInt err = iPlayerUtility->Mute(ETrue); |
|
753 } |
|
754 |
|
755 /** |
|
756 * IsMute Radio |
|
757 * @return None |
|
758 **/ |
|
759 void CTRadioUtility::IsMute() |
|
760 { |
|
761 TBool Mute = iPlayerUtility->IsMute(); |
|
762 iConsole->Printf(_L("IsMute: %x\n"),Mute); |
|
763 } |
|
764 |
|
765 /** |
|
766 * SetVolume Radio |
|
767 * @return None |
|
768 **/ |
|
769 void CTRadioUtility::SetVolume() |
|
770 { |
|
771 TInt Volume = 6; |
|
772 TInt err = iPlayerUtility->SetVolume(Volume); |
|
773 } |
|
774 |
|
775 /** |
|
776 * GetVolume Radio |
|
777 * @return None |
|
778 **/ |
|
779 void CTRadioUtility::GetVolume() |
|
780 { |
|
781 TInt Volume; |
|
782 TInt err = iPlayerUtility->GetVolume(Volume); |
|
783 iConsole->Printf(_L("Volume: %x\n"),Volume); |
|
784 } |
|
785 |
|
786 /** |
|
787 * SetVolumeRamp Radio |
|
788 * @return None |
|
789 **/ |
|
790 void CTRadioUtility::SetVolumeRamp() |
|
791 { |
|
792 TTimeIntervalMicroSeconds RampInterval = 4; |
|
793 TInt err = iPlayerUtility->SetVolumeRamp(RampInterval); |
|
794 iConsole->Printf(_L("RampInterval: %x\n"),RampInterval.Int64() ); |
|
795 } |
|
796 |
|
797 /** |
|
798 * GetMaxVolume Radio |
|
799 * @return None |
|
800 **/ |
|
801 void CTRadioUtility::GetMaxVolume() |
|
802 { |
|
803 TInt MaxVolume; |
|
804 TInt err = iPlayerUtility->GetMaxVolume(MaxVolume); |
|
805 iConsole->Printf(_L("MaxVolume: %x\n"),MaxVolume); |
|
806 } |
|
807 |
|
808 /** |
|
809 * SetBalance Radio |
|
810 * @return None |
|
811 **/ |
|
812 void CTRadioUtility::SetBalance() |
|
813 { |
|
814 TInt LeftPercentage = 49; |
|
815 TInt RightPercentage = 51; |
|
816 TInt err = iPlayerUtility->SetBalance(LeftPercentage, RightPercentage); |
|
817 } |
|
818 |
|
819 /** |
|
820 * GetBalance Radio |
|
821 * @return None |
|
822 **/ |
|
823 void CTRadioUtility::GetBalance() |
|
824 { |
|
825 TInt LeftPercentage; |
|
826 TInt RightPercentage; |
|
827 TInt err = iPlayerUtility->GetBalance(LeftPercentage, RightPercentage); |
|
828 iConsole->Printf(_L("GetBalance: left %x right %x \n"),LeftPercentage,RightPercentage); |
|
829 } |
|
830 |
|
831 // |
|
832 // Rds Utility |
|
833 // |
|
834 |
|
835 void CTRadioUtility::Close() |
|
836 { |
|
837 iRdsUtility->Close(); |
|
838 } |
|
839 |
|
840 void CTRadioUtility::GetRdsCapabilities() |
|
841 { |
|
842 TRdsCapabilities Caps; |
|
843 TInt err = iRdsUtility->GetCapabilities( Caps ); |
|
844 } |
|
845 |
|
846 |
|
847 void CTRadioUtility::GetRdsSignalStatus() |
|
848 { |
|
849 TBool RdsSignal = ETrue; |
|
850 TInt err = iRdsUtility->GetRdsSignalStatus( RdsSignal ); |
|
851 } |
|
852 |
|
853 void CTRadioUtility::NotifyRdsDataChange() |
|
854 { |
|
855 TRdsData RdsData; |
|
856 RdsData.iAdditionalFunctions1 = 0; |
|
857 RdsData.iAdditionalFunctions2 = 0; |
|
858 RdsData.iRdsFunctions = ERdsTrafficAnnouncement | ERdsRadioText | ERdsClockTime; |
|
859 TInt err = iRdsUtility->NotifyRdsDataChange( RdsData ); |
|
860 } |
|
861 |
|
862 void CTRadioUtility::CancelNotifyRdsDataChange() |
|
863 { |
|
864 iRdsUtility->CancelNotifyRdsDataChange(); |
|
865 } |
|
866 |
|
867 void CTRadioUtility::SetAutomaticSwitching() |
|
868 { |
|
869 TBool Auto = ETrue; |
|
870 TInt err = iRdsUtility->SetAutomaticSwitching( Auto ); |
|
871 } |
|
872 |
|
873 void CTRadioUtility::GetAutomaticSwitching() |
|
874 { |
|
875 TBool Auto = EFalse; |
|
876 TInt err = iRdsUtility->GetAutomaticSwitching( Auto ); |
|
877 } |
|
878 |
|
879 void CTRadioUtility::CancelAFSearch() |
|
880 { |
|
881 iRdsUtility->CancelAFSearch(); |
|
882 } |
|
883 |
|
884 void CTRadioUtility::SetAutomaticTrafficAnnouncement() |
|
885 { |
|
886 TBool Auto = ETrue; |
|
887 TInt err = iRdsUtility->SetAutomaticTrafficAnnouncement( Auto ); |
|
888 } |
|
889 |
|
890 void CTRadioUtility::GetAutomaticTrafficAnnouncement() |
|
891 { |
|
892 TBool Auto = EFalse; |
|
893 TInt err = iRdsUtility->GetAutomaticTrafficAnnouncement( Auto ); |
|
894 } |
|
895 |
|
896 void CTRadioUtility::StationSeekByPTY() |
|
897 { |
|
898 TRdsProgrammeType Pty = KRdsPtyNone; |
|
899 TBool SeekUp = ETrue; |
|
900 iRdsUtility->StationSeekByPTY( Pty, SeekUp ); |
|
901 } |
|
902 |
|
903 void CTRadioUtility::StationSeekByTA() |
|
904 { |
|
905 TBool SeekUp = ETrue; |
|
906 iRdsUtility->StationSeekByTA( SeekUp ); |
|
907 } |
|
908 |
|
909 void CTRadioUtility::StationSeekByTP() |
|
910 { |
|
911 TBool SeekUp = ETrue; |
|
912 iRdsUtility->StationSeekByTP( SeekUp ); |
|
913 } |
|
914 |
|
915 void CTRadioUtility::CancelRdsStationSeek() |
|
916 { |
|
917 iRdsUtility->CancelRdsStationSeek(); |
|
918 } |
|
919 |
|
920 void CTRadioUtility::GetFreqByPTY() |
|
921 { |
|
922 TRdsProgrammeType Pty = KRdsPtyNone; |
|
923 iRdsUtility->GetFreqByPTY( Pty ); |
|
924 } |
|
925 |
|
926 void CTRadioUtility::CancelGetFreqByPTY() |
|
927 { |
|
928 iRdsUtility->CancelGetFreqByPTY(); |
|
929 } |
|
930 |
|
931 void CTRadioUtility::GetFreqByTA() |
|
932 { |
|
933 iRdsUtility->GetFreqByTA(); |
|
934 } |
|
935 |
|
936 void CTRadioUtility::CancelGetFreqByTA() |
|
937 { |
|
938 iRdsUtility->CancelGetFreqByTA(); |
|
939 } |
|
940 |
|
941 void CTRadioUtility::GetPSByPTY() |
|
942 { |
|
943 TRdsProgrammeType Pty = KRdsPtyNone; |
|
944 iRdsUtility->GetPSByPTY( Pty ); |
|
945 } |
|
946 |
|
947 void CTRadioUtility::CancelGetPSByPTY() |
|
948 { |
|
949 iRdsUtility->CancelGetPSByPTY(); |
|
950 } |
|
951 |
|
952 void CTRadioUtility::GetPSByTA() |
|
953 { |
|
954 iRdsUtility->GetPSByTA(); |
|
955 } |
|
956 |
|
957 void CTRadioUtility::CancelGetPSByTA() |
|
958 { |
|
959 iRdsUtility->CancelGetPSByTA(); |
|
960 } |
|
961 |
|
962 void CTRadioUtility::GetProgrammeIdentification() |
|
963 { |
|
964 TInt Pi = 0; |
|
965 TInt err = iRdsUtility->GetProgrammeIdentification( Pi ); |
|
966 } |
|
967 |
|
968 void CTRadioUtility::GetProgrammeType() |
|
969 { |
|
970 TRdsProgrammeType Pty = KRdsPtyNone; |
|
971 TInt err = iRdsUtility->GetProgrammeType( Pty ); |
|
972 } |
|
973 |
|
974 void CTRadioUtility::GetProgrammeService() |
|
975 { |
|
976 TRdsPSName Ps = NULL; |
|
977 TInt err = iRdsUtility->GetProgrammeService( Ps ); |
|
978 } |
|
979 |
|
980 void CTRadioUtility::GetRadioText() |
|
981 { |
|
982 TRdsRadioText Rt; |
|
983 TInt err = iRdsUtility->GetRadioText( Rt ); |
|
984 } |
|
985 |
|
986 void CTRadioUtility::GetRadioTextPlus() |
|
987 { |
|
988 TRdsRTplusClass RtPlusClass( ERTplusItemDummy ); |
|
989 TRdsRadioText RtPlusData; |
|
990 |
|
991 TInt err = iRdsUtility->GetRadioTextPlus( RtPlusClass, RtPlusData ); |
|
992 } |
|
993 |
|
994 void CTRadioUtility::GetClockTime() |
|
995 { |
|
996 TDateTime Ct; |
|
997 TInt err = iRdsUtility->GetClockTime( Ct ); |
|
998 } |
|
999 |
|
1000 void CTRadioUtility::GetTrafficAnnouncementStatus() |
|
1001 { |
|
1002 TBool TaStatus = EFalse; |
|
1003 TInt err = iRdsUtility->GetTrafficAnnouncementStatus( TaStatus ); |
|
1004 } |
|
1005 |
|
1006 void CTRadioUtility::GetTrafficProgrammeStatus() |
|
1007 { |
|
1008 TBool TpStatus = EFalse; |
|
1009 TInt err = iRdsUtility->GetTrafficProgrammeStatus( TpStatus ); |
|
1010 } |
|
1011 |
|
1012 /** |
|
1013 * Start listening for client keypresses. |
|
1014 **/ |
|
1015 void CTRadioUtility::StartTestingL() |
|
1016 { |
|
1017 iReadConsole->IssueRequestL(); |
|
1018 } |
|
1019 |
|
1020 /** |
|
1021 * Shutdown the BTTestHarness console. |
|
1022 **/ |
|
1023 void CTRadioUtility::StopTesting() |
|
1024 { |
|
1025 CActiveScheduler::Stop(); |
|
1026 } |
|
1027 |
|
1028 void CTRadioUtility::HandleNotifyL(const TUid /*aUid*/, const TDesC& /*aKey*/, const TDesC& /*aValue*/) |
|
1029 { |
|
1030 } |
|
1031 |
|
1032 /** |
|
1033 * NewL method for creating new instances of this class. |
|
1034 * @param aParent - a pointer to the BTTestHarness |
|
1035 * @return - a pointer to the newly created CBTTestHarnessConsole |
|
1036 **/ |
|
1037 CTRadioUtilityConsole* CTRadioUtilityConsole::NewL(CTRadioUtility* aParent) |
|
1038 { |
|
1039 CTRadioUtilityConsole* s = CTRadioUtilityConsole::NewLC(aParent); |
|
1040 CleanupStack::Pop(); |
|
1041 return s; |
|
1042 } |
|
1043 |
|
1044 /** |
|
1045 * NewLC method for creating new instances of this class. |
|
1046 * @param aParent - a pointer to the BTTestHarness |
|
1047 * @return - a pointer to the newly created CBTTestHarnessConsole |
|
1048 **/ |
|
1049 CTRadioUtilityConsole* CTRadioUtilityConsole::NewLC(CTRadioUtility* aParent) |
|
1050 { |
|
1051 CTRadioUtilityConsole* s = new(ELeave) CTRadioUtilityConsole(aParent); |
|
1052 CleanupStack::PushL(s); |
|
1053 s->ConstructL(); |
|
1054 return s; |
|
1055 } |
|
1056 |
|
1057 /** |
|
1058 * Destructor |
|
1059 **/ |
|
1060 CTRadioUtilityConsole::~CTRadioUtilityConsole() |
|
1061 { |
|
1062 Cancel(); |
|
1063 } |
|
1064 |
|
1065 |
|
1066 /** |
|
1067 * This method is called whenever a key is pressed in the console window. |
|
1068 * |
|
1069 * Player Utility Selections |
|
1070 * |
|
1071 **/ |
|
1072 |
|
1073 void CTRadioUtilityConsole::RunL() |
|
1074 { |
|
1075 TInt key = iConsole->KeyCode(); |
|
1076 switch (key) |
|
1077 { |
|
1078 case '1': |
|
1079 iParent->Play(); |
|
1080 IssueRequestL(); |
|
1081 break; |
|
1082 case '2': |
|
1083 iParent->PlayerState(); |
|
1084 IssueRequestL(); |
|
1085 break; |
|
1086 case '3': |
|
1087 iParent->ClosePlayer(); |
|
1088 IssueRequestL(); |
|
1089 break; |
|
1090 case '4': |
|
1091 iParent->StopPlayer(); |
|
1092 IssueRequestL(); |
|
1093 break; |
|
1094 case '5': |
|
1095 iParent->Mute(); |
|
1096 IssueRequestL(); |
|
1097 break; |
|
1098 case '6': |
|
1099 iParent->IsMute(); |
|
1100 IssueRequestL(); |
|
1101 break; |
|
1102 case '7': |
|
1103 iParent->SetVolume(); |
|
1104 IssueRequestL(); |
|
1105 break; |
|
1106 case '8': |
|
1107 iParent->GetVolume(); |
|
1108 IssueRequestL(); |
|
1109 break; |
|
1110 case '9': |
|
1111 iParent->SetVolumeRamp(); |
|
1112 IssueRequestL(); |
|
1113 break; |
|
1114 case '0': |
|
1115 iParent->GetMaxVolume(); |
|
1116 IssueRequestL(); |
|
1117 break; |
|
1118 case 'a': |
|
1119 iParent->RequestTunerControl(); |
|
1120 IssueRequestL(); |
|
1121 break; |
|
1122 case 'd': |
|
1123 iParent->SetFrequency(); |
|
1124 IssueRequestL(); |
|
1125 break; |
|
1126 case 'g': |
|
1127 iParent->Play(); |
|
1128 IssueRequestL(); |
|
1129 break; |
|
1130 case 'j': |
|
1131 iParent->SetVolume(); |
|
1132 IssueRequestL(); |
|
1133 break; |
|
1134 case 'm': |
|
1135 iParent->StopPlayer(); |
|
1136 IssueRequestL(); |
|
1137 break; |
|
1138 case 'p': |
|
1139 iParent->IsMute(); |
|
1140 IssueRequestL(); |
|
1141 break; |
|
1142 case 't': |
|
1143 iParent->GetVolume(); |
|
1144 IssueRequestL(); |
|
1145 break; |
|
1146 |
|
1147 case 'z': |
|
1148 IssueRequestL(); |
|
1149 break; |
|
1150 case 'x': |
|
1151 iParent->StopTesting(); |
|
1152 break; |
|
1153 default: |
|
1154 IssueRequestL(); |
|
1155 break; |
|
1156 } |
|
1157 } |
|
1158 |
|
1159 /** |
|
1160 * This method is called whenever a key is pressed in the console window. |
|
1161 * |
|
1162 * Tuner Utility Selections |
|
1163 * |
|
1164 **/ |
|
1165 /* |
|
1166 void CTRadioUtilityConsole::RunL() |
|
1167 { |
|
1168 |
|
1169 TInt key = iConsole->KeyCode(); |
|
1170 switch (key) |
|
1171 { |
|
1172 case '1': |
|
1173 iParent->RequestTunerControl(); |
|
1174 IssueRequestL(); |
|
1175 break; |
|
1176 case '2': |
|
1177 iParent->EnableTunerInOfflineMode(); |
|
1178 IssueRequestL(); |
|
1179 break; |
|
1180 case '3': |
|
1181 iParent->CloseTuner(); |
|
1182 IssueRequestL(); |
|
1183 break; |
|
1184 case '4': |
|
1185 iParent->GetCapabilities(); |
|
1186 IssueRequestL(); |
|
1187 break; |
|
1188 case '5': |
|
1189 iParent->SetFrequencyRange(); |
|
1190 IssueRequestL(); |
|
1191 break; |
|
1192 case '6': |
|
1193 iParent->GetFrequencyRange(); |
|
1194 IssueRequestL(); |
|
1195 break; |
|
1196 case '7': |
|
1197 iParent->SetFrequency(); |
|
1198 IssueRequestL(); |
|
1199 break; |
|
1200 case '8': |
|
1201 iParent->GetFrequency(); |
|
1202 IssueRequestL(); |
|
1203 break; |
|
1204 case '9': |
|
1205 iParent->StationSeek(); |
|
1206 IssueRequestL(); |
|
1207 break; |
|
1208 case '0': |
|
1209 iParent->GetSignalStrength(); |
|
1210 IssueRequestL(); |
|
1211 break; |
|
1212 case 'a': |
|
1213 iParent->GetMaxSignalStrength(); |
|
1214 IssueRequestL(); |
|
1215 break; |
|
1216 case 'b': |
|
1217 iParent->GetStereoMode(); |
|
1218 IssueRequestL(); |
|
1219 break; |
|
1220 case 'c': |
|
1221 iParent->ForceMonoReception(); |
|
1222 IssueRequestL(); |
|
1223 break; |
|
1224 case 'd': |
|
1225 iParent->GetForceMonoReception(); |
|
1226 IssueRequestL(); |
|
1227 break; |
|
1228 case 'e': |
|
1229 iParent->SetSquelch(); |
|
1230 IssueRequestL(); |
|
1231 break; |
|
1232 case 'f': |
|
1233 iParent->GetSquelch(); |
|
1234 IssueRequestL(); |
|
1235 break; |
|
1236 case 'g': |
|
1237 iParent->CancelStationSeek(); |
|
1238 IssueRequestL(); |
|
1239 break; |
|
1240 case 'h': |
|
1241 iParent->CancelSetFrequency(); |
|
1242 IssueRequestL(); |
|
1243 break; |
|
1244 case 'i': |
|
1245 iParent->CancelSetFrequencyRange(); |
|
1246 IssueRequestL(); |
|
1247 break; |
|
1248 case 'j': |
|
1249 iParent->Play(); |
|
1250 IssueRequestL(); |
|
1251 break; |
|
1252 |
|
1253 case 'z': |
|
1254 IssueRequestL(); |
|
1255 break; |
|
1256 case 'x': |
|
1257 iParent->StopTesting(); |
|
1258 break; |
|
1259 default: |
|
1260 IssueRequestL(); |
|
1261 break; |
|
1262 } |
|
1263 key = 0; |
|
1264 } |
|
1265 */ |
|
1266 |
|
1267 /** |
|
1268 * This method is called whenever a key is pressed in the console window. |
|
1269 * |
|
1270 * Rds Utility Selections |
|
1271 * |
|
1272 **/ |
|
1273 /* |
|
1274 void CTRadioUtilityConsole::RunL() |
|
1275 { |
|
1276 |
|
1277 TInt key = iConsole->KeyCode(); |
|
1278 switch (key) |
|
1279 { |
|
1280 case '1': |
|
1281 iParent->RequestTunerControl(); |
|
1282 IssueRequestL(); |
|
1283 break; |
|
1284 case '2': |
|
1285 iParent->EnableTunerInOfflineMode(); |
|
1286 IssueRequestL(); |
|
1287 break; |
|
1288 case '3': |
|
1289 iParent->Close(); |
|
1290 IssueRequestL(); |
|
1291 break; |
|
1292 case '4': |
|
1293 iParent->GetCapabilities(); |
|
1294 IssueRequestL(); |
|
1295 break; |
|
1296 case '5': |
|
1297 iParent->GetRdsSignalStatus(); |
|
1298 IssueRequestL(); |
|
1299 break; |
|
1300 case '6': |
|
1301 iParent->NotifyRdsDataChange(); |
|
1302 IssueRequestL(); |
|
1303 break; |
|
1304 case '7': |
|
1305 iParent->CancelNotifyRdsDataChange(); |
|
1306 IssueRequestL(); |
|
1307 break; |
|
1308 case '8': |
|
1309 iParent->SetAutomaticSwitching(); |
|
1310 IssueRequestL(); |
|
1311 break; |
|
1312 case '9': |
|
1313 iParent->GetAutomaticSwitching(); |
|
1314 IssueRequestL(); |
|
1315 break; |
|
1316 case '0': |
|
1317 iParent->CancelAFSearch(); |
|
1318 IssueRequestL(); |
|
1319 break; |
|
1320 case 'a': |
|
1321 iParent->SetAutomaticTrafficAnnouncement(); |
|
1322 IssueRequestL(); |
|
1323 break; |
|
1324 case 'b': |
|
1325 iParent->GetAutomaticTrafficAnnouncement(); |
|
1326 IssueRequestL(); |
|
1327 break; |
|
1328 case 'c': |
|
1329 iParent->StationSeekByPTY(); |
|
1330 IssueRequestL(); |
|
1331 break; |
|
1332 case 'd': |
|
1333 iParent->StationSeekByTA(); |
|
1334 IssueRequestL(); |
|
1335 break; |
|
1336 case 'e': |
|
1337 iParent->StationSeekByTP(); |
|
1338 IssueRequestL(); |
|
1339 break; |
|
1340 case 'f': |
|
1341 iParent->CancelRdsStationSeek(); |
|
1342 IssueRequestL(); |
|
1343 break; |
|
1344 case 'g': |
|
1345 iParent->GetFreqByPTY(); |
|
1346 IssueRequestL(); |
|
1347 break; |
|
1348 case 'h': |
|
1349 iParent->CancelGetFreqByPTY(); |
|
1350 IssueRequestL(); |
|
1351 break; |
|
1352 case 'i': |
|
1353 iParent->GetFreqByTA(); |
|
1354 IssueRequestL(); |
|
1355 break; |
|
1356 case 'j': |
|
1357 iParent->CancelGetFreqByTA(); |
|
1358 IssueRequestL(); |
|
1359 break; |
|
1360 case 'k': |
|
1361 iParent->GetPSByPTY(); |
|
1362 IssueRequestL(); |
|
1363 break; |
|
1364 case 'l': |
|
1365 iParent->CancelGetPSByPTY(); |
|
1366 IssueRequestL(); |
|
1367 break; |
|
1368 case 'm': |
|
1369 iParent->GetPSByTA(); |
|
1370 IssueRequestL(); |
|
1371 break; |
|
1372 case 'n': |
|
1373 iParent->CancelGetPSByTA(); |
|
1374 IssueRequestL(); |
|
1375 break; |
|
1376 case 'o': |
|
1377 iParent->GetProgrammeIdentification(); |
|
1378 IssueRequestL(); |
|
1379 break; |
|
1380 case 'p': |
|
1381 iParent->GetProgrammeType(); |
|
1382 IssueRequestL(); |
|
1383 break; |
|
1384 case 'q': |
|
1385 iParent->GetProgrammeService(); |
|
1386 IssueRequestL(); |
|
1387 break; |
|
1388 case 'r': |
|
1389 iParent->GetRadioText(); |
|
1390 IssueRequestL(); |
|
1391 break; |
|
1392 case 's': |
|
1393 iParent->GetRadioTextPlus(); |
|
1394 IssueRequestL(); |
|
1395 break; |
|
1396 case 't': |
|
1397 iParent->GetClockTime(); |
|
1398 IssueRequestL(); |
|
1399 break; |
|
1400 case 'u': |
|
1401 iParent->GetTrafficAnnouncementStatus(); |
|
1402 IssueRequestL(); |
|
1403 break; |
|
1404 case 'v': |
|
1405 iParent->GetTrafficProgrammeStatus(); |
|
1406 IssueRequestL(); |
|
1407 break; |
|
1408 |
|
1409 |
|
1410 case 'z': |
|
1411 IssueRequestL(); |
|
1412 break; |
|
1413 case 'x': |
|
1414 iParent->StopTesting(); |
|
1415 break; |
|
1416 default: |
|
1417 IssueRequestL(); |
|
1418 break; |
|
1419 } |
|
1420 key = 0; |
|
1421 } |
|
1422 */ |
|
1423 /** |
|
1424 * Cancel any outstanding test requests. |
|
1425 **/ |
|
1426 void CTRadioUtilityConsole::DoCancel() |
|
1427 { |
|
1428 if (iConsole) |
|
1429 { |
|
1430 iConsole->ReadCancel(); |
|
1431 iConsole->Printf(_L("Console read cancelled...\n")); |
|
1432 } |
|
1433 } |
|
1434 |
|
1435 /** |
|
1436 * Constructor |
|
1437 * @param aParent - a pointer to the BTTestHarness |
|
1438 **/ |
|
1439 CTRadioUtilityConsole::CTRadioUtilityConsole(CTRadioUtility* aParent) : |
|
1440 CActive(EPriorityStandard), |
|
1441 iParent(aParent) |
|
1442 { |
|
1443 iConsole = iParent->ConsoleWin(); |
|
1444 CActiveScheduler::Add(this); |
|
1445 } |
|
1446 |
|
1447 /** |
|
1448 * 2nd phase constructor |
|
1449 **/ |
|
1450 void CTRadioUtilityConsole::ConstructL() |
|
1451 { |
|
1452 } |
|
1453 |
|
1454 /** |
|
1455 * Display the console options, and wait for another key press. |
|
1456 * |
|
1457 * Player Utility |
|
1458 * |
|
1459 **/ |
|
1460 |
|
1461 void CTRadioUtilityConsole::IssueRequestL() // here is what you can choose |
|
1462 { |
|
1463 iConsole->Printf(_L("1. Play\n")); |
|
1464 iConsole->Printf(_L("2. PlayerState\n")); |
|
1465 iConsole->Printf(_L("3. Close\n")); |
|
1466 iConsole->Printf(_L("4. Stop\n")); |
|
1467 iConsole->Printf(_L("5. Mute\n")); |
|
1468 iConsole->Printf(_L("6. IsMute\n")); |
|
1469 iConsole->Printf(_L("7. SetVolume\n")); |
|
1470 iConsole->Printf(_L("8. GetVolume\n")); |
|
1471 iConsole->Printf(_L("9. SetVolumeRamp\n")); |
|
1472 iConsole->Printf(_L("0. GetMaxVolume\n")); |
|
1473 iConsole->Printf(_L("a. RequestTunerControl\n")); |
|
1474 iConsole->Printf(_L("d. SetFrequency\n")); |
|
1475 iConsole->Printf(_L("g. Play\n")); |
|
1476 iConsole->Printf(_L("j. SetVolume\n")); |
|
1477 iConsole->Printf(_L("m. Stop\n")); |
|
1478 iConsole->Printf(_L("p. IsMute\n")); |
|
1479 iConsole->Printf(_L("t. GetVolume\n")); |
|
1480 |
|
1481 iConsole->Printf(_L("---------------------\n")); |
|
1482 iConsole->Printf(_L("x. Exit\n")); |
|
1483 ReadConsoleL(); |
|
1484 } |
|
1485 |
|
1486 |
|
1487 /** |
|
1488 * Display the console options, and wait for another key press. |
|
1489 * |
|
1490 * Tuner Utility |
|
1491 * |
|
1492 **/ |
|
1493 /* |
|
1494 void CTRadioUtilityConsole::IssueRequestL() |
|
1495 { |
|
1496 iConsole->Printf(_L("1. RequestTunerControl\n")); |
|
1497 iConsole->Printf(_L("2. EnableTunerInOfflineMode\n")); |
|
1498 iConsole->Printf(_L("3. CloseTuner\n")); |
|
1499 iConsole->Printf(_L("4. GetTunerCapabilities\n")); |
|
1500 iConsole->Printf(_L("5. SetFrequencyRange\n")); |
|
1501 iConsole->Printf(_L("6. GetFrequencyRange\n")); |
|
1502 iConsole->Printf(_L("7. SetFrequency\n")); |
|
1503 iConsole->Printf(_L("8. GetFrequency\n")); |
|
1504 iConsole->Printf(_L("9. StationSeek\n")); |
|
1505 iConsole->Printf(_L("0. GetSignalStrength\n")); |
|
1506 iConsole->Printf(_L("a. GetMaxSignalStrength\n")); |
|
1507 iConsole->Printf(_L("b. GetStereoMode\n")); |
|
1508 iConsole->Printf(_L("c. ForceMonoRecepion\n")); |
|
1509 iConsole->Printf(_L("d. GetForceMonoReception\n")); |
|
1510 iConsole->Printf(_L("e. SetSquelch\n")); |
|
1511 iConsole->Printf(_L("f. GetSquelch\n")); |
|
1512 iConsole->Printf(_L("g. CancelStationSeek\n")); |
|
1513 iConsole->Printf(_L("h. CancelSetFrequency\n")); |
|
1514 iConsole->Printf(_L("i. CancelSetFrequencyRange\n")); |
|
1515 iConsole->Printf(_L("j. Play\n")); |
|
1516 |
|
1517 |
|
1518 iConsole->Printf(_L("---------------------\n")); |
|
1519 iConsole->Printf(_L("x. Exit\n")); |
|
1520 ReadConsoleL(); |
|
1521 } |
|
1522 */ |
|
1523 |
|
1524 /** |
|
1525 * Display the console options, and wait for another key press. |
|
1526 * |
|
1527 * Rds Utility |
|
1528 * |
|
1529 **/ |
|
1530 /* |
|
1531 void CTRadioUtilityConsole::IssueRequestL() |
|
1532 { |
|
1533 iConsole->Printf(_L("1. RequestTunerControl\n")); |
|
1534 iConsole->Printf(_L("2. EnableTunerInOfflineMode\n")); |
|
1535 iConsole->Printf(_L("3. CloseRds\n")); |
|
1536 iConsole->Printf(_L("4. GetRdsCapabilities\n")); |
|
1537 iConsole->Printf(_L("5. GetRdsSignalStatus\n")); |
|
1538 iConsole->Printf(_L("6. NotifyRdsDataChange\n")); |
|
1539 iConsole->Printf(_L("7. CancelNotifyRdsDataChange\n")); |
|
1540 iConsole->Printf(_L("8. SetAutomaticSwitching\n")); |
|
1541 iConsole->Printf(_L("9. GetAutomaticSwitching\n")); |
|
1542 iConsole->Printf(_L("0. CancelAFSearch\n")); |
|
1543 iConsole->Printf(_L("a. SetAutomaticTrafficAnnouncement\n")); |
|
1544 iConsole->Printf(_L("b. GetAutomaticTrafficAnnouncement\n")); |
|
1545 iConsole->Printf(_L("c. StationSeekByPTY\n")); |
|
1546 iConsole->Printf(_L("d. StationSeekByTA\n")); |
|
1547 iConsole->Printf(_L("e. StationSeekByTP\n")); |
|
1548 iConsole->Printf(_L("f. CancelRdsStationSeek\n")); |
|
1549 iConsole->Printf(_L("g. GetFreqByPTY\n")); |
|
1550 iConsole->Printf(_L("h. CancelGetFreqByPTY\n")); |
|
1551 iConsole->Printf(_L("i. GetFreqByTA\n")); |
|
1552 iConsole->Printf(_L("j. CancelGetFreqByTA\n")); |
|
1553 iConsole->Printf(_L("k. GetPSByPTY\n")); |
|
1554 iConsole->Printf(_L("l. CancelGetPSByPTY\n")); |
|
1555 iConsole->Printf(_L("m. GetPSByTA\n")); |
|
1556 iConsole->Printf(_L("n. CancelGetPSByTA\n")); |
|
1557 iConsole->Printf(_L("o. GetProgrammeIdentification\n")); |
|
1558 iConsole->Printf(_L("p. GetProgrammeType\n")); |
|
1559 iConsole->Printf(_L("q. GetProgrammeService\n")); |
|
1560 iConsole->Printf(_L("r. GetRadioText\n")); |
|
1561 iConsole->Printf(_L("s. GetRadioTextPlus\n")); |
|
1562 iConsole->Printf(_L("t. GetClockTime\n")); |
|
1563 iConsole->Printf(_L("u. GetTrafficAnnouncementStatus\n")); |
|
1564 iConsole->Printf(_L("v. GetTrafficProgrammeStatus\n")); |
|
1565 |
|
1566 iConsole->Printf(_L("---------------------\n")); |
|
1567 iConsole->Printf(_L("x. Exit\n")); |
|
1568 ReadConsoleL(); |
|
1569 } |
|
1570 |
|
1571 */ |
|
1572 /** |
|
1573 * Outstanding request has been completed, start waiting for another request. |
|
1574 **/ |
|
1575 void CTRadioUtilityConsole::ReadConsoleL() |
|
1576 { |
|
1577 iConsole->Read(iStatus); |
|
1578 SetActive(); |
|
1579 } |
|
1580 |
|
1581 |