|
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 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 */ |
|
17 |
|
18 #ifndef __SVPSNAPDRIVER_H |
|
19 #define __SVPSNAPDRIVER_H |
|
20 |
|
21 #include <kernel.h> // for DLogicalChannel |
|
22 |
|
23 #define SVPDBG |
|
24 #ifdef SVPDBG |
|
25 #define DP(format...) Kern::Printf(format) |
|
26 #else |
|
27 #define DP(format...) |
|
28 #endif |
|
29 |
|
30 #define RET_IF_ERROR(v, e) { if ((v = (e)) != KErrNone) return v; } |
|
31 |
|
32 enum ESVPSnapReg { |
|
33 ESnapshot_Id = 0, |
|
34 ESnapshot_Address, |
|
35 ESnapshot_Length, |
|
36 ESnapshot_Trigger |
|
37 }; |
|
38 |
|
39 class DSVPSnapDriverFactory : public DLogicalDevice |
|
40 { |
|
41 public: |
|
42 |
|
43 DSVPSnapDriverFactory(); |
|
44 virtual TInt Install(); |
|
45 virtual void GetCaps(TDes8& aDes) const; |
|
46 virtual TInt Create(DLogicalChannelBase*& aChannel); |
|
47 }; |
|
48 |
|
49 class DSVPSnapChannel : public DLogicalChannel |
|
50 { |
|
51 public: |
|
52 |
|
53 DSVPSnapChannel(DLogicalDevice* aLogicalDevice); |
|
54 ~DSVPSnapChannel(); |
|
55 |
|
56 virtual TInt DoCreate(TInt aUnit, const TDesC* anInfo, const TVersion& aVer); |
|
57 virtual void HandleMsg(TMessageBase* aMsg); |
|
58 |
|
59 protected: |
|
60 virtual void DoCancel(TInt aReqNo); |
|
61 virtual TInt DoRequest(TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2); |
|
62 virtual TInt DoControl(TInt aFunction, TAny *a1, TAny *a2); |
|
63 |
|
64 private: |
|
65 TInt SaveVM(const TDesC8* aData); |
|
66 TInt LoadVM(const TDesC8* aData); |
|
67 |
|
68 private: |
|
69 DThread* iClientThread; |
|
70 TDfcQue* iDFCQue; |
|
71 |
|
72 TBuf8<256> iSendDataBuffer; |
|
73 }; |
|
74 |
|
75 #endif |