|
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 "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 // IPProtoCpr.cpp |
|
15 // IPProto Connection Provider implementation |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 */ |
|
23 |
|
24 #include <comms-infras/corecprstates.h> |
|
25 #include <comms-infras/corecpractivities.h> |
|
26 #include "linkcprextensionapi.h" |
|
27 |
|
28 #ifdef __CFLOG_ACTIVE |
|
29 #define KIPProtoCprTag KESockConnectionTag |
|
30 //_LIT8(KIPProtoCprSubTag, "ipprotocpr"); |
|
31 #endif // __CFLOG_ACTIVE |
|
32 |
|
33 using namespace ESock; |
|
34 using namespace NetStateMachine; |
|
35 |
|
36 |
|
37 START_ATTRIBUTE_TABLE(CLinkCprExtensionApi, CLinkCprExtensionApi::EUid, CLinkCprExtensionApi::ETypeId) |
|
38 // No attributes defined, as no serialisation takes place. |
|
39 END_ATTRIBUTE_TABLE() |
|
40 |
|
41 |
|
42 CLinkCprExtensionApi* CLinkCprExtensionApi::NewLC(CIPProtoConnectionProvider& aCpr) |
|
43 { |
|
44 CLinkCprExtensionApi* self = new (ELeave) CLinkCprExtensionApi(aCpr); |
|
45 CleanupStack::PushL(self); |
|
46 return self; |
|
47 } |
|
48 |
|
49 CLinkCprExtensionApi::CLinkCprExtensionApi(CIPProtoConnectionProvider& aCpr) |
|
50 : iLastProgress(KConnectionUninitialised, KErrNone), |
|
51 iLastProgressError(KConnectionUninitialised, KErrNone), |
|
52 iCpr(aCpr) |
|
53 { |
|
54 } |
|
55 |
|
56 void CLinkCprExtensionApi::ProgressL(TProgressBuf& aBuffer) const |
|
57 { |
|
58 aBuffer = iLastProgress; |
|
59 } |
|
60 |
|
61 void CLinkCprExtensionApi::LastProgressError(TProgressBuf& aBuffer) |
|
62 { |
|
63 aBuffer = iLastProgressError; |
|
64 iLastProgressError.iStage = KConnectionUninitialised; |
|
65 iLastProgressError.iError = KErrNone; |
|
66 } |
|
67 |
|
68 TInt CLinkCprExtensionApi::EnumerateSubConnectionsL(TUint& /*aCount*/) |
|
69 { |
|
70 return KErrNone; |
|
71 } |
|
72 |
|
73 TInt CLinkCprExtensionApi::AllSubConnectionNotificationEnable() |
|
74 { |
|
75 return KErrNone; |
|
76 } |
|
77 |
|
78 void CLinkCprExtensionApi::SetLastProgress(const Elements::TStateChange& aStateChange) |
|
79 { |
|
80 iLastProgress = aStateChange; |
|
81 if (aStateChange.iError != KErrNone) |
|
82 { |
|
83 iLastProgressError = aStateChange; |
|
84 } |
|
85 } |