iaupdate/IAD/firmwareupdate/src/iaupdatefwsyncprofile.cpp
changeset 0 ba25891c3a9e
child 77 d1838696558c
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2008 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:    
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include <SyncMLTransportProperties.h>
       
    21 #include "iaupdatefwsyncprofile.h"
       
    22 #include "iaupdatefwdebug.h"
       
    23 #include "iaupdatefwsyncutil.h"
       
    24 #include "iaupdateuids.h"
       
    25 
       
    26 #include "iaupdatefwconst.h" //EAspBearer, KBufSize
       
    27 
       
    28 
       
    29 // ============================ MEMBER FUNCTIONS ==============================
       
    30 //
       
    31 
       
    32 // -----------------------------------------------------------------------------
       
    33 // NewLC
       
    34 //
       
    35 // Two-phased constructor.
       
    36 // -----------------------------------------------------------------------------
       
    37 //
       
    38 CIAUpdateFWSyncProfile* CIAUpdateFWSyncProfile::NewLC( const TInt aApplicationId,
       
    39                                                RSyncMLSession* aSyncSession )
       
    40     {
       
    41     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::NewLC()" );
       
    42     
       
    43     CIAUpdateFWSyncProfile* self = new( ELeave ) CIAUpdateFWSyncProfile( aApplicationId,
       
    44                                                                  aSyncSession );
       
    45 	CleanupStack::PushL( self );
       
    46 	self->ConstructL();
       
    47 	return self;
       
    48     }
       
    49 
       
    50 // -----------------------------------------------------------------------------
       
    51 // NewL
       
    52 //
       
    53 // Two-phased constructor.
       
    54 // -----------------------------------------------------------------------------
       
    55 //
       
    56  CIAUpdateFWSyncProfile* CIAUpdateFWSyncProfile::NewL( const TInt aApplicationId,
       
    57                                               RSyncMLSession* aSyncSession )
       
    58     {
       
    59     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::NewL:" );
       
    60     
       
    61     CIAUpdateFWSyncProfile* self = new( ELeave ) CIAUpdateFWSyncProfile( aApplicationId,
       
    62                                                                  aSyncSession );
       
    63 	CleanupStack::PushL( self );
       
    64 	self->ConstructL();
       
    65 	CleanupStack::Pop( self );
       
    66 	return self;
       
    67     }
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // Destructor.
       
    71 // -----------------------------------------------------------------------------
       
    72 //
       
    73 CIAUpdateFWSyncProfile::~CIAUpdateFWSyncProfile()
       
    74     {
       
    75     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::~CIAUpdateFWSyncProfile:" );
       
    76     
       
    77     iHistoryLog.Close();
       
    78     iConnection.Close();
       
    79     iProfile.Close();
       
    80     }
       
    81 
       
    82 // -----------------------------------------------------------------------------
       
    83 // ConstructL
       
    84 //
       
    85 // Symbian 2nd phase constructor can leave.
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 void CIAUpdateFWSyncProfile::ConstructL()
       
    89     {
       
    90     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::ConstructL:" );
       
    91     }
       
    92 
       
    93 // -----------------------------------------------------------------------------
       
    94 // Constructor.
       
    95 // -----------------------------------------------------------------------------
       
    96 //
       
    97 CIAUpdateFWSyncProfile::CIAUpdateFWSyncProfile( const TInt aApplicationId,
       
    98                                         RSyncMLSession* aSyncSession )
       
    99 	{
       
   100 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::CIAUpdateFWSyncProfile:" );
       
   101 	
       
   102 	iSyncSession = aSyncSession;
       
   103 	iApplicationId = aApplicationId;
       
   104 	
       
   105     iHistoryLogOpen = EFalse;
       
   106     iConnectionOpen = EFalse;
       
   107 	}
       
   108 
       
   109 // -----------------------------------------------------------------------------
       
   110 // CIAUpdateFWSyncProfile::OpenL
       
   111 // -----------------------------------------------------------------------------
       
   112 //
       
   113  void CIAUpdateFWSyncProfile::OpenL( TInt aProfileId, TInt aOpenMode )
       
   114     {
       
   115     FTRACE( FPrint(
       
   116         _L("[IAUPDATEFW] CIAUpdateFWSyncProfile::OpenL(), aProfileId = %d, aOpenMode = %d"),
       
   117         aProfileId, aOpenMode ) );
       
   118 
       
   119     if ( aOpenMode == EOpenRead )
       
   120     	{
       
   121     	iProfile.OpenL( *iSyncSession, aProfileId, ESmlOpenRead );
       
   122     	}
       
   123     else
       
   124     	{
       
   125     	iProfile.OpenL( *iSyncSession, aProfileId, ESmlOpenReadWrite );
       
   126     	}
       
   127     if ( !iConnectionOpen )
       
   128 		{
       
   129     	OpenConnection();
       
   130 		}
       
   131     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::OpenL() completed" );
       
   132     }
       
   133 
       
   134 // -----------------------------------------------------------------------------
       
   135 // CIAUpdateFWSyncProfile::CreateL
       
   136 // -----------------------------------------------------------------------------
       
   137 //
       
   138  TInt CIAUpdateFWSyncProfile::CreateL()
       
   139     {
       
   140     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::CreateL()" );
       
   141     
       
   142     iProfile.CreateL( *iSyncSession );
       
   143     iProfile.SetCreatorId( iApplicationId );
       
   144     iProfile.UpdateL();
       
   145     TInt id = iProfile.Identifier();
       
   146     iProfile.Close();
       
   147 
       
   148     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::CreateL() completed" );
       
   149     return id;
       
   150     }
       
   151 
       
   152 // -----------------------------------------------------------------------------
       
   153 // CIAUpdateFWSyncProfile::CreateCopyL
       
   154 // -----------------------------------------------------------------------------
       
   155 //
       
   156  void CIAUpdateFWSyncProfile::CreateCopyL( TInt aProfileId )
       
   157     {
       
   158     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::CreateCopyL()" );
       
   159     
       
   160     iProfile.CreateL( *iSyncSession );
       
   161     iProfile.SetCreatorId( iApplicationId );
       
   162     iProfile.UpdateL();
       
   163     if ( !iConnectionOpen )
       
   164 		{
       
   165     	OpenConnection();
       
   166 		}
       
   167 	if ( !iHistoryLogOpen )
       
   168 		{
       
   169 	    OpenHistoryLog();
       
   170 		}
       
   171 
       
   172     CIAUpdateFWSyncProfile* profile = 
       
   173                 CIAUpdateFWSyncProfile::NewL( KIAUpdateUiUid, iSyncSession );
       
   174     CleanupStack::PushL( profile );
       
   175     profile->OpenL( aProfileId, ESmlOpenRead );
       
   176     CopyValuesL( profile );
       
   177     CleanupStack::PopAndDestroy( profile );
       
   178     profile  = NULL;
       
   179 
       
   180     iProfile.UpdateL();
       
   181     CloseHistoryLog();
       
   182     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::CreateCopyL() completed" );
       
   183     }
       
   184 
       
   185 // -----------------------------------------------------------------------------
       
   186 // CIAUpdateFWSyncProfile::SaveL
       
   187 // -----------------------------------------------------------------------------
       
   188 //
       
   189  void CIAUpdateFWSyncProfile::SaveL()
       
   190     {
       
   191     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SaveL()" );
       
   192     
       
   193     iProfile.UpdateL();
       
   194     if ( iConnectionOpen )
       
   195     	{
       
   196 	    FLOG( "[IAUPDATEFW] Connection open" );
       
   197     	iConnection.UpdateL(); // IPC call
       
   198     	}
       
   199 	else
       
   200 	{
       
   201 	    FLOG( "[IAUPDATEFW] Connection is not open" );		
       
   202 	}
       
   203     iProfile.Close();
       
   204     }
       
   205 
       
   206 // -----------------------------------------------------------------------------
       
   207 // CIAUpdateFWSyncProfile::GetName
       
   208 // -----------------------------------------------------------------------------
       
   209 //
       
   210  void CIAUpdateFWSyncProfile::GetName( TDes& aText )
       
   211 	{
       
   212 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::GetName()" );
       
   213 	
       
   214     TUtil::StrCopy( aText, iProfile.DisplayName() );
       
   215 	}
       
   216 
       
   217 // -----------------------------------------------------------------------------
       
   218 // CIAUpdateFWSyncProfile::SetNameL
       
   219 // -----------------------------------------------------------------------------
       
   220 //
       
   221  void CIAUpdateFWSyncProfile::SetNameL( const TDesC& aText )
       
   222 	{
       
   223 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SetNameL:" );
       
   224 	
       
   225 	iProfile.SetDisplayNameL( aText );
       
   226 	}
       
   227 
       
   228 // -----------------------------------------------------------------------------
       
   229 // CIAUpdateFWSyncProfile::CreatorId
       
   230 // -----------------------------------------------------------------------------
       
   231 //
       
   232  TInt CIAUpdateFWSyncProfile::CreatorId()
       
   233 	{
       
   234 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::CreatorId:" );
       
   235 	
       
   236 	return iProfile.CreatorId();
       
   237 	}
       
   238 
       
   239 // -----------------------------------------------------------------------------
       
   240 // CIAUpdateFWSyncProfile::SetCreatorId
       
   241 // -----------------------------------------------------------------------------
       
   242 //
       
   243  void CIAUpdateFWSyncProfile::SetCreatorId( TInt aCreatorId )
       
   244 	{
       
   245 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SetCreatorId:" );
       
   246 	
       
   247 	iProfile.SetCreatorId( aCreatorId );
       
   248 	}
       
   249 
       
   250 // -----------------------------------------------------------------------------
       
   251 // CIAUpdateFWSyncProfile::ProfileId
       
   252 // -----------------------------------------------------------------------------
       
   253 //
       
   254  TInt CIAUpdateFWSyncProfile::ProfileId()
       
   255 	{
       
   256 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::ProfileId()" );
       
   257     TInt retval = iProfile.Identifier();
       
   258     FTRACE( FPrint( _L(
       
   259 	    "[IAUPDATEFW] CIAUpdateFWSyncProfile::ProfileId() completed: Profile id = %d"),
       
   260 	    retval ) );
       
   261     return retval;
       
   262 	}
       
   263 
       
   264 // -----------------------------------------------------------------------------
       
   265 // CIAUpdateFWSyncProfile::DeleteAllowed
       
   266 // -----------------------------------------------------------------------------
       
   267 //
       
   268  TBool CIAUpdateFWSyncProfile::DeleteAllowed()
       
   269 	{
       
   270 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::DeleteAllowed:" );
       
   271 	
       
   272     return iProfile.DeleteAllowed();
       
   273 	}
       
   274 
       
   275 // -----------------------------------------------------------------------------
       
   276 // CIAUpdateFWSyncProfile::IsSynced
       
   277 // -----------------------------------------------------------------------------
       
   278 //
       
   279  TBool CIAUpdateFWSyncProfile::IsSynced()
       
   280     {
       
   281     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::IsSynced()" );
       
   282     
       
   283     TBool retVal = EFalse;
       
   284     if ( !iHistoryLogOpen )
       
   285 		{
       
   286 		FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::IsSynced(): Opening history log" );
       
   287 	    OpenHistoryLog();
       
   288 		}
       
   289 		
       
   290     if ( iHistoryLogOpen )
       
   291     	{
       
   292 	    FTRACE( FPrint( _L(
       
   293 	        "[IAUPDATEFW] CIAUpdateFWSyncProfile::IsSynced(): Log open! Log count = %d"),
       
   294 	                                                 iHistoryLog.Count() ) );
       
   295     	if ( iHistoryLog.Count() > 0 )
       
   296     	    {
       
   297             const CSyncMLHistoryJob* job = LatestHistoryJob();
       
   298             if ( job )
       
   299             	{
       
   300             	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::IsSynced(): True" );
       
   301             	if( job->LastSuccessSyncTime() != NULL )
       
   302                    {
       
   303     	        retVal = ETrue;
       
   304                    }
       
   305             	}
       
   306             else
       
   307                 {
       
   308                 FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::IsSynced(): False" );
       
   309                 }
       
   310     	    }
       
   311     	}
       
   312     else
       
   313         {
       
   314         FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::IsSynced() Could not open history log!!!" );
       
   315         }
       
   316     CloseHistoryLog();    	
       
   317 
       
   318     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::IsSynced() completed" );
       
   319     return retVal;
       
   320     }
       
   321 
       
   322 // -----------------------------------------------------------------------------
       
   323 // CIAUpdateFWSyncProfile::LastSync
       
   324 // -----------------------------------------------------------------------------
       
   325 //
       
   326  TTime CIAUpdateFWSyncProfile::LastSync()
       
   327     {
       
   328     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::LastSync()" );
       
   329 
       
   330     if ( !iHistoryLogOpen )
       
   331 		{
       
   332 		FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::LastSync(): Opening history log" );
       
   333 	    OpenHistoryLog();
       
   334 		}
       
   335     
       
   336     TTime time = 0;
       
   337     if ( iHistoryLogOpen )
       
   338     	{
       
   339 	    FTRACE( FPrint( _L(
       
   340 	        "[IAUPDATEFW] CIAUpdateFWSyncProfile::LastSync(): Log open! Log count = %d"),
       
   341 	                                                 iHistoryLog.Count() ) );
       
   342     	
       
   343     	if (iHistoryLog.Count() > 0)
       
   344     	    {
       
   345    	        const CSyncMLHistoryJob* job = LatestHistoryJob();
       
   346             if ( job )
       
   347             	{
       
   348                 FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::LastSync() timestamp" );
       
   349             	time = job->TimeStamp();
       
   350             	}
       
   351     	    }
       
   352     	}
       
   353     else
       
   354         {
       
   355         FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::LastSync() Could not open history log!!!" );
       
   356         }
       
   357 
       
   358     CloseHistoryLog();    	
       
   359 
       
   360     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::LastSync() completed" );
       
   361     return time;
       
   362     }
       
   363 
       
   364  TTime CIAUpdateFWSyncProfile::LastSuccessSync()
       
   365 {
       
   366 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::LastSuccessSynctime()" );
       
   367 
       
   368     if ( !iHistoryLogOpen )
       
   369 		{
       
   370 		FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::LastSync(): Opening history log" );
       
   371 	    OpenHistoryLog();
       
   372 		}
       
   373     
       
   374     TTime time = 0;
       
   375     if ( iHistoryLogOpen )
       
   376     	{
       
   377 	    FTRACE( FPrint( _L(
       
   378 	        "[IAUPDATEFW] CIAUpdateFWSyncProfile::LastSync(): Log open! Log count = %d"),
       
   379 	                                                 iHistoryLog.Count() ) );
       
   380     	
       
   381     	if (iHistoryLog.Count() > 0)
       
   382     	    {
       
   383    	        const CSyncMLHistoryJob* job = LatestHistoryJob();
       
   384    	        iProfileId=ProfileId();
       
   385             if ( job )
       
   386             	{
       
   387                 FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::LastSync() timestamp" );
       
   388             	time = job->LastSuccessSyncTime();
       
   389             	}
       
   390     	    }
       
   391     	}
       
   392     else
       
   393         {
       
   394         FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::LastSync() Could not open history log!!!" );
       
   395         }
       
   396 
       
   397     CloseHistoryLog();    	
       
   398 
       
   399     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::LastSuccessSynctime() completed" );
       
   400     return time;
       
   401     }
       
   402 
       
   403 // -----------------------------------------------------------------------------
       
   404 // CIAUpdateFWSyncProfile::GetServerIdL
       
   405 // -----------------------------------------------------------------------------
       
   406 //
       
   407  void CIAUpdateFWSyncProfile::GetServerId( TDes& aText )
       
   408     {
       
   409     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::GetServerIdL:" );
       
   410     
       
   411 	TUtil::StrCopy(aText, iProfile.ServerId());
       
   412 	}
       
   413 
       
   414 // -----------------------------------------------------------------------------
       
   415 // CIAUpdateFWSyncProfile::SetServerIdL
       
   416 // -----------------------------------------------------------------------------
       
   417 //
       
   418  void CIAUpdateFWSyncProfile::SetServerIdL( const TDesC& aText )
       
   419 	{
       
   420 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SetServerIdL:" );
       
   421 	
       
   422 	TBuf8<KBufSize256> buf;
       
   423 	TUtil::StrCopy(buf, aText);
       
   424 	iProfile.SetServerIdL(buf);
       
   425 	}
       
   426 
       
   427 // -----------------------------------------------------------------------------
       
   428 // CIAUpdateFWSyncProfile::GetServerPassword
       
   429 // -----------------------------------------------------------------------------
       
   430 //
       
   431  void CIAUpdateFWSyncProfile::GetServerPassword(TDes& aText)
       
   432 	{
       
   433 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::GetServerPassword:" );
       
   434 	
       
   435 	TUtil::StrCopy( aText, iProfile.ServerPassword() );
       
   436 	}
       
   437 	
       
   438 // -----------------------------------------------------------------------------
       
   439 // CIAUpdateFWSyncProfile::SetServerPasswordL
       
   440 // -----------------------------------------------------------------------------
       
   441 //
       
   442  void CIAUpdateFWSyncProfile::SetServerPasswordL(const TDesC& aText)
       
   443 	{
       
   444 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SetServerPasswordL:" );
       
   445 	
       
   446 	TUtil::StrCopy(iBuf8, aText);    // conver TDes to TDes8
       
   447 	iProfile.SetServerPasswordL(iBuf8);
       
   448 	}
       
   449 
       
   450 // -----------------------------------------------------------------------------
       
   451 // CIAUpdateFWSyncProfile::ProtocolVersion
       
   452 // -----------------------------------------------------------------------------
       
   453 //
       
   454  TInt CIAUpdateFWSyncProfile::ProtocolVersion()
       
   455 	{
       
   456 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::ProtocolVersion:" );
       
   457 	
       
   458 	TSmlProtocolVersion version = iProfile.ProtocolVersion();
       
   459 	return version;
       
   460 	}
       
   461 	
       
   462 // -----------------------------------------------------------------------------
       
   463 // CIAUpdateFWSyncProfile::SetProtocolVersionL
       
   464 // -----------------------------------------------------------------------------
       
   465 //
       
   466  void CIAUpdateFWSyncProfile::SetProtocolVersionL(TInt aProtocolVersion)
       
   467 	{
       
   468 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SetProtocolVersionL:" );
       
   469 	
       
   470 	iProfile.SetProtocolVersionL((TSmlProtocolVersion) aProtocolVersion);
       
   471     }
       
   472 
       
   473 // -----------------------------------------------------------------------------
       
   474 // CIAUpdateFWSyncProfile::BearerType
       
   475 // -----------------------------------------------------------------------------
       
   476 //
       
   477  TInt CIAUpdateFWSyncProfile::BearerType()
       
   478 	{
       
   479 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::BearerType:" );
       
   480 	
       
   481 	TInt id = iConnection.Identifier();
       
   482 	
       
   483 	if (id == KUidNSmlMediumTypeInternet.iUid)
       
   484 		{
       
   485 		return EAspBearerInternet;
       
   486 		}
       
   487 	else if (id == KUidNSmlMediumTypeBluetooth.iUid)
       
   488 		{
       
   489 		return EAspBearerBlueTooth;
       
   490 		}
       
   491 	else
       
   492 		{
       
   493 		return EAspBearerInternet;
       
   494 		}
       
   495 
       
   496     }
       
   497 	
       
   498 // -----------------------------------------------------------------------------
       
   499 // CIAUpdateFWSyncProfile::SetBearerTypeL
       
   500 // -----------------------------------------------------------------------------
       
   501 //
       
   502  void CIAUpdateFWSyncProfile::SetBearerTypeL(TInt aId)
       
   503 	{
       
   504 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SetBearerTypeL:" );
       
   505 
       
   506 	if ( aId == EAspBearerInternet )
       
   507 		{
       
   508 		iConnection.CreateL( Profile(), KUidNSmlMediumTypeInternet.iUid );
       
   509 		}
       
   510 	else if ( aId == EAspBearerBlueTooth )
       
   511 		{
       
   512 		iConnection.CreateL( Profile(), KUidNSmlMediumTypeBluetooth.iUid );
       
   513     	}
       
   514 	else
       
   515         {
       
   516         // Set default as Internet
       
   517         iConnection.CreateL( Profile(), KUidNSmlMediumTypeInternet.iUid );
       
   518         }
       
   519 	}
       
   520 
       
   521 // -----------------------------------------------------------------------------
       
   522 // CIAUpdateFWSyncProfile::AccessPointL
       
   523 // -----------------------------------------------------------------------------
       
   524 //
       
   525  TInt CIAUpdateFWSyncProfile::AccessPointL()
       
   526 	{
       
   527 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::AccessPointL:" );
       
   528 	
       
   529 	TInt num = KErrNotFound;
       
   530 	
       
   531 	if ( iConnectionOpen )
       
   532 		{
       
   533 	    if ( iConnection.Identifier() == KUidNSmlMediumTypeInternet.iUid )
       
   534 	        {
       
   535         	TBuf8<KBufSize32> key;
       
   536         	TBuf<KBufSize32> value;
       
   537 
       
   538         	GetConnectionPropertyNameL( key, EPropertyIntenetAccessPoint );
       
   539         	TUtil::StrCopy( value, iConnection.GetPropertyL( key ) );
       
   540         	User::LeaveIfError( TUtil::StrToInt(value, num) );
       
   541 	        }
       
   542 		}
       
   543 	return num;
       
   544 	}
       
   545 	
       
   546 // -----------------------------------------------------------------------------
       
   547 // CIAUpdateFWSyncProfile::SetAccessPointL
       
   548 // -----------------------------------------------------------------------------
       
   549 //
       
   550  void CIAUpdateFWSyncProfile::SetAccessPointL( const TInt aId )
       
   551 	{
       
   552 	FTRACE(RDebug::Print(
       
   553 	         _L("[IAUPDATEFW] CIAUpdateFWSyncProfile::SetAccessPointL aId (%d)"), aId));
       
   554 
       
   555 	if ( iConnectionOpen )
       
   556 		{
       
   557 		
       
   558 		FLOG("[IAUPDATEFW] CIAUpdateFWSyncProfile::SetAccessPointL Connection is open");
       
   559 		
       
   560 	    if ( iConnection.Identifier() == KUidNSmlMediumTypeInternet.iUid )
       
   561 	        { 
       
   562 			FLOG("[IAUPDATEFW] CIAUpdateFWSyncProfile::SetAccessPointL identifier found");
       
   563 	
       
   564 	       	TBuf<KBufSize32> buf;
       
   565         	TBuf8<KBufSize32> key;
       
   566         	TBuf8<KBufSize32> value;
       
   567         	
       
   568         	buf.Num(aId);
       
   569         	TUtil::StrCopy(value, buf);  // convert TDes to TDes8
       
   570         	
       
   571         	GetConnectionPropertyNameL(key, EPropertyIntenetAccessPoint);
       
   572         	
       
   573         	FTRACE(RDebug::Print(
       
   574         	    _L("[IAUPDATEFW] CIAUpdateFWSyncProfile::SetAccessPointL key (%S) value (%S)"),
       
   575         	    &key, &value ) );
       
   576         	    
       
   577         	iConnection.SetPropertyL( key, value );
       
   578 	        }
       
   579 	        
       
   580 		}
       
   581 		else
       
   582 		{
       
   583 		
       
   584 		FLOG("[IAUPDATEFW] CIAUpdateFWSyncProfile::SetAccessPointL Connection is not open");			
       
   585 		
       
   586 		}
       
   587 	}
       
   588 
       
   589 // -----------------------------------------------------------------------------
       
   590 // CIAUpdateFWSyncProfile::GetHostAddressL
       
   591 // -----------------------------------------------------------------------------
       
   592 //
       
   593  void CIAUpdateFWSyncProfile::GetHostAddress(TDes& aText, TInt& aPort)
       
   594 	{
       
   595 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::GetHostAddress:" );
       
   596 	aText = KNullDesC;
       
   597 	aPort = KDefaultHttpPort;
       
   598 	
       
   599     if (!iConnectionOpen)	
       
   600     	{
       
   601       	return;
       
   602     	}
       
   603 	
       
   604 	if (BearerType() != EAspBearerInternet)
       
   605 		{
       
   606 		TUtil::StrCopy(aText, iConnection.ServerURI()); // convert TDes8 to TDes
       
   607 		return;  // port number handling is for internet bearer only 
       
   608 		}
       
   609 	
       
   610 	TUtil::StrCopy( iBuf, iConnection.ServerURI() ); // convert TDes8 to TDes
       
   611 	
       
   612 	TURIParser parser( iBuf );
       
   613 	parser.GetUriWithoutPort( aText );
       
   614 	aPort = parser.Port();
       
   615 	if (aPort == KErrNotFound)
       
   616 		{
       
   617 		aPort = parser.DefaultPort();
       
   618 		}
       
   619 	}
       
   620 	
       
   621 // -----------------------------------------------------------------------------
       
   622 // CIAUpdateFWSyncProfile::SetHostAddressL
       
   623 // -----------------------------------------------------------------------------
       
   624 //
       
   625  void CIAUpdateFWSyncProfile::SetHostAddressL( const TDesC& aText, const TInt aPort )
       
   626 	{
       
   627 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SetHostAddressL:" );
       
   628 	
       
   629     if (!iConnectionOpen)	
       
   630     	{
       
   631     	return;
       
   632     	}
       
   633 	if (BearerType() != EAspBearerInternet)
       
   634 		{
       
   635 		// port number handling is for internet bearer only 
       
   636 		TUtil::StrCopy(iBuf, aText); 
       
   637 		}
       
   638 	else
       
   639 		{
       
   640 		TURIParser parser(aText);
       
   641 	    parser.GetUri(iBuf, aPort);
       
   642 		}
       
   643 	
       
   644 	TUtil::StrCopy( iBuf8, iBuf );
       
   645 	iConnection.SetServerURIL( iBuf8 );
       
   646 	}
       
   647 
       
   648 // -----------------------------------------------------------------------------
       
   649 // CIAUpdateFWSyncProfile::GetUserNameL
       
   650 // -----------------------------------------------------------------------------
       
   651 //
       
   652  void CIAUpdateFWSyncProfile::GetUserName(TDes& aText)
       
   653 	{
       
   654 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::GetUserNameL:" );
       
   655 	
       
   656 	TUtil::StrCopy( aText, iProfile.UserName() );
       
   657 	}
       
   658 	
       
   659 // -----------------------------------------------------------------------------
       
   660 // CIAUpdateFWSyncProfile::SetUserNameL
       
   661 // -----------------------------------------------------------------------------
       
   662 //
       
   663  void CIAUpdateFWSyncProfile::SetUserNameL(const TDesC& aText)
       
   664 	{
       
   665 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SetUserNameL:" );
       
   666 	
       
   667 	TUtil::StrCopy(iBuf8, aText);  // conver TDes to TDes8
       
   668 	iProfile.SetUserNameL(iBuf8);
       
   669 	}
       
   670 
       
   671 // -----------------------------------------------------------------------------
       
   672 // CIAUpdateFWSyncProfile::GetPasswordL
       
   673 // -----------------------------------------------------------------------------
       
   674 //
       
   675  void CIAUpdateFWSyncProfile::GetPassword(TDes& aText)
       
   676 	{
       
   677 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::GetPasswordL:" );
       
   678 	
       
   679 	TUtil::StrCopy( aText, iProfile.Password() );
       
   680 	}
       
   681 	
       
   682 // -----------------------------------------------------------------------------
       
   683 // CIAUpdateFWSyncProfile::SetPasswordL
       
   684 // -----------------------------------------------------------------------------
       
   685 //
       
   686  void CIAUpdateFWSyncProfile::SetPasswordL(const TDesC& aText)
       
   687 	{
       
   688 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SetPasswordL:" );
       
   689 	TUtil::StrCopy( iBuf8, aText );    // conver TDes to TDes8
       
   690 	
       
   691 	FTRACE( RDebug::Print(
       
   692 	     _L("[IAUPDATEFW] CIAUpdateFWSyncProfile::SetPasswordL iBuf8 (%S)"), &iBuf8 ) );
       
   693 	iProfile.SetPasswordL( iBuf8 );
       
   694 	}
       
   695 
       
   696 // -----------------------------------------------------------------------------
       
   697 // CIAUpdateFWSyncProfile::SASyncState
       
   698 // -----------------------------------------------------------------------------
       
   699 //
       
   700  TInt CIAUpdateFWSyncProfile::SASyncState()
       
   701 	{
       
   702 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SASyncState()" );
       
   703 	
       
   704 	TSmlServerAlertedAction state = iProfile.SanUserInteraction();
       
   705 
       
   706     FTRACE( FPrint(
       
   707         _L( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SASyncState() completed, state = %d" ),
       
   708         state ) );
       
   709 
       
   710 	if (state == ESmlConfirmSync)
       
   711 		{
       
   712 		return ESASyncStateConfirm;
       
   713 		}
       
   714 	else if (state == ESmlDisableSync)
       
   715 		{
       
   716 		return ESASyncStateDisable;
       
   717 		}
       
   718 	else 
       
   719 		{
       
   720 		return ESASyncStateEnable;
       
   721 		}
       
   722 	}
       
   723 
       
   724 // -----------------------------------------------------------------------------
       
   725 // CIAUpdateFWSyncProfile::SetSASyncStateL
       
   726 // -----------------------------------------------------------------------------
       
   727 //
       
   728  void CIAUpdateFWSyncProfile::SetSASyncStateL(TInt aState)
       
   729     {
       
   730 	if (aState == ESASyncStateConfirm)
       
   731 		{
       
   732 		FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SetSASyncStateL:ESmlConfirmSync" );
       
   733 		Profile().SetSanUserInteractionL(ESmlConfirmSync);
       
   734 		}
       
   735 	else if (aState == ESASyncStateDisable)
       
   736 		{
       
   737 		FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SetSASyncStateL:ESmlDisableSync" );
       
   738 		Profile().SetSanUserInteractionL(ESmlDisableSync);
       
   739 		}
       
   740 	else
       
   741 		{
       
   742 		FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SetSASyncStateL:ESmlEnableSync" );
       
   743 		Profile().SetSanUserInteractionL(ESmlEnableSync);
       
   744 		}
       
   745     }
       
   746 
       
   747 // -----------------------------------------------------------------------------
       
   748 // CIAUpdateFWSyncProfile::SetHttpUsed
       
   749 // -----------------------------------------------------------------------------
       
   750 //
       
   751  void CIAUpdateFWSyncProfile::SetHttpUsedL(TBool aEnable)
       
   752 	{
       
   753 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SetHttpUsed:" );
       
   754 
       
   755     if ( iConnectionOpen )
       
   756     	{
       
   757     	if ( iConnection.Identifier() == KUidNSmlMediumTypeInternet.iUid )
       
   758 		    {
       
   759         	TBuf8<KBufSize32> key;
       
   760         	TBuf8<KBufSize32> value;
       
   761         	
       
   762         	if ( aEnable )
       
   763         		{
       
   764         		value.Num( KHttpUsed ); 
       
   765         		}
       
   766         	else
       
   767         		{
       
   768         		value.Num( KHttpNotUsed );
       
   769         		}
       
   770         		
       
   771         	GetConnectionPropertyNameL( key, EPropertyHttpUsed );
       
   772         	iConnection.SetPropertyL( key, value );
       
   773 		    }
       
   774     	}
       
   775 	}
       
   776 
       
   777 // -----------------------------------------------------------------------------
       
   778 // CIAUpdateFWSyncProfile::HttpUsedL
       
   779 // -----------------------------------------------------------------------------
       
   780 //
       
   781  TBool CIAUpdateFWSyncProfile::HttpUsedL()
       
   782 	{
       
   783 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::HttpUsedL:" );
       
   784     TBool retVal = EFalse; 
       
   785     if ( iConnectionOpen )
       
   786     	{
       
   787     	if ( iConnection.Identifier() == KUidNSmlMediumTypeInternet.iUid )
       
   788 		    {
       
   789         	TBuf8<KBufSize32> key; 
       
   790         	TBuf<KBufSize32> value;
       
   791         	TInt intValue;
       
   792         	
       
   793         	GetConnectionPropertyNameL(key, EPropertyHttpUsed);
       
   794         	TUtil::StrCopy(value, iConnection.GetPropertyL(key));
       
   795         	
       
   796             User::LeaveIfError( TUtil::StrToInt( value, intValue ) );
       
   797             
       
   798             if ( intValue == 1 )
       
   799             	{
       
   800                 retVal = ETrue;
       
   801                 }
       
   802 		    }
       
   803     	}
       
   804     return retVal;
       
   805 	}
       
   806 	
       
   807 // -----------------------------------------------------------------------------
       
   808 // CIAUpdateFWSyncProfile::GetHttpUsernameL
       
   809 // -----------------------------------------------------------------------------
       
   810 //
       
   811  void CIAUpdateFWSyncProfile::GetHttpUserNameL( TDes& aText )
       
   812 	{
       
   813 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::GetHttpUsernameL:" );
       
   814 
       
   815 	aText = KNullDesC;
       
   816 	
       
   817     if ( iConnectionOpen )
       
   818     	{
       
   819     	if ( iConnection.Identifier() == KUidNSmlMediumTypeInternet.iUid )
       
   820 		    {
       
   821         	TBuf8<KBufSize32> key; 
       
   822         	
       
   823         	GetConnectionPropertyNameL( key, EPropertyHttpUserName );
       
   824         	TUtil::StrCopy( aText, iConnection.GetPropertyL( key ) );
       
   825 		    }
       
   826     	}
       
   827   	}
       
   828 	
       
   829 // -----------------------------------------------------------------------------
       
   830 // CIAUpdateFWSyncProfile::SetHttpUsernameL
       
   831 // -----------------------------------------------------------------------------
       
   832 //
       
   833  void CIAUpdateFWSyncProfile::SetHttpUserNameL( const TDesC& aText )
       
   834 	{
       
   835 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SetHttpUsernameL:" );
       
   836 
       
   837     if ( iConnectionOpen )
       
   838     	{
       
   839     	if ( iConnection.Identifier() == KUidNSmlMediumTypeInternet.iUid )
       
   840 		    {
       
   841 		    TBuf8<KBufSize32> key;
       
   842 	
       
   843 	        GetConnectionPropertyNameL( key, EPropertyHttpUserName );
       
   844 	        TUtil::StrCopy( iBuf8, aText );  // convert TDes to TDes8
       
   845 	        iConnection.SetPropertyL( key, iBuf8 );
       
   846 		    }
       
   847     	}
       
   848 	}
       
   849 
       
   850 // -----------------------------------------------------------------------------
       
   851 // CIAUpdateFWSyncProfile::GetHttpPasswordL
       
   852 // -----------------------------------------------------------------------------
       
   853 //
       
   854  void CIAUpdateFWSyncProfile::GetHttpPasswordL( TDes& aText )
       
   855 	{
       
   856 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::GetHttpPasswordL:" );
       
   857    	aText = KNullDesC;
       
   858    	
       
   859     if ( iConnectionOpen )
       
   860     	{
       
   861     	if ( iConnection.Identifier() == KUidNSmlMediumTypeInternet.iUid )
       
   862 		    {
       
   863 		    TBuf8<KBufSize32> key; 
       
   864 	        GetConnectionPropertyNameL( key, EPropertyHttpPassword );
       
   865             TUtil::StrCopy( aText, iConnection.GetPropertyL( key ) );
       
   866 		    }
       
   867     	}
       
   868 	}
       
   869 	
       
   870 // -----------------------------------------------------------------------------
       
   871 // CIAUpdateFWSyncProfile::SetHttpPasswordL
       
   872 // -----------------------------------------------------------------------------
       
   873 //
       
   874  void CIAUpdateFWSyncProfile::SetHttpPasswordL( const TDesC& aText )
       
   875 	{
       
   876 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::SetHttpPasswordL:" );
       
   877 
       
   878     if ( iConnectionOpen )
       
   879     	{
       
   880     	if ( iConnection.Identifier() == KUidNSmlMediumTypeInternet.iUid )
       
   881 		    {
       
   882         	TBuf8<KBufSize32> key;
       
   883         	
       
   884         	GetConnectionPropertyNameL( key, EPropertyHttpPassword );
       
   885         	TUtil::StrCopy( iBuf8, aText );  // convert TDes to TDes8
       
   886         	iConnection.SetPropertyL( key, iBuf8 );
       
   887     	    }
       
   888     	}
       
   889 	}
       
   890  
       
   891 // -----------------------------------------------------------------------------
       
   892 // CIAUpdateFWSyncProfile::Profile
       
   893 // -----------------------------------------------------------------------------
       
   894 //
       
   895  RSyncMLDevManProfile& CIAUpdateFWSyncProfile::Profile()
       
   896     {
       
   897     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::Profile()" );
       
   898     
       
   899     return iProfile;
       
   900     }
       
   901 
       
   902 // -----------------------------------------------------------------------------
       
   903 // CIAUpdateFWSyncProfile::LatestHistoryJob
       
   904 // -----------------------------------------------------------------------------
       
   905 //
       
   906  const CSyncMLHistoryJob* CIAUpdateFWSyncProfile::LatestHistoryJob()
       
   907     {
       
   908     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::LatestHistoryJob:" );
       
   909     
       
   910     if ( !iHistoryLogOpen )
       
   911 		{
       
   912         OpenHistoryLog();
       
   913 		}
       
   914 		
       
   915     if ( iHistoryLogOpen )
       
   916 		{
       
   917 	    TInt count = iHistoryLog.Count();
       
   918         FTRACE( FPrint( _L(
       
   919             "[IAUPDATEFW] CIAUpdateFWSyncProfile::LatestHistoryJob(): Log count %d"),
       
   920             count ) );
       
   921 
       
   922         if ( count == 0 )
       
   923             {
       
   924             FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::LatestHistoryJob(): No history" );
       
   925             return NULL;  // profile has no history job
       
   926             }
       
   927             
       
   928         // sort array
       
   929         iHistoryLog.SortEntries( CSyncMLHistoryEntry::ESortByTime );    
       
   930         
       
   931         // try to find latest sync job (start from last array entry)
       
   932         for ( TInt index = count - 1; index >= 0; index-- )
       
   933         	{
       
   934         	FTRACE( FPrint( _L(
       
   935         	    "[IAUPDATEFW] CIAUpdateFWSyncProfile::LatestHistoryJob: count %d index %d"),
       
   936         	    count, index ) );
       
   937             //const CSyncMLHistoryEntry& entry = iHistoryLog[index];
       
   938             const CSyncMLHistoryEntry& entry = iHistoryLog.Entry( index );
       
   939             
       
   940         	FTRACE( FPrint( _L(
       
   941         	    "[IAUPDATEFW] CIAUpdateFWSyncProfile::LatestHistoryJob: Entry type = %x"),
       
   942         	    entry.EntryType().iUid ) );
       
   943             
       
   944             const CSyncMLHistoryJob* jobEntry =
       
   945                 CSyncMLHistoryJob::DynamicCast( &entry );
       
   946 
       
   947             if ( jobEntry )
       
   948             	{
       
   949             	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::LatestHistoryJob() completed: OK" );
       
   950             	return jobEntry;
       
   951             	}
       
   952         	}
       
   953 		}
       
   954 
       
   955     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::LatestHistoryJob() completed: No history found" );
       
   956     return NULL;  // profile has no history job
       
   957     }
       
   958 
       
   959 // -----------------------------------------------------------------------------
       
   960 // CIAUpdateFWSyncProfile::OpenHistoryLog
       
   961 // -----------------------------------------------------------------------------
       
   962 //
       
   963  void CIAUpdateFWSyncProfile::OpenHistoryLog()
       
   964     {
       
   965     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::OpenHistoryLog()" );
       
   966     
       
   967     TInt id = ProfileId();
       
   968    	TRAPD( err, iHistoryLog.OpenL( Session(), id ) );
       
   969 
       
   970    	if ( err == KErrNone )
       
   971    		{
       
   972    		FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::OpenHistoryLog(): Opened" );
       
   973    		iHistoryLogOpen = ETrue;
       
   974     	}
       
   975 
       
   976     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::OpenHistoryLog() completed" );
       
   977     }
       
   978     
       
   979 // -----------------------------------------------------------------------------
       
   980 // CIAUpdateFWSyncProfile::CloseHistoryLog
       
   981 // -----------------------------------------------------------------------------
       
   982 //
       
   983  void CIAUpdateFWSyncProfile::CloseHistoryLog()
       
   984     {
       
   985     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::CloseHistoryLog()" );
       
   986     
       
   987    	if ( iHistoryLogOpen )
       
   988    		{
       
   989    		FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::CloseHistoryLog(): Closed " );
       
   990    		iHistoryLog.Close();
       
   991    		iHistoryLogOpen = EFalse;
       
   992     	}
       
   993 
       
   994     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::CloseHistoryLog() completed" );
       
   995     }
       
   996     
       
   997 // -----------------------------------------------------------------------------
       
   998 // CIAUpdateFWSyncProfile::OpenConnection
       
   999 // -----------------------------------------------------------------------------
       
  1000 //
       
  1001  void CIAUpdateFWSyncProfile::OpenConnection()
       
  1002     {
       
  1003     FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::OpenConnection()" );
       
  1004         
       
  1005    	TInt err = KErrNone;
       
  1006    	RArray<TSmlTransportId> arr;
       
  1007    	
       
  1008     TRAP( err, Profile().ListConnectionsL(arr) );
       
  1009     if ( err != KErrNone )
       
  1010     	{
       
  1011     	return; 
       
  1012     	}
       
  1013     if ( arr.Count() == 0 )
       
  1014     	{
       
  1015      	arr.Close();  
       
  1016     	return; // no connection
       
  1017     	}
       
  1018         	
       
  1019     TInt transportId = arr[0];
       
  1020     arr.Close();
       
  1021     	
       
  1022     TRAP( err, iConnection.OpenL( iProfile, transportId ) );
       
  1023     if ( err == KErrNone )
       
  1024     	{
       
  1025     	iConnectionOpen = ETrue;
       
  1026     	}
       
  1027 
       
  1028     FTRACE( FPrint( _L(
       
  1029         "[IAUPDATEFW] CIAUpdateFWSyncProfile::OpenConnection() completed, err = %d" ),
       
  1030         err ) );
       
  1031     }
       
  1032 
       
  1033 // -----------------------------------------------------------------------------
       
  1034 // CIAUpdateFWSyncProfile::Session
       
  1035 // -----------------------------------------------------------------------------
       
  1036 //
       
  1037  RSyncMLSession& CIAUpdateFWSyncProfile::Session()
       
  1038 	{
       
  1039 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::Session:" );
       
  1040 	
       
  1041 	return *iSyncSession;
       
  1042 	}
       
  1043 
       
  1044 // -----------------------------------------------------------------------------
       
  1045 // CIAUpdateFWSyncProfile::GetConnectionPropertyNameL
       
  1046 // -----------------------------------------------------------------------------
       
  1047 //
       
  1048  void CIAUpdateFWSyncProfile::GetConnectionPropertyNameL( TDes8& aText,
       
  1049                                                      TInt aPropertyPos )
       
  1050 	{
       
  1051 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::GetConnectionPropertyNameL:" );
       
  1052 	
       
  1053 	// at the moment RSyncMLTransport is only needed
       
  1054 	// for internet connection settings
       
  1055 	RSyncMLTransport transport;
       
  1056 	CleanupClosePushL( transport );
       
  1057 	transport.OpenL( Session(), KUidNSmlMediumTypeInternet.iUid );
       
  1058 
       
  1059 	const CSyncMLTransportPropertiesArray&  arr = transport.Properties();
       
  1060 
       
  1061     __ASSERT_DEBUG( arr.Count() > aPropertyPos, TUtil::Panic( KErrGeneral ) );
       
  1062 
       
  1063 	const TSyncMLTransportPropertyInfo& info = arr.At( aPropertyPos );
       
  1064 	aText = info.iName;
       
  1065 	CleanupStack::PopAndDestroy( &transport );
       
  1066 	
       
  1067 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::GetConnectionPropertyNameL() completed" );
       
  1068 	}
       
  1069 
       
  1070 // -----------------------------------------------------------------------------
       
  1071 // CIAUpdateFWSyncProfile::CopyValuesL
       
  1072 // -----------------------------------------------------------------------------
       
  1073 //
       
  1074 void CIAUpdateFWSyncProfile::CopyValuesL( CIAUpdateFWSyncProfile* aSource )
       
  1075     {
       
  1076 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::CopyValuesL()" );
       
  1077 
       
  1078     TBuf<KBufSize256> buf;
       
  1079     TInt num = 0;
       
  1080     
       
  1081     num = aSource->ProtocolVersion();
       
  1082     SetProtocolVersionL( num );
       
  1083     if ( num == 1 )
       
  1084     	{
       
  1085     	aSource->GetServerId( buf );
       
  1086     	SetServerIdL( buf );
       
  1087     	}
       
  1088     	
       
  1089     num = aSource->BearerType();
       
  1090     SetBearerTypeL( num );
       
  1091     
       
  1092      num = aSource->AccessPointL();
       
  1093     SetAccessPointL( num );
       
  1094     
       
  1095     aSource->GetHostAddress( buf, num );
       
  1096     SetHostAddressL( buf, num );
       
  1097      
       
  1098     aSource->GetUserName( buf );
       
  1099     SetUserNameL(buf);
       
  1100      
       
  1101     aSource->GetPassword( buf );
       
  1102     SetPasswordL( buf );
       
  1103     
       
  1104     num = aSource->SASyncState();
       
  1105     SetSASyncStateL( num );
       
  1106     
       
  1107     if ( aSource->BearerType() == EAspBearerInternet)
       
  1108     	{
       
  1109     	num = aSource->HttpUsedL();
       
  1110     	SetHttpUsedL(num);
       
  1111     	
       
  1112     	aSource->GetHttpUserNameL(buf);
       
  1113     	SetHttpUserNameL(buf);
       
  1114     	
       
  1115     	aSource->GetHttpPasswordL(buf);
       
  1116     	SetHttpPasswordL(buf);
       
  1117     	}
       
  1118 	FLOG( "[IAUPDATEFW] CIAUpdateFWSyncProfile::CopyValuesL() completed" );
       
  1119     }
       
  1120     
       
  1121 // End of File