|
1 // Copyright (c) 2006-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 the License "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Implementation of the client-side code |
|
15 // for the Lbs test server. |
|
16 // |
|
17 // |
|
18 |
|
19 #include <e32base.h> |
|
20 #include "lbstestmessageenums.h" |
|
21 #include "lbstestserverdata.h" |
|
22 #include "lbstestclientimpl.h" |
|
23 |
|
24 |
|
25 /////////////////////////////////////////////////////////////////////////////// |
|
26 // RLbsTestSession |
|
27 /////////////////////////////////////////////////////////////////////////////// |
|
28 |
|
29 /** Get the version of this object. |
|
30 */ |
|
31 TVersion RLbsTestSession::Version() |
|
32 { |
|
33 return TVersion(KTestServerMajorVersionNumber, |
|
34 KTestServerMinorVersionNumber, |
|
35 KTestServerBuildVersionNumber); |
|
36 } |
|
37 |
|
38 /** Force the LBS system to stop and shutdown. |
|
39 |
|
40 THIS FUNCTION SHOULD ONLY BE USED IN TEST CODE! |
|
41 |
|
42 This function will stop the LBS system immediately, even |
|
43 if it is currently processing a location request. |
|
44 */ |
|
45 TInt RLbsTestSession::StopLbsSystem() |
|
46 { |
|
47 return SendReceive(ELbsTestStopLbsSystem); |
|
48 } |
|
49 |
|
50 TInt RLbsTestSession::StartLbsSystem() |
|
51 { |
|
52 return SendReceive(ELbsTestStartLbsSystem); |
|
53 } |
|
54 |
|
55 TInt RLbsTestSession::ResetLbsSystem() |
|
56 { |
|
57 return SendReceive(ELbsTestResetLbsSystem); |
|
58 } |
|
59 |
|
60 /////////////////////////////////////////////////////////////////////////////// |
|
61 // CLbsTestServerImpl |
|
62 /////////////////////////////////////////////////////////////////////////////// |
|
63 |
|
64 CLbsTestServerImpl::~CLbsTestServerImpl() |
|
65 { |
|
66 iSession.Close(); |
|
67 } |
|
68 |
|
69 CLbsTestServerImpl::CLbsTestServerImpl() |
|
70 { |
|
71 } |
|
72 |
|
73 CLbsTestServerImpl* CLbsTestServerImpl::NewL() |
|
74 { |
|
75 CLbsTestServerImpl* self = new (ELeave) CLbsTestServerImpl; |
|
76 CleanupStack::PushL(self); |
|
77 self->ConstructL(); |
|
78 CleanupStack::Pop(self); |
|
79 return self; |
|
80 } |
|
81 |
|
82 void CLbsTestServerImpl::ConstructL() |
|
83 { |
|
84 /** |
|
85 * See the ServerFramework code for the meaning of these params |
|
86 */ |
|
87 iParams.SetServerFileName(KTestServerFileName); |
|
88 iParams.SetServerName(KTestServerName); |
|
89 iParams.SetNumberOfServerSlots(KServerFrameworkDefaultMessageSlots); |
|
90 iParams.SetServerUids(KNullUid, KNullUid, KLbsTestServerUid); |
|
91 |
|
92 User::LeaveIfError(iSession.Connect(iParams)); |
|
93 } |
|
94 |
|
95 TInt CLbsTestServerImpl::StopLbsSystem() |
|
96 { |
|
97 return iSession.StopLbsSystem(); |
|
98 } |
|
99 |
|
100 TInt CLbsTestServerImpl::StartLbsSystem() |
|
101 { |
|
102 return iSession.StartLbsSystem(); |
|
103 } |
|
104 |
|
105 TInt CLbsTestServerImpl::ResetLbsSystem() |
|
106 { |
|
107 return iSession.ResetLbsSystem(); |
|
108 } |