|
1 /* |
|
2 * Copyright (c) 2006 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: This file implements the Location triggering container |
|
15 * interface |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #include <e32std.h> |
|
21 #include <s32strm.h> |
|
22 #include <s32mem.h> |
|
23 |
|
24 #include <lbt.h> |
|
25 #include <lbterrors.h> |
|
26 #include "lbtserverconsts.h" |
|
27 #include "lbtmanager.h" |
|
28 #include "lbttriggeringsystemmanagementsettings.h" |
|
29 #include "lbtterminalptrholder.h" |
|
30 |
|
31 |
|
32 // --------------------------------------------------------- |
|
33 // RLbtManager::RLbtManager |
|
34 // |
|
35 // (other items were commented in a header). |
|
36 // --------------------------------------------------------- |
|
37 // |
|
38 EXPORT_C RLbtManager::RLbtManager() |
|
39 { |
|
40 TRAP_IGNORE( iPtrHolder = CLbtSubSessnPtrHolder::NewL(2,0) ); |
|
41 } |
|
42 |
|
43 // --------------------------------------------------------- |
|
44 // RLbtManager::~RLbtManager |
|
45 // |
|
46 // (other items were commented in a header). |
|
47 // --------------------------------------------------------- |
|
48 // |
|
49 EXPORT_C RLbtManager::~RLbtManager() |
|
50 { |
|
51 delete iPtrHolder; |
|
52 iPtrHolder = NULL; |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------- |
|
56 // RLbtManager::Open |
|
57 // |
|
58 // (other items were commented in a header). |
|
59 // --------------------------------------------------------- |
|
60 // |
|
61 EXPORT_C TInt RLbtManager::Open( RLbtServer& aServer ) |
|
62 { |
|
63 __ASSERT_ALWAYS(aServer.Handle() != 0, |
|
64 User::Panic(KLbtClientPanicCategory, ELbtServerBadHandle)); |
|
65 |
|
66 __ASSERT_ALWAYS(! SubSessionHandle() , User::Panic(KLbtClientPanicCategory, ELbtServerBadHandle)); |
|
67 |
|
68 TInt ret = CreateSubSession(aServer, ELbtMgmtSubSessionOpen, TIpcArgs()); |
|
69 return ret; |
|
70 }; |
|
71 |
|
72 // --------------------------------------------------------- |
|
73 // RLbtManager::SetTriggeringSystemSettingsL |
|
74 // |
|
75 // (other items were commented in a header). |
|
76 // --------------------------------------------------------- |
|
77 // |
|
78 EXPORT_C void RLbtManager::SetTriggeringSystemSettingsL( |
|
79 const TLbtTriggeringSystemManagementSettings& aSettings,TLbtManagementSettingsMask aMask) |
|
80 { |
|
81 __ASSERT_ALWAYS(SubSessionHandle(), User::Panic(KLbtClientPanicCategory, ELbtServerBadHandle)); |
|
82 |
|
83 TIpcArgs args; |
|
84 TPtrC8 ptr( |
|
85 reinterpret_cast<const TUint8*>(&aSettings), |
|
86 sizeof(TLbtTriggeringSystemManagementSettings)); |
|
87 |
|
88 args.Set(KParamSettings,&ptr); |
|
89 args.Set(KParamMask,aMask); |
|
90 |
|
91 User::LeaveIfError(SendReceive(ELbtSetTriggeringSettings,args)); |
|
92 } |
|
93 |
|
94 // --------------------------------------------------------- |
|
95 // RLbtManager::SetTriggeringSystemSettingsL |
|
96 // |
|
97 // (other items were commented in a header). |
|
98 // --------------------------------------------------------- |
|
99 // |
|
100 EXPORT_C void RLbtManager::SetTriggeringMechanismStateL( |
|
101 TLbtTriggeringMechanismState aState ) |
|
102 { |
|
103 __ASSERT_ALWAYS(SubSessionHandle(), User::Panic(KLbtClientPanicCategory, ELbtServerBadHandle)); |
|
104 |
|
105 TIpcArgs args; |
|
106 TLbtTriggeringSystemManagementSettings settings; |
|
107 settings.SetTriggeringMechanismState(aState); |
|
108 |
|
109 TPtrC8 ptr( |
|
110 reinterpret_cast<const TUint8*>(&settings), |
|
111 sizeof(TLbtTriggeringSystemManagementSettings)); |
|
112 args.Set(KParamSettings,&ptr); |
|
113 |
|
114 iMask = ETriggeringMechanismState; |
|
115 |
|
116 args.Set(KParamMask,iMask); |
|
117 User::LeaveIfError(SendReceive(ELbtSetTriggeringSettings,args)); |
|
118 } |
|
119 |
|
120 // --------------------------------------------------------- |
|
121 // RLbtManager::GetTriggeringSystemStatusL |
|
122 // |
|
123 // (other items were commented in a header). |
|
124 // --------------------------------------------------------- |
|
125 // |
|
126 EXPORT_C void RLbtManager::GetTriggeringSystemStatusL( |
|
127 TLbtTriggeringSystemStatus& aTriggeringSystemStatus) |
|
128 { |
|
129 __ASSERT_ALWAYS(SubSessionHandle(), User::Panic(KLbtClientPanicCategory, ELbtServerBadHandle)); |
|
130 TIpcArgs args; |
|
131 |
|
132 TPtr8 ptr( |
|
133 reinterpret_cast< TUint8*>(&aTriggeringSystemStatus), |
|
134 sizeof(TLbtTriggeringSystemStatus)); |
|
135 args.Set(KParamStatus,&ptr); |
|
136 |
|
137 User::LeaveIfError(SendReceive(ELbtGetTriggeringSysStatus,args)); |
|
138 } |
|
139 |
|
140 // --------------------------------------------------------- |
|
141 // RLbtManager::NotifyTriggeringSystemStatusChange |
|
142 // |
|
143 // (other items were commented in a header). |
|
144 // --------------------------------------------------------- |
|
145 // |
|
146 EXPORT_C void RLbtManager::NotifyTriggeringSystemStatusChange( |
|
147 TRequestStatus& aStatus) |
|
148 { |
|
149 __ASSERT_ALWAYS(SubSessionHandle(), User::Panic(KLbtClientPanicCategory, ELbtServerBadHandle)); |
|
150 SendReceive(ELbtNotifyTriggeringSysStatusChange,aStatus); |
|
151 } |
|
152 |
|
153 // --------------------------------------------------------- |
|
154 // RLbtManager::GetTriggeringSystemSettingsL |
|
155 // |
|
156 // (other items were commented in a header). |
|
157 // --------------------------------------------------------- |
|
158 // |
|
159 EXPORT_C void RLbtManager::GetTriggeringSystemSettingsL( |
|
160 TLbtTriggeringSystemSettings& aSetting ) |
|
161 { |
|
162 __ASSERT_ALWAYS(SubSessionHandle(), User::Panic(KLbtClientPanicCategory, ELbtServerBadHandle)); |
|
163 TIpcArgs args; |
|
164 |
|
165 TPtr8 ptr( |
|
166 reinterpret_cast< TUint8*>(&aSetting), |
|
167 sizeof(TLbtTriggeringSystemManagementSettings)); |
|
168 args.Set(KParamSettings,&ptr); |
|
169 User::LeaveIfError(SendReceive(ELbtGetTriggeringSysSetting,args)); |
|
170 } |
|
171 |
|
172 // --------------------------------------------------------- |
|
173 // RLbtManager::CancelNotifyTriggeringSystemStatusChange |
|
174 // |
|
175 // (other items were commented in a header). |
|
176 // --------------------------------------------------------- |
|
177 // |
|
178 EXPORT_C void RLbtManager::CancelNotifyTriggeringSystemStatusChange() |
|
179 { |
|
180 __ASSERT_ALWAYS(SubSessionHandle(), User::Panic(KLbtClientPanicCategory, ELbtServerBadHandle)); |
|
181 SendReceive(ELbtCnclNotifyTriggeringSysStatusChange); |
|
182 } |
|
183 |
|
184 // --------------------------------------------------------- |
|
185 // RLbtManager::NotifyTriggeringSystemSettingChange |
|
186 // |
|
187 // (other items were commented in a header). |
|
188 // --------------------------------------------------------- |
|
189 // |
|
190 EXPORT_C void RLbtManager::NotifyTriggeringSystemSettingChange( |
|
191 TLbtTriggeringSystemManagementSettings& aManagementSettings, |
|
192 TRequestStatus& aStatus ) |
|
193 { |
|
194 __ASSERT_ALWAYS(SubSessionHandle(), User::Panic(KLbtClientPanicCategory, ELbtServerBadHandle)); |
|
195 TIpcArgs args; |
|
196 |
|
197 iPtrHolder->Ptr(0).Set( |
|
198 reinterpret_cast< TUint8*>(&aManagementSettings), |
|
199 sizeof(TLbtTriggeringSystemManagementSettings), |
|
200 sizeof(TLbtTriggeringSystemManagementSettings)); |
|
201 args.Set(0,&iPtrHolder->Ptr(0)); |
|
202 SendReceive( ELbtNotifyTriggeringSysSettingChange,args,aStatus ); |
|
203 } |
|
204 |
|
205 // --------------------------------------------------------- |
|
206 // RLbtManager::GetTriggerManagerUiInfoL |
|
207 // |
|
208 // (other items were commented in a header). |
|
209 // --------------------------------------------------------- |
|
210 // |
|
211 EXPORT_C void RLbtManager::GetTriggerManagerUiInfoL( |
|
212 RArray < TLbtTriggerManagerUiInfo >& /*aManagerUiList*/ ) |
|
213 { |
|
214 |
|
215 } |
|
216 |
|
217 |
|
218 // end of file |
|
219 |