|
1 /* |
|
2 * Copyright (c) 2007 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: Hardware Resource Manager stub plugins fmtx plugin |
|
15 * implementation. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __FMTXPLUGIN_H_ |
|
21 #define __FMTXPLUGIN_H_ |
|
22 |
|
23 #include <hwrmpluginservice.h> |
|
24 #include <hwrmfmtxcommands.h> |
|
25 #include "PluginTimer.h" |
|
26 |
|
27 #ifdef PUBLISH_STATE_INFO |
|
28 #include <e32property.h> |
|
29 const TUint32 KHWRMTestFmtxCommand = 0x44440001; |
|
30 const TUint32 KHWRMTestFmtxDataPckg = 0x44440002; |
|
31 #endif // PUBLISH_STATE_INFO |
|
32 |
|
33 class CPluginTimer; |
|
34 |
|
35 class CFmtxPlugin : public CHWRMPluginService, |
|
36 public MPluginTimerCallback |
|
37 { |
|
38 public: |
|
39 |
|
40 static CFmtxPlugin* NewL(); |
|
41 ~CFmtxPlugin(); |
|
42 |
|
43 /** |
|
44 * Method to invoke a particular command in the plugin |
|
45 * @param aCommandId Command ID |
|
46 * @param aTransId Transaction ID |
|
47 * @param aData Data associated with command |
|
48 */ |
|
49 virtual void ProcessCommandL(const TInt aCommandId, |
|
50 const TUint8 aTransId, |
|
51 TDesC8& aData); |
|
52 |
|
53 /** |
|
54 * Method to cancel a particular command |
|
55 * @param aTransId Transaction ID |
|
56 * @param aCommandId Command ID to optionally double check with the |
|
57 * transaction ID |
|
58 */ |
|
59 virtual void CancelCommandL(const TUint8 aTransId, |
|
60 const TInt aCommandId); |
|
61 |
|
62 // From MPluginTimerCallback |
|
63 void GenericTimerFired(MHWRMPluginCallback* aService, |
|
64 const TInt aCommandId, |
|
65 const TUint8 aTransId, |
|
66 TInt aRetVal); |
|
67 |
|
68 private: // Construction |
|
69 |
|
70 CFmtxPlugin(); |
|
71 void ConstructL(); |
|
72 |
|
73 TInt CheckFrequencyWithinRange(TDesC8& aData); |
|
74 |
|
75 RPointerArray<CPluginTimer> iTimers; |
|
76 |
|
77 #ifdef PUBLISH_STATE_INFO |
|
78 RProperty iCmdProperty; // for publishing command ID |
|
79 RProperty iDataProperty; // for publishing data |
|
80 #endif // PUBLISH_STATE_INFO |
|
81 |
|
82 HWRMFmTxCommand::TFmTxCmd iLastCommand; // the on-going command, if any |
|
83 |
|
84 HWRMFmTxCommand::TFmTxHwState iHwState; // the current hardware state |
|
85 |
|
86 TInt iFrequency; // the requested frequency |
|
87 |
|
88 TInt iStatusIndTransId; // the trans ID of last status indication request |
|
89 |
|
90 // RSSI scanning |
|
91 TInt iChannelsRequested; // the number of clear frequencies requested |
|
92 TUint32 iClearFrequency; // for returning scan responses |
|
93 |
|
94 TBuf<1024> iBuf; |
|
95 }; |
|
96 |
|
97 #endif /* __FMTXPLUGIN_H_ */ |