localconnectivityservice/obexserviceman/plugins/src/usb/obexsmusbconnection.cpp
branchRCL_3
changeset 10 a249528449c3
parent 0 c3e98f10fcf4
equal deleted inserted replaced
9:a2f12998bb04 10:a249528449c3
     1 /*
     1 /*
     2 * Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    93 // Method to create BT connections.
    93 // Method to create BT connections.
    94 // ---------------------------------------------------------
    94 // ---------------------------------------------------------
    95 //
    95 //
    96 void CObexSMUsbConnection::ConstructL()
    96 void CObexSMUsbConnection::ConstructL()
    97     {    
    97     {    
    98     // Create service controller implementation object
    98     // Save service controller implementation UID for deferred initialization
    99     iController = CSrcsInterface::NewL(iImplementationInfo->ImplementationUid());
    99     iImplUid = iImplementationInfo->ImplementationUid();
       
   100 
   100     FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: CSrcsInterface::NewL\t"));
   101     FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: CSrcsInterface::NewL\t"));
   101 
       
   102 	iController->SetMediaType( ESrcsMediaUSB );
       
   103 
   102 
   104     // parsing opaque_data in iImplementationInfo
   103     // parsing opaque_data in iImplementationInfo
   105     TPtrC8 res_string = iImplementationInfo->OpaqueData();
   104     TPtrC8 res_string = iImplementationInfo->OpaqueData();
   106     
   105     
   107     CObexUtilsOpaqueData res_data(res_string);
   106     CObexUtilsOpaqueData res_data(res_string);
   171 		aObexProtocolPolicy.ReceiveMtu(), aObexProtocolPolicy.TransmitMtu() ));
   170 		aObexProtocolPolicy.ReceiveMtu(), aObexProtocolPolicy.TransmitMtu() ));
   172 
   171 
   173 	// Try to create OBEX server
   172 	// Try to create OBEX server
   174 	iServer = CObexServer::NewL(obexUsbProtocolInfo, aObexProtocolPolicy);
   173 	iServer = CObexServer::NewL(obexUsbProtocolInfo, aObexProtocolPolicy);
   175     FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: CObexServer::NewL"));
   174     FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: CObexServer::NewL"));
   176 
       
   177     
       
   178     
       
   179     FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: iServer->Start"));
       
   180 
       
   181 	FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: SetObexServer\t"));
       
   182 	// Try to start server 
       
   183 	User::LeaveIfError ( iController->SetObexServer( iServer ));
       
   184 	
       
   185 
       
   186     // we do not accept Obex passkey for USB transport, so do NOT set callback.
       
   187     // iServer->SetCallBack( *this );
       
   188 
       
   189     // if there is "local who" field
   175     // if there is "local who" field
   190     if(op_LocalWho.Size())
   176     if(op_LocalWho.Size())
   191         {
   177         {
   192         User::LeaveIfError ( iServer->SetLocalWho( op_LocalWho ) );
   178         User::LeaveIfError ( iServer->SetLocalWho( op_LocalWho ) );
   193         FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: SetLocalWho"));
   179         FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: SetLocalWho"));
   194         }      
   180         }
       
   181     
       
   182     // The rest of initialization procedure is executed in PostInitialzeL()
   195     }
   183     }
   196 
   184 
   197 // ---------------------------------------------------------
   185 // ---------------------------------------------------------
   198 // GetUserPasswordL(const TDesC& )
   186 // GetUserPasswordL(const TDesC& )
   199 // Purpose: Get the Obex password from user with ObexPasskeyNotifier
   187 // Purpose: Get the Obex password from user with ObexPasskeyNotifier
   217 	{
   205 	{
   218     FLOG( _L( "[SRCS] CSrcsUsbConnection: IsOBEXActive\t" ) );
   206     FLOG( _L( "[SRCS] CSrcsUsbConnection: IsOBEXActive\t" ) );
   219 	return ETrue;	
   207 	return ETrue;	
   220 	}     
   208 	}     
   221 
   209 
       
   210 void CObexSMUsbConnection::PostInitializeL()
       
   211     {
       
   212     FTRACE(FPrint(_L("[SRCS] CObexSMUsbConnection: PostInitializeL(%08X)"), iImplUid.iUid));
       
   213 
       
   214     iController = CSrcsInterface::NewL(iImplUid);
       
   215     iController->SetMediaType( ESrcsMediaUSB );
       
   216 
       
   217     FLOG(_L("[SRCS] CObexSMUsbConnection::PostInitializeL(): SetObexServer\t"));
       
   218     // Try to start server 
       
   219     User::LeaveIfError ( iController->SetObexServer( iServer ));
       
   220     FLOG( _L( "[SRCS] CObexSMUsbConnection: PostInitializeL() exits\t" ) );
       
   221     }
       
   222 
   222 // End of file
   223 // End of file