|
1 /* |
|
2 * Copyright (c) 2005-2009 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: Implementation for bearer LAN. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "ConnMonBearerLAN.h" |
|
19 #include "connmoncommsdatcache.h" |
|
20 #include "ConnMonIAP.h" |
|
21 #include "log.h" |
|
22 |
|
23 // --------------------------------------------------------------------------- |
|
24 // Construction |
|
25 // --------------------------------------------------------------------------- |
|
26 // |
|
27 TConnMonBearerLAN::TConnMonBearerLAN( |
|
28 CConnMonIAP* aConnMonIAP, |
|
29 CConnMonCommsDatCache* aCommsDatCache ) |
|
30 : |
|
31 TConnMonBearer( aConnMonIAP, aCommsDatCache ) |
|
32 { |
|
33 } |
|
34 |
|
35 // --------------------------------------------------------------------------- |
|
36 // Is bearer available |
|
37 // --------------------------------------------------------------------------- |
|
38 // |
|
39 TInt TConnMonBearerLAN::GetAvailability( TBool& /*aAvailable*/ ) const |
|
40 { |
|
41 return KErrNotSupported; |
|
42 } |
|
43 |
|
44 // --------------------------------------------------------------------------- |
|
45 // Bearer ID getter |
|
46 // --------------------------------------------------------------------------- |
|
47 // |
|
48 TUint TConnMonBearerLAN::BearerId() const |
|
49 { |
|
50 return EBearerIdLAN; |
|
51 } |
|
52 |
|
53 // --------------------------------------------------------------------------- |
|
54 // ETrue if bearer is valid (internal state is correct) |
|
55 // --------------------------------------------------------------------------- |
|
56 // |
|
57 TBool TConnMonBearerLAN::Valid() const |
|
58 { |
|
59 return ETrue; |
|
60 } |
|
61 |
|
62 // --------------------------------------------------------------------------- |
|
63 // Sets available IAPs of this type as available in CommsDat cache |
|
64 // --------------------------------------------------------------------------- |
|
65 // |
|
66 void TConnMonBearerLAN::FlagAvailableIaps() const |
|
67 { |
|
68 LOGENTRFN("TConnMonBearerLAN::FlagAvailableIaps()") |
|
69 |
|
70 RArray<TUint> idArray; |
|
71 iConnMonIAP->GetActiveConnectionsIds( EBearerIdLAN, idArray ); |
|
72 |
|
73 if ( idArray.Count() > 0 ) |
|
74 { |
|
75 LOGIT1("Found %d active LAN IAPs", idArray.Count()) |
|
76 for ( TInt i = 0; i < idArray.Count(); i++ ) |
|
77 { |
|
78 iCommsDatCache->SetAvailableIapWithId( idArray[i] ); |
|
79 } |
|
80 } |
|
81 else |
|
82 { |
|
83 // Currently LAN bearer only supported in emulator, unless LAN IAP already active. |
|
84 #ifdef __WINS__ |
|
85 LOGIT("Emulator environment, enabling all LAN IAPs") |
|
86 iCommsDatCache->SetAvailableIapsWithBearerId( EBearerIdLAN ); |
|
87 #endif |
|
88 } |
|
89 idArray.Close(); |
|
90 |
|
91 LOGEXITFN("TConnMonBearerLAN::FlagAvailableIaps()") |
|
92 } |
|
93 |
|
94 // End-of-file |