24
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
#ifndef MLTSYRECEIVETHREADCALLBACKIF_H
|
|
17 |
#define MLTSYRECEIVETHREADCALLBACKIF_H
|
|
18 |
|
|
19 |
class MLtsyReceiveThreadEventStateHandler
|
|
20 |
/**
|
|
21 |
* Interface to be implmented to provide LTSY specific handling for the management of
|
|
22 |
* the LtsyReceiveThread
|
|
23 |
*/
|
|
24 |
{
|
|
25 |
public:
|
|
26 |
enum
|
|
27 |
{
|
|
28 |
/**
|
|
29 |
* When used as a completion value from ETEL thread to LtsyReceiveThread,
|
|
30 |
* will cause gracefule shutdown of LtsyReceiveThread
|
|
31 |
*/
|
|
32 |
KShutdownLtsyReceiveThread = 1
|
|
33 |
};
|
|
34 |
public:
|
|
35 |
/**
|
|
36 |
* Function to post a request to receive the next event from baseband.
|
|
37 |
* Request is expected to be synchronous
|
|
38 |
*
|
|
39 |
* On receiving the event it should be stored for future use,
|
|
40 |
* after the thread-switching has taken place.
|
|
41 |
*
|
|
42 |
* This function will be called in the LtsyReceiveThread thread of execution.
|
|
43 |
*/
|
|
44 |
virtual void DoRequestNextEvent() = 0;
|
|
45 |
/**
|
|
46 |
* This function is called after the thread has switched from the LtsyReceiveThread
|
|
47 |
* to the ETEL thread. This fucntion kicks-off the LTSY processing of the event,
|
|
48 |
* that will eventualy lead to a call back into the CTsyDispatcher.
|
|
49 |
*
|
|
50 |
* @return TInt This return code is used in the RequestComplete back to the LtsyReceiveThread.
|
|
51 |
* - KErrNone means continue looping for next event.
|
|
52 |
* - KShutdownLtsyReceiveThread means the thread should shutdown gracefully. I.e. Temrinate thread with KErrNone
|
|
53 |
* - All other errors shall be treated as termination.
|
|
54 |
*
|
|
55 |
* * This function will be called in the ETEL thread of execution.
|
|
56 |
*/
|
|
57 |
virtual TInt HandleReceivedEvent()=0;
|
|
58 |
/**
|
|
59 |
*This function is called after an event has been processed and
|
|
60 |
* the ETEL thread has signalled back to the LtsyReceiveThread.
|
|
61 |
*
|
|
62 |
* It is an opportunity for the LTSY to free any memory associated with the event.
|
|
63 |
*
|
|
64 |
* This function will be called in the LtsyReceiveThread thread of execution.
|
|
65 |
*/
|
|
66 |
virtual void DoReleaseEvent()=0;
|
|
67 |
|
|
68 |
}; // class MLtsyReceiveEventThreadStateHandler
|
|
69 |
|
|
70 |
class MLtsyReceiveThreadObserver
|
|
71 |
/** Interface to be implmented to provide LTSY specific handling if the
|
|
72 |
* LtsyReceiveThread dies.
|
|
73 |
*/
|
|
74 |
{
|
|
75 |
public:
|
|
76 |
/**
|
|
77 |
* This function is invoked (within the context of the ETEL thread) when the LtsyReceiveThread
|
|
78 |
* dies.
|
|
79 |
*
|
|
80 |
* It purpose is to allow some action to be performed. An example caction could be
|
|
81 |
* to panic the current (ETEL) thread, which would cause a reboot, since the thread is
|
|
82 |
* system critical. The reason for panic'ing could be because if no events are able to
|
|
83 |
* be received from the baseband then phone is inoperable and therefore mustbe reset.
|
|
84 |
* would cause a
|
|
85 |
* @param aError Cause code for thread death
|
|
86 |
*/
|
|
87 |
virtual void HandleReceiveThreadLifeWatcherComplete(TInt aError)=0;
|
|
88 |
}; //class MLtsyReceiveThreadObserver
|
|
89 |
|
|
90 |
#endif // MLTSYRECEIVETHREADCALLBACKIF_H
|