connectionmonitoring/connmon/connectionmonitor/src/ConnMonUtils.cpp
changeset 0 5a93021fdf25
equal deleted inserted replaced
-1:000000000000 0:5a93021fdf25
       
     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:  ConnMon utilities.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "ConnMonUtils.h"
       
    19 #include "log.h"
       
    20 
       
    21 // -----------------------------------------------------------------------------
       
    22 //Converts from TMobilePhoneNetworkMode to TConnMonMobilePhoneNetworkMode
       
    23 // -----------------------------------------------------------------------------
       
    24 //
       
    25 TInt ConnMonUtils::MobilePhoneNetworkModeToConnMonMobilePhoneNetworkMode(
       
    26         RMobilePhone::TMobilePhoneNetworkMode aMode,
       
    27         TConnMonMobilePhoneNetworkMode& aValue )
       
    28     {
       
    29     switch ( aMode )
       
    30         {
       
    31         case RMobilePhone::ENetworkModeUnknown:
       
    32             aValue = EConnMonNetworkModeUnknown;
       
    33             break;
       
    34         case RMobilePhone::ENetworkModeUnregistered:
       
    35             aValue = EConnMonNetworkModeUnregistered;
       
    36             break;
       
    37         case RMobilePhone::ENetworkModeGsm:
       
    38             aValue = EConnMonNetworkModeGsm;
       
    39             break;
       
    40         case RMobilePhone::ENetworkModeAmps:
       
    41             aValue = EConnMonNetworkModeAmps;
       
    42             break;
       
    43         case RMobilePhone::ENetworkModeCdma95:
       
    44             aValue = EConnMonNetworkModeCdma95;
       
    45             break;
       
    46         case RMobilePhone::ENetworkModeCdma2000:
       
    47             aValue = EConnMonNetworkModeCdma2000;
       
    48             break;
       
    49         case RMobilePhone::ENetworkModeWcdma:
       
    50             aValue = EConnMonNetworkModeWcdma;
       
    51             break;
       
    52         case RMobilePhone::ENetworkModeTdcdma:
       
    53             aValue = EConnMonNetworkModeTdcdma;
       
    54             break;
       
    55         default:
       
    56             return KErrNotFound;
       
    57         }
       
    58     return KErrNone;
       
    59     }
       
    60 
       
    61 // -----------------------------------------------------------------------------
       
    62 // Converts from TDesC8 to build independent TDesC
       
    63 // -----------------------------------------------------------------------------
       
    64 //
       
    65 void ConnMonUtils::TDes8ToTDes( const TDes8& aBuf8, TDes& aInd )
       
    66     {
       
    67     #if defined(_UNICODE)
       
    68 
       
    69     for ( TUint i = 0; i < aBuf8.Length(); ++i )
       
    70         {
       
    71         aInd.Append( aBuf8[i] );
       
    72         }
       
    73     #else
       
    74     aInd = aBuf8;
       
    75     #endif
       
    76     }
       
    77 
       
    78 // -----------------------------------------------------------------------------
       
    79 // Converts from TDesC to TDesC8
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 void ConnMonUtils::TDesToTDes8( const TDes& aSrc, TDes8& aDest )
       
    83     {
       
    84     for ( TUint i = 0; i < aSrc.Length(); ++i )
       
    85         {
       
    86         aDest.Append( aSrc[i] & 0x00FF );
       
    87         }
       
    88     }
       
    89 
       
    90 
       
    91 // -----------------------------------------------------------------------------
       
    92 //
       
    93 // -----------------------------------------------------------------------------
       
    94 
       
    95 TConnMonInap::TConnMonInap()
       
    96     {
       
    97     }
       
    98 
       
    99 
       
   100 TConnMonVirtualIap::TConnMonVirtualIap()
       
   101     {
       
   102     }
       
   103 
       
   104 TBool TConnMonVirtualIap::Real() const
       
   105     {
       
   106     return EFalse;
       
   107     }
       
   108 
       
   109 TBool TConnMonVirtualIap::Valid() const
       
   110     {
       
   111     return EFalse;
       
   112     }
       
   113 
       
   114 
       
   115 TConnMonRealIap::TConnMonRealIap()
       
   116     {
       
   117     }
       
   118 
       
   119 TBool TConnMonRealIap::Real() const
       
   120     {
       
   121     return ETrue;
       
   122     }
       
   123 
       
   124 TBool TConnMonRealIap::Valid() const
       
   125     {
       
   126     return EFalse;
       
   127     }
       
   128 
       
   129 
       
   130 TConnMonSNAP::~TConnMonSNAP()
       
   131     {
       
   132     }
       
   133 
       
   134 EXPORT_C TBool TConnMonSNAP::Valid() const
       
   135     {
       
   136     return ETrue;
       
   137     }
       
   138 
       
   139 TConnMonSNAP::TConnMonSNAP()
       
   140     {
       
   141     }
       
   142 
       
   143 TConnMonSNAP::TConnMonSNAP( TUint aId ) : iId( aId )
       
   144     {
       
   145     }
       
   146 
       
   147 TConnMonSNAP::TConnMonSNAP( const TConnMonSNAP& aSnap )
       
   148     {
       
   149     iId = aSnap.iId;
       
   150     }
       
   151 
       
   152 
       
   153 CConnMonSNAPsAvailabilityManager* CConnMonSNAPsAvailabilityManager::NewL()
       
   154     {
       
   155     CConnMonSNAPsAvailabilityManager* self = new( ELeave ) CConnMonSNAPsAvailabilityManager();
       
   156     return self;
       
   157     }
       
   158 
       
   159 CConnMonSNAPsAvailabilityManager::~CConnMonSNAPsAvailabilityManager()
       
   160     {
       
   161     }
       
   162 
       
   163 CConnMonSNAPsAvailabilityManager::CConnMonSNAPsAvailabilityManager()
       
   164     {
       
   165     }
       
   166 
       
   167 
       
   168 CConnMonCommsDataNotifier* CConnMonCommsDataNotifier::NewL()
       
   169     {
       
   170     CConnMonCommsDataNotifier* self = new( ELeave ) CConnMonCommsDataNotifier();
       
   171     return self;
       
   172     }
       
   173 
       
   174 CConnMonCommsDataNotifier::~CConnMonCommsDataNotifier()
       
   175     {
       
   176     }
       
   177 
       
   178 CConnMonCommsDataNotifier::CConnMonCommsDataNotifier()
       
   179     {
       
   180     }
       
   181 
       
   182 
       
   183 CConnMonIapsAvailabilityManager* CConnMonIapsAvailabilityManager::NewL()
       
   184     {
       
   185     CConnMonIapsAvailabilityManager* self = new( ELeave ) CConnMonIapsAvailabilityManager();
       
   186     return self;
       
   187     }
       
   188 
       
   189 CConnMonIapsAvailabilityManager::CConnMonIapsAvailabilityManager()
       
   190     {
       
   191     }
       
   192 
       
   193 CConnMonIapsAvailabilityManager::~CConnMonIapsAvailabilityManager()
       
   194     {
       
   195     }
       
   196 
       
   197 // End-of-file