|
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 // Connection Provider |
|
15 // (control plane) |
|
16 // |
|
17 // This is a 3-plane comms layer implementation example, which has been customised to be a test layer which gobbles and releases ESOCK MBUFs. |
|
18 // The MBuf gobbling functionality can be disabled by undefining the macro SYMBIAN_COMMSFW_MBUF_GOBBLER which is specified in mbufgobblerproviders.mmp. |
|
19 // 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 |
|
20 // through to the layer above or below without altering it. This makes it useful as a starting point for implementing your own layers / providers; |
|
21 // useful documentation on how to customise your own passthrough layer can be found in ..\docs\MbufGobblerLayer.doc |
|
22 // |
|
23 /** |
|
24 @file |
|
25 @internalComponent |
|
26 */ |
|
27 |
|
28 #include <comms-infras/ss_connprov.h> |
|
29 |
|
30 #include "mbufgobblerconnprovider.h" |
|
31 #include "mbufgobblerconnprovideractivities.h" |
|
32 #include "mbufgobblerlog.h" |
|
33 #include "mbufgobblertestflags.h" |
|
34 |
|
35 using namespace MbufGobblerCprActivities; |
|
36 |
|
37 _LIT8(KNodeName, "CMbufGobblerConnProvider"); |
|
38 |
|
39 CMbufGobblerConnProvider* CMbufGobblerConnProvider::NewL(ESock::CConnectionProviderFactoryBase& aFactory) |
|
40 { |
|
41 CMbufGobblerConnProvider* prov = new (ELeave) CMbufGobblerConnProvider(aFactory); |
|
42 CleanupStack::PushL(prov); |
|
43 prov->ConstructL(); |
|
44 CleanupStack::Pop(prov); |
|
45 return prov; |
|
46 } |
|
47 |
|
48 CMbufGobblerConnProvider::CMbufGobblerConnProvider(ESock::CConnectionProviderFactoryBase& aFactory) |
|
49 : CCoreConnectionProvider(aFactory, MbufGobblerCprActivities::MbufGobblerCprActivitiesMap::Self()) |
|
50 { |
|
51 MBUFGOBBLER_LOG_NODE_CREATE(KMbufGobblerCprSubTag, CMbufGobblerConnProvider, KNodeName, this->NodeId().Ptr()); |
|
52 } |
|
53 |
|
54 |
|
55 |
|
56 void CMbufGobblerConnProvider::ConstructL() |
|
57 { |
|
58 CCoreConnectionProvider::ConstructL(); |
|
59 MBUFGOBBLER_TEST_DATA_INIT |
|
60 MBUFGOBBLER_TEST_POINT(KCPrUp,KErrNone) |
|
61 } |
|
62 |
|
63 CMbufGobblerConnProvider::~CMbufGobblerConnProvider() |
|
64 { |
|
65 MBUFGOBBLER_LOG_NODE_DESTROY(KMbufGobblerCprSubTag, CMbufGobblerConnProvider, KNodeName, this->NodeId().Ptr()); |
|
66 } |
|
67 |
|
68 void CMbufGobblerConnProvider::ReceivedL(const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage) |
|
69 { |
|
70 LOGMESSAGE(KMbufGobblerCprSubTag, KNodeName, this, aSender, aRecipient, aMessage); |
|
71 LOG_NODE_INFO(KMbufGobblerCprSubTag, KNodeName, *this, iClientCount); |
|
72 |
|
73 MeshMachine::TNodeContext<CMbufGobblerConnProvider> ctx(*this, aMessage, aSender, aRecipient); |
|
74 Received(ctx); |
|
75 User::LeaveIfError(ctx.iReturn); |
|
76 } |
|
77 |