|
1 // Copyright (c) 2010 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 // Meta Connection Provider |
|
15 // (management plane) |
|
16 // |
|
17 // |
|
18 // This is a 3-plane comms layer implementation example, which has been customised to be a test layer which gobbles and releases ESOCK MBUFs. |
|
19 // The MBuf gobbling functionality can be disabled by undefining the macro SYMBIAN_COMMSFW_MBUF_GOBBLER which is specified in mbufgobblerproviders.mmp. |
|
20 // When SYMBIAN_COMMSFW_MBUF_GOBBLER is undefined, the source code specified by mbufgobblerproviders.mmp becomes a pass through layer i.e. it passes the data |
|
21 // through to the layer above or below without altering it. This makes it useful as a starting point for implementing your own layers / providers; |
|
22 // useful documentation on how to customise your own passthrough layer can be found in ..\docs\MbufGobblerLayer.doc |
|
23 // |
|
24 |
|
25 /** |
|
26 @file |
|
27 @internalComponent |
|
28 */ |
|
29 |
|
30 #include "mbufgobblermetaconnprovider.h" |
|
31 #include "mbufgobblermetaconnprovideractivities.h" |
|
32 #include "mbufgobblerlog.h" |
|
33 #include "mbufgobblertestflags.h" |
|
34 |
|
35 _LIT8(KNodeName, "CMbufGobblerMetaConnectionProvider"); |
|
36 |
|
37 CMbufGobblerMetaConnectionProvider* CMbufGobblerMetaConnectionProvider::NewL(ESock::CMetaConnectionProviderFactoryBase& aFactory, |
|
38 const ESock::TProviderInfo& aProviderInfo) |
|
39 { |
|
40 CMbufGobblerMetaConnectionProvider* self = new (ELeave) CMbufGobblerMetaConnectionProvider(aFactory,aProviderInfo,MbufGobblerMCprActivities::MbufGobblerMCprActivitiesMap::Self()); |
|
41 CleanupStack::PushL(self); |
|
42 self->ConstructL(); |
|
43 CleanupStack::Pop(); |
|
44 return self; |
|
45 } |
|
46 |
|
47 CMbufGobblerMetaConnectionProvider::CMbufGobblerMetaConnectionProvider(ESock::CMetaConnectionProviderFactoryBase& aFactory, |
|
48 const ESock::TProviderInfo& aProviderInfo, const MeshMachine::TNodeActivityMap& aActivityMap) |
|
49 : CCoreMetaConnectionProvider(aFactory, aProviderInfo, aActivityMap) |
|
50 { |
|
51 MBUFGOBBLER_LOG_NODE_CREATE(KMbufGobblerMcprSubTag, CMbufGobblerMetaConnectionProvider, KNodeName, this->NodeId().Ptr()); |
|
52 } |
|
53 |
|
54 void CMbufGobblerMetaConnectionProvider::ConstructL() |
|
55 { |
|
56 CCoreMetaConnectionProvider::ConstructL(); |
|
57 MBUFGOBBLER_TEST_DATA_INIT |
|
58 MBUFGOBBLER_TEST_POINT(KMCPrUp,KErrNone) |
|
59 } |
|
60 |
|
61 CMbufGobblerMetaConnectionProvider::~CMbufGobblerMetaConnectionProvider() |
|
62 { |
|
63 MBUFGOBBLER_LOG_NODE_DESTROY(KMbufGobblerMcprSubTag, CMbufGobblerMetaConnectionProvider, KNodeName, this->NodeId().Ptr()); |
|
64 } |
|
65 |
|
66 void CMbufGobblerMetaConnectionProvider::ReceivedL(const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aCFMessage) |
|
67 { |
|
68 LOGMESSAGE(KMbufGobblerMcprSubTag, KNodeName, this, aSender, aRecipient, aCFMessage); |
|
69 LOG_NODE_INFO(KMbufGobblerMcprSubTag, KNodeName, *this, iClientCount); |
|
70 MeshMachine::TNodeContext<CMbufGobblerMetaConnectionProvider> ctx(*this, aCFMessage, aSender, aRecipient); |
|
71 CCoreMetaConnectionProvider::Received(ctx); |
|
72 User::LeaveIfError(ctx.iReturn); |
|
73 } |
|
74 |