0
|
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 "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 |
|
|
19 |
#ifndef _TOOLSPROCESS_H_
|
|
20 |
#define _TOOLSPROCESS_H_
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <e32std.h>
|
|
25 |
|
|
26 |
#define KMaxCmdLineConnArgsLen 10
|
|
27 |
|
|
28 |
// DATA TYPES
|
|
29 |
|
|
30 |
// FORWARD DECLARATIONS
|
|
31 |
|
|
32 |
// CLASS DECLARATION
|
|
33 |
class CToolsProcess;
|
|
34 |
|
|
35 |
enum TCmdLineConnType
|
|
36 |
{
|
|
37 |
EUsb = 0,
|
|
38 |
EXti,
|
|
39 |
};
|
|
40 |
|
|
41 |
//
|
|
42 |
// class CProcessTracker
|
|
43 |
//
|
|
44 |
// Watches to see when a process exists
|
|
45 |
//
|
|
46 |
class CProcessTracker : public CActive
|
|
47 |
{
|
|
48 |
public:
|
|
49 |
|
|
50 |
CProcessTracker(CToolsProcess *aToolsProcess, TUint32 aProcessId);
|
|
51 |
~CProcessTracker();
|
|
52 |
|
|
53 |
void Watch();
|
|
54 |
|
|
55 |
protected:
|
|
56 |
|
|
57 |
void RunL();
|
|
58 |
void DoCancel();
|
|
59 |
|
|
60 |
private:
|
|
61 |
|
|
62 |
RProcess iProcess;
|
|
63 |
TUint32 iProcessId;
|
|
64 |
CToolsProcess *iToolsProcess;
|
|
65 |
};
|
|
66 |
|
|
67 |
|
|
68 |
class CToolsProcess: public CBase
|
|
69 |
{
|
|
70 |
public:
|
|
71 |
|
|
72 |
static CToolsProcess* NewL(const TDesC& aPath, const TDesC& aArgsUsb, const TDesC& aArgsXti);
|
|
73 |
static CToolsProcess* NewLC(const TDesC& aPath, const TDesC& aArgsUsb, const TDesC& aArgsXti);
|
|
74 |
~CToolsProcess();
|
|
75 |
|
|
76 |
public:
|
|
77 |
TInt Start(TCmdLineConnType aConnType);
|
|
78 |
void Stop();
|
|
79 |
|
|
80 |
void ProcessDied(TInt aExitReason);
|
|
81 |
TDesC GetProcessPath() { return iPath; }
|
|
82 |
|
|
83 |
private:
|
|
84 |
CToolsProcess();
|
|
85 |
void ConstructL(const TDesC& aPath, const TDesC& aArgsUsb, const TDesC& aArgsXti);
|
|
86 |
|
|
87 |
private:
|
|
88 |
TBuf<KMaxPath> iPath;
|
|
89 |
TBuf<KMaxCmdLineConnArgsLen> iArgsUsb;
|
|
90 |
TBuf<KMaxCmdLineConnArgsLen> iArgsXti;
|
|
91 |
|
|
92 |
TBool iRunning;
|
|
93 |
|
|
94 |
TUint32 iProcessId;
|
|
95 |
|
|
96 |
CProcessTracker* iProcessTracker;
|
|
97 |
RProcess iProcess;
|
|
98 |
|
|
99 |
static TBool iFirstTimeAfterBoot;
|
|
100 |
};
|
|
101 |
|
|
102 |
|
|
103 |
#endif // _TOOLSPROCESS_H_
|
|
104 |
|
|
105 |
|
|
106 |
// End of File
|