|
1 // Copyright (c) 2008-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 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @InternalComponent |
|
19 */ |
|
20 |
|
21 #include "cnetrequestbus.h" |
|
22 #include "lbsdevloggermacros.h" |
|
23 |
|
24 /** |
|
25 Create a request bus, this should be called from the request queue |
|
26 |
|
27 @return The pointer to the request bus |
|
28 */ |
|
29 CNETRequestBus* CNETRequestBus::NewL(const RLbsPositionUpdateRequests::TChannelIdentifer& aChannel) |
|
30 { |
|
31 CNETRequestBus* self = new (ELeave) CNETRequestBus(aChannel); |
|
32 CleanupStack::PushL(self); |
|
33 self->ConstructL(); |
|
34 CleanupStack::Pop(self); |
|
35 return self; |
|
36 } |
|
37 |
|
38 /** |
|
39 constructor, |
|
40 |
|
41 @param aChannel Channel identifier for the RProperty key |
|
42 */ |
|
43 CNETRequestBus::CNETRequestBus(const RLbsPositionUpdateRequests::TChannelIdentifer& aChannel) : iChannel(aChannel) |
|
44 { |
|
45 } |
|
46 |
|
47 /** |
|
48 Close the RProperty. |
|
49 */ |
|
50 CNETRequestBus::~CNETRequestBus() |
|
51 { |
|
52 iNETRequestBus.Close(); |
|
53 } |
|
54 |
|
55 /** |
|
56 Open the RProperty object wrappered by the request bus. |
|
57 Request bus is implemented as Publish & Subscribe mechanism. |
|
58 */ |
|
59 void CNETRequestBus::ConstructL() |
|
60 { |
|
61 iNETRequestBus.OpenL(iChannel); |
|
62 } |
|
63 |
|
64 /** |
|
65 Publish the position request onto the request bus. |
|
66 |
|
67 @param aRequest The TLbsPositionUpdateRequestBase reference to the postion update request |
|
68 */ |
|
69 void CNETRequestBus::PublishRequestL(const TLbsPositionUpdateRequestBase& aRequest) |
|
70 { |
|
71 LBSLOG(ELogP1, "LocServer - CNETRequestBus::PublishRequestL"); |
|
72 User::LeaveIfError(iNETRequestBus.SetPositionUpdateRequest(aRequest)); |
|
73 } |
|
74 |
|
75 /** |
|
76 Read the request from the request bus. This function should be called by request bus observers subscribed to the bus. |
|
77 |
|
78 @param aRequest A reference to the returned position update request |
|
79 */ |
|
80 void CNETRequestBus::ReadRequestL(TLbsPositionUpdateRequestBase& aRequest) |
|
81 { |
|
82 User::LeaveIfError(iNETRequestBus.GetPositionUpdateRequest(aRequest)); |
|
83 } |
|
84 |