|
1 /* |
|
2 * Copyright (c) 2005 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 implements functions handling radio engine state changes |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef FMRADIOENGINERADIOSTATEHANDLER_H |
|
20 #define FMRADIOENGINERADIOSTATEHANDLER_H |
|
21 |
|
22 //INCLUDES |
|
23 #include "fmradioenginestatechangecallback.h" |
|
24 |
|
25 // CONSTANTS |
|
26 const TUint8 KRadioStateEventCallback = 0x01; |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CRadioEngine; |
|
30 |
|
31 |
|
32 // CLASS DECLARATION |
|
33 /** |
|
34 * This class implements the state machines for radio engine state transition. |
|
35 */ |
|
36 class CRadioStateHandler : public CActive |
|
37 { |
|
38 public: |
|
39 /** |
|
40 * Method for creating new instances of this class. |
|
41 * @param aEngine a pointer to CRadioEngine |
|
42 * @return - A pointer to new CRadioEngineTimer object |
|
43 **/ |
|
44 static CRadioStateHandler *NewL(CRadioEngine* aEngine); |
|
45 /** |
|
46 * Destructor |
|
47 **/ |
|
48 virtual ~CRadioStateHandler(); |
|
49 public: |
|
50 /** |
|
51 * Trigger the active object to call the client callback function. |
|
52 * @since Series 60 2.7 |
|
53 * @return none |
|
54 */ |
|
55 void Callback(MRadioEngineStateChangeCallback::TFMRadioNotifyEvent aEventCode, TInt aErrorCode ); |
|
56 private: |
|
57 /** |
|
58 * c++ default constructor |
|
59 **/ |
|
60 CRadioStateHandler(CRadioEngine* aEngine); |
|
61 /** |
|
62 * 2nd phase constructor |
|
63 **/ |
|
64 void ConstructL(); |
|
65 /** |
|
66 * Cancel the timeout timer. This generally means that a response was received from the chip, so the |
|
67 * timeout is no longer needed or the state machine was transitioned. |
|
68 * @since Series 60 2.7 |
|
69 * @return none |
|
70 **/ |
|
71 void DoCancel(); |
|
72 /** |
|
73 * State Change Request/timeout handler |
|
74 * @since Series 60 2.7 |
|
75 * @return none |
|
76 */ |
|
77 void RunL(); |
|
78 /** |
|
79 * handle any errors that occur in the RunL |
|
80 * @since Series 60 2.7 |
|
81 * @return none |
|
82 */ |
|
83 TInt RunError( TInt aError ); |
|
84 private: |
|
85 // pointer to the session who's timeout we are mananging. |
|
86 CRadioEngine* iEngine; |
|
87 // Temporary storage for event code |
|
88 TInt iCallbackEventCode; |
|
89 // Temporary storage for error code |
|
90 TInt iCallbackErrorCode; |
|
91 |
|
92 }; // FMRADIOENGINERADIOSTATEHANDLER_H |
|
93 |
|
94 // End of File |
|
95 |
|
96 #endif |