34
|
1 |
/*
|
57
|
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 the License "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:
|
|
15 |
*
|
|
16 |
*/
|
34
|
17 |
|
|
18 |
// System includes
|
|
19 |
#include <RemConCallHandlingTarget.h>
|
|
20 |
#include <remconcoreapitarget.h>
|
|
21 |
#include <remconinterfaceselector.h>
|
|
22 |
|
|
23 |
// User includes
|
|
24 |
#include "cradioenginelogger.h"
|
|
25 |
#include "cradioremcontargetimp_stub.h"
|
|
26 |
#include "mradiocontroleventobserver.h"
|
|
27 |
#include "radioengineutils.h"
|
|
28 |
|
|
29 |
#define STUB iRadioStubManager->iRemConTarget
|
|
30 |
|
|
31 |
// Constants
|
|
32 |
const TInt KVRVolumeTimerInitialDelay = 0; // Initial timer for headset volume up/down press event should expire immediately
|
|
33 |
|
|
34 |
// ================= MEMBER FUNCTIONS =======================
|
|
35 |
|
|
36 |
// ---------------------------------------------------------------------------
|
|
37 |
//
|
|
38 |
// ---------------------------------------------------------------------------
|
|
39 |
//
|
|
40 |
CRadioRemConTargetImp::CRadioRemConTargetImp()
|
|
41 |
{
|
|
42 |
LOG_METHOD_AUTO;
|
|
43 |
}
|
|
44 |
|
|
45 |
// ---------------------------------------------------------------------------
|
|
46 |
//
|
|
47 |
// ---------------------------------------------------------------------------
|
|
48 |
//
|
|
49 |
void CRadioRemConTargetImp::ConstructL()
|
|
50 |
{
|
57
|
51 |
LOG_METHOD_AUTO;
|
34
|
52 |
// Open chunk for test configuration/control data
|
|
53 |
TInt err = iRadioStubManagerChunk.OpenGlobal(
|
57
|
54 |
KRadioStubManagerLocalChunkName, EFalse, // == Read | Write
|
|
55 |
EOwnerThread);
|
|
56 |
User::LeaveIfError(err);
|
|
57 |
if (sizeof(SRadioStubManager) > iRadioStubManagerChunk.MaxSize())
|
34
|
58 |
{
|
57
|
59 |
User::Leave(KErrTooBig);
|
34
|
60 |
}
|
|
61 |
TUint8* basePtr = iRadioStubManagerChunk.Base();
|
57
|
62 |
User::LeaveIfNull(basePtr);
|
|
63 |
iRadioStubManager = (SRadioStubManager*) basePtr;
|
|
64 |
if (STUB.iLeaveNewL.iError)
|
34
|
65 |
{
|
57
|
66 |
User::Leave(STUB.iLeaveNewL.iError);
|
34
|
67 |
}
|
57
|
68 |
if (STUB.iLeaveConstructL.iError)
|
34
|
69 |
{
|
57
|
70 |
User::Leave(STUB.iLeaveConstructL.iError);
|
34
|
71 |
}
|
|
72 |
STUB.iRemConCoreApiTargetObserver = this;
|
|
73 |
STUB.iRemConCallHandlingTargetObserver = this;
|
|
74 |
RadioEngineUtils::InitializeL();
|
|
75 |
// Create interface selector.
|
57
|
76 |
//iInterfaceSelector = CRemConInterfaceSelector::NewL();
|
34
|
77 |
// Create a new CRemConCoreApiTarget, owned by the interface selector.
|
57
|
78 |
//iCoreTarget = CRemConCoreApiTarget::NewL( *iInterfaceSelector, *this );
|
34
|
79 |
// Create a new CRemConCallHandlingTarget, owned by the interface selector.
|
57
|
80 |
//iCallTarget = CRemConCallHandlingTarget::NewL( *iInterfaceSelector, *this );
|
34
|
81 |
// Start being a target.
|
57
|
82 |
//iInterfaceSelector->OpenTargetL();
|
34
|
83 |
// Create repeat timer.
|
57
|
84 |
iRepeatTimer = CPeriodic::NewL(CActive::EPriorityStandard);
|
34
|
85 |
}
|
|
86 |
|
|
87 |
// ---------------------------------------------------------------------------
|
|
88 |
//
|
|
89 |
// ---------------------------------------------------------------------------
|
|
90 |
//
|
|
91 |
CRadioRemConTargetImp* CRadioRemConTargetImp::NewL()
|
|
92 |
{
|
57
|
93 |
LOG_METHOD_AUTO;
|
|
94 |
CRadioRemConTargetImp* self = new (ELeave) CRadioRemConTargetImp();
|
|
95 |
CleanupStack::PushL(self);
|
34
|
96 |
self->ConstructL();
|
|
97 |
CleanupStack::Pop();
|
|
98 |
return self;
|
|
99 |
}
|
|
100 |
|
|
101 |
// ---------------------------------------------------------------------------
|
|
102 |
//
|
|
103 |
// ---------------------------------------------------------------------------
|
|
104 |
//
|
|
105 |
CRadioRemConTargetImp::~CRadioRemConTargetImp()
|
|
106 |
{
|
57
|
107 |
LOG_METHOD_AUTO;
|
|
108 |
if (iRepeatTimer)
|
34
|
109 |
{
|
|
110 |
iRepeatTimer->Cancel();
|
|
111 |
}
|
|
112 |
delete iRepeatTimer;
|
|
113 |
//delete iInterfaceSelector; //deletes also iCallTarget and iCoreTarget
|
|
114 |
//iCoreTarget = NULL;
|
|
115 |
//iCallTarget = NULL;
|
|
116 |
RadioEngineUtils::Release();
|
|
117 |
iRadioStubManagerChunk.Close();
|
|
118 |
}
|
|
119 |
|
|
120 |
// ---------------------------------------------------------------------------
|
|
121 |
//
|
|
122 |
// ---------------------------------------------------------------------------
|
|
123 |
//
|
57
|
124 |
void CRadioRemConTargetImp::SetControlEventObserver(
|
|
125 |
MRadioControlEventObserver* aControlEventObserver)
|
34
|
126 |
{
|
57
|
127 |
LOG_METHOD_AUTO;
|
34
|
128 |
iObserver = aControlEventObserver;
|
|
129 |
}
|
|
130 |
|
|
131 |
// ---------------------------------------------------------------------------
|
|
132 |
//
|
|
133 |
// ---------------------------------------------------------------------------
|
|
134 |
//
|
57
|
135 |
void CRadioRemConTargetImp::MrccatoCommand(
|
|
136 |
TRemConCoreApiOperationId aOperationId,
|
|
137 |
TRemConCoreApiButtonAction aButtonAct)
|
34
|
138 |
{
|
|
139 |
LOG_FORMAT( "aOperationId = %d, aButtonAct = %d", aOperationId, aButtonAct );
|
|
140 |
LOG_METHOD_AUTO;
|
57
|
141 |
if (iObserver)
|
34
|
142 |
{
|
57
|
143 |
switch (aOperationId)
|
34
|
144 |
{
|
|
145 |
case ERemConCoreApiChannelUp:
|
|
146 |
{
|
57
|
147 |
if (aButtonAct == ERemConCoreApiButtonClick)
|
34
|
148 |
{
|
|
149 |
TRAP_IGNORE( iObserver->ChannelUpL( ETrue ); iObserver->ChannelUpL( EFalse ))
|
|
150 |
}
|
57
|
151 |
else if (aButtonAct == ERemConCoreApiButtonPress)
|
34
|
152 |
{
|
|
153 |
TRAP_IGNORE( iObserver->ChannelUpL( ETrue ))
|
|
154 |
}
|
57
|
155 |
else if (aButtonAct == ERemConCoreApiButtonRelease)
|
34
|
156 |
{
|
|
157 |
TRAP_IGNORE( iObserver->ChannelUpL( EFalse ))
|
|
158 |
}
|
57
|
159 |
else
|
|
160 |
{
|
|
161 |
}
|
34
|
162 |
break;
|
|
163 |
}
|
|
164 |
case ERemConCoreApiChannelDown:
|
|
165 |
{
|
57
|
166 |
if (aButtonAct == ERemConCoreApiButtonClick)
|
34
|
167 |
{
|
|
168 |
TRAP_IGNORE( iObserver->ChannelDownL( ETrue ); iObserver->ChannelDownL( EFalse ))
|
|
169 |
}
|
57
|
170 |
else if (aButtonAct == ERemConCoreApiButtonPress)
|
34
|
171 |
{
|
|
172 |
TRAP_IGNORE( iObserver->ChannelDownL( ETrue ))
|
|
173 |
}
|
57
|
174 |
else if (aButtonAct == ERemConCoreApiButtonRelease)
|
34
|
175 |
{
|
|
176 |
TRAP_IGNORE( iObserver->ChannelDownL( EFalse ))
|
|
177 |
}
|
57
|
178 |
else
|
|
179 |
{
|
|
180 |
}
|
34
|
181 |
break;
|
|
182 |
}
|
|
183 |
case ERemConCoreApiVolumeUp:
|
|
184 |
{
|
57
|
185 |
if (aButtonAct == ERemConCoreApiButtonClick)
|
34
|
186 |
{
|
|
187 |
TRAP_IGNORE( iObserver->VolumeUpL( ETrue ); iObserver->VolumeUpL( EFalse ))
|
|
188 |
}
|
57
|
189 |
else if (aButtonAct == ERemConCoreApiButtonPress)
|
34
|
190 |
{
|
|
191 |
iRepeatTimer->Cancel();
|
|
192 |
iRepeatId = ERemConCoreApiVolumeUp;
|
57
|
193 |
// iRepeatTimer->Start( KVRVolumeTimerInitialDelay, KAknStandardKeyboardRepeatRate, TCallBack( RepeatTimerCallback, this ));
|
|
194 |
iRepeatTimer->Start(KVRVolumeTimerInitialDelay, 1000000,
|
|
195 |
TCallBack(RepeatTimerCallback, this));
|
34
|
196 |
}
|
57
|
197 |
else if (aButtonAct == ERemConCoreApiButtonRelease)
|
34
|
198 |
{
|
|
199 |
iRepeatTimer->Cancel();
|
|
200 |
}
|
57
|
201 |
else
|
|
202 |
{
|
|
203 |
}
|
34
|
204 |
break;
|
|
205 |
}
|
|
206 |
case ERemConCoreApiVolumeDown:
|
|
207 |
{
|
57
|
208 |
if (aButtonAct == ERemConCoreApiButtonClick)
|
34
|
209 |
{
|
|
210 |
TRAP_IGNORE( iObserver->VolumeDownL( ETrue ); iObserver->VolumeDownL( EFalse ))
|
|
211 |
}
|
57
|
212 |
else if (aButtonAct == ERemConCoreApiButtonPress)
|
34
|
213 |
{
|
|
214 |
iRepeatTimer->Cancel();
|
|
215 |
iRepeatId = ERemConCoreApiVolumeDown;
|
57
|
216 |
// iRepeatTimer->Start( KVRVolumeTimerInitialDelay, KAknStandardKeyboardRepeatRate, TCallBack( RepeatTimerCallback, this ));
|
|
217 |
iRepeatTimer->Start(KVRVolumeTimerInitialDelay, 1000000,
|
|
218 |
TCallBack(RepeatTimerCallback, this));
|
34
|
219 |
}
|
57
|
220 |
else if (aButtonAct == ERemConCoreApiButtonRelease)
|
34
|
221 |
{
|
|
222 |
iRepeatTimer->Cancel();
|
|
223 |
}
|
57
|
224 |
else
|
|
225 |
{
|
|
226 |
}
|
34
|
227 |
break;
|
|
228 |
}
|
|
229 |
case ERemConCoreApiStop:
|
|
230 |
{
|
57
|
231 |
if (aButtonAct == ERemConCoreApiButtonClick)
|
34
|
232 |
{
|
|
233 |
TRAP_IGNORE( iObserver->StopL( ETrue ); iObserver->StopL( EFalse ))
|
|
234 |
}
|
|
235 |
break;
|
|
236 |
}
|
|
237 |
case ERemConCoreApiBackward:
|
|
238 |
case ERemConCoreApiRewind:
|
|
239 |
{
|
57
|
240 |
if (aButtonAct == ERemConCoreApiButtonPress)
|
34
|
241 |
{
|
|
242 |
TRAP_IGNORE( iObserver->RewindL( ETrue ))
|
|
243 |
}
|
57
|
244 |
else if (aButtonAct == ERemConCoreApiButtonRelease)
|
34
|
245 |
{
|
|
246 |
TRAP_IGNORE( iObserver->RewindL( EFalse ))
|
|
247 |
}
|
57
|
248 |
else if (aButtonAct == ERemConCoreApiButtonClick)
|
34
|
249 |
{
|
|
250 |
TRAP_IGNORE( iObserver->BackwardL( ETrue ); iObserver->BackwardL( EFalse ))
|
|
251 |
}
|
57
|
252 |
else
|
|
253 |
{
|
|
254 |
}
|
34
|
255 |
break;
|
|
256 |
}
|
|
257 |
case ERemConCoreApiForward:
|
|
258 |
case ERemConCoreApiFastForward:
|
|
259 |
{
|
57
|
260 |
if (aButtonAct == ERemConCoreApiButtonPress)
|
34
|
261 |
{
|
|
262 |
TRAP_IGNORE( iObserver->FastForwardL( ETrue ))
|
|
263 |
}
|
57
|
264 |
else if (aButtonAct == ERemConCoreApiButtonRelease)
|
34
|
265 |
{
|
|
266 |
TRAP_IGNORE( iObserver->FastForwardL( EFalse ))
|
|
267 |
}
|
57
|
268 |
else if (aButtonAct == ERemConCoreApiButtonClick)
|
34
|
269 |
{
|
|
270 |
TRAP_IGNORE( iObserver->ForwardL( ETrue ); iObserver->ForwardL( EFalse ))
|
|
271 |
}
|
57
|
272 |
else
|
|
273 |
{
|
|
274 |
}
|
34
|
275 |
break;
|
|
276 |
}
|
|
277 |
case ERemConCoreApiPlay:
|
|
278 |
case ERemConCoreApiPause:
|
|
279 |
case ERemConCoreApiPausePlayFunction:
|
|
280 |
{
|
57
|
281 |
if (aButtonAct == ERemConCoreApiButtonClick)
|
34
|
282 |
{
|
|
283 |
TRAP_IGNORE( iObserver->PausePlayL( ETrue ); iObserver->PausePlayL( EFalse ))
|
|
284 |
}
|
|
285 |
break;
|
|
286 |
}
|
|
287 |
default:
|
|
288 |
{
|
|
289 |
break;
|
|
290 |
}
|
|
291 |
}
|
|
292 |
}
|
|
293 |
}
|
|
294 |
|
|
295 |
// ---------------------------------------------------------------------------
|
|
296 |
//
|
|
297 |
// ---------------------------------------------------------------------------
|
|
298 |
//
|
57
|
299 |
void CRadioRemConTargetImp::MrccatoPlay(
|
|
300 |
TRemConCoreApiPlaybackSpeed /*aSpeed*/,
|
|
301 |
TRemConCoreApiButtonAction aButtonAct)
|
34
|
302 |
{
|
|
303 |
LOG_METHOD_AUTO;
|
57
|
304 |
if (iObserver)
|
34
|
305 |
{
|
57
|
306 |
if (aButtonAct == ERemConCoreApiButtonClick)
|
34
|
307 |
{
|
|
308 |
TRAP_IGNORE( iObserver->PlayL( ETrue ); iObserver->PlayL( EFalse ))
|
|
309 |
}
|
|
310 |
}
|
|
311 |
}
|
|
312 |
|
|
313 |
// ---------------------------------------------------------------------------
|
|
314 |
//
|
|
315 |
// ---------------------------------------------------------------------------
|
|
316 |
//
|
57
|
317 |
void CRadioRemConTargetImp::MrccatoTuneFunction(TBool /*aTwoPart*/,
|
|
318 |
TUint /*aMajorChannel*/, TUint /*aMinorChannel*/,
|
|
319 |
TRemConCoreApiButtonAction /*aButtonAct*/)
|
34
|
320 |
{
|
|
321 |
LOG_METHOD_AUTO;
|
|
322 |
}
|
|
323 |
|
|
324 |
// ---------------------------------------------------------------------------
|
|
325 |
//
|
|
326 |
// ---------------------------------------------------------------------------
|
|
327 |
//
|
57
|
328 |
void CRadioRemConTargetImp::MrccatoSelectDiskFunction(TUint /*aDisk*/,
|
|
329 |
TRemConCoreApiButtonAction /*aButtonAct*/)
|
34
|
330 |
{
|
|
331 |
LOG_METHOD_AUTO;
|
|
332 |
}
|
|
333 |
|
|
334 |
// ---------------------------------------------------------------------------
|
|
335 |
//
|
|
336 |
// ---------------------------------------------------------------------------
|
|
337 |
//
|
57
|
338 |
void CRadioRemConTargetImp::MrccatoSelectAvInputFunction(
|
|
339 |
TUint8 /*aAvInputSignalNumber*/, TRemConCoreApiButtonAction /*aButtonAct*/)
|
34
|
340 |
{
|
|
341 |
LOG_METHOD_AUTO;
|
|
342 |
}
|
|
343 |
|
|
344 |
// ---------------------------------------------------------------------------
|
|
345 |
//
|
|
346 |
// ---------------------------------------------------------------------------
|
|
347 |
//
|
57
|
348 |
void CRadioRemConTargetImp::MrccatoSelectAudioInputFunction(
|
|
349 |
TUint8 /*aAudioInputSignalNumber*/, TRemConCoreApiButtonAction /*aButtonAct*/)
|
34
|
350 |
{
|
|
351 |
LOG_METHOD_AUTO;
|
|
352 |
}
|
|
353 |
|
|
354 |
// ---------------------------------------------------------------------------
|
|
355 |
//
|
|
356 |
// ---------------------------------------------------------------------------
|
|
357 |
//
|
57
|
358 |
TInt CRadioRemConTargetImp::RepeatTimerCallback(TAny* aPtr)
|
34
|
359 |
{
|
|
360 |
LOG_METHOD_AUTO;
|
|
361 |
|
57
|
362 |
CRadioRemConTargetImp* self =
|
|
363 |
reinterpret_cast<CRadioRemConTargetImp*> (aPtr);
|
34
|
364 |
|
57
|
365 |
if (self)
|
34
|
366 |
{
|
57
|
367 |
if (self->iObserver)
|
34
|
368 |
{
|
57
|
369 |
switch (self->iRepeatId)
|
34
|
370 |
{
|
|
371 |
case ERemConCoreApiVolumeUp:
|
|
372 |
{
|
|
373 |
TRAP_IGNORE( self->iObserver->VolumeUpL( ETrue ); self->iObserver->VolumeUpL( EFalse ))
|
|
374 |
break;
|
|
375 |
}
|
|
376 |
case ERemConCoreApiVolumeDown:
|
|
377 |
{
|
|
378 |
TRAP_IGNORE( self->iObserver->VolumeDownL( ETrue ); self->iObserver->VolumeDownL( EFalse ))
|
|
379 |
break;
|
|
380 |
}
|
|
381 |
default:
|
|
382 |
{
|
|
383 |
break;
|
|
384 |
}
|
|
385 |
}
|
|
386 |
}
|
|
387 |
}
|
|
388 |
|
|
389 |
return KErrNone;
|
|
390 |
}
|
|
391 |
|
|
392 |
// ---------------------------------------------------------------------------
|
|
393 |
//
|
|
394 |
// ---------------------------------------------------------------------------
|
|
395 |
//
|
|
396 |
void CRadioRemConTargetImp::AnswerCall()
|
|
397 |
{
|
|
398 |
LOG_METHOD_AUTO;
|
|
399 |
}
|
|
400 |
|
|
401 |
// ---------------------------------------------------------------------------
|
|
402 |
//
|
|
403 |
// ---------------------------------------------------------------------------
|
|
404 |
//
|
|
405 |
void CRadioRemConTargetImp::AnswerEndCall()
|
|
406 |
{
|
|
407 |
LOG_METHOD_AUTO;
|
57
|
408 |
if (iObserver)
|
34
|
409 |
{
|
|
410 |
TRAP_IGNORE( iObserver->AnswerEndCallL())
|
|
411 |
}
|
|
412 |
}
|
|
413 |
|
|
414 |
// ---------------------------------------------------------------------------
|
|
415 |
//
|
|
416 |
// ---------------------------------------------------------------------------
|
|
417 |
//
|
57
|
418 |
void CRadioRemConTargetImp::DialCall(const TDesC8& /*aTelNumber*/)
|
34
|
419 |
{
|
|
420 |
LOG_METHOD_AUTO;
|
|
421 |
}
|
|
422 |
|
|
423 |
// ---------------------------------------------------------------------------
|
|
424 |
//
|
|
425 |
// ---------------------------------------------------------------------------
|
|
426 |
//
|
|
427 |
void CRadioRemConTargetImp::EndCall()
|
|
428 |
{
|
|
429 |
LOG_METHOD_AUTO;
|
|
430 |
}
|
|
431 |
|
|
432 |
// ---------------------------------------------------------------------------
|
|
433 |
//
|
|
434 |
// ---------------------------------------------------------------------------
|
|
435 |
//
|
57
|
436 |
void CRadioRemConTargetImp::GenerateDTMF(const TChar /*aChar*/)
|
34
|
437 |
{
|
|
438 |
LOG_METHOD_AUTO;
|
|
439 |
}
|
|
440 |
|
|
441 |
// ---------------------------------------------------------------------------
|
|
442 |
//
|
|
443 |
// ---------------------------------------------------------------------------
|
|
444 |
//
|
|
445 |
void CRadioRemConTargetImp::LastNumberRedial()
|
|
446 |
{
|
|
447 |
LOG_METHOD_AUTO;
|
|
448 |
}
|
|
449 |
|
|
450 |
// ---------------------------------------------------------------------------
|
|
451 |
//
|
|
452 |
// ---------------------------------------------------------------------------
|
|
453 |
//
|
57
|
454 |
void CRadioRemConTargetImp::MultipartyCalling(const TDesC8& /*aData*/)
|
34
|
455 |
{
|
|
456 |
LOG_METHOD_AUTO;
|
|
457 |
}
|
|
458 |
|
|
459 |
// ---------------------------------------------------------------------------
|
|
460 |
//
|
|
461 |
// ---------------------------------------------------------------------------
|
|
462 |
//
|
57
|
463 |
void CRadioRemConTargetImp::SpeedDial(const TInt /*aIndex*/)
|
34
|
464 |
{
|
|
465 |
LOG_METHOD_AUTO;
|
|
466 |
}
|
|
467 |
|
|
468 |
// ---------------------------------------------------------------------------
|
|
469 |
//
|
|
470 |
// ---------------------------------------------------------------------------
|
|
471 |
//
|
57
|
472 |
void CRadioRemConTargetImp::VoiceDial(const TBool /*aActivate*/)
|
34
|
473 |
{
|
|
474 |
LOG_METHOD_AUTO;
|
|
475 |
}
|