# HG changeset patch # User hgs # Date 1272057093 -10800 # Node ID ce4f184690c96773986fb280bb096a7e799eaf3a # Parent ec1b007b6296d94258293f854b54baaf9c09e44d 201009 diff -r ec1b007b6296 -r ce4f184690c9 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/Bld.inf --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/Bld.inf Fri Apr 23 23:56:14 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Build information file for LcStylusTapTest -* -*/ - - -PRJ_PLATFORMS -// specify the platforms your component needs to be built for here -// defaults to WINS MARM so you can ignore this if you just build these -DEFAULT - -PRJ_TESTEXPORTS -// NOTE: If using ARS requirements all export operations should be done under this. -// 'abld test export' - -PRJ_EXPORTS -// Specify the source file followed by its destination here -// copy will be used to copy the source file to its destination -// If there's no destination then the source file will be copied -// to the same name in /epoc32/include -// Example: -/* -/agnmodel/inc/AGMCOMON.H -*/ - -PRJ_TESTMMPFILES -LcStylusTapTest.mmp - -PRJ_MMPFILES -LcStylusTapTest_exe.mmp -//LcStylusTapTest_nrm.mmp - -// Specify the .mmp files required for building the important component -// releasables. -// -// Specify "tidy" if the component you need to build doesn't need to be -// released. Specify "ignore" if the MMP file exists but should be -// ignored. -// Example: -/* -/agnmodel/group/agnmodel.mmp -#if defined(MARM) -/agnmodel/group/agsvexe.mmp -#endif -*/ - -// End of File diff -r ec1b007b6296 -r ce4f184690c9 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/bld.inf Sat Apr 24 00:11:33 2010 +0300 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for LcStylusTapTest +* +*/ + + +PRJ_PLATFORMS +// specify the platforms your component needs to be built for here +// defaults to WINS MARM so you can ignore this if you just build these +DEFAULT + +PRJ_TESTEXPORTS +// NOTE: If using ARS requirements all export operations should be done under this. +// 'abld test export' + +PRJ_EXPORTS +// Specify the source file followed by its destination here +// copy will be used to copy the source file to its destination +// If there's no destination then the source file will be copied +// to the same name in /epoc32/include +// Example: +/* +/agnmodel/inc/AGMCOMON.H +*/ + +PRJ_TESTMMPFILES +LcStylusTapTest.mmp + +PRJ_MMPFILES +LcStylusTapTest_exe.mmp +//LcStylusTapTest_nrm.mmp + +// Specify the .mmp files required for building the important component +// releasables. +// +// Specify "tidy" if the component you need to build doesn't need to be +// released. Specify "ignore" if the MMP file exists but should be +// ignored. +// Example: +/* +/agnmodel/group/agnmodel.mmp +#if defined(MARM) +/agnmodel/group/agsvexe.mmp +#endif +*/ + +// End of File diff -r ec1b007b6296 -r ce4f184690c9 localconnectivityservice/modematplugin/src/atcopscmd.cpp --- a/localconnectivityservice/modematplugin/src/atcopscmd.cpp Fri Apr 23 23:56:14 2010 +0300 +++ b/localconnectivityservice/modematplugin/src/atcopscmd.cpp Sat Apr 24 00:11:33 2010 +0300 @@ -732,12 +732,21 @@ break; case ESetSystemNetworkBand: case EManuallyRegisterToNetworkAndChooseAccTech: - // Cannot set the access technology, so set it back to EAccTechNotSet. - // This prevents replying to queries with outdated or incorrect acc tech information. - TRACE_INFO( _L("CATCOPSCmd::RunL() couldn't set system network band, so reset access tech.")); - iAccTech = EAccTechNotSet; - // Fall through to default, because these require an error response. - + if(iRegistrationMode == EModeManualAutomatic) + { + // Manual registration failed, try automatic next. + TRACE_INFO( _L("CATCOPSCmd::RunL() registration mode manual automatic, try automatic.")); + AutomaticNetworkRegistration(); + break; + } + else + { + // Cannot set the access technology, so set it back to EAccTechNotSet. + // This prevents replying to queries with outdated or incorrect acc tech information. + TRACE_INFO( _L("CATCOPSCmd::RunL() couldn't set system network band, so reset access tech.")); + iAccTech = EAccTechNotSet; + // Fall through to default, because these require an error response. + } default: // In all other cases send back an error response. TRACE_INFO( _L("CATCOPSCmd::RunL() reply an error.")); diff -r ec1b007b6296 -r ce4f184690c9 localconnectivityservice/obexsendservices/obexservicebtsend/src/btsssendlisthandler.cpp --- a/localconnectivityservice/obexsendservices/obexservicebtsend/src/btsssendlisthandler.cpp Fri Apr 23 23:56:14 2010 +0300 +++ b/localconnectivityservice/obexsendservices/obexservicebtsend/src/btsssendlisthandler.cpp Sat Apr 24 00:11:33 2010 +0300 @@ -20,7 +20,7 @@ #include #include "BTSSSendListHandler.h" -#include "btserviceparameterlist.h" +#include "BTServiceParameterList.h" #include "BTSendingServiceDebug.h" diff -r ec1b007b6296 -r ce4f184690c9 localconnectivityservice/obexserviceman/group/bld.inf --- a/localconnectivityservice/obexserviceman/group/bld.inf Fri Apr 23 23:56:14 2010 +0300 +++ b/localconnectivityservice/obexserviceman/group/bld.inf Sat Apr 24 00:11:33 2010 +0300 @@ -33,12 +33,13 @@ ../conf/obexserviceman.confml MW_LAYER_CONFML(obexserviceman.confml) ../conf/obexserviceman_20016BC5.crml MW_LAYER_CRML(obexserviceman_20016BC5.crml) +../obexservicemanserver/inc/obexservicemanprop.h MW_LAYER_PLATFORM_EXPORT_PATH(obexservicemanprop.h) + // Backup registration file backup_registration.xml /epoc32/data/z/private/101f7c87/backup_registration.xml backup_registration.xml /epoc32/release/winscw/udeb/z/private/101f7c87/backup_registration.xml backup_registration.xml /epoc32/release/winscw/urel/z/private/101f7c87/backup_registration.xml -../obexservicemanclient/inc/usbobex.h |../../../inc/usbobex.h ../rom/obex.iby /epoc32/rom/include/obex.iby ../rom/obex.iby CORE_MW_LAYER_IBY_EXPORT_PATH(obex.iby) diff -r ec1b007b6296 -r ce4f184690c9 localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsServiceManager.h --- a/localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsServiceManager.h Fri Apr 23 23:56:14 2010 +0300 +++ b/localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsServiceManager.h Sat Apr 24 00:11:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -141,12 +141,17 @@ void ServiceArray(CArrayPtr &aTransport, TBool aState); private: - + /** * C++ default constructor. */ CSrcsServiceManager(); + /* + * Perform service controllers post-initialization + */ + void PostInitialize(CArrayPtr &aTransport); + CArrayPtr* iBTConnectionArray; // array of BT Connections CArrayPtr* iUSBConnectionArray; // array of USB Connections CArrayPtr* iIrDAConnectionArray; // array of IrDA Connections @@ -155,6 +160,8 @@ RMessage2 iMessage; TInt iErrorState; TPtrC8 iTransportName; // Service name + TSrcsTransport iTransportType; // Service type + TBool iTransportState; // Service On/Off }; #endif // SRCSSERVICEMANAGER_H diff -r ec1b007b6296 -r ce4f184690c9 localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsTransport.h --- a/localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsTransport.h Fri Apr 23 23:56:14 2010 +0300 +++ b/localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsTransport.h Sat Apr 24 00:11:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -89,7 +89,17 @@ * false: OBEX service is inactive. */ virtual TBool IsOBEXActive() = 0; - + + /** + * Perform any outstanding initialization tasks. + * + * The transport may decide to implement two-phase initialization to improve performance where needed. + * For instance, USB Transport has to register all service controller's interfaces and complete the message from obex class controller + * as soon as possible to satisfy timing requirements and defer service controller plugin creation to later stage. + * + * @return none. + */ + virtual void PostInitializeL(); protected: diff -r ec1b007b6296 -r ce4f184690c9 localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsTransport.inl --- a/localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsTransport.inl Fri Apr 23 23:56:14 2010 +0300 +++ b/localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsTransport.inl Sat Apr 24 00:11:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -69,3 +69,6 @@ REComSession::ListImplementationsL(KCSrcsTransportUid, resolverParams, aImplInfoArray); } +inline void CSrcsTransport::PostInitializeL() + { + } diff -r ec1b007b6296 -r ce4f184690c9 localconnectivityservice/obexserviceman/obexservicemanserver/inc/obexservicemanprop.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/localconnectivityservice/obexserviceman/obexservicemanserver/inc/obexservicemanprop.h Sat Apr 24 00:11:33 2010 +0300 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * Obex Service Manager P&S keys definitions + * + */ + +#ifndef __OBEXSERVICEMANPROP_H__ +#define __OBEXSERVICEMANPROP_H__ + +#include + +const TUid KUidObexSMCategory = {0x101F7C87}; +const TUint KObexSMPostInitErrorProperty = 1; // Post Initialization Error Code + +#endif diff -r ec1b007b6296 -r ce4f184690c9 localconnectivityservice/obexserviceman/obexservicemanserver/src/SrcsServiceManager.cpp --- a/localconnectivityservice/obexserviceman/obexservicemanserver/src/SrcsServiceManager.cpp Fri Apr 23 23:56:14 2010 +0300 +++ b/localconnectivityservice/obexserviceman/obexservicemanserver/src/SrcsServiceManager.cpp Sat Apr 24 00:11:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -20,6 +20,8 @@ // INCLUDE FILES #include "SrcsServiceManager.h" #include "debug.h" +#include +#include "obexservicemanprop.h" // CONSTANTS @@ -27,6 +29,10 @@ // The granularity of the array used to hold BT, IrDA and USB connnection objects static const TInt KConnectionArrayGranularity = 4; +const TUint32 KObexSMSid = {0x101F7C87}; +static _LIT_SECURITY_POLICY_S0(KObexSMOnlyPolicy,KObexSMSid); +static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy); + // ================= MEMBER FUNCTIONS ======================= @@ -46,7 +52,8 @@ // CSrcsServiceManager::~CSrcsServiceManager() { - Cancel(); + Cancel(); + RProperty::Delete(KUidObexSMCategory, KObexSMPostInitErrorProperty); if ( iBTConnectionArray ) { // Cleanup the array @@ -95,6 +102,13 @@ iBTConnectionArray = new(ELeave) CArrayPtrFlat(KConnectionArrayGranularity); iUSBConnectionArray = new(ELeave) CArrayPtrFlat(KConnectionArrayGranularity); iIrDAConnectionArray = new(ELeave) CArrayPtrFlat(KConnectionArrayGranularity); + + TInt err = RProperty::Define(KUidObexSMCategory, KObexSMPostInitErrorProperty, RProperty::EInt, KAllowAllPolicy, KObexSMOnlyPolicy); + if ( err != KErrNone && err != KErrAlreadyExists ) + { + User::LeaveIfError(err); + } + (void)RProperty::Set(KUidObexSMCategory,KObexSMPostInitErrorProperty,KErrNone); } // --------------------------------------------------------- @@ -132,7 +146,9 @@ { FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: DoManageServices")); iObserver=aObserver; - iMessage=aMessage; + iMessage=aMessage; + iTransportType = aTransport; + iTransportState = aState; TRAPD(error,RealDoManageServiceL(aTransport,aState)); if (error != KErrNone) { @@ -152,6 +168,35 @@ { FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: RunL")); iObserver->RequestCompleted(iMessage,iStatus.Int()); + + // If the transport is being turned on, launch post-initialization routine + // for appropriate service controllers array + if (iTransportState) + { + switch(iTransportType) + { + case ESrcsTransportBT: + FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: RunL(Bluetooth)")); + PostInitialize(*iBTConnectionArray); + break; + case ESrcsTransportUSB: + FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: RunL(USB)")); + PostInitialize(*iUSBConnectionArray); + break; + case ESrcsTransportIrDA: + FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: RunL(IrDA)")); + PostInitialize(*iIrDAConnectionArray); + break; + default: + FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServicesL. Transport not supported."))); + break; + } + } + else + { + FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: RunL() - transport is turned off")); + } + FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: RunL exit")); } // --------------------------------------------------------- @@ -177,7 +222,7 @@ void CSrcsServiceManager::RealDoManageServiceL(TSrcsTransport aTransport, TBool aState) { FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: RealDoManageServiceL")); - + switch(aTransport) { case ESrcsTransportBT: @@ -276,17 +321,52 @@ } // Clean up - infoArrayTranport.ResetAndDestroy(); - infoArrayServiceController.ResetAndDestroy(); - CleanupStack::PopAndDestroy(2); //infoArrayServiceController + infoArrayTranport.ResetAndDestroy(); + infoArrayServiceController.ResetAndDestroy(); + CleanupStack::PopAndDestroy(2); //infoArrayServiceController } } else // turn off service { FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServicesL(Turn OFF)")); - aTransport.ResetAndDestroy(); + aTransport.ResetAndDestroy(); + // This is a special case for USB transport. Clear errors. + if (iTransportType == ESrcsTransportUSB) + { + (void)RProperty::Set(KUidObexSMCategory,KObexSMPostInitErrorProperty,KErrNone); + } } FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: RealDoManageServiceL exit")); - } + } + +// ------------------------------------------------------------------------------------------ +// CSrcsServiceManager +// This function iterates through all detected service controllers for given transport +// and calls post-initialization routines. +// This solution is implemented mainly to satisfy tough timing requirements for USB transport +// ------------------------------------------------------------------------------------------ +// +void CSrcsServiceManager::PostInitialize(CArrayPtr &aTransport) + { + FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: PostInitialize()")); + for (TInt i=0; i < aTransport.Count(); ++i) + { + FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsServiceManager: PostInitilize. Processing Service Controller[%d]"), i)); + TRAPD(err,aTransport[i]->PostInitializeL()); + + // This is a special case for USB transport to notify the USB OBEX class controller about any errors occured + // at Post-Initialization stage. + // Post-initialization is not implemented for Bluetooth and IrDA transports, so there is no need to notify. + if ((err != KErrNone) && (iTransportType == ESrcsTransportUSB)) + { + (void)RProperty::Set(KUidObexSMCategory,KObexSMPostInitErrorProperty,err); + FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsServiceManager: PostInitialize. Transport[%d]::PostInitializeL() returned %d, exiting..."), i, err)); + break; + } + FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: PostInitialize() - DONE post initialization")); + } + FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: PostInitialize() exit")); + } + // End of file diff -r ec1b007b6296 -r ce4f184690c9 localconnectivityservice/obexserviceman/plugins/inc/usb/obexsmusbconnection.h --- a/localconnectivityservice/obexserviceman/plugins/inc/usb/obexsmusbconnection.h Fri Apr 23 23:56:14 2010 +0300 +++ b/localconnectivityservice/obexserviceman/plugins/inc/usb/obexsmusbconnection.h Sat Apr 24 00:11:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -55,8 +55,13 @@ * EFalse: OBEX service is inactive. */ TBool IsOBEXActive(); - - + + /** + * Perform any outstanding initialization tasks + * + * @return none. + */ + void PostInitializeL(); private: @@ -96,7 +101,8 @@ private: CObexServer* iServer; // Obex Server CSrcsInterface* iController; // Service Controller callback - CImplementationInformation* iImplementationInfo; // Implementation Info + CImplementationInformation* iImplementationInfo; // Implementation Info + TUid iImplUid; }; #endif // OBEXSMUSBCONNECTION_H diff -r ec1b007b6296 -r ce4f184690c9 localconnectivityservice/obexserviceman/plugins/src/usb/obexsmusbconnection.cpp --- a/localconnectivityservice/obexserviceman/plugins/src/usb/obexsmusbconnection.cpp Fri Apr 23 23:56:14 2010 +0300 +++ b/localconnectivityservice/obexserviceman/plugins/src/usb/obexsmusbconnection.cpp Sat Apr 24 00:11:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -95,12 +95,11 @@ // void CObexSMUsbConnection::ConstructL() { - // Create service controller implementation object - iController = CSrcsInterface::NewL(iImplementationInfo->ImplementationUid()); + // Save service controller implementation UID for deferred initialization + iImplUid = iImplementationInfo->ImplementationUid(); + FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: CSrcsInterface::NewL\t")); - iController->SetMediaType( ESrcsMediaUSB ); - // parsing opaque_data in iImplementationInfo TPtrC8 res_string = iImplementationInfo->OpaqueData(); @@ -173,25 +172,14 @@ // Try to create OBEX server iServer = CObexServer::NewL(obexUsbProtocolInfo, aObexProtocolPolicy); FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: CObexServer::NewL")); - - - - FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: iServer->Start")); - - FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: SetObexServer\t")); - // Try to start server - User::LeaveIfError ( iController->SetObexServer( iServer )); - - - // we do not accept Obex passkey for USB transport, so do NOT set callback. - // iServer->SetCallBack( *this ); - // if there is "local who" field if(op_LocalWho.Size()) { User::LeaveIfError ( iServer->SetLocalWho( op_LocalWho ) ); FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: SetLocalWho")); - } + } + + // The rest of initialization procedure is executed in PostInitialzeL() } // --------------------------------------------------------- @@ -219,4 +207,17 @@ return ETrue; } +void CObexSMUsbConnection::PostInitializeL() + { + FTRACE(FPrint(_L("[SRCS] CObexSMUsbConnection: PostInitializeL(%08X)"), iImplUid.iUid)); + + iController = CSrcsInterface::NewL(iImplUid); + iController->SetMediaType( ESrcsMediaUSB ); + + FLOG(_L("[SRCS] CObexSMUsbConnection::PostInitializeL(): SetObexServer\t")); + // Try to start server + User::LeaveIfError ( iController->SetObexServer( iServer )); + FLOG( _L( "[SRCS] CObexSMUsbConnection: PostInitializeL() exits\t" ) ); + } + // End of file