|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Definition of Test Harness request handler component. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalTechnology |
|
21 @test |
|
22 */ |
|
23 |
|
24 #ifndef CTLBSAGPSHANDLER_H |
|
25 #define CTLBSAGPSHANDLER_H |
|
26 |
|
27 #include <e32hashtab.h> |
|
28 #include <lbs/test/tlbschannel.h> |
|
29 |
|
30 |
|
31 // |
|
32 // Test Harness Request Handler Channel |
|
33 // |
|
34 |
|
35 /** Observer for TH Request Handler interface |
|
36 */ |
|
37 class MT_ResponseObserver |
|
38 { |
|
39 public: |
|
40 virtual void ProcessAGpsResponseMessage(const TT_LbsAGpsResponseMsg::TModuleResponseType aResponse) = 0; |
|
41 }; |
|
42 |
|
43 /** Manager for the TH channel. |
|
44 |
|
45 This class handles sending and receiving messages on the Test Harness channel. |
|
46 It is implemented as an active object to allow it to asnychronously wait for |
|
47 messages to arrive. Sending is synchronous. |
|
48 */ |
|
49 class CT_LbsAGpsHandler : public CActive, |
|
50 public MT_LbsChannelObserver |
|
51 { |
|
52 public: |
|
53 IMPORT_C static CT_LbsAGpsHandler* NewL(MT_ResponseObserver* aObserver); |
|
54 ~CT_LbsAGpsHandler(); |
|
55 |
|
56 IMPORT_C void SendRequestUpdateInitMsg(const TDesC& aConfigFileName, |
|
57 const TDesC& aConfigSection); |
|
58 IMPORT_C void SendRequestTimeOutMsg(const TTimeIntervalMicroSeconds& aTimeOut); |
|
59 IMPORT_C void SendRequestSetAllModuleOptions(); |
|
60 IMPORT_C void SendRequestClearAllModuleOptions(); |
|
61 IMPORT_C void SendRequestModuleOption(TLbsHybridModuleOptions aOption, TBool aValue); |
|
62 IMPORT_C void SendRequestForcedUpdate(); |
|
63 IMPORT_C void SendRequestError(TInt aError); |
|
64 IMPORT_C void SendImmediateMeasurementsMsg(const TInt& aImmediateMeasurements); |
|
65 |
|
66 |
|
67 private: |
|
68 CT_LbsAGpsHandler(MT_ResponseObserver* aObserver); |
|
69 void ConstructL(); |
|
70 |
|
71 // from CActive |
|
72 void RunL(); |
|
73 void DoCancel(); |
|
74 TInt RunError(TInt aError); |
|
75 |
|
76 // Send a message. |
|
77 void SendRequestMessage(const TT_LbsMsgBase* aMessage); |
|
78 |
|
79 // Buffer a message. |
|
80 void BufferMessage(const TT_LbsMsgBase* aMessage); |
|
81 |
|
82 // from MT_LbsChannelObserver |
|
83 void ProcessChannelMessage(RT_LbsChannel::TT_LbsChannelId aChannelId, const TT_LbsMsgBase& aMessage); |
|
84 |
|
85 private: |
|
86 MT_ResponseObserver* iObserver; |
|
87 RT_LbsChannel iTHChannel; |
|
88 RPointerArray<TT_LbsMsgBase> iMsgBuffer; |
|
89 }; |
|
90 |
|
91 |
|
92 #endif // CTLBSAGPSHANDLER_H |