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 |
#ifndef __TrkDebugManager_h__
|
|
19 |
#define __TrkDebugManager_h__
|
|
20 |
|
|
21 |
// System includes
|
|
22 |
#include <e32base.h>
|
|
23 |
#include <f32file.h>
|
|
24 |
|
|
25 |
// User includes
|
|
26 |
#include "TrkEngine.h"
|
|
27 |
#include "trksrvcmdcodes.h"
|
|
28 |
#ifndef __TEXT_SHELL__
|
|
29 |
#include "toolsconnectionlistener.h"
|
|
30 |
#endif
|
|
31 |
// Classes referenced
|
|
32 |
class MTrkDebugMgrCallbacks;
|
|
33 |
|
|
34 |
//
|
|
35 |
// CTrkDebugManager (header)
|
|
36 |
//
|
|
37 |
// The underlying engine used by each session. Manipulates the server-side objects.
|
|
38 |
//
|
|
39 |
class CTrkDebugManager : public CBase, public MTrkEngineCallback , public MTrkUsbConnectionListener
|
|
40 |
{
|
|
41 |
//Static construct and destruct
|
|
42 |
public:
|
|
43 |
static CTrkDebugManager* NewLC();
|
|
44 |
static CTrkDebugManager* NewL();
|
|
45 |
~CTrkDebugManager();
|
|
46 |
|
|
47 |
|
|
48 |
//methods implementing the server cmds functionality
|
|
49 |
public:
|
|
50 |
void StartDebuggingL();
|
|
51 |
void StartDebuggingL(TTrkConnType aConnType);
|
|
52 |
void StopDebugging();
|
|
53 |
void GetVersion(TTRKVersion& aVersion);
|
|
54 |
void GetConnectionMsg(TDes& aConnStatusMsg);
|
|
55 |
void ConnectToDebuggerL();
|
|
56 |
void DisConnect();
|
|
57 |
void GetCurrentConnData(TTrkConnData& aConnData);
|
|
58 |
void SetCurrentConnData(TTrkConnData& aConnData);
|
|
59 |
TBool IsConnected() { return (iConnStatus == ETrkConnected); }
|
|
60 |
TTrkConnStatus GetConnectionStatus(){return iConnStatus;};
|
|
61 |
TBool IsDebugging();
|
|
62 |
TBool GetPlugAndPlayOption();
|
|
63 |
void SetPlugAndPlayOption(TBool aPlugAndPlay);
|
|
64 |
|
|
65 |
void SetDebugMgrCallback(MTrkDebugMgrCallbacks* aDebugMgrCallback) { iDebugMgrCallback = aDebugMgrCallback; }
|
|
66 |
void NotifyTheUserL();
|
|
67 |
void StopListening();
|
|
68 |
|
|
69 |
public: // methods from MTrkEngineCallback
|
|
70 |
void OnConnection();
|
|
71 |
void OnCloseConnection();
|
|
72 |
void DebuggingStarted();
|
|
73 |
void DebuggingEnded();
|
|
74 |
void OnAsyncConnectionFailed();
|
|
75 |
|
|
76 |
public: //Methods from public MTrkUsbConnectionListener
|
|
77 |
void ConnectionAvailable();
|
|
78 |
void ConnectionUnAvailable();
|
|
79 |
|
|
80 |
//private construct
|
|
81 |
private:
|
|
82 |
CTrkDebugManager();
|
|
83 |
void ConstructL();
|
|
84 |
|
|
85 |
//date members
|
|
86 |
private:
|
|
87 |
CTrkEngine* iTrkEngine;
|
|
88 |
TTrkConnStatus iConnStatus;
|
|
89 |
TBool iDebugging;
|
|
90 |
TBuf<KMaxPath> iConnMsg;
|
|
91 |
TBool iPlugAndPlay;
|
|
92 |
MTrkDebugMgrCallbacks* iDebugMgrCallback;
|
|
93 |
#ifndef __TEXT_SHELL__
|
|
94 |
CToolsConnectionListener* iToolsConnectionListener;
|
|
95 |
#endif
|
|
96 |
|
|
97 |
};
|
|
98 |
|
|
99 |
#endif // __TrkDebugManager_h__
|