# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1283259968 -10800 # Node ID 4096754ee773695a010e9eeeae1b72f1655dc826 # Parent 3dcb815346df5062ad1be5f8159efe29fa3f6bd5 Revision: 201033 Kit: 201035 diff -r 3dcb815346df -r 4096754ee773 group/bld.inf --- a/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2006-2009 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 -* -*/ - - - -#include "../shortlinkconn_plat/group/bld.inf" -#include "../localconnectivityservice/group/bld.inf" diff -r 3dcb815346df -r 4096754ee773 layers.sysdef.xml --- a/layers.sysdef.xml Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - -]> - - - - - - - - - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/bwins/dunatextu.def --- a/localconnectivityservice/dun/atext/bwins/dunatextu.def Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -EXPORTS - ?AddCmdModeCallback@CDunAtCmdHandler@@QAEHPAVMDunCmdModeMonitor@@@Z @ 1 NONAME ; int CDunAtCmdHandler::AddCmdModeCallback(class MDunCmdModeMonitor *) - ?AddDataForParsing@CDunAtCmdHandler@@QAEHAAVTDesC8@@AAH@Z @ 2 NONAME ; int CDunAtCmdHandler::AddDataForParsing(class TDesC8 &, int &) - ?ManageAbortRequest@CDunAtCmdHandler@@QAEHXZ @ 3 NONAME ; int CDunAtCmdHandler::ManageAbortRequest(void) - ?NewL@CDunAtCmdHandler@@SAPAV1@PAVMDunAtCmdStatusReporter@@PAVMDunStreamManipulator@@PBVTDesC8@@@Z @ 4 NONAME ; class CDunAtCmdHandler * CDunAtCmdHandler::NewL(class MDunAtCmdStatusReporter *, class MDunStreamManipulator *, class TDesC8 const *) - ?ResetData@CDunAtCmdHandler@@QAEXXZ @ 5 NONAME ; void CDunAtCmdHandler::ResetData(void) - ?SendEchoCharacter@CDunAtCmdHandler@@QAEHPBVTDesC8@@PAVMDunAtCmdEchoer@@@Z @ 6 NONAME ; int CDunAtCmdHandler::SendEchoCharacter(class TDesC8 const *, class MDunAtCmdEchoer *) - ?StartUrc@CDunAtCmdHandler@@QAEHXZ @ 7 NONAME ; int CDunAtCmdHandler::StartUrc(void) - ?Stop@CDunAtCmdHandler@@QAEHXZ @ 8 NONAME ; int CDunAtCmdHandler::Stop(void) - ?StopUrc@CDunAtCmdHandler@@QAEHXZ @ 9 NONAME ; int CDunAtCmdHandler::StopUrc(void) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/eabi/dunatextu.def --- a/localconnectivityservice/dun/atext/eabi/dunatextu.def Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -EXPORTS - _ZN16CDunAtCmdHandler17AddDataForParsingER6TDesC8Ri @ 1 NONAME - _ZN16CDunAtCmdHandler17SendEchoCharacterEPK6TDesC8P15MDunAtCmdEchoer @ 2 NONAME - _ZN16CDunAtCmdHandler18AddCmdModeCallbackEP18MDunCmdModeMonitor @ 3 NONAME - _ZN16CDunAtCmdHandler18ManageAbortRequestEv @ 4 NONAME - _ZN16CDunAtCmdHandler4NewLEP23MDunAtCmdStatusReporterP21MDunStreamManipulatorPK6TDesC8 @ 5 NONAME - _ZN16CDunAtCmdHandler4StopEv @ 6 NONAME - _ZN16CDunAtCmdHandler7StopUrcEv @ 7 NONAME - _ZN16CDunAtCmdHandler8StartUrcEv @ 8 NONAME - _ZN16CDunAtCmdHandler9ResetDataEv @ 9 NONAME - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/group/bld.inf --- a/localconnectivityservice/dun/atext/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2008 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: -* This file provides the information required for building the -* whole of DUN ATEXT -* -*/ - -#include - -PRJ_PLATFORMS - -PRJ_EXPORTS -../../rom/dunatext.iby CORE_MW_LAYER_IBY_EXPORT_PATH(dunatext.iby) - -PRJ_MMPFILES -dunatext.mmp - -PRJ_TESTMMPFILES diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/group/dunatext.mmp --- a/localconnectivityservice/dun/atext/group/dunatext.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2008 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: Project definition file for project DUN ATEXT -* -*/ - - -#include -#include - -TARGET dunatext.dll -TARGETTYPE DLL -UID 0x1000008d 0x2001CBE6 - -CAPABILITY CAP_GENERAL_DLL -VENDORID VID_DEFAULT - -SOURCEPATH ../src -SOURCE DunAtCmdEchoer.cpp -SOURCE DunAtCmdHandler.cpp -SOURCE DunAtCmdPusher.cpp -SOURCE DunAtUrcHandler.cpp -SOURCE DunAtModeListen.cpp -SOURCE DunAtEcomListen.cpp -SOURCE DunAtNvramListen.cpp -SOURCE DunAtSpecialCmdHandler.cpp - -USERINCLUDE ../inc ../../utils/inc - -MW_LAYER_SYSTEMINCLUDE - -// Note: -// The only other SYSTEMINCLUDE should you shall add are Symbian specific ones. -// If there is a S60 header in the subdirectory then that should be -// added into the include statements (like #include ) -//SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE ../../../inc - -LIBRARY atextclient.lib -LIBRARY atextcommon.lib -LIBRARY euser.lib -LIBRARY bafl.lib -DEBUGLIBRARY flogger.lib diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/inc/DunAtCmdEchoer.h --- a/localconnectivityservice/dun/atext/inc/DunAtCmdEchoer.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/* -* 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: Echoer for AT commands -* -*/ - -#ifndef C_CDUNATCMDECHOER_H -#define C_CDUNATCMDECHOER_H - -#include "DunDataPusher.h" - -class MDunStreamManipulator; - -/** - * Notification interface class for text mode - * - * @lib dunatext.lib - * @since TB9.2 - */ -NONSHARABLE_CLASS( MDunAtCmdEchoer ) - { - -public: - - /** - * Notifies about completed echo in text mode - * - * @since TB9.2 - * @return None - */ - virtual void NotifyEchoComplete() = 0; - - }; - -/** - * Class for AT command echoer - * - * @lib dunatext.lib - * @since TB9.2 - */ -NONSHARABLE_CLASS( CDunAtCmdEchoer ) : public CBase, - public MDunCompletionReporter - { - -public: - - /** - * Two-phased constructor. - * @param aStreamCallback Callback to stream - * @return Instance of self - */ - static CDunAtCmdEchoer* NewL( MDunStreamManipulator* aStreamCallback ); - - /** - * Destructor. - */ - virtual ~CDunAtCmdEchoer(); - - /** - * Resets data to initial values - * - * @since TB9.2 - * @return None - */ - void ResetData(); - - /** - * Sends a character to be echoed - * - * @since TB9.2 - * @param aInput Input to echo - * @param aCallback Callback to echo request completions - * @return Symbian error code on error, KErrNone otherwise - */ - TInt SendEchoCharacter( const TDesC8* aInput, MDunAtCmdEchoer* aCallback ); - -private: - - CDunAtCmdEchoer( MDunStreamManipulator* aStreamCallback ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since TB9.2 - * @return None - */ - void Initialize(); - -// from base class MDunCompletionReporter - - /** - * From MDunCompletionReporter. - * Gets called when data push is complete - * - * @since TB9.2 - * @param aAllPushed ETrue if all in the queue were pushed, EFalse otherwise - * @return None - */ - void NotifyDataPushComplete( TBool aAllPushed ); - -private: // data - - /** - * Notification interface class for echo request completions - * Not own. - */ - MDunAtCmdEchoer* iCallback; - - /** - * Callback to call when data to push - * Not own. - */ - MDunStreamManipulator* iStreamCallback; - - /** - * Current state of echoing: active or inactive - */ - TDunState iAtEchoState; - - }; - -#endif // C_CDUNATCMDECHOER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/inc/DunAtCmdHandler.h --- a/localconnectivityservice/dun/atext/inc/DunAtCmdHandler.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,990 +0,0 @@ -/* -* Copyright (c) 2009-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: AT command handler and notifier -* -*/ - -#ifndef C_CDUNATCMDHANDLER_H -#define C_CDUNATCMDHANDLER_H - -#include -#include -#include -#include "DunDataPusher.h" -#include "DunAtCmdPusher.h" -#include "DunAtCmdEchoer.h" -#include "DunAtEcomListen.h" -#include "DunAtModeListen.h" -#include "DunAtNvramListen.h" -#include "DunAtSpecialCmdHandler.h" - -const TInt KDunChSetMaxCharLen = 1; // Only ASCII supported for now -const TInt KDunOkBufLength = 1+1+2+1+1; // ++"OK"++ -const TInt KDunErrorBufLength = 1+1+5+1+1; // ++"ERROR"++ -const TInt KDunLineBufLength = (512 + 1); // 512 chars for command + -const TInt KDunEscBufLength = 1; // Escape (0x1B) character - -class CDunAtUrcHandler; -class MDunConnMon; -class MDunStreamManipulator; - -/** - * Class used for storing information related to string conversion and parsing - * - * @lib dunatext.lib - * @since TB9.2 - */ -NONSHARABLE_CLASS( TDunParseInfo ) - { - -public: - - /** - * Buffer for sending to ATEXT (one command) - * (length is part of KDunLineBufLength) - */ - TBuf8 iSendBuffer; - - /** - * Conversion limit for upper case conversion. - * This is needed to convert the base part of special commands to upper case - * where the part after the base part should not be converted to upper case. - */ - TInt iLimit; - - }; - -/** - * Class used for AT command decoding related functionality - * - * @lib dunatext.lib - * @since TB9.2 - */ -NONSHARABLE_CLASS( TDunDecodeInfo ) - { - -public: - - /** - * Flag to indicate if first decode - */ - TBool iFirstDecode; - - /** - * Index in iLineBuffer for decoding to iSendBuffer - */ - TInt iDecodeIndex; - - /** - * Index in iLineBuffer for extended character position - */ - TInt iExtendedIndex; - - /** - * Previous character in parsing - */ - TChar iPrevChar; - - /** - * Flag to indicate if previous character exists - */ - TBool iPrevExists; - - /** - * Flag to indicate if assignment mark found - */ - TBool iAssignFound; - - /** - * Flag to indicate if processing inside quotes - */ - TBool iInQuotes; - - /** - * Flag to indicate if special subcommand found - */ - TBool iSpecialFound; - - /** - * Number of commands handled (for debugging purposes) - */ - TBool iCmdsHandled; - - }; - -/** - * Class used for AT command editor mode related functionality - * - * @lib dunatext.lib - * @since TB9.2 - */ -NONSHARABLE_CLASS( TDunEditorModeInfo ) - { - -public: - - /** - * Flag to indicate if content found (not used if iContentFindStarted is EFalse) - */ - TBool iContentFound; - - /** - * AT command decoding related information for peeked data - * (not to be used if HandleNextSubCommand() returns EFalse) - */ - TDunDecodeInfo iPeekInfo; - - }; - -/** - * Notification interface class for command mode start/end - * - * @lib dunutils.lib - * @since TB9.2 - */ -NONSHARABLE_CLASS( MDunCmdModeMonitor ) - { - -public: - - /** - * Notifies about command mode start - * - * @since TB9.2 - * @return None - */ - virtual void NotifyCommandModeStart() = 0; - - /** - * Notifies about command mode end - * - * @since TB9.2 - * @return None - */ - virtual void NotifyCommandModeEnd() = 0; - - }; - -/** - * Notification interface class for status changes in AT command handling - * - * @lib dunatext.lib - * @since TB9.2 - */ -NONSHARABLE_CLASS( MDunAtCmdStatusReporter ) - { - -public: - - /** - * Notifies about parser's need to get more data - * - * @since TB9.2 - * @return None - */ - virtual void NotifyParserNeedsMoreData() = 0; - - /** - * Notifies about editor mode reply - * - * @since TB9.2 - * @param aStart ETrue if start of editor mode, EFalse otherwise - * @return None - */ - virtual void NotifyEditorModeReply( TBool aStart ) = 0; - - }; - -/** - * Class for AT command handler and notifier - * - * @lib dunatext.lib - * @since TB9.2 - */ -NONSHARABLE_CLASS( CDunAtCmdHandler ) : public CBase, - public MDunAtCmdPusher, - public MDunAtEcomListen, - public MDunAtModeListen - { - -public: - - /** - * Two-phased constructor. - * @param aUpstream Callback to upstream - * @param aDownstream Callback to downstream - * @param aConnectionName Connection identifier name - * @return Instance of self - */ - IMPORT_C static CDunAtCmdHandler* NewL( - MDunAtCmdStatusReporter* aUpstream, - MDunStreamManipulator* aDownstream, - const TDesC8* aConnectionName ); - - /** - * Destructor. - */ - virtual ~CDunAtCmdHandler(); - - /** - * Resets data to initial values - * - * @since TB9.2 - * @return None - */ - IMPORT_C void ResetData(); - - /** - * Adds callback for command mode notification - * The callback will be called when command mode starts or ends - * - * @since TB9.2 - * @param aCallback Callback to call when command mode starts or ends - * @return Symbian error code on error, KErrNone otherwise - */ - IMPORT_C TInt AddCmdModeCallback( MDunCmdModeMonitor* aCallback ); - - /** - * Adds data for parsing and parses if necessary - * - * @since TB9.2 - * @param aInput Data to add for parsing - * @param aMoreNeeded ETrue if more data needed, EFalse otherwise - * @return Symbian error code on error, KErrNone otherwise - */ - IMPORT_C TInt AddDataForParsing( TDesC8& aInput, TBool& aMoreNeeded ); - - /** - * Manages request to abort command handling - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - IMPORT_C TInt ManageAbortRequest(); - - /** - * Sends a character to be echoed - * - * @since TB9.2 - * @param aInput Input to echo - * @param aCallback Callback to echo request completions - * @return Symbian error code on error, KErrNone otherwise - */ - IMPORT_C TInt SendEchoCharacter( const TDesC8* aInput, - MDunAtCmdEchoer* aCallback ); - - /** - * Stops sending of AT command from decode buffer - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - IMPORT_C TInt Stop(); - - /** - * Starts URC message handling - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - IMPORT_C TInt StartUrc(); - - /** - * Stops URC message handling - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - IMPORT_C TInt StopUrc(); - -private: - - CDunAtCmdHandler( MDunAtCmdStatusReporter* aUpstream, - MDunStreamManipulator* aDownstream, - const TDesC8* aConnectionName ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since TB9.2 - * @return None - */ - void Initialize(); - - /** - * Creates plugin handlers for this class - * - * @since TB9.2 - * @return None - */ - void CreatePluginHandlersL(); - - /** - * Creates the array of special commands - * - * @since TB9.2 - * @return None - */ - void CreateSpecialCommandsL(); - - /** - * Recreates special command data. - * This is done when a plugin is installed or uninstalled. - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt RecreateSpecialCommands(); - - /** - * Gets default settings from RATExtCommon and sets them to RATExt - * - * @since TB9.2 - * @return None - */ - void GetAndSetDefaultSettingsL(); - - /** - * Regenerates the reply strings based on settings - * - * @since TB9.2 - * @return ETrue if quiet mode, EFalse otherwise - */ - TBool RegenerateReplyStrings(); - - /** - * Regenerates the ok reply based on settings - * - * @since TB9.2 - * @return ETrue if quiet mode, EFalse otherwise - */ - TBool RegenerateOkReply(); - - /** - * Regenerates the error reply based on settings - * - * @since TB9.2 - * @return ETrue if quiet mode, EFalse otherwise - */ - TBool RegenerateErrorReply(); - - /** - * Gets current mode - * - * @since TB9.2 - * @param aMask Mask for current mode (only one supported) - * @return New current mode - */ - TUint GetCurrentModeL( TUint aMask ); - - /** - * Instantiates one URC message handling class instance and adds it to - * the URC message handler array - * - * @since TB9.2 - * @return None - */ - CDunAtUrcHandler* AddOneUrcHandlerL(); - - /** - * Deletes all instantiated URC message handlers - * - * @since TB9.2 - * @return None - */ - void DeletePluginHandlers(); - - /** - * Manages partial AT command - * - * @since TB9.2 - * @return ETrue if more data needed, EFalse otherwise - */ - TBool ManagePartialCommand(); - - /** - * Echoes a command if echo is on - * - * @since TB9.2 - * @return ETrue if echo push started, EFalse otherwise - */ - TBool EchoCommand(); - - /** - * Handles backspace and cancel characters - * - * @since TB9.2 - * @return ETrue if special character found, EFalse otherwise - */ - TBool HandleSpecialCharacters(); - - /** - * Extracts line from input buffer to line buffer - * - * @since TB9.2 - * @return ETrue if more data needed, EFalse otherwise - */ - TBool ExtractLineFromInputBuffer(); - - /** - * Handles generic buffer management - * (explanation in ExtractLineFromInputBuffer()) - * - * @since TB9.2 - * @param aStartIndex Start index for buffer to be copied - * @param aCopyLength Length for data needed to be copied - * @param aCopyNeeded ETrue if buffer copy needed - * @return ETrue if more data needed, EFalse otherwise - */ - TBool HandleGenericBufferManagement( TInt& aStartIndex, - TInt& aCopyLength, - TBool& aCopyNeeded ); - - /** - * Handles special buffer management - * (explanation in ExtractLineFromInputBuffer()) - * - * @since TB9.2 - * @param aStartIndex Start index for buffer to be copied - * @param aCopyLength Length for data needed to be copied - * @param aCopyNeeded ETrue if buffer copy needed - * @return ETrue if more data needed, EFalse otherwise - */ - TBool HandleSpecialBufferManagement( TInt aStartIndex, - TInt& aCopyLength, - TBool& aCopyNeeded ); - - /** - * Skips end-of-line characters - * - * @since TB9.2 - * @param aStartIndex Start index - * @return Index to end of non-end-of-line or Symbian error code on error - */ - TInt SkipEndOfLineCharacters( TInt aStartIndex ); - - /** - * Skips subcommand delimiter characters - * - * @since TB9.2 - * @param aStartIndex Start index - * @return Index to end of delimiter or Symbian error code on error - */ - TInt SkipSubCommandDelimiterCharacters( TInt aStartIndex ); - - /** - * Finds the end of the line - * - * @since TB9.2 - * @param aStartIndex Start index - * @return Index to end of line or Symbian error code on error - */ - TInt FindEndOfLine( TInt aStartIndex ); - - /** - * Handles next subcommand from line buffer - * - * @since TB9.2 - * @return ETrue if last command decoded, EFalse otherwise - */ - TBool HandleNextSubCommand(); - - /** - * Manages end of AT command handling - * - * @since TB9.2 - * @param aNotifyLocal Notify local parties - * @param aNotifyExternal Notify external parties - * @return None - */ - void ManageEndOfCmdHandling( TBool aNotifyLocal, - TBool aNotifyExternal ); - - /** - * Extracts next subcommand from line buffer to send buffer - * - * @since TB9.2 - * @param aPeek Peek for the next command if ETrue, EFalse otherwise - * @return ETrue if command extracted, EFalse otherwise - */ - TBool ExtractNextSubCommand( TBool aPeek=EFalse ); - - /** - * Finds the start of subcommand from line buffer - * - * @since TB9.2 - * @return Index to the next command or Symbian error code on error - */ - TInt FindStartOfSubCommand(); - - /** - * Restores old decode info. For ExtractNextSubCommand() when aPeeks is - * ETrue. - * - * @since TB9.2 - * @param aPeek Peek for the next command if ETrue, EFalse otherwise - * @param aOldInfo Old information to restore when aPeek is ETrue - * @return None - */ - void RestoreOldDecodeInfo( TBool aPeek, TDunDecodeInfo& aOldInfo ); - - /** - * Tests for end of AT command line - * - * @since TB9.2 - * @param aCharacter Character to test - * @return ETrue if end of command, EFalse otherwise - */ - TBool IsEndOfLine( TChar& aCharacter ); - - /** - * Checks if character is delimiter character - * - * @since TB9.2 - * @param aCharacter Character to test - * @return ETrue if delimiter character, EFalse otherwise - */ - TBool IsDelimiterCharacter( TChar aCharacter ); - - /** - * Checks if character is of extended group - * - * @since TB9.2 - * @param aCharacter Character to test - * @return ETrue if extended character, EFalse otherwise - */ - TBool IsExtendedCharacter( TChar aCharacter ); - - /** - * Checks special command - * - * @since TB9.2 - * @param aEndIndex End index (changes) - * @return Symbian error code on error, KErrNone otherwise - */ - TBool CheckSpecialCommand( TInt& aEndIndex ); - - /** - * Saves character decode state for a found character - * - * @since TB9.2 - * @param aCharacter Character to save a state for - * @param aAddSpecial ETrue to add character for special command, - * EFalse otherwise - * @return Symbian error code on error, KErrNone otherwise - */ - void SaveFoundCharDecodeState( TChar aCharacter, - TBool aAddSpecial=ETrue ); - - /** - * Saves character decode state for a not found character - * - * @since TB9.2 - * @param aStartIndex Start index (doesn't change) - * @param aEndIndex End index (changes) - * @return Symbian error code on error, KErrNone otherwise - */ - void SaveNotFoundCharDecodeState(); - - /** - * Find quotes within subcommands - * - * @since TB9.2 - * @param aCharacter Character to check - * @param aStartIndex Start index (doesn't change) - * @param aEndIndex End index (changes) - * @return Symbian error code on error, KErrNone otherwise - */ - TBool FindSubCommandQuotes( TChar aCharacter, TInt aStartIndex, TInt& aEndIndex ); - - /** - * Check if in next subcommand's extended border - * - * @since TB9.2 - * @param aCharacter Extended character to check - * @param aStartIndex Start index (doesn't change) - * @param aEndIndex End index (changes) - * @return ETrue if in next command's extended border, EFalse otherwise - */ - TBool IsExtendedBorder( TChar aCharacter, TInt aStartIndex, TInt& aEndIndex ); - - /** - * Finds subcommand with alphanumeric borders - * - * @since TB9.2 - * @param aCharacter Character to check - * @param aEndIndex End index (changes) - * @return ETrue if alpha border found, EFalse otherwise - */ - TBool FindSubCommandAlphaBorder( TChar aCharacter, TInt& aEndIndex ); - - /** - * Finds subcommand - * - * @since TB9.2 - * @param aEndIndex End index (changes) - * @return Symbian error code on error, KErrNone otherwise - */ - TInt FindSubCommand( TInt& aEndIndex ); - - /** - * Check if "A/" command - * - * @since TB9.2 - * @return ETrue if "A/" command, EFalse otherwise - */ - TBool IsASlashCommand(); - - /** - * Handles "A/" command - * - * @since TB9.2 - * @return ETrue if error reply push started, EFalse otherwise - */ - TBool HandleASlashCommand(); - - /** - * Manages command mode change - * - * @since TB9.2 - * @param aMode Mode to manage - * @return ETrue if command mode change detected, EFalse otherwise - */ - TBool ManageCommandModeChange( TUint aMode ); - - /** - * Reports command mode start/end change - * - * @since TB9.2 - * @param aStart Command mode start if ETrue, end otherwise - * @return None - */ - void ReportCommandModeChange( TBool aStart ); - - /** - * Manages echo mode change - * - * @since TB9.2 - * @param aMode Mode to manage - * @return ETrue if echo mode change detected, EFalse otherwise - */ - TBool ManageEchoModeChange( TUint aMode ); - - /** - * Manages quiet mode change - * - * @since TB9.2 - * @param aMode Mode to manage - * @return ETrue if quiet mode change detected, EFalse otherwise - */ - TBool ManageQuietModeChange( TUint aMode ); - - /** - * Manages verbose mode change - * - * @since TB9.2 - * @param aMode Mode to manage - * @return ETrue if verbose mode change detected, EFalse otherwise - */ - TBool ManageVerboseModeChange( TUint aMode ); - - /** - * Manages character change - * - * @since TB9.2 - * @param aMode Mode to manage - * @return None - */ - void ManageCharacterChange( TUint aMode ); - - /** - * Manages editor mode reply - * - * @since TB9.2 - * @param aStart ETrue if start of editor mode, EFalse otherwise - * @return Symbian error code on error, KErrNone otherwise - */ - TInt ManageEditorModeReply( TBool aStart ); - - /** - * Finds the next content from the input buffer - * - * @since TB9.2 - * @param aStart ETrue if start of editor mode, EFalse otherwise - * @return ETrue if next content found, EFalse otherwise - */ - TBool FindNextContent( TBool aStart ); - -// from base class MDunAtCmdPusher - - /** - * From MDunAtCmdPusher. - * Notifies about end of AT command processing. - * This is after all reply data for an AT command is multiplexed to the - * downstream. - * - * @since TB9.2 - * @param aError Error code of command processing completion - * @return None - */ - TInt NotifyEndOfProcessing( TInt aError ); - - /** - * Notifies about request to stop AT command handling for the rest of the - * command line data - * - * @since TB9.2 - * @return None - */ - void NotifyEndOfCmdLineProcessing(); - - /** - * Notifies about request to peek for the next command - * - * @since TB9.2 - * @return ETrue if next command exists, EFalse otherwise - */ - TBool NotifyNextCommandPeekRequest(); - - /** - * Notifies about editor mode reply - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyEditorModeReply(); - -// from base class MDunAtCmdEchoer - - /** - * Notifies about completed echo in text mode - * - * @since TB9.2 - * @return None - */ - void NotifyEchoComplete(); - -// from base class MDunAtEcomListen - - /** - * From MDunAtEcomListen. - * Notifies about new plugin installation - * - * @since TB9.2 - * @return None - */ - TInt NotifyPluginInstallation( TUid& aPluginUid ); - - /** - * From MDunAtEcomListen. - * Notifies about existing plugin uninstallation - * - * @since TB9.2 - * @return None - */ - TInt NotifyPluginUninstallation( TUid& aPluginUid ); - -// from base class MDunAtModeListen - - /** - * From MDunAtModeListen. - * Gets called on mode status change - * - * @since TB9.2 - * @param aMode Mode to manage - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyModeStatusChange( TUint aMode ); - -private: // data - - /** - * Callback to call when AT command handling status changes - * Not own. - */ - MDunAtCmdStatusReporter* iUpstream; - - /** - * Callback to call when data to push - * Not own. - */ - MDunStreamManipulator* iDownstream; - - /** - * Callback(s) to call when command mode starts or ends - * Usually two needed: one for upstream and second for downstream - */ - RPointerArray iCmdCallbacks; - - /** - * Connection identifier name - */ - const TDesC8* iConnectionName; - - /** - * Current state of AT command handling: active or inactive - */ - TDunState iHandleState; - - /** - * Character for carriage return - */ - TInt8 iCarriageReturn; - - /** - * Character for line feed - */ - TInt8 iLineFeed; - - /** - * Character for backspace - */ - TInt8 iBackspace; - - /** - * Current input to AddDataForParsing() - * Not own. - */ - TDesC8* iInput; - - /** - * Special commands for parsing - */ - RPointerArray iSpecials; - - /** - * Buffer for character echoing - */ - TBuf8 iEchoBuffer; - - /** - * Buffer for ok reply - */ - TBuf8 iOkBuffer; - - /** - * Buffer for error reply - */ - TBuf8 iErrorBuffer; - - /** - * Buffer for AT command (one line) - */ - TBuf8 iLineBuffer; - - /** - * Buffer for last AT command input (for "A/") - */ - TBuf8 iLastBuffer; - - /** - * Buffer for command - */ - TBuf8 iEscapeBuffer; - - /** - * AT command decoding related information - */ - TDunDecodeInfo iDecodeInfo; - - /** - * Information for parsing - */ - TDunParseInfo iParseInfo; - - /** - * Information for editor mode - */ - TDunEditorModeInfo iEditorModeInfo; - - /** - * AT command reply pusher - * Own. - */ - CDunAtCmdPusher* iCmdPusher; - - /** - * AT command reply echoer - * Own. - */ - CDunAtCmdEchoer* iCmdEchoer; - - /** - * URC message handlers - * Own. - */ - RPointerArray iUrcHandlers; - - /** - * ECOM plugin interface status change listener - * Own. - */ - CDunAtEcomListen* iEcomListen; - - /** - * Modem mode status change listener - * Own. - */ - CDunAtModeListen* iModeListen; - - /** - * NVRAM status change listener - * Own. - */ - CDunAtNvramListen* iNvramListen; - - /** - * Flag to mark command mode start/end - */ - TBool iDataMode; - - /** - * Flag to be set on if echo on - */ - TBool iEchoOn; - - /** - * Flag to be set on if quiet mode on - */ - TBool iQuietOn; - - /** - * Flag to be set on if verbose mode on - */ - TBool iVerboseOn; - - /** - * End index for not added data in iCommand - */ - TInt iEndIndex; - - /** - * AT command extension - */ - RATExt iAtCmdExt; - - /** - * AT command extension to common functionality - */ - RATExtCommon iAtCmdExtCommon; - - /** - * Special AT command handler for handling commands like AT&FE0Q0V1&C1&D2+IFC=3,1. - */ - CDunAtSpecialCmdHandler* iAtSpecialCmdHandler; - }; - -#endif // C_CDUNATCMDHANDLER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/inc/DunAtCmdPusher.h --- a/localconnectivityservice/dun/atext/inc/DunAtCmdPusher.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,372 +0,0 @@ -/* -* Copyright (c) 2008-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: AT command pusher for downstream -* -*/ - -#ifndef C_CDUNATCMDPUSHER_H -#define C_CDUNATCMDPUSHER_H - -#include -#include -#include "DunDataPusher.h" - -class MDunStreamManipulator; - -/** - * Notification interface class for data pushing status changes - * - * @lib dunatext.lib - * @since TB9.2 - */ -NONSHARABLE_CLASS( MDunAtCmdPusher ) - { - -public: - - /** - * Notifies about end of AT command processing. - * This is after all reply data for an AT command is multiplexed to the - * downstream. - * - * @since TB9.2 - * @param aError Error code of command processing completion - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyEndOfProcessing( TInt aError ) = 0; - - /** - * Notifies about request to stop AT command handling for the rest of the - * command line data - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - virtual void NotifyEndOfCmdLineProcessing() = 0; - - /** - * Notifies about request to peek for the next command - * - * @since TB9.2 - * @return ETrue if next command exists, EFalse otherwise - */ - virtual TBool NotifyNextCommandPeekRequest() = 0; - - /** - * Notifies about editor mode reply - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyEditorModeReply() = 0; - - }; - -/** - * Class for AT command URC handler - * - * @lib dunatext.lib - * @since TB9.2 - */ -NONSHARABLE_CLASS( CDunAtCmdPusher ) : public CActive, - public MDunCompletionReporter - { - -public: - - /** - * Two-phased constructor. - * @param aAtCmdExt Pointer to AT command extension - * @param aCallback Callback to AT command handler - * @param aDownstream Callback to downstream, - * @param aOkBuffer Buffer for ok reply - * @return Instance of self - */ - static CDunAtCmdPusher* NewL( RATExt* aAtCmdExt, - MDunAtCmdPusher* aCallback, - MDunStreamManipulator* aDownstream, - TDesC8* aOkBuffer ); - - /** - * Two-phased constructor. - * @param aAtCmdExt Pointer to AT command extension - * @param aCallback Callback to AT command handler - * @param aDownstream Callback to downstream - * @param aOkBuffer Buffer for ok reply - * @return Instance of self - */ - static CDunAtCmdPusher* NewLC( RATExt* aAtCmdExt, - MDunAtCmdPusher* aCallback, - MDunStreamManipulator* aDownstream, - TDesC8* aOkBuffer ); - - /** - * Destructor. - */ - virtual ~CDunAtCmdPusher(); - - /** - * Resets data to initial values - * - * @since TB9.2 - * @return None - */ - void ResetData(); - - /** - * Starts AT command handling - * - * @since TB9.2 - * @param aInput AT command or editor mode input to handle - * @param aNormalMode ETrue if request issue for normal mode - * @return Symbian error code on error, KErrNone otherwise - */ - TInt IssueRequest( TDesC8& aInput, TBool aNormalMode=ETrue ); - - /** - * Stops AT command handling - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Stop(); - - /** - * Manages request to abort command handling - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt ManageAbortRequest(); - - /** - * Sets end of command line marker on for the possible series of AT - * commands. - * - * @since TB9.2 - * @param aPushLast ETrue to push last reply, EFalse otherwise - * @return None - */ - void SetEndOfCmdLine(); - - /** - * Gets the editor mode status - * - * @since TB9.2 - * @return ETrue if in editor mode, EFalse otherwise - */ - TBool EditorMode(); - -private: - - CDunAtCmdPusher( RATExt* aAtCmdExt, - MDunAtCmdPusher* aCallback, - MDunStreamManipulator* aDownstream, - TDesC8* aOkBuffer ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since TB9.2 - * @return None - */ - void Initialize(); - - /** - * Sets state to idle and notifies about subcommand handling completion - * - * @since TB9.2 - * @param aError Error code for completion - * @return None - */ - void SetToIdleAndNotifyEnd( TInt aError ); - - /** - * Checks if "OK" (verbose) or "0" (numeric) string or exists at the end of - * buffer and removes it - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt CheckAndRemoveOkString(); - - /** - * Sends reply data to downstream - * - * @since TB9.2 - * @param aRecvBuffer ETrue if using receive buffer - * EFalse if using "OK" buffer - * @return None - */ - void SendReplyData( TBool aRecvBuffer=ETrue ); - - /** - * Manages change in reply type to EReplyTypeOther - * - * @since TB9.2 - * @return None - */ - void ManageReplyTypeChangeToOther(); - - /** - * Manages change in reply type to EReplyTypeOk - * - * @since TB9.2 - * @return None - */ - void ManageReplyTypeChangeToOk(); - - /** - * Manages change in reply type to EReplyTypeError - * - * @since TB9.2 - * @return None - */ - void ManageReplyTypeChangeToError(); - - /** - * Manages change in reply type to EReplyTypeEditor - * - * @since TB9.2 - * @return None - */ - void ManageReplyTypeChangeToEditor(); - - /** - * Manages change in reply type - * - * @since TB9.2 - * @return None - */ - void ManageReplyTypeChange(); - -// from base class CActive - - /** - * From CActive. - * Gets called when AT command handled - * - * @since TB9.2 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Gets called on cancel - * - * @since TB9.2 - * @return None - */ - void DoCancel(); - -// from base class MDunCompletionReporter - - /** - * From MDunCompletionReporter. - * Gets called when data push is complete - * - * @since TB9.2 - * @param aAllPushed ETrue if all in the queue were pushed, EFalse otherwise - * @return None - */ - void NotifyDataPushComplete( TBool aAllPushed ); - -private: // data - - /** - * AT command extension - * Not own. - */ - RATExt* iAtCmdExt; - - /** - * Notification interface class for data pushing status changes - * Not own. - */ - MDunAtCmdPusher* iCallback; - - /** - * Callback to call when data to push - * Not own. - */ - MDunStreamManipulator* iDownstream; - - /** - * Buffer for ok reply - * Not own. - */ - TDesC8* iOkBuffer; - - /** - * Current state of AT command handling: active or inactive - */ - TDunState iAtPushState; - - /** - * Buffer for receiving - */ - TBuf8 iRecvBuffer; - - /** - * Indicates how many bytes of reply left - */ - TInt iReplyBytesLeft; - - /** - * Package for reply bytes left - */ - TPckg iReplyLeftPckg; - - /** - * Reply type for the handled AT command - */ - TATExtensionReplyType iReplyType; - - /** - * Package for reply type for the handled AT command - */ - TPckg iReplyTypePckg; - - /** - * Flag indicating if other than "ERROR" reply already received in the - * command line - */ - TBool iNoErrorReceived; - - /** - * Flag indicating if the last "OK" reply push is started - */ - TBool iLastOkPush; - - /** - * Flag indicating if abort already tried for one command - */ - TBool iCmdAbort; - - /** - * Flag indicating if stop needed after the next reply - */ - TBool iStop; - - /** - * Flag indicating if in editor mode - */ - TBool iEditorMode; - - }; - -#endif // C_CDUNATCMDPUSHER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/inc/DunAtEcomListen.h --- a/localconnectivityservice/dun/atext/inc/DunAtEcomListen.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,185 +0,0 @@ -/* -* Copyright (c) 2008 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: ECom plugin install/uninstall/version listener -* -*/ - - -#ifndef C_CDUNATECOMLISTEN_H -#define C_CDUNATECOMLISTEN_H - -#include -#include "DunTransporter.h" - -/** - * Notification interface class for ECOM plugin interface status changes - * - * @lib dunatext.lib - * @since TB9.2 - */ -NONSHARABLE_CLASS( MDunAtEcomListen ) - { - -public: - - /** - * Notifies about new plugin installation - * - * @since TB9.2 - * @param aPluginUid UID of installed plugin - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyPluginInstallation( TUid& aPluginUid ) = 0; - - /** - * Notifies about existing plugin uninstallation - * - * @since TB9.2 - * @param aPluginUid UID of uninstalled plugin - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyPluginUninstallation( TUid& aPluginUid ) = 0; - - }; - -/** - * Class for ECom plugin install/uninstall/version listener - * - * @lib dunatext.lib - * @since TB9.2 - */ -NONSHARABLE_CLASS( CDunAtEcomListen ) : public CActive - { - -public: - - /** - * Two-phased constructor. - * @param aAtCmdExt Pointer to AT command extension - * @param aCallback Callback to mode status change - * @return Instance of self - */ - static CDunAtEcomListen* NewL( RATExt* aAtCmdExt, - MDunAtEcomListen* aCallback ); - - /** - * Two-phased constructor. - * @param aAtCmdExt Pointer to AT command extension - * @param aCallback Callback to mode status change - * @return Instance of self - */ - static CDunAtEcomListen* NewLC( RATExt* aAtCmdExt, - MDunAtEcomListen* aCallback ); - - /** - * Destructor. - */ - virtual ~CDunAtEcomListen(); - - /** - * Resets data to initial values - * - * @since TB9.2 - * @return None - */ - void ResetData(); - - /** - * Starts waiting for ECom plugin install/uninstall/version status changes - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt IssueRequest(); - - /** - * Stops waiting for Ecom plugin install/uninstall/version status changes - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Stop(); - -private: - - CDunAtEcomListen( RATExt* aAtCmdExt, - MDunAtEcomListen* aCallback ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since TB9.2 - * @return None - */ - void Initialize(); - -// from base class CActive - - /** - * From CActive. - * Gets called when plugin installed, uninstalled or changed - * - * @since TB9.2 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Gets called on cancel - * - * @since TB9.2 - * @return None - */ - void DoCancel(); - -private: // data - - /** - * AT command extension - * Not own. - */ - RATExt* iAtCmdExt; - - /** - * Callback to call when plugin installed, uninstalled or changed - * Not own. - */ - MDunAtEcomListen* iCallback; - - /** - * Current state of ECom interface listening: active or inactive - */ - TDunState iEcomListenState; - - /** - * UID of the installed, uninstalled or changed plugin - */ - TUid iPluginUid; - - /** - * Package for plugin UID - */ - TPckg iPluginUidPckg; - - /** - * Package for ECOM type - */ - TPckg iEcomTypePckg; - - }; - -#endif // C_CDUNATECOMLISTEN_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/inc/DunAtModeListen.h --- a/localconnectivityservice/dun/atext/inc/DunAtModeListen.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,172 +0,0 @@ -/* -* Copyright (c) 2008 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: Modem's mode listener and notifier -* -*/ - - -#ifndef C_CDUNATMODELISTEN_H -#define C_CDUNATMODELISTEN_H - -#include -#include -#include "DunTransporter.h" - -/** - * Notification interface class for modem's mode listener - * - * @lib dunatext.lib - * @since TB9.2 - */ -NONSHARABLE_CLASS( MDunAtModeListen ) - { - -public: - - /** - * Notifies about mode status change - * - * @since TB9.2 - * @param aMode Current modem modes - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyModeStatusChange( TUint aMode ) = 0; - - }; - -/** - * Class for modem's mode listener and notifier - * - * @lib dunatext.lib - * @since TB9.2 - */ -NONSHARABLE_CLASS( CDunAtModeListen ) : public CActive - { - -public: - - /** - * Two-phased constructor. - * aAtCmdExtCommand AT command extension to common functionality - * aCallback Callback to mode status change - * @return Instance of self - */ - static CDunAtModeListen* NewL( RATExtCommon* aAtCmdExtCommon, - MDunAtModeListen* aCallback ); - - /** - * Two-phased constructor. - * aAtCmdExtCommand AT command extension to common functionality - * aCallback Callback to mode status change - * @return Instance of self - */ - static CDunAtModeListen* NewLC( RATExtCommon* aAtCmdExtCommon, - MDunAtModeListen* aCallback ); - - /** - * Destructor. - */ - virtual ~CDunAtModeListen(); - - /** - * Resets data to initial values - * - * @since TB9.2 - * @return None - */ - void ResetData(); - - /** - * Issues request to start monitoring for mode status changes - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt IssueRequest(); - - /** - * Stops monitoring for mode status changes - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Stop(); - -private: - - CDunAtModeListen( RATExtCommon* iAtCmdExtCommon, - MDunAtModeListen* aCallback ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since TB9.2 - * @return None - */ - void Initialize(); - -// from base class CActive - - /** - * From CActive. - * Gets called when mode changes - * - * @since TB9.2 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Gets called on cancel - * - * @since TB9.2 - * @return None - */ - void DoCancel(); - -private: // data - - /** - * AT command extension to common functionality - * Not own. - */ - RATExtCommon* iAtCmdExtCommon; - - /** - * Callback to call when mode status changes - * Not own. - */ - MDunAtModeListen* iCallback; - - /** - * Current state of mode listening: active or inactive - */ - TDunState iModeListenState; - - /** - * Stored mode status change - */ - TUint iMode; - - /** - * Package for mode status changes - */ - TPckg iModePckg; - - }; - -#endif // C_CDUNATMODELISTEN_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/inc/DunAtNvramListen.h --- a/localconnectivityservice/dun/atext/inc/DunAtNvramListen.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,151 +0,0 @@ -/* -* Copyright (c) 2008 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: AT NVRAM status change listener and notifier -* -*/ - -#ifndef C_CDUNATNVRAMLISTEN_H -#define C_CDUNATNVRAMLISTEN_H - -#include -#include -#include "DunTransporter.h" - -/** - * Class for AT NVRAM status change listener - * - * @lib dunatext.lib - * @since TB9.2 - */ -NONSHARABLE_CLASS( CDunAtNvramListen ) : public CActive - { - -public: - - /** - * Two-phased constructor. - * @param aAtCmdExt Pointer to AT command extension - * @param aAtCmdExtCommon Pointer to AT command extension to common - * functionality - * @return Instance of self - */ - static CDunAtNvramListen* NewL( RATExt* aAtCmdExt, - RATExtCommon* aAtCmdExtCommon ); - - /** - * Two-phased constructor. - * @param aAtCmdExt Pointer to AT command extension - * @param aAtCmdExtCommon Pointer to AT command extension to common - * functionality - * @return Instance of self - */ - static CDunAtNvramListen* NewLC( RATExt* aAtCmdExt, - RATExtCommon* aAtCmdExtCommon ); - - /** - * Destructor. - */ - virtual ~CDunAtNvramListen(); - - /** - * Resets data to initial values - * - * @since TB9.2 - * @return None - */ - void ResetData(); - - /** - * Starts waiting for NVRAM status changes - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt IssueRequest(); - - /** - * Stops waiting for NVRAM status changes - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Stop(); - -private: - - CDunAtNvramListen( RATExt* aAtCmdExt, - RATExtCommon* aAtCmdExtCommon ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since TB9.2 - * @return None - */ - void Initialize(); - -// from base class CActive - - /** - * From CActive. - * Gets called when NVRAM has changed - * - * @since TB9.2 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Gets called on cancel - * - * @since TB9.2 - * @return None - */ - void DoCancel(); - -private: // data - - /** - * AT command extension - * Not own. - */ - RATExt* iAtCmdExt; - - /** - * AT command extension to common functionality - * Not own. - */ - RATExtCommon* iAtCmdExtCommon; - - /** - * Current state of NVRAM status change listening; active or inactive - */ - TDunState iNvramHandleState; - - /** - * Buffer for NVRAM - */ - TBuf8 iNvramBuffer; - - /** - * Flag to indicate start of receiving - */ - TBool iStarted; - - }; - -#endif // C_CDUNATNVRAMLISTEN_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/inc/DunAtSpecialCmdHandler.h --- a/localconnectivityservice/dun/atext/inc/DunAtSpecialCmdHandler.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* -* 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: Special AT command handler -* -*/ - -#ifndef C_CDUNATSPECIALCMDHANDLER_H -#define C_CDUNATSPECIALCMDHANDLER_H - -#include -#include - -const TInt KLineBufLength = (512 + 1); // Set this the same as in KDunLineBufLength - -/** - * Class for special AT command handler - * - * @lib dunatext.lib - * @since TB9.2 - */ -NONSHARABLE_CLASS( CDunAtSpecialCmdHandler ) : public CBase - { - -public: - - /** - * Two-phased constructor. - * @param None - * @return Instance of self - */ - static CDunAtSpecialCmdHandler* NewL(); - - /** - * Destructor. - */ - ~CDunAtSpecialCmdHandler(); - -public: - - /** - * Checks if the command has to be treated special way. - * For example in case of MAC, it sends command AT&FE0Q0V1&C1&D2+IFC=3,1. - * meaning there is no delimiters in the command. - * In case of MAC we try to search AT&F (sub command) string from the - * beginning of the command. - * Search is done string basis. - * - * @since TB9.2 - * @param aCharacter Character to add - * @return ETrue if data is ready for comparison, EFalse otherwise - */ - TBool IsCompleteSubCommand( TChar aCharacter ); - - /** - * Resets the buffer used for comparisons - * - * @since TB9.2 - * @return None - */ - void ResetComparisonBuffer(); - -private: - - CDunAtSpecialCmdHandler(); - - void ConstructL(); - - /** - * Defines when comparison is excecuted, checks if the data lengths are - * equal. - * - * @since TB9.2 - * @return ETrue if data is ready for comparison, EFalse otherwise - */ - TBool IsDataReadyForComparison( TInt aLength ); - - /** - * Defines minimum length of the special commands. - * - * @since TB9.2 - * @return Minimum length of the special commands - */ - TInt MinimumLength(); - -private: // data - - /** - * Buffer for temporary AT command input - */ - TBuf8 iBuffer; - - /** - * Special commands for parsing - */ - CDesC8Array *iSpecialCmds; - - }; - -#endif // C_CDUNATSPECIALCMDHANDLER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/inc/DunAtUrcHandler.h --- a/localconnectivityservice/dun/atext/inc/DunAtUrcHandler.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,182 +0,0 @@ -/* -* Copyright (c) 2008 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: AT command URC handler -* -*/ - - -#ifndef C_CDUNATURCHANDLER_H -#define C_CDUNATURCHANDLER_H - -#include -#include "DunDataPusher.h" - -class MDunStreamManipulator; - -/** - * Class for AT command URC handler - * - * @lib dunatext.lib - * @since TB9.2 - */ -NONSHARABLE_CLASS( CDunAtUrcHandler ) : public CActive, - public MDunCompletionReporter - { - -public: - - /** - * Two-phased constructor. - * @param aAtCmdExt Pointer to AT command extension - * @param aStreamCallback Callback to stream - * @return Instance of self - */ - static CDunAtUrcHandler* NewL( RATExt* aAtCmdExt, - MDunStreamManipulator* aStreamCallback ); - - /** - * Two-phased constructor. - * @param aAtCmdExt Pointer to AT command extension - * @param aStreamCallback Callback to stream - * @return Instance of self - */ - static CDunAtUrcHandler* NewLC( RATExt* aAtCmdExt, - MDunStreamManipulator* aStreamCallback ); - - /** - * Destructor. - */ - virtual ~CDunAtUrcHandler(); - - /** - * Resets data to initial values - * - * @since TB9.2 - * @return None - */ - void ResetData(); - - /** - * Starts waiting for an incoming URC message - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt IssueRequest(); - - /** - * Stops waiting for an incoming URC message - * - * @since TB9.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Stop(); - - /** - * UID of the owning plugin - * - * @since TB9.2 - * @return UID of the owning plugin - */ - TUid OwnerUid(); - -private: - - CDunAtUrcHandler( RATExt* aAtCmdExt, - MDunStreamManipulator* aStreamCallback ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since TB9.2 - * @return None - */ - void Initialize(); - -// from base class CActive - - /** - * From CActive. - * Gets called when URC command received - * - * @since TB9.2 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Gets called on cancel - * - * @since TB9.2 - * @return None - */ - void DoCancel(); - -// from base class MDunCompletionReporter - - /** - * From MDunCompletionReporter. - * Gets called when data push is complete - * - * @since TB9.2 - * @param aAllPushed ETrue if all in the queue were pushed, EFalse otherwise - * @return None - */ - void NotifyDataPushComplete( TBool aAllPushed ); - -private: // data - - /** - * AT command extension - * Not own. - */ - RATExt* iAtCmdExt; - - /** - * Callback to call when data to push - * Not own. - */ - MDunStreamManipulator* iStreamCallback; - - /** - * Current state of URC message handling: active or inactive - */ - TDunState iUrcHandleState; - - /** - * Buffer for receiving - */ - TBuf8 iRecvBuffer; - - /** - * UID of the responsible ATEXT plugin - */ - TUid iOwnerUid; - - /** - * Package for owner UID - */ - TPckg iOwnerUidPckg; - - /** - * Flag to indicate start of receiving (for ownership marking) - */ - TBool iStarted; - - }; - -#endif // C_CDUNATURCHANDLER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/src/DunAtCmdEchoer.cpp --- a/localconnectivityservice/dun/atext/src/DunAtCmdEchoer.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/* -* 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: Echoer for AT commands -* -*/ - -#include "DunAtCmdEchoer.h" -#include "DunDownstream.h" -#include "DunDebug.h" - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunAtCmdEchoer* CDunAtCmdEchoer::NewL( - MDunStreamManipulator* aStreamCallback ) - { - CDunAtCmdEchoer* self = new (ELeave) CDunAtCmdEchoer( aStreamCallback ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunAtCmdEchoer::~CDunAtCmdEchoer() - { - FTRACE(FPrint( _L("CDunAtCmdEchoer::~CDunAtCmdEchoer()") )); - ResetData(); - FTRACE(FPrint( _L("CDunAtCmdEchoer::~CDunAtCmdEchoer() complete") )); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunAtCmdEchoer::ResetData() - { - FTRACE(FPrint( _L("CDunAtCmdEchoer::ResetData()") )); - // Internal - Initialize(); - FTRACE(FPrint( _L("CDunAtCmdEchoer::ResetData() complete") )); - } - -// --------------------------------------------------------------------------- -// Sends a character to be echoed -// --------------------------------------------------------------------------- -// -TInt CDunAtCmdEchoer::SendEchoCharacter( - const TDesC8* aInput, - MDunAtCmdEchoer* aCallback ) - { - FTRACE(FPrint( _L("CDunAtCmdEchoer::SendEchoCharacter()") )); - if ( iAtEchoState!=EDunStateIdle || iCallback ) - { - FTRACE(FPrint( _L("CDunAtCmdEchoer::SendEchoCharacter() (not ready) complete") )); - return KErrNotReady; - } - iStreamCallback->NotifyDataPushRequest( aInput, this ); - iCallback = aCallback; - iAtEchoState = EDunStateAtCmdEchoing; - FTRACE(FPrint( _L("CDunDownstream::SendEchoCharacter() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CDunAtCmdEchoer::CDunAtCmdEchoer -// --------------------------------------------------------------------------- -// -CDunAtCmdEchoer::CDunAtCmdEchoer( MDunStreamManipulator* aStreamCallback ) : - iStreamCallback( aStreamCallback ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunAtCmdEchoer::ConstructL -// --------------------------------------------------------------------------- -// -void CDunAtCmdEchoer::ConstructL() - { - FTRACE(FPrint( _L("CDunAtCmdEchoer::ConstructL()") )); - if ( !iStreamCallback ) - { - FTRACE(FPrint( _L("CDunAtCmdEchoer::ConstructL() complete") )); - User::Leave( KErrGeneral ); - } - FTRACE(FPrint( _L("CDunAtCmdEchoer::ConstructL() complete") )); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunAtCmdEchoer::Initialize() - { - // Don't initialize iStreamCallback here (it is set through NewL) - iCallback = NULL; - iAtEchoState = EDunStateIdle; - } - -// --------------------------------------------------------------------------- -// From MDunCompletionReporter. -// Gets called when data push is complete -// --------------------------------------------------------------------------- -// -void CDunAtCmdEchoer::NotifyDataPushComplete( TBool /*aAllPushed*/ ) - { - FTRACE(FPrint( _L("CDunAtCmdEchoer::NotifyDataPushComplete()") )); - MDunAtCmdEchoer* callback = iCallback; - iCallback = NULL; - iAtEchoState = EDunStateIdle; - callback->NotifyEchoComplete(); - FTRACE(FPrint( _L("CDunAtCmdEchoer::NotifyDataPushComplete() complete") )); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/src/DunAtCmdHandler.cpp --- a/localconnectivityservice/dun/atext/src/DunAtCmdHandler.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1991 +0,0 @@ -/* -* Copyright (c) 2009-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: AT command handler and notifier -* -*/ - -/* - * Points to consider: - * - Each of the AT commands sent to ATEXT are converted to upper case form. - * Thus the ATEXT plugins don't need to check for case. The conversion to - * upper case form stops when carriage return or '=' character is found. - */ - -/* - * This file has the following functionality: - * 1) Line buffer filler: - * AddDataForParsing(), ManagePartialCommand(), ExtractLineFromInputBuffer(), - * etc. This buffer is used for parsing. These functions are used for - * splitter-combiner logic described below. CDunAtCmdPusher is used - * separately for each element in the line buffer. - * 2) Parser and splitter-combiner to handle the separater elements (subcommands) - * in the line buffer. When end of line is detected, iEndIndex is used to - * extract the next line in iInput to the line buffer (ManageEndOfCmdHandling() - * and ExtractLineFromInputBuffer()). - * 3) When end of iEndIndex is found (ExtractLineFromInputBuffer()), more data - * is asked from CDunUpstream. - * Note: There is separate handling for "one character input data" and "A/" - * command handling which should be supported only for one line based data - * (ManagePartialCommand()). - */ - -/* - * The AT command handling is splitted to two parts on high level: - * 1) Splitter: splitting the sub-commands in a command line to multiple ones - * for ATEXT to process. - * 2) Combiner: combining the replies coming from ATEXT using a filter - * (the filter categories are explained in DunAtCmdPusher.cpp) - */ - -/* - * Note1: This file uses AT command parsing based on heuristics. - * Refer to test specification if planning to change the heuristic. - * Note2: Input buffer management (ExtractLineFromInputBuffer()) can be tested - * with non-line based terminals such as HyperTerminal or Realterm. - */ - -#include "DunAtCmdHandler.h" -#include "DunAtUrcHandler.h" -#include "DunDownstream.h" -#include "DunDebug.h" - -const TInt8 KDunCancel = 24; // Used for line editing, cancel character -const TInt8 KDunEscape = 27; // Used for editor ending, escape character - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -EXPORT_C CDunAtCmdHandler* CDunAtCmdHandler::NewL( - MDunAtCmdStatusReporter* aUpstream, - MDunStreamManipulator* aDownstream, - const TDesC8* aConnectionName ) - { - CDunAtCmdHandler* self = new (ELeave) CDunAtCmdHandler( - aUpstream, - aDownstream, - aConnectionName ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunAtCmdHandler::~CDunAtCmdHandler() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::~CDunAtCmdHandler()") )); - ResetData(); - FTRACE(FPrint( _L("CDunAtCmdHandler::~CDunAtCmdHandler() complete") )); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -EXPORT_C void CDunAtCmdHandler::ResetData() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ResetData()") )); - // APIs affecting this: - // IssueRequest() - Stop(); - // NewL() - DeletePluginHandlers(); - delete iCmdEchoer; - iCmdEchoer = NULL; - delete iNvramListen; - iNvramListen = NULL; - delete iModeListen; - iModeListen = NULL; - delete iEcomListen; - iEcomListen = NULL; - delete iAtSpecialCmdHandler; - iAtSpecialCmdHandler = NULL; - if ( iAtCmdExtCommon.Handle() ) - { - iAtCmdExtCommon.SynchronousClose(); - iAtCmdExtCommon.Close(); - } - if ( iAtCmdExt.Handle() ) - { - iAtCmdExt.SynchronousClose(); - iAtCmdExt.Close(); - } - iSpecials.ResetAndDestroy(); - iSpecials.Close(); - // AddCmdModeCallback() - iCmdCallbacks.Close(); - // Internal - Initialize(); - FTRACE(FPrint( _L("CDunAtCmdHandler::ResetData() complete") )); - } - -// --------------------------------------------------------------------------- -// Adds callback for command mode notification -// The callback will be called when command mode starts or ends -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CDunAtCmdHandler::AddCmdModeCallback( MDunCmdModeMonitor* aCallback ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::AddCmdModeCallback()" ) )); - if ( !aCallback ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::AddCmdModeCallback() (aCallback) not initialized!" ) )); - return KErrGeneral; - } - TInt retTemp = iCmdCallbacks.Find( aCallback ); - if ( retTemp != KErrNotFound ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::AddCmdModeCallback() (already exists) complete" ) )); - return KErrAlreadyExists; - } - retTemp = iCmdCallbacks.Append( aCallback ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::AddCmdModeCallback() (append failed!) complete" ) )); - return retTemp; - } - FTRACE(FPrint( _L("CDunAtCmdHandler::AddCmdModeCallback() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Adds data for parsing and parses if necessary -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CDunAtCmdHandler::AddDataForParsing( TDesC8& aInput, - TBool& aMoreNeeded ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::AddDataForParsing()") )); - FTRACE(FPrint( _L("CDunAtCmdHandler::AddDataForParsing() received (%d bytes):"), aInput.Length() )); - FTRACE(FPrintRaw(aInput) ); - TBool editorMode = iCmdPusher->EditorMode(); - if ( editorMode ) - { - // Note: return here with "no more data needed" and some error to fool - // CDunUpstream into not reissuing the read request. - iCmdPusher->IssueRequest( aInput, EFalse ); - aMoreNeeded = EFalse; - return KErrGeneral; - } - iInput = &aInput; // iInput only for normal mode - // Manage partial AT command - TBool moreNeeded = ManagePartialCommand(); - if ( moreNeeded ) - { - aMoreNeeded = ETrue; - FTRACE(FPrint( _L("CDunAtCmdHandler::AddDataForParsing() (more partial) complete") )); - return KErrNone; - } - if ( iHandleState != EDunStateIdle ) - { - aMoreNeeded = EFalse; - ManageEndOfCmdHandling( EFalse, EFalse ); - FTRACE(FPrint( _L("CDunAtCmdHandler::AddDataForParsing() (not ready) complete") )); - return KErrNotReady; - } - TBool pushStarted = HandleASlashCommand(); - if ( pushStarted ) - { - // Note: return here with "partial input" status to fool CDunUpstream - // into reissuing the read request. The AT command has not really - // started yet so this is necessary. - aMoreNeeded = ETrue; - ManageEndOfCmdHandling( EFalse, EFalse ); - FTRACE(FPrint( _L("CDunAtCmdHandler::AddDataForParsing() (A/) complete") )); - return KErrNone; - } - iHandleState = EDunStateAtCmdHandling; - iDecodeInfo.iFirstDecode = ETrue; - iDecodeInfo.iDecodeIndex = 0; - iDecodeInfo.iPrevExists = EFalse; - iParseInfo.iLimit = KErrNotFound; - iParseInfo.iSendBuffer.Zero(); - iEditorModeInfo.iContentFound = EFalse; - HandleNextSubCommand(); - FTRACE(FPrint( _L("CDunAtCmdHandler::AddDataForParsing() complete") )); - aMoreNeeded = EFalse; - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Manages request to abort command handling -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CDunAtCmdHandler::ManageAbortRequest() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageAbortRequest()") )); - // Just forward the request, do no other own processing - TInt retVal = iCmdPusher->ManageAbortRequest(); - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageAbortRequest() complete") )); - return retVal; - } - -// --------------------------------------------------------------------------- -// Sends a character to be echoed -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CDunAtCmdHandler::SendEchoCharacter( const TDesC8* aInput, - MDunAtCmdEchoer* aCallback ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::SendEchoCharacter()") )); - TInt retVal = iCmdEchoer->SendEchoCharacter( aInput, aCallback ); - FTRACE(FPrint( _L("CDunAtCmdHandler::SendEchoCharacter() complete") )); - return retVal; - } - -// --------------------------------------------------------------------------- -// Stops sending of AT command from parse buffer -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CDunAtCmdHandler::Stop() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::Stop()") )); - // Only stop iCmdPusher here, not iUrcHandlers! - if ( iHandleState != EDunStateAtCmdHandling ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::Stop() (not ready) complete" ))); - return KErrNotReady; - } - iCmdPusher->Stop(); - // The line below is used in the case when this function is called by - // CDunUpstream as a result of "data mode ON" change notification. - // In this case it is possible that HandleNextSubCommand() returns - // without resetting the iSendBuffer because of the way it checks the - // iHandleState. - ManageEndOfCmdHandling( ETrue, EFalse ); - FTRACE(FPrint( _L("CDunAtCmdHandler::Stop() complete") )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Starts URC message handling -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CDunAtCmdHandler::StartUrc() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::StartUrc()") )); - TInt i; - TInt count = iUrcHandlers.Count(); - for ( i=0; iIssueRequest(); - if ( retTemp!=KErrNone && retTemp!=KErrNotReady ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::StartUrc() (ERROR) complete") )); - return retTemp; - } - } - FTRACE(FPrint( _L("CDunAtCmdHandler::StartUrc() complete") )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Stops URC message handling -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CDunAtCmdHandler::StopUrc() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::StopUrc()") )); - TInt i; - TInt retVal = KErrNone; - TInt count = iUrcHandlers.Count(); - for ( i=0; iStop(); - } - FTRACE(FPrint( _L("CDunAtCmdHandler::StopUrc() complete") )); - return retVal; - } - -// --------------------------------------------------------------------------- -// CDunAtCmdHandler::CDunAtCmdHandler -// --------------------------------------------------------------------------- -// -CDunAtCmdHandler::CDunAtCmdHandler( MDunAtCmdStatusReporter* aUpstream, - MDunStreamManipulator* aDownstream, - const TDesC8* aConnectionName ) : - iUpstream( aUpstream ), - iDownstream( aDownstream ), - iConnectionName( aConnectionName ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunAtCmdHandler::ConstructL -// --------------------------------------------------------------------------- -// -void CDunAtCmdHandler::ConstructL() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ConstructL()") )); - if ( !iUpstream || !iDownstream || !iConnectionName ) - { - User::Leave( KErrGeneral ); - } - // Connect to AT command extension (must succeed) - TInt retTemp = KErrNone; - CleanupClosePushL( iAtCmdExt ); - retTemp = iAtCmdExt.Connect( EDunATExtension, *iConnectionName ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ConstructL() connect (%d)"), retTemp)); - User::Leave( retTemp ); - } - CleanupClosePushL( iAtCmdExtCommon ); - retTemp = iAtCmdExtCommon.Connect( *iConnectionName ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ConstructL() common connect (%d)"), retTemp)); - User::Leave( retTemp ); - } - // Create the array of special commands - CreateSpecialCommandsL(); - // Create the plugin handlers - CreatePluginHandlersL(); - // Create the echo handler - iCmdEchoer = CDunAtCmdEchoer::NewL( iDownstream ); - // Create the listeners - iEcomListen = CDunAtEcomListen::NewL( &iAtCmdExt, this ); - iModeListen = CDunAtModeListen::NewL( &iAtCmdExtCommon, this ); - iNvramListen = CDunAtNvramListen::NewL( &iAtCmdExt, &iAtCmdExtCommon ); - iAtSpecialCmdHandler = CDunAtSpecialCmdHandler::NewL(); - // Set the default modes (+report) and characters - GetAndSetDefaultSettingsL(); - // Start listening - iEcomListen->IssueRequest(); - iModeListen->IssueRequest(); - iNvramListen->IssueRequest(); - CleanupStack::Pop( &iAtCmdExtCommon ); - CleanupStack::Pop( &iAtCmdExt ); - FTRACE(FPrint( _L("CDunAtCmdHandler::ConstructL() complete") )); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunAtCmdHandler::Initialize() - { - // Don't initialize iUpstream here (it is set through NewL) - // Don't initialize iDownstream here (it is set through NewL) - // Don't initialize iConnectionName here (it is set through NewL) - iHandleState = EDunStateIdle; - iCarriageReturn = 0; - iLineFeed = 0; - iBackspace = 0; - iInput = NULL; - iDecodeInfo.iFirstDecode = ETrue; - iDecodeInfo.iDecodeIndex = KErrNotFound; - iDecodeInfo.iExtendedIndex = KErrNotFound; - iDecodeInfo.iPrevChar = 0; - iDecodeInfo.iPrevExists = EFalse; - iDecodeInfo.iAssignFound = EFalse; - iDecodeInfo.iInQuotes = EFalse; - iDecodeInfo.iSpecialFound = EFalse; - iDecodeInfo.iCmdsHandled = 0; - iEditorModeInfo.iContentFound = EFalse; - iCmdPusher = NULL; - iEcomListen = NULL; - iModeListen = NULL; - iNvramListen = NULL; - iDataMode = EFalse; - iEchoOn = EFalse; - iQuietOn = EFalse; - iVerboseOn = EFalse; - iEndIndex = KErrNotFound; - } - -// --------------------------------------------------------------------------- -// Creates plugin handlers for this class -// --------------------------------------------------------------------------- -// -void CDunAtCmdHandler::CreatePluginHandlersL() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::CreatePluginHandlersL()") )); - if ( !iAtCmdExt.Handle() ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::CreatePluginHandlersL() complete") )); - User::Leave( KErrGeneral ); - } - // First create the command reply pusher - CDunAtCmdPusher* cmdPusher = CDunAtCmdPusher::NewLC( &iAtCmdExt, - this, - iDownstream, - &iOkBuffer ); - // Next create the URC handlers - TInt i; - TInt numOfPlugins = iAtCmdExt.NumberOfPlugins(); - for ( i=0; iIsDataInQueue(&iOkBuffer) ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::RegenerateOkReply() (in queue!) complete") )); - return iQuietOn; - } - iOkBuffer.Zero(); - if ( iQuietOn ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::RegenerateOkReply() (quiet) complete") )); - return ETrue; - } - if ( iVerboseOn ) - { - _LIT8( KVerboseOk, "OK" ); - iOkBuffer.Append( iCarriageReturn ); - iOkBuffer.Append( iLineFeed ); - iOkBuffer.Append( KVerboseOk ); - iOkBuffer.Append( iCarriageReturn ); - iOkBuffer.Append( iLineFeed ); - } - else - { - _LIT8( KNumericOk, "0" ); - iOkBuffer.Append( KNumericOk ); - iOkBuffer.Append( iCarriageReturn ); - } - FTRACE(FPrint( _L("CDunAtCmdHandler::RegenerateOkReply() complete") )); - return EFalse; - } - -// --------------------------------------------------------------------------- -// Regenerates the error reply based on settings -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::RegenerateErrorReply() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::RegenerateErrorReply()") )); - if ( iDownstream->IsDataInQueue(&iErrorBuffer) ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::RegenerateErrorReply() (in queue!) complete") )); - return iQuietOn; - } - iErrorBuffer.Zero(); - if ( iQuietOn ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::RegenerateErrorReply() (quiet) complete") )); - return ETrue; - } - if ( iVerboseOn ) - { - _LIT8( KVerboseError, "ERROR" ); - iErrorBuffer.Append( iCarriageReturn ); - iErrorBuffer.Append( iLineFeed ); - iErrorBuffer.Append( KVerboseError ); - iErrorBuffer.Append( iCarriageReturn ); - iErrorBuffer.Append( iLineFeed ); - } - else - { - _LIT8( KNumericError, "4" ); - iErrorBuffer.Append( KNumericError ); - iErrorBuffer.Append( iCarriageReturn ); - } - FTRACE(FPrint( _L("CDunAtCmdHandler::RegenerateErrorReply() complete") )); - return EFalse; - } - -// --------------------------------------------------------------------------- -// Gets current mode -// --------------------------------------------------------------------------- -// -TUint CDunAtCmdHandler::GetCurrentModeL( TUint aMask ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::GetCurrentModeL()") )); - TUint maskCheck = aMask & ( ~KSupportedModes ); - if ( maskCheck != 0 ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::GetCurrentModeL() (not supported) complete") )); - User::Leave( KErrNotSupported ); - } - TUint newMode = 0; - TInt retTemp = iAtCmdExtCommon.GetMode( aMask, newMode ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::GetCurrentModeL() (ERROR) complete") )); - User::Leave( retTemp ); - } - FTRACE(FPrint( _L("CDunAtCmdHandler::GetCurrentModeL() complete") )); - return newMode & (KModeChanged-1); - } - -// --------------------------------------------------------------------------- -// Instantiates one URC message handling class instance and adds it to the URC -// message handler array -// --------------------------------------------------------------------------- -// -CDunAtUrcHandler* CDunAtCmdHandler::AddOneUrcHandlerL() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::AddOneUrcHandlerL()") )); - CDunAtUrcHandler* urcHandler = CDunAtUrcHandler::NewLC( &iAtCmdExt, - iDownstream ); - iUrcHandlers.AppendL( urcHandler ); - CleanupStack::Pop( urcHandler ); - FTRACE(FPrint( _L("CDunAtCmdHandler::AddOneUrcHandlerL() complete") )); - return urcHandler; - } - -// --------------------------------------------------------------------------- -// Deletes all instantiated URC message handlers -// --------------------------------------------------------------------------- -// -void CDunAtCmdHandler::DeletePluginHandlers() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::DeletePluginHandlers()") )); - delete iCmdPusher; - iCmdPusher = NULL; - TInt i; - TInt count = iUrcHandlers.Count(); - for ( i=0; iLength() == KDunChSetMaxCharLen ) - { - EchoCommand(); - // Handle backspace and cancel characters - TBool found = HandleSpecialCharacters(); - if ( found ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ManagePartialCommand() (special) complete") )); - return ETrue; - } - } - TBool moreNeeded = ExtractLineFromInputBuffer(); - if ( moreNeeded ) - { - // More data is not needed with "A/" (no carriage return), check that - // special case here, otherwise continue processing - if ( !IsASlashCommand() ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ManagePartialCommand() (more) complete") )); - return ETrue; - } - } - // If something went wrong, do nothing (return consumed) - if ( iLineBuffer.Length() <= 0 ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ManagePartialCommand() (length) complete") )); - return ETrue; - } - // For other commands, just return with consumed - FTRACE(FPrint( _L("CDunAtCmdHandler::ManagePartialCommand() complete") )); - return EFalse; - } - -// --------------------------------------------------------------------------- -// Echoes a command if echo is on -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::EchoCommand() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::EchoCommand()") )); - if ( iInput->Length() > KDunChSetMaxCharLen ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::EchoCommand() (wrong length) complete") )); - return EFalse; - } - if ( iEchoOn ) - { - if ( iDownstream->IsDataInQueue(&iEchoBuffer) ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::EchoCommand() (in queue!) complete") )); - return EFalse; - } - iEchoBuffer.Copy( *iInput ); - iDownstream->NotifyDataPushRequest( &iEchoBuffer, NULL ); - FTRACE(FPrint( _L("CDunAtCmdHandler::EchoCommand() complete") )); - return ETrue; - } - FTRACE(FPrint( _L("CDunAtCmdHandler::EchoCommand() (not started) complete") )); - return EFalse; - } - -// --------------------------------------------------------------------------- -// Handles backspace and cancel characters -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::HandleSpecialCharacters() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::HandleSpecialCharacters()") )); - if ( iInput->Length() != KDunChSetMaxCharLen ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::HandleSpecialCharacters() (wrong length) complete") )); - return EFalse; - } - if ( (*iInput)[0] == iBackspace ) - { - TInt lineLength = iLineBuffer.Length(); - if ( lineLength > 0 ) - { - iLineBuffer.SetLength( lineLength-1 ); - } - FTRACE(FPrint( _L("CDunAtCmdHandler::HandleSpecialCharacters() (backspace) complete") )); - return ETrue; - } - if ( (*iInput)[0] == KDunCancel ) - { - ManageEndOfCmdHandling( EFalse, EFalse ); - FTRACE(FPrint( _L("CDunAtCmdHandler::HandleSpecialCharacters() (cancel) complete") )); - return ETrue; - } - FTRACE(FPrint( _L("CDunAtCmdHandler::HandleSpecialCharacters() complete") )); - return EFalse; - } - -// --------------------------------------------------------------------------- -// Extracts line from input buffer to line buffer -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::ExtractLineFromInputBuffer() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractLineFromInputBuffer()") )); - FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractLineFromInputBuffer() before (%d bytes):"), iLineBuffer.Length() )); - FTRACE(FPrintRaw(iLineBuffer) ); - // Case1: If no data in iLineBuffer and end-of-line character in iInputBuffer[start]: - // - Skip end-of-line characters, find start-of-line condition, find end-of-line character - // - If partial line found (start-of-line condition and no end-of-line character): - // - Save partial line to iLineBuffer - // - Set iEndIndex to end of iInputBuffer - // - If full line found (start-of-line condition and end-of-line character): - // - Save full line to iLineBuffer - // - Skip multiple end-of-line characters until next start-of-line - // condition or end of iInputBuffer -> save this position to iEndIndex - // Case2: If no data in iLineBuffer and non-end-of-line character in iInputBuffer[start]: - // - Find end-of-line character - // - If partial line found (no end-of-line character): - // - Save partial line to iLineBuffer - // - Set iEndIndex to end of iLineBuffer - // - If full line found (end-of-line character): - // - Save full line to iLineBuffer - // - Skip multiple end-of-line characters until next start-of-line - // condition or end of iInputBuffer -> save this position to iEndIndex - // Case3: If data in iLineBuffer and end-of-line character in iInputBuffer[start]: - // - Skip end-of-line characters - // - Keep string currently in iLineBuffer - // - Skip end-of-line characters until non-end-of-line or end of - // iInputBuffer -> save this position to iEndIndex - // Case4: If data in iLineBuffer and non-end-of-line character in iInputBuffer[start]: - // - Processed the same way as Case1, however "Skip end-of-line characters" does - // not have any effect - if ( iInput->Length() <= 0 ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractLineFromInputBuffer() (wrong length) complete") )); - return ETrue; - } - TBool moreNeeded = ETrue; - TBool copyNeeded = EFalse; - TInt copyLength = KErrNotFound; - TInt lineLength = iLineBuffer.Length(); - TInt lineMaxLength = iLineBuffer.MaxLength(); - TInt freeLineSpace = lineMaxLength - lineLength; - TInt inputLength = iInput->Length(); - TInt startIndex = ( iEndIndex>=0 ) ? iEndIndex : 0; - if ( startIndex >= inputLength ) - { - iEndIndex = KErrNotFound; - FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractLineFromInputBuffer() (input end) complete") )); - return ETrue; - } - // Cases here: - // Case1: If no data in iLineBuffer and end-of-line character in iInputBuffer[start] - // Case2: If no data in iLineBuffer and non-end-of-line character in iInputBuffer[start] - // Case3: If data in iLineBuffer and end-of-line character in iInputBuffer[start] - // Case4: If data in iLineBuffer and non-end-of-line character in iInputBuffer[start] - // Summary: Cases 1, 2 and 4 can be combined. Case 3 needs a separate check. - TChar character = (*iInput)[startIndex]; - TBool endOfLine = IsEndOfLine(character); - if ( lineLength>0 && endOfLine ) - { - moreNeeded = HandleSpecialBufferManagement( startIndex, - copyLength, - copyNeeded ); - } - else - { - moreNeeded = HandleGenericBufferManagement( startIndex, - copyLength, - copyNeeded ); - } - if ( copyNeeded && copyLength>0 ) - { - // Check the case copyLength does not fit to iLineBuffer - // This case should be handled by returning "more data needed" - // Also reset the iLineBuffer to ensure the handling doesn't stuck - // for rest of the commands (usability case) - if ( copyLength > freeLineSpace ) - { - iLineBuffer.Zero(); - iEndIndex = KErrNotFound; - FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractLineFromInputBuffer() after (%d bytes):"), iLineBuffer.Length() )); - FTRACE(FPrintRaw(iLineBuffer) ); - FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractLineFromInputBuffer() (overflow) complete") )); - return ETrue; - } - iLineBuffer.Append( &(*iInput)[startIndex], copyLength ); - FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractLineFromInputBuffer() after (%d bytes):"), iLineBuffer.Length() )); - FTRACE(FPrintRaw(iLineBuffer) ); - } - if ( moreNeeded ) - { - iEndIndex = KErrNotFound; - FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractLineFromInputBuffer() (more needed) complete") )); - return ETrue; - } - FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractLineFromInputBuffer() (line found) complete") )); - return EFalse; - } - -// --------------------------------------------------------------------------- -// Handles generic buffer management -// (explanation in ExtractLineFromInputBuffer()) -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::HandleGenericBufferManagement( TInt& aStartIndex, - TInt& aCopyLength, - TBool& aCopyNeeded ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::HandleGenericBufferManagement()") )); - TInt inputLength = iInput->Length(); - TInt currentIndex = SkipEndOfLineCharacters( aStartIndex ); - if ( currentIndex >= inputLength ) - { - // No data in iLineBuffer and only end-of-lines in new buffer - // return with "need more data" - iEndIndex = inputLength; - aCopyLength = 0; - aCopyNeeded = EFalse; - FTRACE(FPrint( _L("CDunAtCmdHandler::HandleGenericBufferManagement() (new end for old no data) complete") )); - return ETrue; - } - // No data in iLineBuffer and non-end-of-line character found - // Try to find the first start-of-line condition - TInt lineLength = iLineBuffer.Length(); - if ( lineLength == 0 ) - { - currentIndex = SkipSubCommandDelimiterCharacters( aStartIndex ); - if ( currentIndex >= inputLength ) - { - // No data in iLineBuffer and only end-of-lines+delimiter in new buffer - // return with "need more data" - iEndIndex = inputLength; - aCopyLength = 0; - aCopyNeeded = EFalse; - FTRACE(FPrint( _L("CDunAtCmdHandler::HandleGenericBufferManagement() (new end+delim for old no data) complete") )); - return ETrue; - } - } - aStartIndex = currentIndex; - // No data in iLineBuffer and other than end-of-line or delimiter character found - // Variable currentIndex is now the start of new command - // Next try to find the end of the command - TInt endIndex = FindEndOfLine( aStartIndex ); - if ( endIndex >= inputLength ) - { - // No data in iLineBuffer and start of command found without end - // return with "need more data" - iEndIndex = inputLength; - aCopyLength = inputLength - aStartIndex; - aCopyNeeded = ETrue; - FTRACE(FPrint( _L("CDunAtCmdHandler::HandleGenericBufferManagement() (start but no end for old no data) complete") )); - return ETrue; - } - // No data in iLineBuffer and end-of-line character found - // Try to skip possible multiple end-of-line characters - currentIndex = SkipEndOfLineCharacters( endIndex ); - // Variable currentIndex is now either start of next command or end of iInput - // Note that this requires that Case 2 must skip the possible IsDelimiterCharacter()s - iEndIndex = currentIndex; - aCopyLength = endIndex - aStartIndex; - aCopyNeeded = ETrue; - FTRACE(FPrint( _L("CDunAtCmdHandler::HandleGenericBufferManagement() (line found) complete") )); - return EFalse; - } - -// --------------------------------------------------------------------------- -// Handles special buffer management -// (explanation in ExtractLineFromInputBuffer()) -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::HandleSpecialBufferManagement( TInt aStartIndex, - TInt& aCopyLength, - TBool& aCopyNeeded ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::HandleSpecialBufferManagement()") )); - TInt currentIndex = SkipEndOfLineCharacters( aStartIndex ); - // Variable currentIndex is now either start of next command or end of iInput - iEndIndex = currentIndex; - aCopyLength = 0; - aCopyNeeded = EFalse; - FTRACE(FPrint( _L("CDunAtCmdHandler::HandleSpecialBufferManagement() complete") )); - return EFalse; - } - -// --------------------------------------------------------------------------- -// Skips end-of-line characters -// --------------------------------------------------------------------------- -// -TInt CDunAtCmdHandler::SkipEndOfLineCharacters( TInt aStartIndex ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::SkipEndOfLineCharacters()") )); - TInt foundIndex = iInput->Length(); - TInt inputLength = foundIndex; - for ( TInt i=aStartIndex; iLength(); - TInt foundIndex = inputLength; - for ( TInt i=aStartIndex; iLength(); - TInt foundIndex = inputLength; - for ( TInt i=aStartIndex; i let mixed cases pass - TInt oldLength = iParseInfo.iSendBuffer.Length(); - iParseInfo.iSendBuffer.SetLength( iParseInfo.iLimit ); - iParseInfo.iSendBuffer.UpperCase(); - iParseInfo.iSendBuffer.SetLength( oldLength ); - // Next always send the command to ATEXT - iCmdPusher->IssueRequest( iParseInfo.iSendBuffer ); - FTRACE(FPrint( _L("CDunAtCmdHandler::HandleNextSubCommand() complete") )); - return ETrue; - } - -// --------------------------------------------------------------------------- -// Manages end of AT command handling -// --------------------------------------------------------------------------- -// -void CDunAtCmdHandler::ManageEndOfCmdHandling( TBool aNotifyLocal, - TBool aNotifyExternal ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageEndOfCmdHandling()") )); - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageEndOfCmdHandling() (loc=%d, ext=%d)"), aNotifyLocal, aNotifyExternal )); - // If iEndIndex is (>=0 && Length(); - TBool subBlock = ( iEndIndex>=0&&iEndIndex0 && !subBlock ) - { - // Line buffer set and no partial subblock, copy to lastbuffer - iLastBuffer.Copy( iLineBuffer ); - } - iLineBuffer.Zero(); - iDecodeInfo.iFirstDecode = ETrue; - iDecodeInfo.iDecodeIndex = 0; - iDecodeInfo.iPrevExists = EFalse; - iParseInfo.iLimit = KErrNotFound; - iParseInfo.iSendBuffer.Zero(); - iEditorModeInfo.iContentFound = EFalse; - iHandleState = EDunStateIdle; - if ( aNotifyLocal ) - { - iCmdPusher->SetEndOfCmdLine(); - } - // iEndIndex must not be reset to KErrNotFound only when - // ExtractLineFromInputBuffer() found the next line - // (when moreNeeded is EFalse) - TBool resetIndex = ETrue; - if ( aNotifyExternal ) - { - TBool moreNeeded = ExtractLineFromInputBuffer(); - if ( moreNeeded ) - { - iUpstream->NotifyParserNeedsMoreData(); - } - else - { - // AppendBlockToInputBuffer() was able to fill with known end, handle next - iHandleState = EDunStateAtCmdHandling; - HandleNextSubCommand(); - resetIndex = EFalse; - } - } - if ( resetIndex ) - { - iEndIndex = KErrNotFound; - } - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageEndOfCmdHandling() complete") )); - } - -// --------------------------------------------------------------------------- -// Extracts next subcommand from line buffer to send buffer -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::ExtractNextSubCommand( TBool aPeek ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractNextSubCommand()") )); - TDunDecodeInfo oldInfo = iDecodeInfo; - iParseInfo.iLimit = KErrNotFound; - iParseInfo.iSendBuffer.Zero(); - // Find start of subcommand from line buffer - TInt startIndex = FindStartOfSubCommand(); - if ( startIndex < 0 ) - { - RestoreOldDecodeInfo( aPeek, oldInfo ); - FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractNextDecodedCommand() (no start) complete") )); - return EFalse; - } - iDecodeInfo.iDecodeIndex = startIndex; - TBool specialCmd = EFalse; - TInt endIndex = KErrNotFound; - specialCmd = CheckSpecialCommand( endIndex ); - if ( !specialCmd ) - { - FindSubCommand( endIndex ); - } - TInt lineLength = iLineBuffer.Length(); - TBool inStartLimits = ( startIndex >= 0 && startIndex < lineLength ) ? ETrue : EFalse; - TBool inEndLimits = ( endIndex >= 0 && endIndex < lineLength ) ? ETrue : EFalse; - if ( !inStartLimits || !inEndLimits ) - { - RestoreOldDecodeInfo( aPeek, oldInfo ); - FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractNextSubCommand() (no end) complete") )); - return EFalse; - } - TInt cmdLength = endIndex - startIndex + 1; - // If the limit was not already set then do it now - if ( iParseInfo.iLimit < 0 ) - { - iParseInfo.iLimit = cmdLength; - } - // Next create a new command - if ( !iDecodeInfo.iFirstDecode ) - { - _LIT( KAtPrefix, "AT" ); - iParseInfo.iSendBuffer.Append( KAtPrefix ); - if ( !specialCmd ) // Already added with CheckSpecialCommand() - { - iParseInfo.iLimit += 2; // Length of "AT" - } - // Note: The length of iDecodeBuffer is not exceeded here because "AT" - // is added only for the second commands after that. - } - iParseInfo.iSendBuffer.Append( &iLineBuffer[startIndex], cmdLength ); - // Change settings for the next decode round - iDecodeInfo.iFirstDecode = EFalse; - iDecodeInfo.iDecodeIndex = endIndex + 1; - RestoreOldDecodeInfo( aPeek, oldInfo ); - if ( !aPeek ) - { - iDecodeInfo.iCmdsHandled++; - FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractNextSubCommand() (handled=%d)"), iDecodeInfo.iCmdsHandled )); - } - FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractNextSubCommand() complete") )); - return ETrue; - } - -// --------------------------------------------------------------------------- -// Finds the start of subcommand from line buffer -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::FindStartOfSubCommand() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::FindStartOfSubCommand()") )); - TInt i; - TInt foundIndex = KErrNotFound; - TInt lineLength = iLineBuffer.Length(); - for ( i=iDecodeInfo.iDecodeIndex; i upperBuf; - if ( !iDecodeInfo.iFirstDecode ) - { - // For cases such as "ATM1L3DT*99#" "DT" must have "AT" - _LIT8( KAtPrefix, "AT" ); - upperBuf.Copy( KAtPrefix ); - atPrefixLen = 2; // "AT" - newLength += atPrefixLen; - } - upperBuf.Append( &iLineBuffer[startIndex], newLength ); - upperBuf.UpperCase(); - TInt i; - TInt count = iSpecials.Count(); - for ( i=0; iLength(); - if ( newLength < specialLength ) - { - continue; - } - TInt origLength = newLength; - if ( newLength > specialLength ) - { - upperBuf.SetLength( specialLength ); - } - TInt cmpResult = upperBuf.Compare( *specialCmd ); - upperBuf.SetLength( origLength ); - if ( cmpResult == 0 ) - { - iParseInfo.iLimit = specialLength; - aEndIndex = (origLength-1) + startIndex - atPrefixLen; - FTRACE(FPrint( _L("CDunAtCmdHandler::CheckSpecialCommand() complete") )); - return ETrue; - } - } - FTRACE(FPrint( _L("CDunAtCmdHandler::CheckSpecialCommand() (not found) complete") )); - return EFalse; - } - -// --------------------------------------------------------------------------- -// Saves character decode state for a found character -// --------------------------------------------------------------------------- -// -void CDunAtCmdHandler::SaveFoundCharDecodeState( TChar aCharacter, - TBool aAddSpecial ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::SaveFoundCharDecodeState()") )); - iDecodeInfo.iPrevExists = ETrue; - iDecodeInfo.iPrevChar = aCharacter; - if ( aAddSpecial ) - { - iDecodeInfo.iSpecialFound = - iAtSpecialCmdHandler->IsCompleteSubCommand( aCharacter ); - } - FTRACE(FPrint( _L("CDunAtCmdHandler::SaveFoundCharDecodeState() complete") )); - } - -// --------------------------------------------------------------------------- -// Saves character decode state for a not found character -// --------------------------------------------------------------------------- -// -void CDunAtCmdHandler::SaveNotFoundCharDecodeState() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::SaveNotFoundCharDecodeState()") )); - iDecodeInfo.iPrevExists = EFalse; - // Note: don't set iAssignFound or iInQuotes here - iDecodeInfo.iSpecialFound = EFalse; - FTRACE(FPrint( _L("CDunAtCmdHandler::SaveNotFoundCharDecodeState() complete") )); - } - -// --------------------------------------------------------------------------- -// Find quotes within subcommands -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::FindSubCommandQuotes( TChar aCharacter, - TInt aStartIndex, - TInt& aEndIndex ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommandQuotes()") )); - if ( aCharacter == '"' ) - { - if ( iParseInfo.iLimit < 0 ) // Only first the first '"' - { - iParseInfo.iLimit = aEndIndex - aStartIndex; - } - iDecodeInfo.iInQuotes ^= ETrue; // EFalse to ETrue or ETrue to EFalse - SaveFoundCharDecodeState( aCharacter, EFalse ); - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommandQuotes() (quote) complete") )); - return ETrue; - } - // The next ones are those that are not in quotes. - // We still need to save the iParseInfo.iLimit and skip non-delimiter characters. - if ( aCharacter == '=' ) - { - if ( iParseInfo.iLimit < 0 ) // Only first the first '"' - { - iParseInfo.iLimit = aEndIndex - aStartIndex; - } - iDecodeInfo.iAssignFound = ETrue; - SaveFoundCharDecodeState( aCharacter, EFalse ); - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommandQuotes() (equals) complete") )); - return ETrue; - } - if ( iDecodeInfo.iInQuotes ) - { - SaveNotFoundCharDecodeState(); - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommandQuotes() (in quotes) complete") )); - return ETrue; - } - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommandQuotes() (not found) complete") )); - return EFalse; - } - -// --------------------------------------------------------------------------- -// Check if in next subcommand's extended border -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::IsExtendedBorder( TChar aCharacter, - TInt aStartIndex, - TInt& aEndIndex ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::IsExtendedBorder()") )); - TInt expectedIndex = 0; // "+CMD" when iDecodeInfo.iFirstDecode is EFalse - TInt extendedIndex = aEndIndex - aStartIndex; // absolute index to the extended character - if ( iDecodeInfo.iFirstDecode ) - { - expectedIndex = 2; // "AT+CMD" - } - if ( extendedIndex == expectedIndex ) - { - iDecodeInfo.iExtendedIndex = aEndIndex; - SaveFoundCharDecodeState( aCharacter ); - FTRACE(FPrint( _L("CDunAtCmdHandler::IsExtendedBorder() (no border normal) complete") )); - return EFalse; - } - // Now suspect border found so peek the next character after the suspected - // extended character. If it is not alphabetical character, return with EFalse. - // This case is to detect the cases such as "AT+VTS={*,3000}", where '*' would - // be the start of the next command in normal cases. - TInt peekIndex = aEndIndex + 1; - TInt lineLength = iLineBuffer.Length(); - if ( peekIndex < lineLength ) - { - TChar nextCharacter = iLineBuffer[peekIndex]; - if ( !nextCharacter.IsAlpha() ) - { - SaveFoundCharDecodeState( aCharacter ); - FTRACE(FPrint( _L("CDunAtCmdHandler::IsExtendedBorder() (no border special) complete") )); - return EFalse; - } - } - aEndIndex--; - FTRACE(FPrint( _L("CDunAtCmdHandler::IsExtendedBorder() (border) complete") )); - return ETrue; - } - -// --------------------------------------------------------------------------- -// Finds subcommand with alphanumeric borders -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::FindSubCommandAlphaBorder( TChar aCharacter, - TInt& aEndIndex ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommandAlphaBorder()") )); - if ( iDecodeInfo.iAssignFound && !iDecodeInfo.iInQuotes ) - { - // Check the special case when assigning a number with "basic" command - // and there is no delimiter after it. In this case | - // border must be detected but only for a "basic" command, not for - // extended. - if ( iDecodeInfo.iExtendedIndex<0 && iDecodeInfo.iPrevExists && - iDecodeInfo.iPrevChar.IsDigit() && aCharacter.IsAlpha() ) - { - aEndIndex--; - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommandAlphaBorder() (N|A) complete") )); - return ETrue; - } - // The code below is for the following type of cases: - // (do not check alphanumeric borders if "=" set without quotes): - // AT+CMD=a - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommandAlphaBorder() (skip) complete") )); - return EFalse; - } - if ( !iDecodeInfo.iPrevExists || !aCharacter.IsAlpha() ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommandAlphaBorder() (not found) complete") )); - return EFalse; - } - if ( iDecodeInfo.iPrevChar.IsAlpha() ) - { - // The check below detects the following type of cases - // (note that special handling is needed to separate the Alpha|Alpha boundary): - // AT&FE0 - if ( iDecodeInfo.iSpecialFound ) - { - // Special command was found before and this is Alpha|Alpha boundary -> end - aEndIndex--; - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommandAlphaBorder() (special) complete") )); - return ETrue; - } - // The code below is for the following type of cases - // (note there is no border between C|M, for example -> continue): - // ATCMD - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommandAlphaBorder() (continue) complete") )); - return EFalse; - } - // The code below is for skipping the following type of cases: - // AT+CMD [the '+' must be skipped] - if ( aEndIndex-1 == iDecodeInfo.iExtendedIndex ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommandAlphaBorder() (extended) complete") )); - return EFalse; - } - // The code below is for the following type of cases: - // ATCMD?ATCMD - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommandAlphaBorder() (boundary) complete") )); - aEndIndex--; - return ETrue; - } - -// --------------------------------------------------------------------------- -// Finds subcommand -// --------------------------------------------------------------------------- -// -TInt CDunAtCmdHandler::FindSubCommand( TInt& aEndIndex ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommand()") )); - TInt startIndex = iDecodeInfo.iDecodeIndex; - aEndIndex = startIndex; - TBool found = EFalse; - TInt lineLength = iLineBuffer.Length(); - iDecodeInfo.iAssignFound = EFalse; - iDecodeInfo.iInQuotes = EFalse; - iDecodeInfo.iExtendedIndex = KErrNotFound; - SaveNotFoundCharDecodeState(); - iAtSpecialCmdHandler->ResetComparisonBuffer(); // just to be sure - for ( ; aEndIndex - if ( IsDelimiterCharacter(character) ) - { - aEndIndex--; - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommand() (delimiter) complete") )); - return KErrNone; - } - // The check below detects the following type of cases: - // ATCMD+CMD [first + as delimiter] - // AT+CMD+CMD [second + as delimiter] - if ( IsExtendedCharacter(character) ) - { - found = IsExtendedBorder( character, startIndex, aEndIndex ); - if ( !found ) - { - continue; - } - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommand() (extended) complete") )); - return KErrNone; - } - found = FindSubCommandAlphaBorder( character, aEndIndex ); - if ( found ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommand() (alpha sub) complete") )); - return KErrNone; - } - SaveFoundCharDecodeState( character ); - } - aEndIndex--; - FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommand() (not found) complete") )); - return KErrNotFound; - } - -// --------------------------------------------------------------------------- -// Check if "A/" command -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::IsASlashCommand() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::IsASlashCommand()") )); - if ( iLineBuffer.Length() == 2 ) - { - if ( iLineBuffer[1] == '/' && - (iLineBuffer[0] == 'A' || iLineBuffer[0] == 'a') ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::IsASlashCommand() (found) complete") )); - return ETrue; - } - } - FTRACE(FPrint( _L("CDunAtCmdHandler::IsASlashCommand() (not found) complete") )); - return EFalse; - } - -// --------------------------------------------------------------------------- -// Handles "A/" command -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::HandleASlashCommand() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::HandleASlashCommand()") )); - // If not "A/" command, return - if ( !IsASlashCommand() ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::HandleASlashCommand() (no push) complete") )); - return EFalse; - } - iEndIndex = iInput->Length(); // Causes skipping of last '/' in ManageEndOfCmdHandling() - // If "A/" command and last buffer exist, set the last buffer as the current buffer - if ( iLastBuffer.Length() > 0 ) - { - iLineBuffer.Copy( iLastBuffer ); - FTRACE(FPrint( _L("CDunAtCmdHandler::HandleASlashCommand() (copy) complete") )); - return EFalse; - } - // Last buffer not set so return "ERROR" - iDownstream->NotifyDataPushRequest( &iErrorBuffer, NULL ); - FTRACE(FPrint( _L("CDunAtCmdHandler::HandleASlashCommand() complete") )); - return ETrue; - } - -// --------------------------------------------------------------------------- -// Manages command mode change -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::ManageCommandModeChange( TUint aMode ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageCommandModeChange()" ) )); - if ( aMode & KCommandModeChanged ) - { - if ( aMode & KModeCommand ) // command mode ON - { - ReportCommandModeChange( ETrue ); - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageCommandModeChange() command mode changed ON" ) )); - } - else // command mode OFF - { - ReportCommandModeChange( EFalse ); - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageCommandModeChange() command mode changed OFF" ) )); - } - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageCommandModeChange() (change) complete" ) )); - return ETrue; - } - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageCommandModeChange()" ) )); - return EFalse; - } - -// --------------------------------------------------------------------------- -// Reports command mode start/end change -// --------------------------------------------------------------------------- -// -void CDunAtCmdHandler::ReportCommandModeChange( TBool aStart ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ReportCommandModeChange()" ) )); - TInt i; - TInt count = iCmdCallbacks.Count(); - if ( aStart ) - { - if ( iDataMode ) - { - for ( i=0; iNotifyCommandModeStart(); - } - iDataMode = EFalse; - } - } - else // end - { - if ( !iDataMode ) - { - for ( i=0; iNotifyCommandModeEnd(); - } - iDataMode = ETrue; - } - } - FTRACE(FPrint( _L("CDunAtCmdHandler::ReportCommandModeChange() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Manages echo mode change -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::ManageEchoModeChange( TUint aMode ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageEchoModeChange()" ) )); - if ( aMode & KEchoModeChanged ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageEchoModeChange() checking echo mode..." ) )); - if ( aMode & KModeEcho ) // echo mode ON - { - iEchoOn = ETrue; - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageEchoModeChange() echo mode changed ON" ) )); - } - else // echo mode OFF - { - iEchoOn = EFalse; - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageEchoModeChange() echo mode changed OFF" ) )); - } - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageEchoModeChange() (change) complete" ) )); - return ETrue; - } - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageEchoModeChange() complete" ) )); - return EFalse; - } - -// --------------------------------------------------------------------------- -// Manages quiet mode change -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::ManageQuietModeChange( TUint aMode ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageQuietModeChange()" ) )); - if ( aMode & KQuietModeChanged ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageEchoModeChange() checking quiet mode..." ) )); - if ( aMode & KModeQuiet ) // quiet mode ON - { - iAtCmdExt.ReportQuietModeChange( ETrue ); - iQuietOn = ETrue; - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageQuietModeChange() quiet mode changed ON" ) )); - } - else // quiet mode OFF - { - iAtCmdExt.ReportQuietModeChange( EFalse ); - iQuietOn = EFalse; - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageQuietModeChange() quiet mode changed OFF" ) )); - } - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageQuietModeChange() (change) complete" ) )); - return ETrue; - } - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageQuietModeChange() complete" ) )); - return EFalse; - } - -// --------------------------------------------------------------------------- -// Manages quiet mode change -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::ManageVerboseModeChange( TUint aMode ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageVerboseModeChange()" ) )); - if ( aMode & KVerboseModeChanged ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageVerboseModeChange() checking verbose mode..." ) )); - if ( aMode & KModeVerbose ) // verbose mode ON - { - iAtCmdExt.ReportVerboseModeChange( ETrue ); - iVerboseOn = ETrue; - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyVerboseStatusChange() verbose mode changed ON" ) )); - } - else // verbose mode OFF - { - iAtCmdExt.ReportVerboseModeChange( EFalse ); - iVerboseOn = EFalse; - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyVerboseStatusChange() verbose mode changed OFF" ) )); - } - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageVerboseModeChange() (change) complete" ) )); - return ETrue; - } - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageVerboseModeChange() complete" ) )); - return EFalse; - } - -// --------------------------------------------------------------------------- -// Manages character change -// --------------------------------------------------------------------------- -// -void CDunAtCmdHandler::ManageCharacterChange( TUint aMode ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageCharacterChange()" ) )); - if ( aMode & KCarriageChanged ) - { - iCarriageReturn = aMode & (KModeChanged-1); - iAtCmdExt.ReportCharacterChange( ECharTypeCarriage, iCarriageReturn ); - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageCharacterChange() carriage return changed" ) )); - } - else if ( aMode & KLineFeedChanged ) - { - iLineFeed = aMode & (KModeChanged-1); - iAtCmdExt.ReportCharacterChange( ECharTypeLineFeed, iLineFeed ); - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageCharacterChange() line feed changed" ) )); - } - else if ( aMode & KBackspaceChanged ) - { - iBackspace = aMode & (KModeChanged-1); - iAtCmdExt.ReportCharacterChange( ECharTypeBackspace, iBackspace ); - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageCharacterChange() backspace changed" ) )); - } - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageCharacterChange() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Manages editor mode reply -// --------------------------------------------------------------------------- -// -TInt CDunAtCmdHandler::ManageEditorModeReply( TBool aStart ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageEditorModeReply()" ) )); - // Two modes possible here: - // 1) Sending data directly from DTE to DCE, i.e. no subsequent data in - // the input buffer -> Reissue read request from DTE. - // 2) Sending data from input buffer to DCE -> Do not reissue read request - // from DTE: send the data in a loop - // In summary: send data byte-by-byte in editor mode until end of input. - // When end of input notify CDunUpstream to reissue the read request. - TBool nextContentFound = FindNextContent( aStart ); - if ( !nextContentFound ) - { - iUpstream->NotifyEditorModeReply( aStart ); - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageEditorModeReply() complete") )); - return KErrNone; - } - // In block mode end the block mode by sending and hope it works. - iEscapeBuffer.Zero(); - iEscapeBuffer.Append( KDunEscape ); - iCmdPusher->IssueRequest( iEscapeBuffer, EFalse ); - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageEditorModeReply() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Finds the next content from the input data -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::FindNextContent( TBool aStart ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::FindNextContent()" ) )); - if ( !aStart ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::FindNextContent() (skip) complete" ) )); - return iEditorModeInfo.iContentFound; - } - // If iEndIndex is (>=0 && Length(); - TBool subBlock = ( iEndIndex>=0&&iEndIndexEditorMode(); - if ( editorMode ) - { - ManageEditorModeReply( ETrue ); - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyEndOfProcessing() (editor) complete" ) )); - return KErrNone; - } - HandleNextSubCommand(); - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyEndOfProcessing() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunAtCmdPusher. -// Notifies about request to stop AT command handling for the rest of the -// command line data -// --------------------------------------------------------------------------- -// -void CDunAtCmdHandler::NotifyEndOfCmdLineProcessing() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyEndOfCmdLineProcessing()" ) )); - ManageEndOfCmdHandling( ETrue, ETrue ); - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyEndOfCmdLineProcessing() complete" ) )); - } - -// --------------------------------------------------------------------------- -// From class MDunAtCmdPusher. -// Notifies about request to peek for the next command -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::NotifyNextCommandPeekRequest() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyNextCommandPeekRequest()") )); - TBool extracted = ExtractNextSubCommand( ETrue ); - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyNextCommandPeekRequest() complete") )); - return extracted; - } - -// --------------------------------------------------------------------------- -// From class MDunAtCmdPusher. -// Notifies about editor mode reply -// --------------------------------------------------------------------------- -// -TInt CDunAtCmdHandler::NotifyEditorModeReply() - { - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyEditorModeReply()") )); - TInt retVal = ManageEditorModeReply( EFalse ); - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyEditorModeReply() complete") )); - return retVal; - } - -// --------------------------------------------------------------------------- -// From class MDunAtEcomListen. -// Notifies about new plugin installation -// --------------------------------------------------------------------------- -// -TInt CDunAtCmdHandler::NotifyPluginInstallation( TUid& /*aPluginUid*/ ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyPluginInstallation()" ) )); - CDunAtUrcHandler* urcHandler = NULL; - TRAPD( retTrap, urcHandler=AddOneUrcHandlerL() ); - if ( retTrap != KErrNone ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyPluginInstallation() (trapped!) complete" ) )); - return retTrap; - } - TInt retTemp = urcHandler->IssueRequest(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyPluginInstallation() (issuerequest) complete" ) )); - return retTemp; - } - TUid ownerUid = urcHandler->OwnerUid(); - iAtCmdExt.ReportListenerUpdateReady( ownerUid, EEcomTypeInstall ); - // As a last step recreate the special command data - retTemp = RecreateSpecialCommands(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyPluginInstallation() (recreate) complete" ) )); - return retTemp; - } - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyPluginInstallation() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunAtEcomListen. -// Notifies about existing plugin uninstallation -// --------------------------------------------------------------------------- -// -TInt CDunAtCmdHandler::NotifyPluginUninstallation( TUid& aPluginUid ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyPluginUninstallation()" ) )); - TInt i; - TInt count = iUrcHandlers.Count(); - for ( i=count-1; i>=0; i-- ) - { - TUid ownerUid = iUrcHandlers[i]->OwnerUid(); - if ( ownerUid == aPluginUid ) - { - delete iUrcHandlers[i]; - iUrcHandlers.Remove( i ); - iAtCmdExt.ReportListenerUpdateReady( ownerUid, - EEcomTypeUninstall ); - } - } - // As a last step recreate the special command data - TInt retTemp = RecreateSpecialCommands(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyPluginUninstallation() (recreate) complete" ) )); - return retTemp; - } - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyPluginUninstallation() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunAtModeListen. -// Gets called on mode status change -// --------------------------------------------------------------------------- -// -TInt CDunAtCmdHandler::NotifyModeStatusChange( TUint aMode ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyModeStatusChange()") )); - TBool commandModeSet = ManageCommandModeChange( aMode ); - TBool echoModeSet = ManageEchoModeChange( aMode ); - TBool quietModeSet = ManageQuietModeChange( aMode ); - TBool verboseModeSet = ManageVerboseModeChange( aMode ); - if ( quietModeSet || verboseModeSet ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyModeStatusChange() new settings: E=%d, Q=%d, V=%d"), iEchoOn, iQuietOn, iVerboseOn )); - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyModeStatusChange() (regenerate) mode set" ) )); - RegenerateReplyStrings(); - return KErrNone; - } - // Keep the following after "quietModeSet || verboseModeSet" in order to - // regenerate the reply also if two modes change at the same time - if ( commandModeSet || echoModeSet ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyModeStatusChange() new settings: E=%d, Q=%d, V=%d"), iEchoOn, iQuietOn, iVerboseOn )); - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyModeStatusChange() mode set" ) )); - return KErrNone; - } - ManageCharacterChange( aMode ); - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyModeStatusChange() new settings: CR=%u, LF=%u, BS=%u"), iCarriageReturn, iLineFeed, iBackspace )); - RegenerateReplyStrings(); - FTRACE(FPrint( _L("CDunAtCmdHandler::NotifyModeStatusChange() complete") )); - return KErrNone; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/src/DunAtCmdPusher.cpp --- a/localconnectivityservice/dun/atext/src/DunAtCmdPusher.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,521 +0,0 @@ -/* -* 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: AT command pusher for downstream -* -*/ - -/* - * Filtering categories for multiple commands on one line (DunAtCmdPusher.cpp) - * (here "OTHER" reply means a reply which is something else than "OK" and "ERROR") - * One reply: OK -> OK - * One reply: OTHER -> OTHER - * One reply: ERROR -> ERROR - * Two replies: OK, OK -> OK - * Two replies: OTHER, OTHER -> OTHER, OTHER - * Two replies: OK, OTHER -> OTHER - * Two replies: OTHER, OK -> OTHER - * Two replies: OK, ERROR -> ERROR - * Two replies: OTHER, ERROR -> OTHER, ERROR - * Note: "OK" replies are skipped. The "OK" string is stripped from the "OTHER" - * replies and manually added the the downstream as the last operation if either - * "OK" or "OTHER" was received before. - */ - -#include "DunAtCmdPusher.h" -#include "DunDownstream.h" -#include "DunDebug.h" - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunAtCmdPusher* CDunAtCmdPusher::NewL( - RATExt* aAtCmdExt, - MDunAtCmdPusher* aCallback, - MDunStreamManipulator* aDownstream, - TDesC8* aOkBuffer ) - { - CDunAtCmdPusher* self = NewLC( aAtCmdExt, - aCallback, - aDownstream, - aOkBuffer ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunAtCmdPusher* CDunAtCmdPusher::NewLC( - RATExt* aAtCmdExt, - MDunAtCmdPusher* aCallback, - MDunStreamManipulator* aDownstream, - TDesC8* aOkBuffer ) - { - CDunAtCmdPusher* self = new (ELeave) CDunAtCmdPusher( aAtCmdExt, - aCallback, - aDownstream, - aOkBuffer ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunAtCmdPusher::~CDunAtCmdPusher() - { - FTRACE(FPrint( _L("CDunAtCmdPusher::~CDunAtCmdPusher()") )); - ResetData(); - FTRACE(FPrint( _L("CDunAtCmdPusher::~CDunAtCmdPusher() complete") )); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunAtCmdPusher::ResetData() - { - FTRACE(FPrint( _L("CDunAtCmdPusher::ResetData()") )); - // APIs affecting this: - // IssueRequest() - Stop(); - // Internal - Initialize(); - FTRACE(FPrint( _L("CDunAtCmdPusher::ResetData() complete") )); - } - -// --------------------------------------------------------------------------- -// Starts AT command handling -// --------------------------------------------------------------------------- -// -TInt CDunAtCmdPusher::IssueRequest( TDesC8& aInput, TBool aNormalMode ) - { - FTRACE(FPrint( _L("CDunAtCmdPusher::IssueRequest()") )); - FTRACE(FPrint( _L("CDunAtCmdPusher::IssueRequest() send ATEXT:") )); - FTRACE(FPrintRaw(aInput) ); - if ( iAtPushState!=EDunStateIdle && aNormalMode ) - { - FTRACE(FPrint( _L("CDunAtCmdPusher::IssueRequest() (not ready) complete") )); - return KErrNotReady; - } - if ( iDownstream->IsDataInQueue(&iRecvBuffer) ) - { - FTRACE(FPrint( _L("CDunAtCmdPusher::IssueRequest() (in queue!) complete") )); - return KErrGeneral; - } - iStatus = KRequestPending; - iAtCmdExt->HandleCommand( iStatus, - aInput, - iRecvBuffer, - iReplyLeftPckg, - iReplyTypePckg ); - SetActive(); - iAtPushState = EDunStateAtCmdPushing; - FTRACE(FPrint( _L("CDunAtCmdPusher::IssueRequest() complete") )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Stops AT command handling -// --------------------------------------------------------------------------- -// -TInt CDunAtCmdPusher::Stop() - { - FTRACE(FPrint( _L("CDunAtCmdPusher::Stop()") )); - SetEndOfCmdLine(); - if ( iAtPushState != EDunStateAtCmdPushing ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::Stop() (not ready) complete" ))); - return KErrNotReady; - } - // As the EDunStateAtCmdHandling can be set even when the actual request - // has completed (when replying with NotifyDataPushComplete() and setting - // idle eventually), cancel the actual operation in DoCancel() - Cancel(); - iAtPushState = EDunStateIdle; - FTRACE(FPrint( _L("CDunAtCmdPusher::Stop() complete") )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Manages request to abort command handling -// --------------------------------------------------------------------------- -// -TInt CDunAtCmdPusher::ManageAbortRequest() - { - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageAbortRequest()") )); - if ( iAtPushState != EDunStateAtCmdPushing ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::ManageAbortRequest() (not ready) complete" ))); - return KErrNotReady; - } - if ( iCmdAbort ) - { - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageAbortRequest() (already exists) complete") )); - return KErrAlreadyExists; - } - TInt retTemp = iAtCmdExt->ReportHandleCommandAbort( iStop ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageAbortRequest() (ERROR) complete") )); - return retTemp; - } - iCmdAbort = ETrue; - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageAbortRequest() complete") )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Sets end of command line marker on for the possible series of AT commands. -// --------------------------------------------------------------------------- -// -void CDunAtCmdPusher::SetEndOfCmdLine() - { - FTRACE(FPrint( _L("CDunAtCmdPusher::SetEndOfCmdLine()") )); - iNoErrorReceived = EFalse; - iLastOkPush = EFalse; - iCmdAbort = EFalse; - iStop = EFalse; - iEditorMode = EFalse; - FTRACE(FPrint( _L("CDunAtCmdPusher::SetEndOfCmdLine() complete") )); - } - -// --------------------------------------------------------------------------- -// Gets the editor mode status -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdPusher::EditorMode() - { - FTRACE(FPrint( _L("CDunAtCmdPusher::EditorMode()") )); - FTRACE(FPrint( _L("CDunAtCmdPusher::EditorMode() complete") )); - return iEditorMode; - } - -// --------------------------------------------------------------------------- -// CDunAtCmdPusher::CDunAtCmdPusher -// --------------------------------------------------------------------------- -// -CDunAtCmdPusher::CDunAtCmdPusher( RATExt* aAtCmdExt, - MDunAtCmdPusher* aCallback, - MDunStreamManipulator* aDownstream, - TDesC8* aOkBuffer ) : - CActive( EPriorityHigh ), - iAtCmdExt( aAtCmdExt ), - iCallback( aCallback ), - iDownstream( aDownstream ), - iOkBuffer( aOkBuffer ), - iReplyLeftPckg( iReplyBytesLeft ), - iReplyTypePckg( iReplyType ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunAtCmdPusher::ConstructL -// --------------------------------------------------------------------------- -// -void CDunAtCmdPusher::ConstructL() - { - FTRACE(FPrint( _L("CDunAtCmdPusher::ConstructL()") )); - if ( !iAtCmdExt || !iCallback || !iDownstream || !iOkBuffer ) - { - User::Leave( KErrGeneral ); - } - CActiveScheduler::Add( this ); - FTRACE(FPrint( _L("CDunAtCmdPusher::ConstructL() complete") )); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunAtCmdPusher::Initialize() - { - // Don't initialize iAtCmdExt here (it is set through NewL) - // Don't initialize iCallback here (it is set through NewL) - // Don't initialize iDownstream here (it is set through NewL) - // Don't initialize iOkBuffer here (it is set through NewL) - iAtPushState = EDunStateIdle; - iReplyBytesLeft = 0; - iReplyType = EReplyTypeUndefined; - SetEndOfCmdLine(); - } - -// --------------------------------------------------------------------------- -// Sets state to idle and notifies about subcommand handling completion -// --------------------------------------------------------------------------- -// -void CDunAtCmdPusher::SetToIdleAndNotifyEnd( TInt aError ) - { - FTRACE(FPrint( _L("CDunAtCmdPusher::SetToIdleAndNotifyEnd()") )); - iCmdAbort = EFalse; - iAtPushState = EDunStateIdle; - iCallback->NotifyEndOfProcessing( aError ); - FTRACE(FPrint( _L("CDunAtCmdPusher::SetToIdleAndNotifyEnd() complete") )); - } - -// --------------------------------------------------------------------------- -// Checks if "OK" (verbose) or "0" (numeric) string or exists at the end of -// buffer and removes it -// --------------------------------------------------------------------------- -// -TInt CDunAtCmdPusher::CheckAndRemoveOkString() - { - FTRACE(FPrint( _L("CDunAtCmdPusher::CheckAndRemoveOkString()") )); - TInt recvBufferLength = iRecvBuffer.Length(); - TInt okBufferLength = iOkBuffer->Length(); - // Skip the removal if removing not possible, if removal results in zero - // length (plugin should have used KErrReplyTypeOk) or if string to be - // removed is zero. - // Note also that if plugin sends a final reply when quiet mode is on, DUN - // can't remove the possibly existing result code as it is different from - // iOkReply (zero length). - if ( recvBufferLength<=okBufferLength || okBufferLength<=0 ) - { - FTRACE(FPrint( _L("CDunAtCmdPusher::CheckAndRemoveOkString() (skip) complete") )); - return KErrGeneral; - } - TInt lengthWithNoOk = recvBufferLength - okBufferLength; - TPtr8 recvBufferDes( &iRecvBuffer[lengthWithNoOk], okBufferLength, okBufferLength ); - if ( recvBufferDes.Compare(*iOkBuffer) != 0 ) - { - FTRACE(FPrint( _L("CDunAtCmdPusher::CheckAndRemoveOkString() (not found) complete") )); - return KErrNotFound; - } - iRecvBuffer.SetLength( lengthWithNoOk ); - FTRACE(FPrint( _L("CDunAtCmdPusher::CheckAndRemoveOkString() complete") )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Sends reply data to downstream -// --------------------------------------------------------------------------- -// -void CDunAtCmdPusher::SendReplyData( TBool aRecvBuffer ) - { - FTRACE(FPrint( _L("CDunAtCmdPusher::SendReplyData()") )); - TDesC8* sendBuffer = iOkBuffer; - if ( aRecvBuffer ) - { - sendBuffer = &iRecvBuffer; - // Check if last block of long push and remove "OK" if exists - if ( iReplyType==EReplyTypeOther && iReplyBytesLeft==0 ) - { - CheckAndRemoveOkString(); - } - } - FTRACE(FPrint( _L("CDunAtCmdPusher::SendReplyData() send reply:") )); - FTRACE(FPrintRaw(*sendBuffer) ); - iDownstream->NotifyDataPushRequest( sendBuffer, this ); - FTRACE(FPrint( _L("CDunAtCmdPusher::SendReplyData() complete") )); - } - -// --------------------------------------------------------------------------- -// Manages change in reply type to EReplyTypeOther -// --------------------------------------------------------------------------- -// -void CDunAtCmdPusher::ManageReplyTypeChangeToOther() - { - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageReplyTypeChangeToOther()") )); - iNoErrorReceived = ETrue; - SendReplyData(); - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageReplyTypeChangeToOther() complete") )); - } - -// --------------------------------------------------------------------------- -// Manages change in reply type to EReplyTypeOk -// --------------------------------------------------------------------------- -// -void CDunAtCmdPusher::ManageReplyTypeChangeToOk() - { - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageReplyTypeChangeToOk()") )); - // Skip the "OK" replies if not last. Only push the "OK" reply at the end. - // iStop changes it so that the we have to send the "OK" immediately and - // only stop with NotifyDataPushComplete() - TBool found = iCallback->NotifyNextCommandPeekRequest(); - if ( !found || iStop ) - { - SendReplyData(); - } - else - { - iNoErrorReceived = ETrue; - SetToIdleAndNotifyEnd( KErrNone ); - } - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageReplyTypeChangeToOk() complete") )); - } - -// --------------------------------------------------------------------------- -// Manages change in reply type to EReplyTypeError -// --------------------------------------------------------------------------- -// -void CDunAtCmdPusher::ManageReplyTypeChangeToError() - { - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageReplyTypeChangeToError()") )); - if ( iNoErrorReceived ) - { - iAtCmdExt->ReportExternalHandleCommandError(); - } - SendReplyData(); - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageReplyTypeChangeToError() complete") )); - } - -// --------------------------------------------------------------------------- -// Manages change in reply type to EReplyTypeEditor -// --------------------------------------------------------------------------- -// -void CDunAtCmdPusher::ManageReplyTypeChangeToEditor() - { - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageReplyTypeChangeToEditor()") )); - if ( !iEditorMode ) - { - // First change to editor mode: manage it as EReplyTypeOther (prompt) - iEditorMode = ETrue; - ManageReplyTypeChangeToOther(); - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageReplyTypeChangeToEditor() (editor) complete") )); - return; - } - // The same reply to editor mode as before: no reply, only notification for - // echo/forwarding purposes - iCallback->NotifyEditorModeReply(); - // Do nothing after notifying. The next ForwardEditorModeInput() triggers - // the next call of this function. - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageReplyTypeChangeToEditor() complete") )); - } - -// --------------------------------------------------------------------------- -// Manages change in reply type -// --------------------------------------------------------------------------- -// -void CDunAtCmdPusher::ManageReplyTypeChange() - { - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageReplyTypeChange()") )); - switch ( iReplyType ) - { - case EReplyTypeOther: - { - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageReplyTypeChange() EReplyTypeOther") )); - iEditorMode = EFalse; - ManageReplyTypeChangeToOther(); - } - break; - case EReplyTypeOk: - { - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageReplyTypeChange() EReplyTypeOk") )); - iEditorMode = EFalse; - ManageReplyTypeChangeToOk(); - } - break; - case EReplyTypeError: - { - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageReplyTypeChange() EReplyTypeError") )); - iEditorMode = EFalse; - ManageReplyTypeChangeToError(); - } - break; - case EReplyTypeEditor: - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageReplyTypeChange() EReplyTypeEditor") )); - ManageReplyTypeChangeToEditor(); - break; - default: - { - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageReplyTypeChange() EReplyTypeUndefined") )); - iEditorMode = EFalse; - SetToIdleAndNotifyEnd( KErrNone ); - } - break; - } - FTRACE(FPrint( _L("CDunAtCmdPusher::ManageReplyTypeChange() complete") )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called when AT command handled -// --------------------------------------------------------------------------- -// -void CDunAtCmdPusher::RunL() - { - FTRACE(FPrint( _L("CDunAtCmdPusher::RunL()") )); - TInt retTemp = iStatus.Int(); - if ( retTemp != KErrNone ) - { - SetToIdleAndNotifyEnd( retTemp ); - FTRACE(FPrint( _L("CDunAtCmdPusher::RunL() (ERROR) complete (%d)"), retTemp)); - return; - } - ManageReplyTypeChange(); - FTRACE(FPrint( _L("CDunAtCmdPusher::RunL() complete") )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called on cancel -// --------------------------------------------------------------------------- -// -void CDunAtCmdPusher::DoCancel() - { - FTRACE(FPrint( _L("CDunAtCmdPusher::DoCancel()") )); - iAtCmdExt->CancelHandleCommand(); - FTRACE(FPrint( _L("CDunAtCmdPusher::DoCancel() complete") )); - } - -// --------------------------------------------------------------------------- -// From class MDunCompletionReporter. -// Gets called when data push is complete -// --------------------------------------------------------------------------- -// -void CDunAtCmdPusher::NotifyDataPushComplete( TBool /*aAllPushed*/ ) - { - FTRACE(FPrint( _L("CDunAtCmdPusher::NotifyDataPushComplete()") )); - // First check if error or stop condition detected - if ( iReplyType==EReplyTypeError || iStop ) - { - SetEndOfCmdLine(); - iAtPushState = EDunStateIdle; - iCallback->NotifyEndOfCmdLineProcessing(); - FTRACE(FPrint( _L("CDunAtCmdPusher::NotifyDataPushComplete() (error reply) complete") )); - return; - } - // Secondly check only the case where push restart is required - if ( iReplyType==EReplyTypeOther && iReplyBytesLeft>0 ) - { - iAtCmdExt->GetNextPartOfReply( iRecvBuffer, iReplyBytesLeft ); - SendReplyData(); - FTRACE(FPrint( _L("CDunAtCmdPusher::NotifyDataPushComplete() (push restart) complete") )); - return; - } - // Next check the case where other than "OK" and "ERROR" reply is received - // and that is the last one in the command line. Then just send "OK". - if ( !iLastOkPush && iReplyType==EReplyTypeOther ) - { - TBool found = iCallback->NotifyNextCommandPeekRequest(); - if ( !found ) - { - // Force iReplyType here to match the correct one in NotifyDataPushComplete() - iReplyType = EReplyTypeOk; - iLastOkPush = ETrue; - SendReplyData( EFalse ); - FTRACE(FPrint( _L("CDunAtCmdPusher::NotifyDataPushComplete() (last OK) complete") )); - return; - } - // Now the next command was found so just fall through - } - // As a last step just set to idle - SetToIdleAndNotifyEnd( KErrNone ); - FTRACE(FPrint( _L("CDunAtCmdPusher::NotifyDataPushComplete() complete") )); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/src/DunAtEcomListen.cpp --- a/localconnectivityservice/dun/atext/src/DunAtEcomListen.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +0,0 @@ -/* -* Copyright (c) 2008 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: ECom plugin install/uninstall/version listener -* -*/ - - -#include "DunAtEcomListen.h" -#include "DunDebug.h" - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunAtEcomListen* CDunAtEcomListen::NewL( - RATExt* aAtCmdExt, - MDunAtEcomListen* aCallback ) - { - CDunAtEcomListen* self = NewLC( aAtCmdExt, aCallback ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunAtEcomListen* CDunAtEcomListen::NewLC( - RATExt* aAtCmdExt, - MDunAtEcomListen* aCallback ) - { - CDunAtEcomListen* self = new (ELeave) CDunAtEcomListen( aAtCmdExt, - aCallback ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunAtEcomListen::~CDunAtEcomListen() - { - FTRACE(FPrint( _L("CDunAtEcomListen::~CDunAtEcomListen()") )); - ResetData(); - FTRACE(FPrint( _L("CDunAtEcomListen::~CDunAtEcomListen() complete") )); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunAtEcomListen::ResetData() - { - FTRACE(FPrint( _L("CDunAtEcomListen::ResetData()") )); - // APIs affecting this: - // IssueRequest() - Stop(); - // Internal - Initialize(); - FTRACE(FPrint( _L("CDunAtEcomListen::ResetData() complete") )); - } - -// --------------------------------------------------------------------------- -// Starts waiting for ECom plugin install/uninstall/version status changes -// --------------------------------------------------------------------------- -// -TInt CDunAtEcomListen::IssueRequest() - { - FTRACE(FPrint( _L("CDunAtEcomListen::IssueRequest()") )); - if ( iEcomListenState != EDunStateIdle ) - { - FTRACE(FPrint( _L("CDunAtEcomListen::IssueRequest() (not ready) complete") )); - return KErrNotReady; - } - iStatus = KRequestPending; - iAtCmdExt->ReceiveEcomPluginChange( iStatus, iPluginUidPckg, iEcomTypePckg ); - SetActive(); - iEcomListenState = EDunStateEcomListening; - FTRACE(FPrint( _L("CDunAtEcomListen::IssueRequest() complete") )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Stops waiting for Ecom plugin install/uninstall/version status changes -// --------------------------------------------------------------------------- -// -TInt CDunAtEcomListen::Stop() - { - FTRACE(FPrint( _L("CDunAtEcomListen::Stop()") )); - if ( iEcomListenState != EDunStateEcomListening ) - { - FTRACE(FPrint( _L("CDunAtEcomListen::Stop() (not ready) complete" ))); - return KErrNotReady; - } - iAtCmdExt->CancelReceiveEcomPluginChange(); - Cancel(); - iEcomListenState = EDunStateIdle; - FTRACE(FPrint( _L("CDunAtEcomListen::Stop() complete") )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CDunAtEcomListen::CDunAtEcomListen -// --------------------------------------------------------------------------- -// -CDunAtEcomListen::CDunAtEcomListen( RATExt* aAtCmdExt, - MDunAtEcomListen* aCallback ) : - CActive( EPriorityHigh ), - iAtCmdExt( aAtCmdExt ), - iCallback( aCallback ), - iPluginUidPckg( iPluginUid ), - iEcomTypePckg( EEcomTypeUninstall ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunAtEcomListen::ConstructL -// --------------------------------------------------------------------------- -// -void CDunAtEcomListen::ConstructL() - { - FTRACE(FPrint( _L("CDunAtEcomListen::ConstructL()") )); - if ( !iAtCmdExt || !iCallback ) - { - User::Leave( KErrGeneral ); - } - CActiveScheduler::Add( this ); - FTRACE(FPrint( _L("CDunAtEcomListen::ConstructL() complete") )); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunAtEcomListen::Initialize() - { - // Don't initialize iAtCmdExt here (it is set through NewL) - // Don't initialize iCallback here (it is set through NewL) - iEcomListenState = EDunStateIdle; - iPluginUid = TUid::Null(); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called when plugin installed, uninstalled or changed -// --------------------------------------------------------------------------- -// -void CDunAtEcomListen::RunL() - { - FTRACE(FPrint( _L("CDunAtEcomListen::RunL()") )); - iEcomListenState = EDunStateIdle; - TInt retTemp = iStatus.Int(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunAtEcomListen::RunL() (ERROR) complete (%d)"), retTemp )); - return; - } - IssueRequest(); - // Now the operation is either unintall or install of plugin - // Notify parent and ATEXT - if ( iEcomTypePckg() == EEcomTypeUninstall ) - { - iCallback->NotifyPluginUninstallation( iPluginUid ); - } - else if ( iEcomTypePckg() == EEcomTypeInstall ) - { - iCallback->NotifyPluginInstallation( iPluginUid ); - } - else - { - FTRACE(FPrint( _L("CDunAtEcomListen::RunL() (not supported) complete") )); - } - FTRACE(FPrint( _L("CDunAtEcomListen::RunL() complete") )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called on cancel -// --------------------------------------------------------------------------- -// -void CDunAtEcomListen::DoCancel() - { - FTRACE(FPrint( _L("CDunAtEcomListen::DoCancel()") )); - FTRACE(FPrint( _L("CDunAtEcomListen::DoCancel() complete") )); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/src/DunAtModeListen.cpp --- a/localconnectivityservice/dun/atext/src/DunAtModeListen.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,182 +0,0 @@ -/* -* Copyright (c) 2008 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: Modem's mode listener and notifier -* -*/ - - -#include "DunAtModeListen.h" -#include "DunDebug.h" - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunAtModeListen* CDunAtModeListen::NewL( RATExtCommon* aAtCmdExtCommon, - MDunAtModeListen* aCallback ) - { - CDunAtModeListen* self = NewLC( aAtCmdExtCommon, aCallback ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunAtModeListen* CDunAtModeListen::NewLC( RATExtCommon* aAtCmdExtCommon, - MDunAtModeListen* aCallback ) - { - CDunAtModeListen* self = new (ELeave) CDunAtModeListen( aAtCmdExtCommon, - aCallback ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunAtModeListen::~CDunAtModeListen() - { - FTRACE(FPrint( _L("CDunAtModeListen::~CDunAtModeListen()") )); - ResetData(); - FTRACE(FPrint( _L("CDunAtModeListen::~CDunAtModeListen() complete") )); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunAtModeListen::ResetData() - { - FTRACE(FPrint( _L("CDunAtModeListen::ResetData()") )); - // APIs affecting this: - // IssueRequest() - Stop(); - // Internal - Initialize(); - FTRACE(FPrint( _L("CDunAtModeListen::ResetData() complete") )); - } - -// --------------------------------------------------------------------------- -// Issues request to start monitoring for mode status changes -// --------------------------------------------------------------------------- -// -TInt CDunAtModeListen::IssueRequest() - { - FTRACE(FPrint( _L("CDunAtModeListen::IssueRequest()" ))); - if ( iModeListenState != EDunStateIdle ) - { - FTRACE(FPrint( _L("CDunAtModeListen::IssueRequest() (not ready) complete" ) )); - return KErrNotReady; - } - iStatus = KRequestPending; - iAtCmdExtCommon->ReceiveModeStatusChange( iStatus, iModePckg ); - SetActive(); - iModeListenState = EDunStateModeListening; - FTRACE(FPrint( _L("CDunAtModeListen::IssueRequest() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Stops monitoring for mode status changes -// --------------------------------------------------------------------------- -// -TInt CDunAtModeListen::Stop() - { - FTRACE(FPrint( _L("CDunAtModeListen::Stop()" ))); - if ( iModeListenState != EDunStateModeListening ) - { - FTRACE(FPrint( _L("CDunAtModeListen::Stop() (not ready) complete" ) )); - return KErrNotReady; - } - iAtCmdExtCommon->CancelReceiveModeStatusChange(); - Cancel(); - iModeListenState = EDunStateIdle; - FTRACE(FPrint( _L("CDunAtModeListen::Stop() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CDunAtModeListen::CDunAtModeListen -// --------------------------------------------------------------------------- -// -CDunAtModeListen::CDunAtModeListen( RATExtCommon* aAtCmdExtCommon, - MDunAtModeListen* aCallback ) : - CActive( EPriorityHigh ), - iAtCmdExtCommon( aAtCmdExtCommon ), - iCallback( aCallback ), - iModePckg( iMode ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunAtModeListen::ConstructL -// --------------------------------------------------------------------------- -// -void CDunAtModeListen::ConstructL() - { - FTRACE(FPrint( _L("CDunAtModeListen::ConstructL()") )); - if ( !iAtCmdExtCommon || !iCallback ) - { - User::Leave( KErrGeneral ); - } - CActiveScheduler::Add( this ); - FTRACE(FPrint( _L("CDunAtModeListen::ConstructL() complete") )); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunAtModeListen::Initialize() - { - // Don't initialize iAtCmdExtCommon here (it is set through NewL) - // Don't initialize iCallback here (it is set through NewL) - iModeListenState = EDunStateIdle; - iMode = 0; - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called when mode changes -// --------------------------------------------------------------------------- -// -void CDunAtModeListen::RunL() - { - FTRACE(FPrint( _L("CDunAtModeListen::RunL()") )); - iModeListenState = EDunStateIdle; - TInt retTemp = iStatus.Int(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunAtModeListen::RunL() (ERROR) complete (%d)"), retTemp )); - return; - } - FTRACE(FPrint( _L("CDunAtModeListen::RunL() managing 0x%08X" ), iMode )); - iCallback->NotifyModeStatusChange( iMode ); - IssueRequest(); - FTRACE(FPrint( _L("CDunAtModeListen::RunL() complete") )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called on cancel -// --------------------------------------------------------------------------- -// -void CDunAtModeListen::DoCancel() - { - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/src/DunAtNvramListen.cpp --- a/localconnectivityservice/dun/atext/src/DunAtNvramListen.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,190 +0,0 @@ -/* -* Copyright (c) 2008 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: AT NVRAM status change listener and notifier -* -*/ - - -#include "DunAtNvramListen.h" -#include "DunDebug.h" - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunAtNvramListen* CDunAtNvramListen::NewL( RATExt* aAtCmdExt, - RATExtCommon* aAtCmdExtCommon ) - { - CDunAtNvramListen* self = NewLC( aAtCmdExt, aAtCmdExtCommon ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunAtNvramListen* CDunAtNvramListen::NewLC( RATExt* aAtCmdExt, - RATExtCommon* aAtCmdExtCommon ) - { - CDunAtNvramListen* self = new (ELeave) CDunAtNvramListen( - aAtCmdExt, - aAtCmdExtCommon ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunAtNvramListen::~CDunAtNvramListen() - { - FTRACE(FPrint( _L("CDunAtNvramListen::~CDunAtNvramListen()") )); - ResetData(); - FTRACE(FPrint( _L("CDunAtNvramListen::~CDunAtNvramListen() complete") )); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunAtNvramListen::ResetData() - { - FTRACE(FPrint( _L("CDunAtNvramListen::ResetData()") )); - // APIs affecting this: - // IssueRequest() - Stop(); - // Internal - Initialize(); - FTRACE(FPrint( _L("CDunAtNvramListen::ResetData() complete") )); - } - -// --------------------------------------------------------------------------- -// Starts waiting for NVRAM status changes -// --------------------------------------------------------------------------- -// -TInt CDunAtNvramListen::IssueRequest() - { - FTRACE(FPrint( _L("CDunAtNvramListen::IssueRequest()") )); - if ( iNvramHandleState != EDunStateIdle ) - { - FTRACE(FPrint( _L("CDunAtNvramListen::IssueRequest() (not ready) complete") )); - return KErrNotReady; - } - if ( !iStarted ) - { - iAtCmdExtCommon->GetNvramStatus( iNvramBuffer ); - iAtCmdExt->BroadcastNvramStatusChange( iNvramBuffer ); - iStarted = ETrue; - } - iStatus = KRequestPending; - iAtCmdExtCommon->ReceiveNvramStatusChange( iStatus, iNvramBuffer ); - SetActive(); - iNvramHandleState = EDunStateNvramListening; - FTRACE(FPrint( _L("CDunAtNvramListen::IssueRequest() complete") )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Stops waiting for NVRAM status changes -// --------------------------------------------------------------------------- -// -TInt CDunAtNvramListen::Stop() - { - FTRACE(FPrint( _L("CDunAtNvramListen::Stop()") )); - if ( iNvramHandleState != EDunStateNvramListening ) - { - FTRACE(FPrint( _L("CDunAtNvramListen::Stop() (not ready) complete" ))); - return KErrNotReady; - } - iAtCmdExtCommon->CancelReceiveNvramStatusChange(); - Cancel(); - iNvramHandleState = EDunStateIdle; - FTRACE(FPrint( _L("CDunAtNvramListen::Stop() complete") )); - // Note: Don't mark iStarted to EFalse here! - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CDunAtNvramListen::CDunAtNvramListen -// --------------------------------------------------------------------------- -// -CDunAtNvramListen::CDunAtNvramListen( RATExt* aAtCmdExt, - RATExtCommon* aAtCmdExtCommon ) : - CActive( EPriorityHigh ), - iAtCmdExt( aAtCmdExt ), - iAtCmdExtCommon( aAtCmdExtCommon ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunAtNvramListen::ConstructL -// --------------------------------------------------------------------------- -// -void CDunAtNvramListen::ConstructL() - { - FTRACE(FPrint( _L("CDunAtNvramListen::ConstructL()") )); - if ( !iAtCmdExt || !iAtCmdExtCommon ) - { - User::Leave( KErrGeneral ); - } - CActiveScheduler::Add( this ); - FTRACE(FPrint( _L("CDunAtNvramListen::ConstructL() complete") )); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunAtNvramListen::Initialize() - { - // Don't initialize iAtCmdExt here (it is set through NewL) - // Don't initialize iAtCmdExtCommon here (it is set through NewL) - iNvramHandleState = EDunStateIdle; - iStarted = EFalse; - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called when NVRAM has changed -// --------------------------------------------------------------------------- -// -void CDunAtNvramListen::RunL() - { - FTRACE(FPrint( _L("CDunAtNvramListen::RunL()") )); - iNvramHandleState = EDunStateIdle; - TInt retTemp = iStatus.Int(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunAtNvramListen::RunL() (ERROR) complete (%d)"), retTemp )); - return; - } - iAtCmdExt->BroadcastNvramStatusChange( iNvramBuffer ); - IssueRequest(); - FTRACE(FPrint( _L("CDunAtNvramListen::RunL() complete") )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called on cancel -// --------------------------------------------------------------------------- -// -void CDunAtNvramListen::DoCancel() - { - FTRACE(FPrint( _L("CDunAtNvramListen::DoCancel()") )); - FTRACE(FPrint( _L("CDunAtNvramListen::DoCancel() complete") )); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/src/DunAtSpecialCmdHandler.cpp --- a/localconnectivityservice/dun/atext/src/DunAtSpecialCmdHandler.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -/* -* 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: Special AT command handler -* -*/ - -#include "DunAtSpecialCmdHandler.h" -#include "DunDebug.h" - -const TInt KDefaultGranularity = 1; - -// AT command(s) below is part of the AT&FE0Q0V1&C1&D2+IFC=3,1. command which -// is sent by MAC. There is no delimiter between "AT&F" and "E0". -// Only list those commands where alphabetical boundary detection is needed -// (i.e. "AT&F0" is not needed as "AT&F0E0" has non-alphabetical boundary) -_LIT8( KSpecialATCmd1, "AT&F" ); - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunAtSpecialCmdHandler* CDunAtSpecialCmdHandler::NewL() - { - CDunAtSpecialCmdHandler* self = new (ELeave) CDunAtSpecialCmdHandler(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CDunAtSpecialCmdHandler::CDunAtSpecialCmdHandler -// --------------------------------------------------------------------------- -// -CDunAtSpecialCmdHandler::CDunAtSpecialCmdHandler() - { - } - -// --------------------------------------------------------------------------- -// CDunAtSpecialCmdHandler::ConstructL -// --------------------------------------------------------------------------- -// -void CDunAtSpecialCmdHandler::ConstructL() - { - iSpecialCmds = new (ELeave) CDesC8ArrayFlat( KDefaultGranularity ); - // Add here all special commands which need to be handled - iSpecialCmds->AppendL( KSpecialATCmd1 ); - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunAtSpecialCmdHandler::~CDunAtSpecialCmdHandler() - { - FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::~CDunAtSpecialCmdHandler()") )); - delete iSpecialCmds; - FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::~CDunAtSpecialCmdHandler() complete") )); - } - -// --------------------------------------------------------------------------- -// Checks if the command has to be treated special way. -// For example in case of MAC, it sends command AT&FE0Q0V1&C1&D2+IFC=3,1. -// meaning there is no delimiters in the command. -// In case of MAC we try to search AT&F (sub command) string from the beginning -// of the command. -// Search is done character by character basis. -// --------------------------------------------------------------------------- -// -TBool CDunAtSpecialCmdHandler::IsCompleteSubCommand( TChar aCharacter ) - { - FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::IsCompleteSubCommand()") )); - iBuffer.Append( aCharacter ); - TBool completeSubCmd = EFalse; - - if( !IsDataReadyForComparison(iBuffer.Length()) ) - { - // No need to do comparison because we don't have correct amount of data - FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::IsCompleteSubCommand(), no need to compare") )); - return completeSubCmd; - } - - TInt count = iSpecialCmds->Count(); - for ( TInt i=0; iMdcaPoint(i).Compare(iBuffer) == 0 ) - { - FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::IsCompleteSubCommand(), match found, cmd index %d"), i )); - // Reset internal buffer for next comparison. - ResetComparisonBuffer(); - completeSubCmd = ETrue; - break; - } - } - FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::IsCompleteSubCommand() complete") )); - return completeSubCmd; - } - -// --------------------------------------------------------------------------- -// Resets the buffer used for comparisons -// --------------------------------------------------------------------------- -// -void CDunAtSpecialCmdHandler::ResetComparisonBuffer() - { - FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::ResetComparisonBuffer()") )); - iBuffer.FillZ(); - iBuffer.Zero(); - FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::ResetComparisonBuffer() complete") )); - } - -// --------------------------------------------------------------------------- -// Defines when comparison is excecuted, checks if the data lengths are equal. -// --------------------------------------------------------------------------- -// -TBool CDunAtSpecialCmdHandler::IsDataReadyForComparison( TInt aLength ) - { - FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::IsDataReadyForComparison()") )); - TInt count = iSpecialCmds->Count(); - for ( TInt i=0; iMdcaPoint(i).Length() == aLength ) - { - FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::IsDataReadyForComparison() (ready) complete") )); - return ETrue; - } - } - FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::IsDataReadyForComparison() (not ready) complete") )); - return EFalse; - } - -// --------------------------------------------------------------------------- -// Defines minimum length of the special commands. -// --------------------------------------------------------------------------- -// -TInt CDunAtSpecialCmdHandler::MinimumLength() - { - FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::MinimumLength()") )); - TInt length = iSpecialCmds->MdcaPoint(0).Length(); - TInt count = iSpecialCmds->Count(); - for ( TInt i=1; iMdcaPoint(i).Length() < length ) - { - length = iSpecialCmds->MdcaPoint(i).Length(); - break; - } - } - FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::MinimumLength() complete") )); - return length; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/atext/src/DunAtUrcHandler.cpp --- a/localconnectivityservice/dun/atext/src/DunAtUrcHandler.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,228 +0,0 @@ -/* -* Copyright (c) 2008 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: AT command URC handler -* -*/ - - -#include -#include "DunAtCmdHandler.h" -#include "DunAtUrcHandler.h" -#include "DunDownstream.h" -#include "DunDebug.h" - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunAtUrcHandler* CDunAtUrcHandler::NewL( - RATExt* aAtCmdExt, - MDunStreamManipulator* aStreamCallback ) - { - CDunAtUrcHandler* self = NewLC( aAtCmdExt, aStreamCallback ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunAtUrcHandler* CDunAtUrcHandler::NewLC( - RATExt* aAtCmdExt, - MDunStreamManipulator* aStreamCallback ) - { - CDunAtUrcHandler* self = new (ELeave) CDunAtUrcHandler( aAtCmdExt, - aStreamCallback ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunAtUrcHandler::~CDunAtUrcHandler() - { - FTRACE(FPrint( _L("CDunAtUrcHandler::~CDunAtUrcHandler()") )); - ResetData(); - FTRACE(FPrint( _L("CDunAtUrcHandler::~CDunAtUrcHandler() complete") )); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunAtUrcHandler::ResetData() - { - FTRACE(FPrint( _L("CDunAtUrcHandler::ResetData()") )); - // APIs affecting this: - // IssueRequest() - Stop(); - // Don't close iAtCmdExt here (it is done in CDunAtCmdHandler)! - // Internal - Initialize(); - FTRACE(FPrint( _L("CDunAtUrcHandler::ResetData() complete") )); - } - -// --------------------------------------------------------------------------- -// Starts waiting for an incoming URC message -// --------------------------------------------------------------------------- -// -TInt CDunAtUrcHandler::IssueRequest() - { - FTRACE(FPrint( _L("CDunAtUrcHandler::IssueRequest()") )); - if ( iUrcHandleState != EDunStateIdle ) - { - FTRACE(FPrint( _L("CDunAtUrcHandler::IssueRequest() (not ready) complete") )); - return KErrNotReady; - } - iStatus = KRequestPending; - iAtCmdExt->ReceiveUnsolicitedResult( iStatus, iRecvBuffer, iOwnerUidPckg ); - SetActive(); - iUrcHandleState = EDunStateAtUrcHandling; - // Next mark ownership - if ( !iStarted ) - { - TInt retTemp = iAtCmdExt->MarkUrcHandlingOwnership( iOwnerUid ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunAtUrcHandler::IssueRequest() (not owned) complete") )); - return KErrGeneral; - } - } - iStarted = ETrue; - FTRACE(FPrint( _L("CDunAtUrcHandler::IssueRequest() complete") )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Stops waiting for an incoming URC message -// --------------------------------------------------------------------------- -// -TInt CDunAtUrcHandler::Stop() - { - FTRACE(FPrint( _L("CDunAtUrcHandler::Stop()") )); - if ( iUrcHandleState != EDunStateAtUrcHandling ) - { - FTRACE(FPrint( _L("CDunAtUrcHandler::Stop() (not ready) complete" ))); - return KErrNotReady; - } - iAtCmdExt->CancelReceiveUnsolicitedResult( iOwnerUid ); - Cancel(); - iUrcHandleState = EDunStateIdle; - FTRACE(FPrint( _L("CDunAtUrcHandler::Stop() complete") )); - // Note: Don't mark iStarted to EFalse here as it is used to get the UID - return KErrNone; - } - -// --------------------------------------------------------------------------- -// UID of the owning plugin -// --------------------------------------------------------------------------- -// -TUid CDunAtUrcHandler::OwnerUid() - { - return iOwnerUid; - } - -// --------------------------------------------------------------------------- -// CDunAtUrcHandler::CDunAtUrcHandler -// --------------------------------------------------------------------------- -// -CDunAtUrcHandler::CDunAtUrcHandler( RATExt* aAtCmdExt, - MDunStreamManipulator* aStreamCallback ) : - CActive( EPriorityHigh ), - iAtCmdExt( aAtCmdExt ), - iStreamCallback( aStreamCallback ), - iOwnerUidPckg( iOwnerUid ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunAtUrcHandler::ConstructL -// --------------------------------------------------------------------------- -// -void CDunAtUrcHandler::ConstructL() - { - FTRACE(FPrint( _L("CDunAtUrcHandler::ConstructL()") )); - if ( !iAtCmdExt || !iStreamCallback ) - { - User::Leave( KErrGeneral ); - } - CActiveScheduler::Add( this ); - FTRACE(FPrint( _L("CDunAtUrcHandler::ConstructL() complete") )); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunAtUrcHandler::Initialize() - { - // Don't initialize iStreamCallback here (it is set through NewL) - iUrcHandleState = EDunStateIdle; - iOwnerUid = TUid::Null(); - iStarted = EFalse; - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called when URC command received -// --------------------------------------------------------------------------- -// -void CDunAtUrcHandler::RunL() - { - FTRACE(FPrint( _L("CDunAtUrcHandler::RunL()") )); - iUrcHandleState = EDunStateIdle; - TInt retTemp = iStatus.Int(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunAtUrcHandler::RunL() (ERROR) complete (%d)"), retTemp)); - return; - } - if ( iRecvBuffer.Length() == 0 ) - { - FTRACE(FPrint( _L("CDunAtUrcHandler::RunL() (empty buffer) complete") )); - return; - } - - // Send received URC message - - iStreamCallback->NotifyDataPushRequest( &iRecvBuffer, this ); - - FTRACE(FPrint( _L("CDunAtUrcHandler::RunL() complete") )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called on cancel -// --------------------------------------------------------------------------- -// -void CDunAtUrcHandler::DoCancel() - { - } - -// --------------------------------------------------------------------------- -// From class MDunCompletionReporter. -// Gets called when data push is complete -// --------------------------------------------------------------------------- -// -void CDunAtUrcHandler::NotifyDataPushComplete( TBool /*aAllPushed*/ ) - { - FTRACE(FPrint( _L("CDunAtUrcHandler::NotifyDataPushComplete()") )); - IssueRequest(); - FTRACE(FPrint( _L("CDunAtUrcHandler::NotifyDataPushComplete() complete") )); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/client/group/bld.inf --- a/localconnectivityservice/dun/client/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2007 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: -* This file provides the information required for building the -* whole of DUN client -* -*/ - -#include - -PRJ_PLATFORMS - -PRJ_EXPORTS -../../rom/dunclient.iby CORE_MW_LAYER_IBY_EXPORT_PATH(dunclient.iby) - -PRJ_MMPFILES -dunclient.mmp - -PRJ_TESTMMPFILES diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/client/group/dunclient.mmp --- a/localconnectivityservice/dun/client/group/dunclient.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Project definition file for project DUN client -* -*/ - - -#include -#include - -TARGET dunclient.dll -TARGETTYPE PLUGIN -UID 0x10009D8D 0x20002775 - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -SOURCEPATH ../src -SOURCE dunplugin.cpp -SOURCE dunactive.cpp -SOURCE dunclient.cpp -SOURCE proxy.cpp - -START RESOURCE 0x20002775.rss -TARGET dunclient.rsc -END // RESOURCE - -USERINCLUDE ../inc ../../utils/inc - -MW_LAYER_SYSTEMINCLUDE - -// Note: -// The only other SYSTEMINCLUDE should you shall add are Symbian specific ones. -// If there is a S60 header in the subdirectory then that should be -// added into the include statements (like #include ) -//SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE ../../../inc ../../../../inc /epoc32/include/ecom - -LIBRARY euser.lib -LIBRARY ecom.lib -DEBUGLIBRARY flogger.lib diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/client/inc/dunactive.h --- a/localconnectivityservice/dun/client/inc/dunactive.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Controls asynchronous requests between LOCOD and DUN server -* -*/ - - -#ifndef C_CDUNACTIVE_H -#define C_CDUNACTIVE_H - -#include - -class CDunPlugin; - -/** - * Class for accessing bearer statuses of CDunActive class - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunActive ) - { - -public: - - /** - * Bearer - * - * @since S60 3.2 - * @return Bearer - */ - virtual TLocodBearer Bearer() = 0; - - /** - * Bearer status - * - * @since S60 3.2 - * @return Bearer status - */ - virtual TBool BearerStatus() = 0; - - }; - -/** - * Class that controls asynchronous requests between LOCOD and DUN server - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunActive ) : public CActive, public MDunActive - { - -public: - - /** - * Two-phased constructor. - * @param aPlugin Plugin - * @param aBearer Brearer - * @param aBearerStatus Bearer status - * @return Instance of self - */ - static CDunActive* NewL( CDunPlugin* aPlugin, - TLocodBearer aBearer, - TBool aBearerStatus ); - - /** - * Two-phased constructor. - * @param aPlugin Plugin - * @param aBearer Brearer - * @param aBearerStatus Bearer status - * @return Instance of self - */ - static CDunActive* NewLC( CDunPlugin* aPlugin, - TLocodBearer aBearer, - TBool aBearerStatus ); - - /** - * Destructor. - */ - virtual ~CDunActive(); - - /** - * Request function - * - * @since S60 3.2 - * @return Symbian Error code - */ - TInt ServiceRequest(); - -private: - - CDunActive( CDunPlugin* aPlugin, - TLocodBearer aBearer, - TBool aBearerStatus ); - - void ConstructL(); - -// from base class CActive - - /** - * From CActive. - * Called when read or write operation is ready. - * - * @since S60 3.2 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Cancel current activity. - * - * @since S60 3.2 - * @return None - */ - void DoCancel(); - -// from base class MDunActive - - /** - * From MDunActive. - * Bearer - * - * @since S60 3.2 - * @return Bearer - */ - TLocodBearer Bearer(); - - /** - * From MDunActive. - * Bearer status - * - * @since S60 3.2 - * @return Bearer status - */ - TBool BearerStatus(); - -private: // data - - /** - * CDunPlugin - * Not own. Passed by DunPlugin - */ - CDunPlugin* iPlugin; - - /** - * Bearer - * Not own. Passed by DunPlugin - */ - TLocodBearer iBearer; - - /** - * Service state - * Not own. Passed by DunPlugin - */ - TBool iBearerStatus; - - }; - -#endif // C_CDUNACTIVE_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/client/inc/dunclient.h --- a/localconnectivityservice/dun/client/inc/dunclient.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: Main client side interface of DUN -* -*/ - - -#ifndef R_RDUNCLIENT_H -#define R_RDUNCLIENT_H - -#include -#include -#include - -class MDunActive; - -/** - * Main client side interface of DUN - * Manages service from/to LOCOD - * - * @since S60 v3.2 - */ -class RDun : public RSessionBase - { - -public: - - RDun(); - - /** - * This function starts DUN open/close for different medias - * - * @since S60 3.2 - * @param aRequest Request to manage - * @param aReqStatus Active object's request status - * @return Symbian error code on error, KErrNone otherwise - */ - TInt ManageService( MDunActive* aRequest, TRequestStatus& aReqStatus ); - - /** - * This function gets the active connection - * (For testing purposes only). - * - * @since S60 5.0 - * @return Active connection if found, NULL otherwise - */ - TAny* ActiveConnection(); - - /** - * Version number - * - * @since S60 3.2 - * @return Version number of DUN - */ - TVersion Version() const; - - /** - * This function connects to DUN server and creates a new session. - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Connect(); - - }; - -#endif // R_RDUNCLIENT_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/client/inc/dunplugin.h --- a/localconnectivityservice/dun/client/inc/dunplugin.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: EComm interface implementation and the client side of DUN -* -*/ - - -#ifndef C_CDUNPLUGIN_H -#define C_CDUNPLUGIN_H - -#include -#include -#include "dunclient.h" - -class CDunActive; - -/** - * Class of EComm interface implementation and the client side of DUN - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunPlugin ) : public CLocodServicePlugin - { - -public: - - /** - * Two-phased constructor. - * @param aParams LOCOD service plugin parameters - * @return Instance of self - */ - static CDunPlugin* NewL( TLocodServicePluginParams& aParams ); - - /** - * Destructor. - */ - ~CDunPlugin(); - - /** - * Return owned RServer - * - * @since S60 3.2 - * @return RDun - */ - RDun& Server(); - - /** - * Called by instance of CDunActive to inform Observer of service completed. - * Destruct the active object. - * - * @since S60 3.2 - * @param aRequest Request to service - * @param aError Error value - * @return None - */ - void ServiceCompleted( MDunActive* aRequest, TInt aError ); - -// from base class CLocodServicePlugin - - /** - * From CLocodServicePlugin. - * Implements interface virtual function - * - * @since S60 3.2 - * @param aBearer, BT/IR/USB bearer defined in locodbearer.h - * @param aBearerStatus, the status of this bearer, - ETrue if it is available; - EFalse otherwise. - * @return None - */ - void ManageService( TLocodBearer aBearer, TBool aBearerStatus ); - -private: - - CDunPlugin( TLocodServicePluginParams& aParams ); - - void ConstructL(); - - /** - * Reports completion status to LOCOD - * - * @since S60 3.2 - * @param aBearer Bearer to report - * @param aBearerStatus Bearer status to report - * @param aErr Error condition to report - * @return None - */ - void ReportCompletion( TLocodBearer aBearer, - TBool aBearerStatus, - TInt aErr); - -private: // data - - /** - * Client side of DUN Server - */ - RDun iServer; - - /** - * Array of Active Object - */ - RPointerArray iActiveContainer; - - }; - -#endif // C_CDUNPLUGIN_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/client/inc/dunserverdef.h --- a/localconnectivityservice/dun/client/inc/dunserverdef.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* Copyright (c) 2008 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: Definitions for server -* -*/ - - -#ifndef DUN_SERVERDEF_H -#define DUN_SERVERDEF_H - -// INCLUDES -#include -#include - -// DATA TYPES -enum TDunIpc - { - EDunFuncManageService, - EDunFuncActiveConnection, // For testing purposes only - EInvalidIpc - }; - -// GLOBAL CONSTANTS - -_LIT( KDialupServerName, "dunserver" ); - -const TUint KDunServerMajorVersionNumber = 2; -const TUint KDunServerMinorVersionNumber = 0; -const TUint KDunServerBuildVersionNumber = 0; - -#endif // DUN_SERVERDEF_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/client/src/0x20002775.rss --- a/localconnectivityservice/dun/client/src/0x20002775.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Resource definitions for project DUN -* -*/ - - -#include "registryinfov2.rh" -#include "locodplugin.hrh" - -RESOURCE REGISTRY_INFO theInfo - { - // resource_format_version must always be set as follows - resource_format_version = RESOURCE_FORMAT_VERSION_2; - - // UID for the DLL - dll_uid = 0x20002775; - // Declare array of interface info - interfaces = - { - INTERFACE_INFO - { - // UID of interface that is implemented - interface_uid = KLOCODSERVICEINTERFACEUID; - implementations = - { - // Info for CDunPlugin - IMPLEMENTATION_INFO - { - implementation_uid = KFeatureIdDialupNetworking; - version_no = 1; - display_name = "DialupNetwork Plugin"; - default_data = ""; - opaque_data = ""; - // This implementation CANNOT be overridden by a RAM-based plug-in - rom_only = 1; - } - }; - } - }; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/client/src/dunactive.cpp --- a/localconnectivityservice/dun/client/src/dunactive.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Controls asynchronous requests between LOCOD and DUN server -* -*/ - - -#include "dunactive.h" -#include "dunplugin.h" -#include "DunDebug.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunActive* CDunActive::NewL( CDunPlugin* aPlugin, - TLocodBearer aBearer, - TBool aBearerStatus) - { - CDunActive* self = CDunActive::NewLC( aPlugin, aBearer, aBearerStatus ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunActive* CDunActive::NewLC( CDunPlugin* aPlugin, - TLocodBearer aBearer, - TBool aBearerStatus ) - { - CDunActive* self = new (ELeave) CDunActive( aPlugin, - aBearer, - aBearerStatus ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunActive::~CDunActive() - { - FTRACE(FPrint( _L("CDunActive::~CDunActive()") )); - Cancel(); - FTRACE(FPrint( _L("CDunActive::~CDunActive() complete") )); - } - -// --------------------------------------------------------------------------- -// Request function -// --------------------------------------------------------------------------- -// -TInt CDunActive::ServiceRequest() - { - FTRACE(FPrint( _L("CDunActive::ServiceRequest()") )); - TInt err = KErrNone; - - iStatus = KRequestPending; - err = (iPlugin->Server()).ManageService( this, iStatus ); - SetActive(); - FTRACE(FPrint( _L("CDunActive::ServiceRequest() complete") )); - return err; - } - -// --------------------------------------------------------------------------- -// CDunActive::CDunActive -// --------------------------------------------------------------------------- -// -CDunActive::CDunActive( CDunPlugin* aPlugin, - TLocodBearer aBearer, - TBool aBearerStatus ) - : CActive( EPriorityStandard ), - iPlugin( aPlugin ), - iBearer( aBearer ), - iBearerStatus( aBearerStatus ) - { - } - -// --------------------------------------------------------------------------- -// CDunActive::ConstructL -// --------------------------------------------------------------------------- -// -void CDunActive::ConstructL() - { - FTRACE(FPrint( _L("CDunActive::ConstructL()") )); - CActiveScheduler::Add( this ); - FTRACE(FPrint( _L("CDunActive::ConstructL() complete") )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Cancel current activity. -// --------------------------------------------------------------------------- -// -void CDunActive::DoCancel() - { - } - -// --------------------------------------------------------------------------- -// From class CActive -// Called when read or write operation is ready. -// --------------------------------------------------------------------------- -// -void CDunActive::RunL() - { - FTRACE(FPrint( _L("CDunActive::RunL()") )); - TInt retVal = iStatus.Int(); - iPlugin->ServiceCompleted( this, retVal ); - FTRACE(FPrint( _L("CDunActive::RunL() complete (%d)"), retVal )); - } - -// --------------------------------------------------------------------------- -// From class MDunActive. -// Bearer -// --------------------------------------------------------------------------- -// -TLocodBearer CDunActive::Bearer() - { - FTRACE(FPrint( _L("CDunActive::Bearer()") )); - FTRACE(FPrint( _L("CDunActive::Bearer() complete") )); - return iBearer; - } - -// --------------------------------------------------------------------------- -// From class MDunActive. -// Bearer status -// --------------------------------------------------------------------------- -// -TBool CDunActive::BearerStatus() - { - FTRACE(FPrint( _L("CDunActive::BearerStatus()") )); - FTRACE(FPrint( _L("CDunActive::BearerStatus() complete") )); - return iBearerStatus; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/client/src/dunclient.cpp --- a/localconnectivityservice/dun/client/src/dunclient.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,164 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Main client side interface of DUN -* -*/ - - -#include "dunclient.h" -#include "dunserverdef.h" -#include "DunDebug.h" -#include "dunactive.h" - -const TInt KDunRetryCount = 3; -const TInt KDunNumOfMessageSlots = 4; - -// ======== LOCAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Create server thread/process -// --------------------------------------------------------------------------- -// -static TInt StartServer() - { - FTRACE(FPrint( _L("StartServer()") )); - TInt retVal = KErrNone; - TRequestStatus statusStarted; - - RProcess server; - retVal = server.Create( KDialupServerName, KNullDesC, EOwnerThread ); - - if ( retVal != KErrNone ) - { - FTRACE(FPrint( _L("StartServer() complete (%d)"), retVal )); - return retVal; - } - - TRequestStatus stat; - server.Rendezvous( stat ); - - if ( stat != KRequestPending ) - { - server.Kill( 0 ); //abort startup - } - else - { - server.Resume(); //logon OK - start the server - } - - User::WaitForRequest( stat ); //wait the start or death of the server - - /* - we can't use the 'exit reason' if the server panicked as this - is the panic 'reason' and may be '0' which cannot be distinguished - from KErrNone - */ - retVal = stat.Int(); - if ( server.ExitType() == EExitPanic ) - { - retVal = KErrServerTerminated; - } - - server.Close(); - FTRACE(FPrint( _L("StartServer() complete (%d)"), retVal )); - return retVal; - } - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// RDun::RDun() -// --------------------------------------------------------------------------- -// -RDun::RDun() - { - } - -// --------------------------------------------------------------------------- -// This function starts DUN open/close for different medias -// --------------------------------------------------------------------------- -// -TInt RDun::ManageService( MDunActive* aRequest, TRequestStatus& aReqStatus ) - { - FTRACE(FPrint( _L("RDun::ManageService()") )); - SendReceive( EDunFuncManageService, - TIpcArgs(aRequest->Bearer(), - aRequest->BearerStatus()), - aReqStatus ); - FTRACE(FPrint( _L("RDun::ManageService() complete") )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// This function gets the active connection -// --------------------------------------------------------------------------- -// -TAny* RDun::ActiveConnection() - { - FTRACE(FPrint( _L("RDun::ActiveConnection()") )); - TAny* connId = NULL; - TPckg connIdPckg( connId ); - SendReceive( EDunFuncActiveConnection, - TIpcArgs(&connIdPckg) ); - FTRACE(FPrint( _L("RDun::ActiveConnection() complete") )); - return connId; - } - -// --------------------------------------------------------------------------- -// Version number -// --------------------------------------------------------------------------- -// -TVersion RDun::Version() const - { - FTRACE(FPrint( _L("RDun::Version()") )); - FTRACE(FPrint( _L("RDun::Version() complete") )); - return ( TVersion(KDunServerMajorVersionNumber, - KDunServerMinorVersionNumber, - KDunServerBuildVersionNumber) ); - } - -// --------------------------------------------------------------------------- -// This function connects to DUN server and creates a new session. -// --------------------------------------------------------------------------- -// -TInt RDun::Connect() - { - FTRACE(FPrint( _L("RDun::Connect()") )); - TInt retry; - TInt retVal = KErrNone; - for ( retry=KDunRetryCount; retry>=0; retry-- ) - { - retVal=CreateSession( KDialupServerName, - TVersion(KDunServerMajorVersionNumber, - KDunServerMinorVersionNumber, - KDunServerBuildVersionNumber), - KDunNumOfMessageSlots ); - if ( retVal == KErrNotFound || retVal == KErrServerTerminated ) - { - retVal = StartServer(); - if ( retVal!=KErrNone && retVal!=KErrAlreadyExists ) - { - FTRACE(FPrint( _L("RDun::Connect() complete (%d)"), retVal )); - return retVal; - } - } - else // KErrNone, or other error code. - { - FTRACE(FPrint( _L("RDun::Connect() complete (%d)"), retVal )); - return retVal; - } - } - FTRACE(FPrint( _L("RDun::Connect() complete (%d)"), retVal )); - return retVal; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/client/src/dunplugin.cpp --- a/localconnectivityservice/dun/client/src/dunplugin.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: EComm interface implementation and the client side of DUN -* -*/ - - -#include "dunplugin.h" -#include "dunactive.h" -#include "DunDebug.h" - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunPlugin* CDunPlugin::NewL( TLocodServicePluginParams& aParams ) - { - CDunPlugin* self = new (ELeave) CDunPlugin( aParams ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunPlugin::~CDunPlugin() - { - FTRACE(FPrint( _L("CDunPlugin::~CDunPlugin()") )); - iActiveContainer.ResetAndDestroy(); - iActiveContainer.Close(); - if ( iServer.Handle() != KNullHandle ) - { - iServer.Close(); - } - FTRACE(FPrint( _L("CDunPlugin::~CDunPlugin() complete") )); - } - -// --------------------------------------------------------------------------- -// Return owned RServer -// --------------------------------------------------------------------------- -// -RDun& CDunPlugin::Server() - { - FTRACE(FPrint( _L("CDunPlugin::Server()") )); - FTRACE(FPrint( _L("CDunPlugin::Server() complete") )); - return iServer; - } - -// --------------------------------------------------------------------------- -// Called by instance of CDunActive to inform Observer of service completed. -// Destruct the active object. -// --------------------------------------------------------------------------- -// -void CDunPlugin::ServiceCompleted( MDunActive* aRequest, TInt aError ) - { - FTRACE(FPrint( _L("CDunPlugin::ServiceCompleted()") )); - TInt i; - TLocodBearer bearer = aRequest->Bearer(); - TBool status = aRequest->BearerStatus(); - for ( i=iActiveContainer.Count()-1; i>=0; i-- ) - { - if ( iActiveContainer[i] == aRequest ) - { - delete iActiveContainer[i]; - iActiveContainer.Remove( i ); - break; - } - } - ReportCompletion( bearer, status, aError ); - FTRACE(FPrint( _L("CDunPlugin::ServiceCompleted() completed (%d)"), aError )); - } - -// --------------------------------------------------------------------------- -// From class CLocodServicePlugin. -// Implements interface virtual function -// --------------------------------------------------------------------------- -// -void CDunPlugin::ManageService( TLocodBearer aBearer, TBool aBearerStatus ) - { - FTRACE(FPrint( _L("CDunPlugin::ManageService()") )); - TInt retTemp; - if ( iServer.Handle() == KNullHandle ) - { - retTemp = iServer.Connect(); - if ( retTemp != KErrNone ) - { - ReportCompletion( aBearer, aBearerStatus, retTemp ); - FTRACE(FPrint( _L("CDunPlugin::ManageService() (failed!) complete (%d)"), retTemp )); - return; - } - } - CDunActive* stateRequest = NULL; - TRAPD( retTrap, stateRequest=CDunActive::NewL( this, - aBearer, - aBearerStatus )); - if ( retTrap != KErrNone ) - { - ReportCompletion( aBearer, aBearerStatus, retTrap ); - FTRACE(FPrint( _L("CDunPlugin::ManageService() (failed!) complete (%d)"), retTrap )); - return; - } - if ( !stateRequest ) - { - ReportCompletion( aBearer, aBearerStatus, KErrGeneral ); - FTRACE(FPrint( _L("CDunPlugin::ManageService() (failed!) complete (%d)"), KErrGeneral )); - return; - } - retTemp = iActiveContainer.Append( stateRequest ); - if ( retTemp != KErrNone ) - { - ReportCompletion( aBearer, aBearerStatus, retTemp ); - FTRACE(FPrint( _L("CDunPlugin::ManageService() (failed!) complete (%d)"), retTemp )); - return; - } - stateRequest->ServiceRequest(); - FTRACE(FPrint( _L("CDunPlugin::ManageService() complete") )); - } - -// --------------------------------------------------------------------------- -// CDunPlugin::CDunPlugin -// --------------------------------------------------------------------------- -// -CDunPlugin::CDunPlugin( TLocodServicePluginParams& aParams ) - : CLocodServicePlugin( aParams ) - { - } - -// --------------------------------------------------------------------------- -// CDunPlugin::ConstructL -// --------------------------------------------------------------------------- -// -void CDunPlugin::ConstructL() - { - FTRACE(FPrint( _L("CDunPlugin::ConstructL()") )); - FTRACE(FPrint( _L("CDunPlugin::ConstructL() complete") )); - } - -// --------------------------------------------------------------------------- -// Reports completion status to LOCOD -// --------------------------------------------------------------------------- -// -void CDunPlugin::ReportCompletion( TLocodBearer aBearer, - TBool aBearerStatus, - TInt aErr) - { - FTRACE(FPrint( _L("CDunPlugin::ReportCompletion()") )); - Observer().ManageServiceCompleted( aBearer, - aBearerStatus, - ImplementationUid(), - aErr); - FTRACE(FPrint( _L("CDunPlugin::ReportCompletion() completed (%d)"), aErr )); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/client/src/proxy.cpp --- a/localconnectivityservice/dun/client/src/proxy.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Export ECom interface implementations -* -*/ - - -#include //ECom header file -#include "dunplugin.h" - -// --------------------------------------------------------------------------- -// An array of TImplementationProxy objects which onnect each -// implemeation with its instantiation function -// --------------------------------------------------------------------------- -// -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( KFeatureIdDialupNetworking, CDunPlugin::NewL ) - }; - -// --------------------------------------------------------------------------- -// Exported proxy function to resolve instantiation methods for an Ecom -// plug-in DLL -// --------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( - TInt & aTableCount ) - { - aTableCount = sizeof( ImplementationTable ) / - sizeof( TImplementationProxy ); - return ImplementationTable; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/group/bld.inf --- a/localconnectivityservice/dun/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ -PRJ_PLATFORMS - -PRJ_EXPORTS - -// bld.inf list of the modules to be build using this file -// NOTE: order of this list must be same as the correct building order - -#include "../atext/group/bld.inf" -#include "../utils/group/bld.inf" -#include "../server/group/bld.inf" -#include "../client/group/bld.inf" -#include "../plugins/group/bld.inf" diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/bwins/dunbtu.def --- a/localconnectivityservice/dun/plugins/bwins/dunbtu.def Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?NewLocalPluginL@@YAPAVMDunLocalMediaPlugin@@XZ @ 1 NONAME ; class MDunLocalMediaPlugin * NewLocalPluginL(void) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/bwins/duniru.def --- a/localconnectivityservice/dun/plugins/bwins/duniru.def Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?NewLocalPluginL@@YAPAVMDunLocalMediaPlugin@@XZ @ 1 NONAME ; class MDunLocalMediaPlugin * NewLocalPluginL(void) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/bwins/dunusbu.def --- a/localconnectivityservice/dun/plugins/bwins/dunusbu.def Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?NewLocalPluginL@@YAPAVMDunLocalMediaPlugin@@XZ @ 1 NONAME ; class MDunLocalMediaPlugin * NewLocalPluginL(void) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/eabi/dunbtu.def --- a/localconnectivityservice/dun/plugins/eabi/dunbtu.def Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z15NewLocalPluginLv @ 1 NONAME - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/eabi/duniru.def --- a/localconnectivityservice/dun/plugins/eabi/duniru.def Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z15NewLocalPluginLv @ 1 NONAME - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/eabi/dunusbu.def --- a/localconnectivityservice/dun/plugins/eabi/dunusbu.def Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z15NewLocalPluginLv @ 1 NONAME - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/group/bld.inf --- a/localconnectivityservice/dun/plugins/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +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: -* This file provides the information required for building the whole of -* plugins. -* -*/ - -#include - -PRJ_PLATFORMS - -PRJ_EXPORTS -#ifdef __BT -../../rom/dunbt.iby CORE_MW_LAYER_IBY_EXPORT_PATH(dunbt.iby) -#endif -#ifdef __IRDA -../../rom/dunir.iby CORE_MW_LAYER_IBY_EXPORT_PATH(dunir.iby) -#endif -#ifdef __USB -../../rom/dunusb.iby CORE_MW_LAYER_IBY_EXPORT_PATH(dunusb.iby) -#endif - -PRJ_MMPFILES - -#ifdef __BT -dunbt.mmp -#endif -#ifdef __IRDA -dunir.mmp -#endif -#ifdef __USB -dunusb.mmp -#endif - -PRJ_TESTMMPFILES diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/group/dunbt.mmp --- a/localconnectivityservice/dun/plugins/group/dunbt.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Project definition file for project DUN BT plugin. -* -*/ - - -#include - -TARGET dunbt.dll -TARGETTYPE DLL -UID 0x101F6E2D 0x101F6E2B - -CAPABILITY CAP_GENERAL_DLL -VENDORID VID_DEFAULT - -SOURCEPATH ../src/bt -SOURCE DunBtPlugin.cpp -SOURCE DunBtListen.cpp - -USERINCLUDE ../inc/bt ../../utils/inc - -MW_LAYER_SYSTEMINCLUDE - -// Note: -// The only other SYSTEMINCLUDE should you shall add are Symbian specific ones. -// If there is a S60 header in the subdirectory then that should be -// added into the include statements (like #include ) -//SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE ../../../inc - -LIBRARY euser.lib -LIBRARY esock.lib -LIBRARY btengdiscovery.lib -LIBRARY bluetooth.lib -LIBRARY dunutils.lib -DEBUGLIBRARY flogger.lib diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/group/dunir.mmp --- a/localconnectivityservice/dun/plugins/group/dunir.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Project definition file for project DUN IR plugin -* -*/ - - -#include - -TARGET dunir.dll -TARGETTYPE DLL -UID 0x101F6E2D 0x101FBAEB - -CAPABILITY CAP_GENERAL_DLL -VENDORID VID_DEFAULT - -SOURCEPATH ../src/ir -SOURCE DunIrPlugin.cpp - -USERINCLUDE ../inc/ir ../../utils/inc - -MW_LAYER_SYSTEMINCLUDE - -// Note: -// The only other SYSTEMINCLUDE should you shall add are Symbian specific ones. -// If there is a S60 header in the subdirectory then that should be -// added into the include statements (like #include ) -//SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE ../../../inc - -LIBRARY euser.lib -LIBRARY c32.lib -LIBRARY dunutils.lib -DEBUGLIBRARY flogger.lib diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/group/dunusb.mmp --- a/localconnectivityservice/dun/plugins/group/dunusb.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Project definition file for project DUN USB plugin -* -*/ - - -#include - -TARGET dunusb.dll -TARGETTYPE DLL -UID 0x101F6E2D 0x101F6E2F - -CAPABILITY CAP_GENERAL_DLL -VENDORID VID_DEFAULT - -SOURCEPATH ../src/usb -SOURCE DunUsbPlugin.cpp -SOURCE DunUsbListen.cpp -SOURCE DunUsbConfig.cpp - -USERINCLUDE ../inc/usb ../../utils/inc - -MW_LAYER_SYSTEMINCLUDE - -// Note: -// The only other SYSTEMINCLUDE should you shall add are Symbian specific ones. -// If there is a S60 header in the subdirectory then that should be -// added into the include statements (like #include ) -//SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE ../../../inc - -LIBRARY euser.lib -LIBRARY c32.lib -LIBRARY usbman.lib -LIBRARY dunutils.lib -DEBUGLIBRARY flogger.lib diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/inc/bt/DunBtListen.h --- a/localconnectivityservice/dun/plugins/inc/bt/DunBtListen.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,261 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: DUN Bluetooth plugin's listener -* -*/ - - -#ifndef C_CDUNBTLISTEN_H -#define C_CDUNBTLISTEN_H - -#include -#include "DunPlugin.h" -#include "DunTransporter.h" - -class TBtPortEntity; - -enum TBtListenState - { - EBtListenStateIdle, - EBtListenStateListening - }; - -/** - * DUN Bluetooth plugin's listener class - * This class starts listening on a created BT RFComm channel and notifies - * parent (CDunBtPlugin) when new connection is detected. Also registers and - * unregisters DUN SDP record. - * - * @lib dunbt.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunBtListen ) : public CActive, - public MDunServAdvMon - { - -public: - - /** - * Two-phased constructor. - * @param aServer Server - * @param aParent Callback interface to parent - * @param aTransporter Transporter - * @param aEntity Data socket entity - * @return Instance of self - */ - static CDunBtListen* NewL( MDunServerCallback* aServer, - MDunListenCallback* aParent, - CDunTransporter* aTransporter, - TBtPortEntity& aEntity ); - - /** - * Destructor. - */ - virtual ~CDunBtListen(); - - /** - * Resets data to initial values - * - * @since S60 3.2 - * @return None - */ - void ResetData(); - - /** - * Registers DUN and starts to listen. - * Registers itself to SDP and BT manager, opens a socket - * and starts to listen it. - * - * @since S60 3.2 - * @return None - */ - void IssueRequestL(); - - /** - * Stops listening - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Stop(); - -private: - - CDunBtListen( MDunServerCallback* aServer, - MDunListenCallback* aParent, - CDunTransporter* aTransporter, - TBtPortEntity& aEntity ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since S60 3.2 - * @return None - */ - void Initialize(); - - /** - * Starts dialup service advertisement - * - * @since S60 3.2 - * @param aInUse ETrue is returned if all RFCOMM channels in use. - * @return Symbian error code on error, KErrNone otherwise - */ - TInt StartServiceAdvertisement( TBool& aInUse ); - - /** - * Stops dialup service advertisement - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt StopServiceAdvertisement(); - - /** - * Method which reserves local RFCOMM channel (from possible channels 1-30) - * and returns it to client. - * - * @since S60 3.2 - * @param aSocketServer Handle to connected socket server. - * @param aListenSocket Socket which is initiated for listening. - * @param aChannelNum RFCOMM channel which is reserved for listening. - * @param aInUse ETrue is returned if all RFCOMM channels in use. - * @return KErrNone if OK, else value indicating error situation. - */ - TInt ReserveLocalChannel( RSocketServ& aSocketServ, - RSocket& aListenSocket, - TUint& aChannelNum, - TBool& aInUse ); - - /** - * Tries to bind to a fixed port and if that fails with - * KRfcommPassiveAutoBind. This is for spec breaking solutions like the - * OSX Leopard. - * - * @since S60 5.0 - * @param aListenSocket Listen socket for Bind() - * @param aSockAddr Address for the socket - * (must be set for KRfcommPassiveAutoBind) - * @return Symbian error code on error, KErrNone otherwise - */ - TInt DoExtendedBind( RSocket& aListenSocket, TRfcommSockAddr& aSockAddr ); - -// from base class CActive - - /** - * From CActive. - * Called when a service is requested via BT. - * - * @since S60 3.2 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Cancel current activity. - * - * @since S60 3.2 - * @return None - */ - void DoCancel(); - -// from base class MDunServAdvMon - - /** - * From MDunServAdvMon. - * Gets called when advertisement status changes to start - * - * @since S60 5.0 - * @param aCreation ETrue if channel creation - * EFalse if channel free - * @return None - */ - void NotifyAdvertisementStart( TBool aCreation ); - - /** - * From MDunServAdvMon. - * Gets called when advertisement status changes to end - * - * @since S60 5.0 - * @return None - */ - void NotifyAdvertisementEnd(); - -private: // data - - /** - * Callback to call when notification via MDunServerCallback to be made - * Not own. - */ - MDunServerCallback* iServer; - - /** - * Callback to call when notification via MDunListenCallback to be made - * Not own. - */ - MDunListenCallback* iParent; - - /** - * Transporter to use for network side communication - * Not own. - */ - CDunTransporter* iTransporter; - - /** - * Data socket entity for actual data transfer - * This will be valid after CDunBtListen reacts to new data in - * listener socket - */ - TBtPortEntity& iEntity; - - /** - * Current state of listening: active or inactive - */ - TBtListenState iListenState; - - /** - * Listener socket that will listen for activity in RFComm channel - */ - RSocket iListenSocket; - - /** - * Socket server used to reserve RFComm channel and creating data socket - */ - RSocketServ iSockServer; - - /** - * BT engine's Bluetooth discovery functionality - * Used for registering/unregistering SDP record - * Own. - */ - CBTEngDiscovery* iDiscovery; - - /** - * Local BT channel number - * Set to reserved RFComm channel and used to register SDP record - */ - TUint iChannelNum; - - /** - * Handle to the reserver SDP channel - * Set when SDP record registered - */ - TSdpServRecordHandle iSDPHandleDun; - - }; - -#endif // C_CDUNBTLISTEN_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/inc/bt/DunBtPlugin.h --- a/localconnectivityservice/dun/plugins/inc/bt/DunBtPlugin.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,310 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: DUN Bluetooth plugin -* -*/ - - -#ifndef C_CDUNBTPLUGIN_H -#define C_CDUNBTPLUGIN_H - -#include -#include -#include "DunTransporter.h" -#include "DunPlugin.h" - -/** - * Cleanup information for AllocateChannelL(). - * This data is needed to clean up partially constructed data in - * NotifyChannelAllocate() when a leave occurs in channel creation. - * - * @lib dunbt.lib - * @since S60 v5.0 - */ -NONSHARABLE_CLASS( TBtCleanupInfo ) - { - -public: - - /** - * Flag to indicate whether or not a new entity was created - */ - TBool iNewEntity; - - /** - * Index to the position of the found entity - */ - TInt iEntityIndex; - - }; - -/** - * DUN BT plugin's port entity - * This class is used to keep track of N number of BT ports and RFCOMM - * channel numbers associated to them. - * - * @lib dunbt.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TBtPortEntity ) - { - -public: - - /** - * RFCOMM channel number for BT local media side - */ - TInt iChannelNum; - - /** - * Port for BT local media side - */ - RSocket iBTPort; - - }; - -/** - * DUN Bluetooth plugin's main class - * This class creates new transporter channel when new data is detected by - * CDunBtListen class and acts on transporter's state changes. Also acts on - * DUN server's requests. - * - * @lib dunbt.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunBtPlugin ) : public CBase, - public MDunLocalMediaPlugin, - public MDunListenCallback, - public MDunConnMon - { - -public: - - CDunBtPlugin(); - - /** - * Destructor. - */ - virtual ~CDunBtPlugin(); - -private: - - /** - * State of this plugin - * - * @since S60 3.2 - * @return State of plugin - */ - TDunPluginState PluginState(); - - /** - * Constructs a listener object for this plugin - * - * @since S60 3.2 - * @return None - */ - void ConstructListenerL(); - - /** - * Sets new state - * New state must be one more than the old state - * - * @since S60 3.2 - * @param aPluginState New state to set for a plugin - * @return Symbian error code on error, KErrNone otherwise - */ - TInt ReportStateChangeUp( TDunPluginState aPluginState ); - - /** - * Sets new state - * New state must be one less than the old state - * - * @since S60 3.2 - * @param aPluginState New state to set for a plugin - * @return Symbian error code on error, KErrNone otherwise - */ - TInt ReportStateChangeDown( TDunPluginState aPluginState ); - - /** - * Allocates a free channel - * - * @since S60 3.2 - * @param aNoFreeChans ETrue if no free channels, EFalse otherwise - * @param aCleanupInfo Cleanup information - * @return None - */ - void AllocateChannelL( TBool& aNoFreeChans, TBtCleanupInfo& aCleanupInfo ); - - /** - * Frees existing channels - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt FreeChannels(); - - /** - * Uninitializes this plugin - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Uninitialize(); - - /** - * Gets port's index and entity by connection ID - * - * @since S60 3.2 - * @param aConnId Connection ID of the connection to find - * @param aEntity Returned port entity - * @return KErrNotFound if entity not found, found index otherwise - */ - TInt GetPortByConnId( TConnId aConnId, TBtPortEntity*& aEntity ); - - /** - * Gets first free port's index and entity - * - * @since S60 3.2 - * @param aEntity Returned port entity - * @return KErrNotFound if entity not found, found index otherwise - */ - TInt GetFirstFreePort( TBtPortEntity*& aEntity ); - - /** - * Sets modem's MSC (Modem Status Command) - * - * @since S60 3.2 - * @param aEntity Port entity for which to change signal - * @param aSignal Signal to set to high or low - * @param aSignalOn ETrue if signal wanted high, otherwise low - * @return Symbian error code on error, KErrNone otherwise - */ - TInt SetRFCOMMStatusCommand( TBtPortEntity& aEntity, - TUint8 aSignal, - TBool aSignalOn ); - - /** - * Manages advertiser for channel free operation - * - * @since S60 5.0 - * @return None - */ - void ManageAdvertiserFreeOperationL(); - - /** - * Cleans partial created channel data based on TATExtCleanupInfo - * - * @since S60 5.0 - * @param aCleanupInfo Cleanup information - * @return None - */ - void CleanPartialChanneldata( TBtCleanupInfo& aCleanupInfo ); - -// from base class MDunLocalMediaPlugin - - void ConstructL( MDunServerCallback* aServer, - CDunTransporter* aTransporter ); - - /** - * From MDunLocalMediaPlugin. - * Gets called when server changes a plugin's state - * - * @since S60 3.2 - * @param aPluginState New changed state - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyServerStateChange( TDunPluginState aPluginState ); - - /** - * From MDunLocalMediaPlugin. - * Gets called when server needs to know the active connection - * (For testing purposes only) - * - * @since S60 5.0 - * @return Active connection, NULL otherwise - */ - TConnId ActiveConnection(); - -// from base class MDunListenCallback - - /** - * From MDunListenCallback. - * Gets called when new channel must be created - * - * @since S60 3.2 - * @param aNoFreeChans ETrue if no free channels, EFalse otherwise - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyChannelAllocate( TBool& aNoFreeChans ); - - /** - * From MDunListenCallback. - * Gets called when an existing channel must be freed - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyChannelFree(); - -// from base class MDunConnMon - - /** - * From MDunConnMon. - * Gets called when line status changes or when any type of error is - * detected - * - * @since S60 3.2 - * @param aConnId Connection ID for callback - * @param aConnReason Reason for progress change - * @return None - */ - void NotifyProgressChangeL( TConnId aConnId, - TDunConnectionReason aConnReason ); - -private: // data - - /** - * Callback to call when notification via MDunServerCallback to be made - * Not own. - */ - MDunServerCallback* iServer; - - /** - * Listener for detecting new data in RFComm channel - * Notifies this class about new data - * Own. - */ - CDunBtListen* iBTListen; - - /** - * Data socket entity for actual data transfer - * This will be valid after CDunBtListen reacts to new data in - * listener socket - */ - TBtPortEntity iEntity; - - /** - * Array of RSocket port(s) entities for BT local media side - */ - RArray iBTPorts; - - /** - * Transporter to use for network side communication - * Not own. - */ - CDunTransporter* iTransporter; - - }; - -#endif // C_CDUNBTPLUGIN_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/inc/ir/DunIrPlugin.h --- a/localconnectivityservice/dun/plugins/inc/ir/DunIrPlugin.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,177 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: DUN Infrared plugin -* -*/ - - -#ifndef C_CDUNIRPLUGIN_H -#define C_CDUNIRPLUGIN_H - -#include -#include -#include "DunTransporter.h" -#include "DunPlugin.h" - -/** - * DUN Infrared plugin's main class - * This class creates new transporter channel as soon as listening is - * required by DUN server - * - * @lib dunir.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunIrPlugin ) : public CBase, - public MDunLocalMediaPlugin, - public MDunConnMon - { - -public: - - CDunIrPlugin(); - - /** - * Destructor. - */ - virtual ~CDunIrPlugin(); - -private: - - /** - * State of this plugin - * - * @since S60 3.2 - * @return State of plugin - */ - TDunPluginState PluginState(); - - /** - * Constructs a listener object for this plugin - * - * @since S60 3.2 - * @return None - */ - TInt ConstructListener(); - - /** - * Sets new state - * New state must be one more than the old state - * - * @since S60 3.2 - * @param aPluginState New state to set for a plugin - * @return Symbian error code on error, KErrNone otherwise - */ - TInt ReportStateChangeUp( TDunPluginState aPluginState ); - - /** - * Sets new state - * New state must be one less than the old state - * - * @since S60 3.2 - * @param aPluginState New state to set for a plugin - * @return Symbian error code on error, KErrNone otherwise - */ - TInt ReportStateChangeDown( TDunPluginState aPluginState ); - - /** - * Initializes one infrared port with role DCE - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt InitPort(); - - /** - * Allocates a channel - * - * @since S60 3.2 - * @return None - */ - void AllocateChannelL(); - - /** - * Uninitializes this plugin - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Uninitialize(); - -// from base class MDunLocalMediaPlugin - - void ConstructL( MDunServerCallback* aServer, - CDunTransporter* aTransporter ); - - /** - * From MDunLocalMediaPlugin. - * Gets called when server changes a plugin's state - * - * @since S60 3.2 - * @param aPluginState New changed state - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyServerStateChange( TDunPluginState aPluginState ); - - /** - * From MDunLocalMediaPlugin. - * Gets called when server needs to know the active connection - * (For testing purposes only) - * - * @since S60 5.0 - * @return Active connection, NULL otherwise - */ - TConnId ActiveConnection(); - -// from base class MDunConnMon - - /** - * From MDunConnMon. - * Gets called when line status changes or when any type of error is - * detected - * - * @since S60 3.2 - * @param aConnId Connection ID for callback - * @param aConnReason Reason for progress change - * @return None - */ - void NotifyProgressChangeL( TConnId aConnId, - TDunConnectionReason aConnReason ); - -private: // Data - - /** - * Callback to call when notification MDunServerCallback via to be made - * Not own. - */ - MDunServerCallback* iServer; - - /** - * Communications server used to load IRCOMM and open IR port - */ - RCommServ iCommServer; - - /** - * RComm port for infrared local media side - */ - RComm iIrPort; - - /** - * Transporter to use for network side communication - * Not own. - */ - CDunTransporter* iTransporter; - - }; - -#endif // C_CDUNIRPLUGIN_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/inc/usb/DunUsbConfig.h --- a/localconnectivityservice/dun/plugins/inc/usb/DunUsbConfig.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,207 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: DUN USB configuration accessor and listener -* -*/ - - -#ifndef C_CDUNUSBCONFIG_H -#define C_CDUNUSBCONFIG_H - -#include -#include -#include "DunPlugin.h" - -enum TUsbConfigState - { - EUsbConfigStateIdle, - EUsbConfigStateWaiting - }; - -/** - * Notification interface class to report USB ACM configuration change - * - * @lib dunusb.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunUsbConfig ) - { - -public: - - /** - * Gets called when one or more ACM configurations are added - * - * @since S60 3.2 - * @param aIndex Index (also port number) of added ACM configuration - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyConfigAddition( TInt aIndex ) = 0; - - /** - * Gets called when one or more ACM configurations are removed - * - * @since S60 3.2 - * @param aIndex Index (also port number) of removed ACM configuration - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyConfigRemoval( TInt aIndex ) = 0; - - }; - -/** - * Class for detecting USB ACM configuration change - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunUsbConfig ) : public CActive - { - -public: - - /** - * Two-phased constructor. - * @param aServer Server - * @param aCallback Pointer to listener callback - * @param aProtocol Protocol number to listen - * @return Instance of self - */ - static CDunUsbConfig* NewL( MDunServerCallback* aServer, - MDunUsbConfig* aCallback, - TUint8 aProtocol ); - - /** - * Destructor. - */ - virtual ~CDunUsbConfig(); - - /** - * Resets data to initial values - * - * @since S60 3.2 - * @return None - */ - void ResetData(); - - /** - * Compares initialized protocol number to configuration by index - * - * @since S60 3.2 - * @param aIndex Index for which to compare protocol number - * @param aValidity If initialized protocol matched at aIndex then ETrue - * @return Symbian error code on error, KErrNone otherwise - */ - TInt GetConfigValidityByIndex( TInt aIndex, TBool& aValidity ); - - /** - * Starts listening for ACM configuration changes - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt IssueRequest(); - - /** - * Stops listening for ACM configuration changes - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Stop(); - -private: - - CDunUsbConfig( MDunServerCallback* aServer, - MDunUsbConfig* aCallback, - TUint8 aProtocol ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since S60 3.2 - * @return None - */ - void Initialize(); - - /* - * Gets current ACM configuration - */ - TInt GetConfiguration( TPublishedAcmConfigs& aConfig ); - -// from base class CActive - - /** - * From CActive. - * Gets called when ACM configuration changes - * - * @since S60 3.2 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Gets called on cancel - * - * @since S60 3.2 - * @return None - */ - void DoCancel(); - -private: // data - - /** - * Callback to call when notification via MDunServerCallback to be made - * Not own. - */ - MDunServerCallback* iServer; - - /** - * Callback to call when notification(s) via MDunUsbConfig to be made - */ - MDunUsbConfig* iCallback; - - /** - * Current state of configuration waiting: active or inactive - */ - TUsbConfigState iConfigState; - - /* - * Protocol number of USB ACM to which listening is done - */ - TUint8 iProtocol; - - /** - * ACM config from the previous Get() - * Used to check whether configs are added or removed and also array data - * needed for check in the removal case - */ - TPublishedAcmConfigs iConfig; - - /* - * ACM configuration property - */ - RProperty iAcmProperty; - - /* - * Flag to indicate if configuration already received - */ - TBool iConfigExist; - - }; - -#endif // C_CDUNUSBCONFIG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/inc/usb/DunUsbListen.h --- a/localconnectivityservice/dun/plugins/inc/usb/DunUsbListen.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,168 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: DUN USB plugin's listener -* -*/ - - -#ifndef C_CDUNUSBLISTEN_H -#define C_CDUNUSBLISTEN_H - -#include -#include -#include -#include "DunPlugin.h" - -enum TUsbListenState - { - EUsbListenStateIdle, - EUsbListenStateListening - }; - -/** - * DUN USB plugin's listener class - * This class starts listening for USB device state to change to configured. - * When change to configured is detected, parent (CDunUsbPlugin) is notified - * to create a channel. Also when device state is no longer configured, - * parent (CDunUsbPlugin) is notified to remove a channel. - * - * @lib dunusb.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunUsbListen ) : public CActive - { - -public: - - /** - * Two-phased constructor. - * @param aServer Server - * @param aParent Creator of this instance - * @param aUsbServer USB server - * @return Instance of self - */ - static CDunUsbListen* NewL( MDunServerCallback* aServer, - MDunListenCallback* aParent, - RUsb& aUsbServer ); - - /** - * Destructor. - */ - virtual ~CDunUsbListen(); - - /** - * Resets data to initial values - * - * @since S60 3.2 - * @return None - */ - void ResetData(); - - /** - * IssueRequest to USB server for device state change notifications - * - * @return KErrAlreadyExists if device state configured, - * KErrNone otherwise - */ - TInt IssueRequestL(); - - /** - * Stops listening - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Stop(); - -private: - - CDunUsbListen( MDunServerCallback* aServer, - MDunListenCallback* aParent, - RUsb& aUsbServer ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since S60 3.2 - * @return None - */ - void Initialize(); - - /** - * Activates listening request - * - * @since S60 3.2 - * @return KErrNotReady if already active, KErrNone otherwise - */ - TInt Activate(); - -// from base class CActive - - /** - * From CActive. - * Called when read or write operation is ready. - * - * @since S60 3.2 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Cancel current activity. - * - * @return None - */ - void DoCancel(); - -private: // data - - /** - * Callback to call when notification via MDunServerCallback to be made - * Not own. - */ - MDunServerCallback* iServer; - - /** - * Callback to call when notification via MDunListenCallback to be made - * Not own. - */ - MDunListenCallback* iParent; - - /** - * Current state of listening: active or inactive - */ - TUsbListenState iListenState; - - /** - * USB server (USB manager) needed for device state notifications - * Device states needed to create transporter channel - */ - RUsb& iUsbServer; - - /** - * Device state of USB set when RUsb::DeviceStateNotification completes - */ - TUsbDeviceState iDeviceState; - - /** - * Previous state of USB set when RUsb::DeviceStateNotification completes - */ - TUsbDeviceState iDeviceStatePrev; - - }; - -#endif // C_CDUNUSBLISTEN_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/inc/usb/DunUsbPlugin.h --- a/localconnectivityservice/dun/plugins/inc/usb/DunUsbPlugin.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,362 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: DUN USB plugin -* -*/ - - -#ifndef C_CDUNUSBPLUGIN_H -#define C_CDUNUSBPLUGIN_H - -#include -#include -#include "DunTransporter.h" -#include "DunUsbListen.h" -#include "DunUsbConfig.h" -#include "DunPlugin.h" - -/** - * DUN USB plugin's port entity - * This class is used to keep track of N number of USB ports and port - * numbers associated to them (for CDunUsbConfig's purposes). - * - * @lib dunusb.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TUsbPortEntity ) - { - -public: - - /** - * Port number for USB local media side - */ - TInt iPortNum; - - /** - * Port for USB local media side - */ - RComm iUsbPort; - - }; - -/** - * DUN USB plugin's main class - * This class creates new transporter channel(s) when configured USB is - * detected by CDunUsbListen class and acts on transporter's state changes. - * Also acts on DUN server's requests. - * - * @lib dunusb.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunUsbPlugin ) : public CBase, - public MDunLocalMediaPlugin, - public MDunListenCallback, - public MDunBufferCorrection, - public MDunConnMon, - public MDunUsbConfig - { - -public: - - CDunUsbPlugin(); - - /** - * Destructor. - */ - virtual ~CDunUsbPlugin(); - -private: - - /** - * State of this plugin - * - * @since S60 3.2 - * @return State of plugin - */ - TDunPluginState PluginState(); - - /** - * Constructs a listener object for this plugin - * - * @since S60 3.2 - * @return None - */ - void ConstructListenerL(); - - /** - * Initializes USB by loading LDD - * - * @since S60 3.2 - * @return None - */ - void InitUsbL(); - - /** - * Initializes all usable USB ports for DUN - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt InitPorts(); - - /** - * Creates empty usable USB ports that can be used by DUN - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt CreateAllPorts(); - - /** - * Initializes one USB port for DUN - * - * @since S60 3.2 - * @param aEntity Pointer to port entity - * @return Symbian error code on error, KErrNone otherwise - */ - TInt InitOnePort( TUsbPortEntity* aEntity ); - - /** - * Sets channel for one USB port - * - * @since S60 3.2 - * @param aEntity Pointer to port entity - * @return None - */ - void SetChannelL( TUsbPortEntity* aEntity ); - - /** - * Adds skipped error code to Transporter - * The skipped error is added to local media's read and write operations - * - * @since S60 3.2 - * @param aError Skipped error code to add - * @param aComm RComm object for which to add the error code - * @return None - */ - void AddSkippedErrorL( TInt aError, RComm* aComm ); - - /** - * Sets new state - * New state must be one more than the old state - * - * @since S60 3.2 - * @param aPluginState New state to set for a plugin - * @return Symbian error code on error, KErrNone otherwise - */ - TInt ReportStateChangeUp( TDunPluginState aPluginState ); - - /** - * Sets new state - * New state must be one less than the old state - * - * @since S60 3.2 - * @param aPluginState New state to set for a plugin - * @return Symbian error code on error, KErrNone otherwise - */ - TInt ReportStateChangeDown( TDunPluginState aPluginState ); - - /** - * Frees existing channels - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt FreeChannels(); - - /** - * Uninitializes this plugin - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Uninitialize(); - - /** - * Gets port's index and entity by connection ID - * - * @since S60 3.2 - * @param aConnId Connection ID of the connection to find - * @param aEntity Returned port entity - * @return KErrNotFound if entity not found, found index otherwise - */ - TInt GetEntityByConnId( TConnId aConnId, TUsbPortEntity*& aEntity ); - - /** - * Gets port's entity by port number - * - * @since S60 3.2 - * @param aPortNum Port number of the connection to find - * @param aEntity Returned port entity - * @return KErrNotFound if entity not found, found index otherwise - */ - TInt GetEntityByPortNumber( TInt aPortNum, TUsbPortEntity*& aEntity ); - - /** - * Gets first free port's index and entity - * - * @since S60 3.2 - * @param aEntity Returned port entity - * @return KErrNotFound if entity not found, found index otherwise - */ - TInt GetFirstFreeEntity( TUsbPortEntity*& aEntity ); - -// from base class MDunLocalMediaPlugin - - void ConstructL( MDunServerCallback* aServer, - CDunTransporter* aTransporter ); - - /** - * From MDunLocalMediaPlugin. - * Gets called when server changes a plugin's state - * - * @since S60 3.2 - * @param aPluginState New changed state - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyServerStateChange( TDunPluginState aPluginState ); - - /** - * From MDunLocalMediaPlugin. - * Gets called when server needs to know the active connection - * (For testing purposes only) - * - * @since S60 5.0 - * @return Active connection, NULL otherwise - */ - TConnId ActiveConnection(); - -// from base class MDunListenCallback - - /** - * From MDunListenCallback. - * Gets called when new channel must be created - * - * @since S60 3.2 - * @param aNoFreeChans ETrue if no free channels, EFalse otherwise - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyChannelAllocate( TBool& aNoFreeChans ); - - /** - * From MDunListenCallback. - * Gets called when an existing channel must be freed - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyChannelFree(); - -// from base class MDunConnMon - - /** - * From MDunConnMon. - * Gets called when line status changes or when any type of error is - * detected - * - * @since S60 3.2 - * @param aConnId Connection ID for callback - * @param aConnReason Reason for progress change - * @return None - */ - void NotifyProgressChangeL( TConnId aConnId, - TDunConnectionReason aConnReason ); - -// from base class MDunBufferCorrection - - /** - * Gets called when request to change local media's buffer size - * - * @since S60 3.2 - * @param aLength Suggested buffer length that will be used if no - * correction done - * @return New (corrected) buffer length - */ - TInt NotifyBufferCorrection( TInt aLength ); - -// from base class MDunUsbConfig - - /** - * Gets called when one or more ACM configurations are added - * - * @since S60 3.2 - * @param aIndex Index (also port number) of added ACM configuration - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyConfigAddition( TInt aIndex ); - - /** - * Gets called when one or more ACM configurations are removed - * - * @since S60 3.2 - * @param aIndex Index (also port number) of removed ACM configuration - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyConfigRemoval( TInt aIndex ); - -private: // data - - /** - * Callback to call when notification via MDunServerCallback to be made - * Not own. - */ - MDunServerCallback* iServer; - - /** - * Listener for detecting attached USB cable and configured ACM - * Notifies this class to create new channel - * Own. - */ - CDunUsbListen* iUsbListen; - - /** - * Listener and accessor for detecting USB ACM configuration change - * Own. - */ - CDunUsbConfig* iUsbConfig; - - /** - * Communications server used to load ECACM and open USB port(s) - * Also used to get port information to calculate number of supported ACMs - */ - RCommServ iCommServer; - - /** - * USB server (USB manager) needed for device state notifications - * Device states needed to create transporter channel - */ - RUsb iUsbServer; - - /** - * Array of port(s) for USB local media side - */ - RArray iUsbPorts; - - /** - * Transporter to use for network side communication - * Not own. - */ - CDunTransporter* iTransporter; - - /** - * Flag to be set on if CDunUsbPlugin is waiting for shutdown. - * This flag is used to skip subsequent higher-level error codes after - * driver based error occurred. - */ - TBool iShutdown; - - }; - -#endif // C_CDUNUSBPLUGIN_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/src/bt/DunBtListen.cpp --- a/localconnectivityservice/dun/plugins/src/bt/DunBtListen.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,464 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: DUN Bluetooth plugin's listener -* -*/ - - -#include -#include -#include -#include -#include "DunPlugin.h" -#include "DunBtListen.h" -#include "DunBtPlugin.h" -#include "DunDebug.h" - -const TInt KListenQueSize = 1; -const TInt KDunFixedChannel = 22; // Hack/kludge for Apple Bug ID 6527598 - -//Service Class Bits supported by DUN -static const TUint16 KCoDDunServiceClass = EMajorServiceTelephony | EMajorServiceNetworking; - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunBtListen* CDunBtListen::NewL( MDunServerCallback* aServer, - MDunListenCallback* aParent, - CDunTransporter* aTransporter, - TBtPortEntity& aEntity ) - { - CDunBtListen* self = new (ELeave) CDunBtListen( aServer, - aParent, - aTransporter, - aEntity ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunBtListen::~CDunBtListen() - { - FTRACE(FPrint( _L("CDunBtListen::~CDunBtListen()") )); - ResetData(); - FTRACE(FPrint( _L("CDunBtListen::~CDunBtListen() complete") )); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunBtListen::ResetData() - { - // APIs affecting this: - // IssueRequestL() - Stop(); - StopServiceAdvertisement(); - // NewL() - iTransporter->FreeAdvertisementMonitor( KDunBtPluginUid, this ); - delete iDiscovery; - iDiscovery = NULL; - if ( iSockServer.Handle() != KNullHandle ) - { - iSockServer.Close(); - } - // Internal - Initialize(); - } - -// --------------------------------------------------------------------------- -// Registers itself to SDP and BT manager, opens a socket -// and starts to listen it. -// --------------------------------------------------------------------------- -// -void CDunBtListen::IssueRequestL() - { - FTRACE(FPrint( _L( "CDunBtListen::IssueRequestL()" ) )); - - if ( iListenState == EBtListenStateListening ) - { - FTRACE(FPrint( _L( "CDunBtListen::IssueRequestL() (already active) complete" ) )); - User::Leave( KErrNotReady ); - } - - TBool advertise = iTransporter->AdvertisementStatus(); - if ( !advertise ) - { - // Return silently here as CDunTransporter will notify later - return; - } - - TBool inUse = EFalse; - TInt numOfChans = 0; - TInt retTemp = StartServiceAdvertisement( inUse ); - if ( retTemp != KErrNone ) - { - if ( inUse ) - { - numOfChans = iTransporter->GetNumberOfAllocatedChannelsByUid( - KDunBtPluginUid ); - if ( numOfChans == 0) - { - // No channels so parent can't reissue requests of this object - // This is fatal case -> leave. - // NOTE: To add full support for this case a poller (timer) is - // needed that polls for free RFCOMM channel by given interval. - User::Leave( retTemp ); - } - // If in use and parent has channels then just fail silently. - // Let this object to wait until parent finds new resources. - FTRACE(FPrint( _L( "CDunBtListen::IssueRequestL() complete" ) )); - return; - } - FTRACE(FPrint( _L( "CDunBtListen::IssueRequestL() (failed!) complete" ) )); - User::Leave( retTemp ); - } - - // Not already active here so start listening - // First open blank data socket - retTemp = iEntity.iBTPort.Open( iSockServer ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L( "CDunBtListen::IssueRequestL() (ERROR) complete (%d)" ), retTemp)); - User::Leave( retTemp ); - } - iStatus = KRequestPending; - iListenSocket.Accept( iEntity.iBTPort, iStatus ); - SetActive(); - iListenState = EBtListenStateListening; - - FTRACE(FPrint( _L( "CDunBtListen::IssueRequestL() complete") )); - } - -// --------------------------------------------------------------------------- -// Stops listening -// --------------------------------------------------------------------------- -// -TInt CDunBtListen::Stop() - { - FTRACE(FPrint( _L( "CDunBtListen::Stop()") )); - if ( iListenState != EBtListenStateListening ) - { - FTRACE(FPrint( _L("CDunBtListen::Stop() (not ready) complete" ))); - return KErrNotReady; - } - iListenSocket.CancelAccept(); - Cancel(); - iListenState = EBtListenStateIdle; - FTRACE(FPrint( _L( "CDunBtListen::Stop() complete") )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CDunBtListen::CDunBtListen -// --------------------------------------------------------------------------- -// -CDunBtListen::CDunBtListen( MDunServerCallback* aServer, - MDunListenCallback* aParent, - CDunTransporter* aTransporter, - TBtPortEntity& aEntity ) : - CActive( EPriorityStandard ), - iServer( aServer ), - iParent( aParent ), - iTransporter( aTransporter ), - iEntity( aEntity ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunBtListen::ConstructL -// --------------------------------------------------------------------------- -// -void CDunBtListen::ConstructL() - { - FTRACE(FPrint(_L("CDunBtListen::ConstructL()"))); - if ( !iServer || !iParent || !iTransporter ) - { - User::Leave( KErrGeneral ); - } - - CBTEngDiscovery* discovery = CBTEngDiscovery::NewLC(); - FTRACE(FPrint(_L("CDunBtListen::ConstructL: iSockServer.Connect"))); - User::LeaveIfError( iSockServer.Connect() ); - - // Set advertisement monitor - iTransporter->SetAdvertisementMonitorL( KDunBtPluginUid, this ); - - // Then we are ready to start listening and accepting incoming connection - // requests. - CleanupStack::Pop( discovery ); - iDiscovery = discovery; - CActiveScheduler::Add( this ); - FTRACE(FPrint(_L("CDunBtListen::ConstructL() complete"))); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunBtListen::Initialize() - { - // Don't initialize iServer here (it is set through NewL) - // Don't initialize iParent here (it is set through NewL) - // Don't initialize iTransporter here (it is set through NewL) - // Don't initialize iEntity here (it is set through NewL) - iListenState = EBtListenStateIdle; - iDiscovery = NULL; - iChannelNum = 0; - iSDPHandleDun = 0; - } - -// --------------------------------------------------------------------------- -// Starts dialup service advertisement -// --------------------------------------------------------------------------- -// -TInt CDunBtListen::StartServiceAdvertisement( TBool& aInUse ) - { - FTRACE(FPrint( _L( "CDunBtListen::StartServiceAdvertisement()" ) )); - - TInt retTemp = ReserveLocalChannel( iSockServer, - iListenSocket, - iChannelNum, - aInUse ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L( "CDunBtListen::StartServiceAdvertisement() (ERROR) complete" ) )); - return retTemp; - } - - // Now RFCOMM channel number of the next data socket must be the same as - // the current listener's RFCOMM channel number. Set that now. - iEntity.iChannelNum = iChannelNum; - - // Register SDP record - iSDPHandleDun = 0; - retTemp = iDiscovery->RegisterSdpRecord( KDialUpNetworkingUUID, - iChannelNum, - iSDPHandleDun ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L( "CDunBtListen::StartServiceAdvertisement() (failed!) complete (%d)" ), retTemp)); - return retTemp; - } - FTRACE(FPrint( _L( "CDunBtListen::StartServiceAdvertisement() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Stops dialup service advertisement -// --------------------------------------------------------------------------- -// -TInt CDunBtListen::StopServiceAdvertisement() - { - FTRACE(FPrint( _L( "CDunBtListen::StopServiceAdvertisement()" ) )); - if ( !iDiscovery ) - { - FTRACE(FPrint( _L( "CDunBtListen::StopServiceAdvertisement() (iDiscovery) not initialized!" ) )); - return KErrGeneral; - } - if ( iSDPHandleDun != 0 ) - { - TInt retTemp = iDiscovery->DeleteSdpRecord( iSDPHandleDun ); - FTRACE(FPrint( _L( "CDunBtListen::StopServiceAdvertisement() record closed (%d)" ), retTemp )); - iSDPHandleDun = 0; - } - if ( iListenSocket.SubSessionHandle() ) - { - iListenSocket.Close(); - } - FTRACE(FPrint( _L( "CDunBtListen::StopServiceAdvertisement() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Method which reserves local RFCOMM channel (from possible channels 1-30) -// and returns it to client. -// --------------------------------------------------------------------------- -// -TInt CDunBtListen::ReserveLocalChannel( RSocketServ& aSocketServ, - RSocket& aListenSocket, - TUint& aChannelNum, - TBool& aInUse ) - { - FTRACE(FPrint(_L("CDunBtListen::ReserveLocalChannel()"))); - aInUse = EFalse; - if ( aListenSocket.SubSessionHandle() ) - { - FTRACE(FPrint(_L("CDunBtListen::ReserveLocalChannel() (open socket!) complete"))); - return KErrArgument; - } - TInt retTemp; - TProtocolDesc pInfo; - retTemp = aSocketServ.FindProtocol( TProtocolName(KRFCOMMDesC), pInfo ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunBtListen::ReserveLocalChannel() (FindProtocol failed) complete (%d)"), retTemp)); - return retTemp; - } - retTemp = aListenSocket.Open( aSocketServ, - pInfo.iAddrFamily, - pInfo.iSockType, - pInfo.iProtocol ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunBtListen::ReserveLocalChannel() (Open failed) complete (%d)"), retTemp)); - return retTemp; - } - TRfcommSockAddr addr; - TBTServiceSecurity sec; - sec.SetAuthentication( ETrue ); - sec.SetAuthorisation( ETrue ); - sec.SetEncryption( ETrue ); - sec.SetPasskeyMinLength( 0 ); - addr.SetSecurity( sec ); - addr.SetPort( KRfcommPassiveAutoBind ); - // When fix from Apple, replace the following with - // "retTemp = aListenSocket.Bind( addr );" - retTemp = DoExtendedBind( aListenSocket, addr ); - if ( retTemp != KErrNone ) - { - aListenSocket.Close(); - aInUse = ETrue; - FTRACE(FPrint(_L("CDunBtListen::ReserveLocalChannel() Bind() complete (%d)"), retTemp)); - return KErrInUse; - } - aChannelNum = aListenSocket.LocalPort(); - - // We try to set the Telephony and Networking bits in our service class. If this fails we - // ignore it, as it's better to carry on without it than to fail to start listening. - aListenSocket.SetOpt(KBTRegisterCodService, KSolBtRFCOMM, KCoDDunServiceClass); - - retTemp = aListenSocket.Listen( KListenQueSize ); - if ( retTemp != KErrNone ) - { - aListenSocket.Close(); - FTRACE(FPrint(_L("CDunBtListen::ReserveLocalChannel() Listen() complete (%d)"), retTemp)); - return retTemp; - } - FTRACE(FPrint(_L("CDunBtListen::ReserveLocalChannel() complete (%d)"), aChannelNum)); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Tries to bind to a fixed port and if that fails with KRfcommPassiveAutoBind. -// This is for spec breaking solutions like the OSX Leopard. -// --------------------------------------------------------------------------- -// -TInt CDunBtListen::DoExtendedBind( RSocket& aListenSocket, - TRfcommSockAddr& aSockAddr ) - { - FTRACE(FPrint(_L("CDunBtListen::DoExtendedBind()"))); - if ( !aListenSocket.SubSessionHandle() ) - { - FTRACE(FPrint(_L("CDunBtListen::DoExtendedBind() (closed socket!) complete"))); - return KErrGeneral; - } - TRfcommSockAddr fixedAddr = aSockAddr; - fixedAddr.SetPort( KDunFixedChannel ); - TInt retTemp = aListenSocket.Bind( fixedAddr ); - if ( retTemp == KErrNone ) - { - FTRACE(FPrint(_L("CDunBtListen::DoExtendedBind() complete"))); - return KErrNone; - } - TInt retVal = aListenSocket.Bind( aSockAddr ); - FTRACE(FPrint(_L("CDunBtListen::DoExtendedBind() complete"))); - return retVal; - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Called when a service is requested via BT. -// --------------------------------------------------------------------------- -// -void CDunBtListen::RunL() - { - FTRACE(FPrint( _L( "CDunBtListen::RunL()" ) )); - iListenState = EBtListenStateIdle; - - StopServiceAdvertisement(); - - TInt retTemp = iStatus.Int(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L( "CDunBtListen::RunL() (ERROR) complete (%d)" ), retTemp)); - iServer->NotifyPluginCloseRequest( KDunBtPluginUid, ETrue ); - return; - } - // Notify new connection - TBool noFreeChans = EFalse; - retTemp = iParent->NotifyChannelAllocate( noFreeChans ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L( "CDunBtListen::RunL() channel allocation failed! (%d)" ), retTemp)); - // Other error than no free channels, close plugin now - if ( !noFreeChans ) - { - iServer->NotifyPluginCloseRequest( KDunBtPluginUid, ETrue ); - } - return; - } - - // Don't restart listening here. Request is issued via - // NotifyAdvertisementStart() - - FTRACE(FPrint( _L( "CDunBtListen::RunL() complete" ) )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Cancel current activity. -// --------------------------------------------------------------------------- -// -void CDunBtListen::DoCancel() - { - } - -// --------------------------------------------------------------------------- -// From class MDunServAdvMon. -// Gets called when advertisement status changes to start. -// --------------------------------------------------------------------------- -// -void CDunBtListen::NotifyAdvertisementStart( TBool aCreation ) - { - FTRACE(FPrint( _L( "CDunBtListen::NotifyAdvertisementStart()" ) )); - // Remove the "if" below when fix comes from Apple - if ( !aCreation ) - { - TRAP_IGNORE( IssueRequestL() ); - } - FTRACE(FPrint( _L( "CDunBtListen::NotifyAdvertisementStart() complete" ) )); - } - -// --------------------------------------------------------------------------- -// From class MDunServAdvMon. -// Gets called when advertisement status changes to end. -// --------------------------------------------------------------------------- -// -void CDunBtListen::NotifyAdvertisementEnd() - { - FTRACE(FPrint( _L( "CDunBtListen::NotifyAdvertisementEnd()" ) )); - Stop(); - StopServiceAdvertisement(); - FTRACE(FPrint( _L( "CDunBtListen::NotifyAdvertisementEnd() complete" ) )); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/src/bt/DunBtPlugin.cpp --- a/localconnectivityservice/dun/plugins/src/bt/DunBtPlugin.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,582 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: DUN Bluetooth plugin -* -*/ - - -#include -#include -#include "DunPlugin.h" -#include "DunBtListen.h" -#include "DunBtPlugin.h" -#include "DunDebug.h" -#include "DunTransporter.h" - -_LIT( KBtChannelName, "DUNBT::" ); - -const TInt KCharactersInTInt = 10; // For "2147483648" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CDunBtPlugin::CDunBtPlugin() -// --------------------------------------------------------------------------- -// -CDunBtPlugin::CDunBtPlugin() : - iServer( NULL ), - iBTListen( NULL ), - iTransporter( NULL ) - { - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunBtPlugin::~CDunBtPlugin() - { - FTRACE(FPrint( _L( "CDunBtPlugin::~CDunBtPlugin()" ) )); - Uninitialize(); - FTRACE(FPrint( _L( "CDunBtPlugin::~CDunBtPlugin() complete" ) )); - } - -// --------------------------------------------------------------------------- -// State of this plugin -// --------------------------------------------------------------------------- -// -TDunPluginState CDunBtPlugin::PluginState() - { - return iServer->GetPluginStateByUid( KDunBtPluginUid ); - } - -// --------------------------------------------------------------------------- -// Constructs a listener object for this plugin -// --------------------------------------------------------------------------- -// -void CDunBtPlugin::ConstructListenerL() - { - FTRACE(FPrint(_L("CDunBtPlugin::ConstructListenerL()"))); - if ( PluginState() != EDunStateLoaded ) - { - FTRACE(FPrint(_L("CDunBtPlugin::ConstructListenerL() (not ready) complete"))); - User::Leave( KErrNotReady ); - } - ReportStateChangeUp( EDunStateTryListen ); - if ( iBTListen ) - { - FTRACE(FPrint(_L("CDunBtPlugin::ConstructListenerL() (already exists) complete"))); - User::Leave( KErrAlreadyExists ); - } - CDunBtListen* listen = CDunBtListen::NewL( iServer, - this, - iTransporter, - iEntity ); - CleanupStack::PushL( listen ); - listen->IssueRequestL(); - CleanupStack::Pop( listen ); - iBTListen = listen; - ReportStateChangeUp( EDunStateListening ); - FTRACE(FPrint(_L("CDunBtPlugin::ConstructListenerL() complete"))); - } - -// --------------------------------------------------------------------------- -// Sets new state -// New state must be one more than the old state -// --------------------------------------------------------------------------- -// -TInt CDunBtPlugin::ReportStateChangeUp( TDunPluginState aPluginState ) - { - FTRACE(FPrint(_L("CDunBtPlugin::ReportStateChangeUp()"))); - TInt retTemp = iServer->NotifyPluginStateChangeUp( aPluginState, - KDunBtPluginUid ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunBtPlugin::ReportStateChangeUp() (ERROR) complete"))); - return retTemp; - } - FTRACE(FPrint(_L("CDunBtPlugin::ReportStateChangeUp() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Sets new state -// New state must be one less than the old state -// --------------------------------------------------------------------------- -// -TInt CDunBtPlugin::ReportStateChangeDown( TDunPluginState aPluginState ) - { - FTRACE(FPrint(_L("CDunBtPlugin::ReportStateChangeDown()"))); - TInt retTemp = iServer->NotifyPluginStateChangeDown( aPluginState, - KDunBtPluginUid ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunBtPlugin::ReportStateChangeDown() (ERROR) complete"))); - return retTemp; - } - FTRACE(FPrint(_L("CDunBtPlugin::ReportStateChangeDown() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Allocates a free channel -// --------------------------------------------------------------------------- -// -void CDunBtPlugin::AllocateChannelL( TBool& aNoFreeChans, - TBtCleanupInfo& aCleanupInfo ) - { - FTRACE(FPrint(_L("CDunBtPlugin::AllocateChannelL()"))); - // iDataSocket has new data socket information so copy it to iBTPorts - TBtPortEntity* foundEntity = NULL; - TInt foundIndex = GetFirstFreePort( foundEntity ); - if ( !foundEntity ) // free not found so add new - { - TBtPortEntity newEntity; - iBTPorts.AppendL( newEntity ); - aCleanupInfo.iNewEntity = ETrue; - aCleanupInfo.iEntityIndex = iBTPorts.Count() - 1; - foundEntity = &iBTPorts[ aCleanupInfo.iEntityIndex ]; - } - else // free found so change array - { - aCleanupInfo.iNewEntity = EFalse; - aCleanupInfo.iEntityIndex = foundIndex; - foundEntity = &iBTPorts[ foundIndex ]; - } - foundEntity->iChannelNum = iEntity.iChannelNum; - foundEntity->iBTPort = iEntity.iBTPort; - RSocket* socket = &foundEntity->iBTPort; - HBufC8* channelName = HBufC8::NewMaxLC( KBtChannelName().Length() + - KCharactersInTInt ); - TPtr8 channelNamePtr = channelName->Des(); - channelNamePtr.Copy( KBtChannelName ); - channelNamePtr.AppendNum( iEntity.iChannelNum ); - iTransporter->AllocateChannelL( socket, - KDunBtPluginUid, - channelNamePtr, - EFalse, - aNoFreeChans ); - iTransporter->AddConnMonCallbackL( socket, - this, - EDunReaderUpstream, - EFalse ); - iTransporter->AddConnMonCallbackL( socket, - this, - EDunWriterUpstream, - EFalse ); - iTransporter->AddConnMonCallbackL( socket, - this, - EDunReaderDownstream, - ETrue ); - iTransporter->AddConnMonCallbackL( socket, - this, - EDunWriterDownstream, - EFalse ); - iTransporter->IssueTransferRequestsL( socket ); - CleanupStack::PopAndDestroy( channelName ); - FTRACE(FPrint(_L("CDunBtPlugin::AllocateChannelL() complete"))); - } - -// --------------------------------------------------------------------------- -// Frees an existing channel -// --------------------------------------------------------------------------- -// -TInt CDunBtPlugin::FreeChannels() - { - FTRACE(FPrint(_L("CDunBtPlugin::FreeChannels()"))); - if ( PluginState() != EDunStateTryUninitialize ) - { - FTRACE(FPrint(_L("CDunBtPlugin::FreeChannels() (not ready) complete"))); - return KErrNotReady; - } - TInt i; - TInt count = iBTPorts.Count(); - for ( i=0; iFreeChannel( &iBTPorts[i].iBTPort ); - iBTPorts[i].iBTPort.Close(); - // All channels freed and this is for Uninitialize() so don't touch - // advertisement monitor here! - } - iBTPorts[i].iChannelNum = KErrNotFound; - } - iBTPorts.Close(); - FTRACE(FPrint(_L("CDunBtPlugin::FreeChannels() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Uninitializes this plugin -// --------------------------------------------------------------------------- -// -TInt CDunBtPlugin::Uninitialize() - { - FTRACE(FPrint( _L( "CDunBtPlugin::Uninitialize()" ) )); - ReportStateChangeDown( EDunStateTryUninitialize ); - // Free channels (ignore errors) - FreeChannels(); - // Delete listening object (also advertisement monitor) - delete iBTListen; - iBTListen = NULL; - // Set state back to loaded - ReportStateChangeUp( EDunStateUninitialized ); - ReportStateChangeUp( EDunStateTryLoad ); - ReportStateChangeUp( EDunStateLoaded ); - FTRACE(FPrint( _L( "CDunBtPlugin::Uninitialize() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Gets port's index and entity by connection ID -// --------------------------------------------------------------------------- -// -TInt CDunBtPlugin::GetPortByConnId( TConnId aConnId, TBtPortEntity*& aEntity ) - { - FTRACE(FPrint( _L( "CDunBtPlugin::GetPortByConnId()")) ); - TInt i; - TInt count = iBTPorts.Count(); - for ( i=0; i pkg( modemStatus ); - TInt retTemp = aEntity.iBTPort.GetOpt( KRFCOMMLocalModemStatus, - KSolBtRFCOMM, - pkg ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L( "CDunBtPlugin::SetRFCOMMStatusCommand() (GetOpt failed!) complete" ) )); - return retTemp; - } - modemStatus = pkg(); - FTRACE(FPrint( _L( "CDunBtPlugin::SetRFCOMMStatusCommand() signals are: 0x%02X" ), modemStatus)); - TBool changed = EFalse; - TUint8 signal = modemStatus & aSignal; - if ( aSignalOn ) - { - if ( !signal ) - { - modemStatus |= aSignal; - changed = ETrue; - } - } - else - { - if ( signal ) - { - modemStatus &= ( ~aSignal ); - changed = ETrue; - } - } - if ( changed ) - { - pkg = modemStatus; - retTemp = aEntity.iBTPort.SetOpt( KRFCOMMLocalModemStatus, - KSolBtRFCOMM, - pkg ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L( "CDunBtPlugin::SetRFCOMMStatusCommand() (SetOpt failed!) complete" ) )); - return retTemp; - } - } - FTRACE(FPrint( _L( "CDunBtPlugin::SetRFCOMMStatusCommand() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Manages advertiser for channel free operation -// --------------------------------------------------------------------------- -// -void CDunBtPlugin::ManageAdvertiserFreeOperationL() - { - FTRACE(FPrint(_L("CDunBtPlugin::ManageAdvertiserFreeOperationL()"))); - TInt numOfChans = iTransporter->NumberOfAllocatedChannels(); - // Remove of last CDunTransporter channel removes also the - // advertisement monitor so set it now if necessary - if ( numOfChans == 0 ) - { - iTransporter->SetAdvertisementMonitorL( KDunBtPluginUid, iBTListen ); - } - FTRACE(FPrint(_L("CDunBtPlugin::ManageAdvertiserFreeOperationL() complete"))); - } - -// --------------------------------------------------------------------------- -// Cleans partial created channel data based on TATExtCleanupInfo -// --------------------------------------------------------------------------- -// -void CDunBtPlugin::CleanPartialChanneldata( TBtCleanupInfo& aCleanupInfo ) - { - FTRACE(FPrint(_L("CDunBtPlugin::CleanPartialChanneldata()"))); - RSocket* socket = &iBTPorts[aCleanupInfo.iEntityIndex].iBTPort; - iTransporter->FreeChannel( socket ); - iBTPorts[aCleanupInfo.iEntityIndex].iChannelNum = KErrNotFound; - socket->Close(); - if ( aCleanupInfo.iNewEntity ) - { - iBTPorts.Remove( aCleanupInfo.iEntityIndex ); - } - FTRACE(FPrint(_L("CDunBtPlugin::CleanPartialChanneldata() complete"))); - } - -// --------------------------------------------------------------------------- -// From class MDunLocalMediaPlugin. -// CDunBtPlugin::ConstructL -// --------------------------------------------------------------------------- -// -void CDunBtPlugin::ConstructL( MDunServerCallback* aServer, - CDunTransporter* aTransporter ) - { - FTRACE(FPrint( _L( "CDunBtPlugin::ConstructL()" ) )); - if ( !aServer || !aTransporter ) - { - FTRACE(FPrint(_L("CDunBtPlugin::ConstructL() not initialized!"))); - User::Leave( KErrBadHandle ); - } - iServer = aServer; - iTransporter = aTransporter; - FTRACE(FPrint( _L( "CDunBtPlugin::ConstructL() complete" ) )); - } - -// --------------------------------------------------------------------------- -// From class MDunLocalMediaPlugin. -// Gets called when server changes a plugin's state -// --------------------------------------------------------------------------- -// -TInt CDunBtPlugin::NotifyServerStateChange( TDunPluginState aPluginState ) - { - FTRACE(FPrint(_L("CDunBtPlugin::NotifyServerStateChange()"))); - TInt retTemp; - switch ( aPluginState ) - { - case EDunStateTryListen: - if ( PluginState() != EDunStateLoaded ) - { - FTRACE(FPrint(_L("CDunBtPlugin::NotifyServerStateChange() (not ready) complete"))); - return KErrNotReady; - } - // Change to listening mode - TRAPD( retTrap, ConstructListenerL() ); - if ( retTrap != KErrNone ) - { - FTRACE(FPrint(_L("CDunBtPlugin::NotifyServerStateChange() (ERROR) complete (%d)"), retTrap)); - return retTrap; - } - break; - case EDunStateTryUninitialize: - if ( PluginState() == EDunStateUninitialized ) - { - FTRACE(FPrint(_L("CDunBtPlugin::NotifyServerStateChange() (not ready) complete"))); - return KErrNotReady; - } - // Uninitialize - retTemp = Uninitialize(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunBtPlugin::NotifyServerStateChange() (not ready) complete (%d)"), retTemp)); - return KErrNotReady; - } - break; - default: - FTRACE(FPrint(_L("CDunBtPlugin::NotifyServerStateChange() (unknown state) complete"))); - return KErrNotSupported; - } - FTRACE(FPrint(_L("CDunBtPlugin::NotifyServerStateChange() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunLocalMediaPlugin. -// Gets called when server needs to know the active connection -// --------------------------------------------------------------------------- -// -TConnId CDunBtPlugin::ActiveConnection() - { - FTRACE(FPrint(_L("CDunBtPlugin::ActiveConnection()"))); - if ( iBTPorts.Count() >= 1 ) - { - FTRACE(FPrint(_L("CDunBtPlugin::ActiveConnection() complete"))); - return &iBTPorts[0]; - } - FTRACE(FPrint(_L("CDunBtPlugin::ActiveConnection() (not found) complete"))); - return NULL; - } - -// --------------------------------------------------------------------------- -// From class MDunListenCallback. -// Gets called when new channel must be created -// --------------------------------------------------------------------------- -// -TInt CDunBtPlugin::NotifyChannelAllocate( TBool& aNoFreeChans ) - { - // Now state can be either EDunStateListening (no channels) or - // EDunStateChanneled (one or more channels). Support both states - TDunPluginState startState = PluginState(); - if ( startState!=EDunStateListening && startState!=EDunStateChanneled ) - { - FTRACE(FPrint(_L("CDunBtPlugin::NotifyChannelAllocate() (not ready) complete"))); - return KErrNotReady; - } - if ( startState == EDunStateListening ) - { - ReportStateChangeUp( EDunStateTryChannel ); - } - TBtCleanupInfo cleanupInfo; - TRAPD( retTrap, AllocateChannelL(aNoFreeChans,cleanupInfo) ); - if ( retTrap != KErrNone ) - { - CleanPartialChanneldata( cleanupInfo ); - FTRACE(FPrint(_L("CDunBtPlugin::NotifyChannelAllocate() (trapped!) complete"))); - return retTrap; - } - if ( startState == EDunStateListening ) - { - ReportStateChangeUp( EDunStateChanneled ); - } - FTRACE(FPrint(_L("CDunBtPlugin::NotifyChannelAllocate() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunListenCallback. -// Gets called when an existing channel must be freed -// --------------------------------------------------------------------------- -// -TInt CDunBtPlugin::NotifyChannelFree() - { - // No implementation needed here - return KErrNotSupported; - } - -// --------------------------------------------------------------------------- -// From class MDunConnMon. -// Gets called when line status changes or when any type of error is detected -// --------------------------------------------------------------------------- -// -void CDunBtPlugin::NotifyProgressChangeL( TConnId aConnId, - TDunConnectionReason aConnReason ) - { - FTRACE(FPrint( _L( "CDunBtPlugin::NotifyProgressChangeL()" ) )); - // Find matching failed ID - TBtPortEntity* foundEntity = NULL; - TInt foundIndex = GetPortByConnId( aConnId, foundEntity ); - if ( !foundEntity ) - { - FTRACE(FPrint( _L( "CDunBtPlugin::NotifyProgressChangeL() (not found) complete")) ); - User::Leave( KErrNotFound ); - } - if ( aConnReason.iReasonType == EDunReasonTypeSignal ) - { - if ( aConnReason.iContext != EDunMediaContextNetwork ) - { - // Should never come here as other signals are for RComm - FTRACE(FPrint( _L( "CDunBtPlugin::NotifyProgressChangeL() (ERROR) complete")) ); - User::Leave( KErrGeneral ); - } - // Signal change detected on network side -> process change - if ( aConnReason.iSignalType == KSignalDCD ) - { - SetRFCOMMStatusCommand( *foundEntity, - KModemSignalDV, - aConnReason.iSignalHigh ); - FTRACE(FPrint( _L( "CDunBtPlugin::NotifyProgressChangeL() DV changed")) ); - } - else if ( aConnReason.iSignalType == KSignalRNG ) - { - SetRFCOMMStatusCommand( *foundEntity, - KModemSignalIC, - aConnReason.iSignalHigh ); - FTRACE(FPrint( _L( "CDunBtPlugin::NotifyProgressChangeL() IC changed")) ); - } - // Omit other signals - } - else - { - // All other cases are down indications from local media side - if ( foundEntity->iBTPort.SubSessionHandle() ) - { - iTransporter->FreeChannel( &foundEntity->iBTPort ); - // CDunTransporter will notify the listener about advertisement - // status change after FreeChannel() so no need to do - // IssueRequestL() for CDunBtListen here after this. - foundEntity->iBTPort.Close(); - } - ManageAdvertiserFreeOperationL(); - // Now resources are freed so command server to reopen possibly - // existing queued plugins - iServer->NotifyPluginReopenRequest(); - } - FTRACE(FPrint( _L( "CDunBtPlugin::NotifyProgressChangeL() complete")) ); - } - -// ======== GLOBAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// NewLocalPluginL implements factory construction for -// the class CDunBtPlugin. -// The function is exported at ordinal 1. -// --------------------------------------------------------------------------- -// -EXPORT_C MDunLocalMediaPlugin* NewLocalPluginL() - { - return new (ELeave) CDunBtPlugin; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/src/ir/DunIrPlugin.cpp --- a/localconnectivityservice/dun/plugins/src/ir/DunIrPlugin.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,340 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: DUN Infrared plugin -* -*/ - - -#include "DunIrPlugin.h" -#include "DunUtils.h" -#include "DunDebug.h" - -_LIT( KIrdaCsy, "IRCOMM" ); -_LIT( KIrdaCsy0, "IRCOMM::0" ); -_LIT( KIrChannelName, "DUNIR::0" ); - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CDunIrPlugin::CDunIrPlugin -// --------------------------------------------------------------------------- -// -CDunIrPlugin::CDunIrPlugin() : - iServer( NULL ), - iTransporter( NULL ) - { - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunIrPlugin::~CDunIrPlugin() - { - FTRACE(FPrint( _L( "CDunIrPlugin::~CDunIrPlugin()" ) )); - Uninitialize(); - FTRACE(FPrint( _L( "CDunIrPlugin::~CDunIrPlugin() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Gets state of this plugin -// --------------------------------------------------------------------------- -// -TDunPluginState CDunIrPlugin::PluginState() - { - return iServer->GetPluginStateByUid( KDunIrPluginUid ); - } - -// --------------------------------------------------------------------------- -// Constructs a listener object for this plugin -// --------------------------------------------------------------------------- -// -TInt CDunIrPlugin::ConstructListener() - { - FTRACE(FPrint(_L("CDunIrPlugin::ConstructListenerL()"))); - if ( PluginState() != EDunStateLoaded ) - { - FTRACE(FPrint(_L("CDunIrPlugin::ConstructListenerL() (not ready) complete"))); - return KErrNotReady; - } - ReportStateChangeUp( EDunStateTryListen ); - TInt retTemp = InitPort(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunIrPlugin::ConstructListenerL() (ERROR) complete"))); - return retTemp; - } - ReportStateChangeUp( EDunStateListening ); - ReportStateChangeUp( EDunStateTryChannel ); - TRAPD( retTrap, AllocateChannelL() ); - if ( retTrap != KErrNone ) - { - iTransporter->FreeChannel( &iIrPort ); - FTRACE(FPrint(_L("CDunIrPlugin::ConstructListenerL() (trapped!) complete"))); - return retTrap; - } - ReportStateChangeUp( EDunStateChanneled ); - FTRACE(FPrint(_L("CDunIrPlugin::ConstructListenerL() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Sets new state -// New state must be one more than the old state -// --------------------------------------------------------------------------- -// -TInt CDunIrPlugin::ReportStateChangeUp( TDunPluginState aPluginState ) - { - FTRACE(FPrint(_L("CDunIrPlugin::ReportStateChangeUp()"))); - TInt retTemp = iServer->NotifyPluginStateChangeUp( aPluginState, - KDunIrPluginUid ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunIrPlugin::ReportStateChangeUp() (ERROR) complete"))); - return retTemp; - } - FTRACE(FPrint(_L("CDunIrPlugin::ReportStateChangeUp() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Sets new state -// New state must be one less than the old state -// --------------------------------------------------------------------------- -// -TInt CDunIrPlugin::ReportStateChangeDown( TDunPluginState aPluginState ) - { - FTRACE(FPrint(_L("CDunIrPlugin::ReportStateChangeDown()"))); - TInt retTemp = iServer->NotifyPluginStateChangeDown( aPluginState, - KDunIrPluginUid ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunIrPlugin::ReportStateChangeDown() (ERROR) complete"))); - return retTemp; - } - FTRACE(FPrint(_L("CDunIrPlugin::ReportStateChangeDown() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Initializes one infrared port with role DCE -// --------------------------------------------------------------------------- -// -TInt CDunIrPlugin::InitPort() - { - FTRACE(FPrint( _L( "CDunIrPlugin::InitPort()" ) )); - TInt retTemp; - retTemp = CDunUtils::ConnectCommsServer( iCommServer ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L( "CDunIrPlugin::InitPort() (ERROR) complete" ) )); - return retTemp; - } - retTemp = iCommServer.LoadCommModule( KIrdaCsy ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunIrPlugin::InitPort() (load module) failed!") )); - return retTemp; - } - if ( iIrPort.SubSessionHandle() ) - { - FTRACE(FPrint(_L("CDunIrPlugin::InitPort (already exists!) complete") )); - return KErrAlreadyExists; - } - retTemp = iIrPort.Open( iCommServer, - KIrdaCsy0, - ECommExclusive, - ECommRoleDCE ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunIrPlugin::InitPort() (open) failed!") )); - return retTemp; - } - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Allocates a channel -// --------------------------------------------------------------------------- -// -void CDunIrPlugin::AllocateChannelL() - { - FTRACE(FPrint(_L("CDunIrPlugin::AllocateChannelL()"))); - HBufC8* channelName = HBufC8::NewMaxLC( KIrChannelName().Length() ); - TPtr8 channelNamePtr = channelName->Des(); - channelNamePtr.Copy( KIrChannelName ); - iTransporter->AllocateChannelL( &iIrPort, - KDunIrPluginUid, - channelNamePtr, - ETrue ); - iTransporter->AddConnMonCallbackL( &iIrPort, - this, - EDunReaderUpstream, - EFalse ); - iTransporter->AddConnMonCallbackL( &iIrPort, - this, - EDunWriterUpstream, - EFalse ); - iTransporter->AddConnMonCallbackL( &iIrPort, - this, - EDunReaderDownstream, - EFalse ); - iTransporter->AddConnMonCallbackL( &iIrPort, - this, - EDunWriterDownstream, - EFalse ); - iTransporter->IssueTransferRequestsL( &iIrPort ); - CleanupStack::PopAndDestroy( channelName ); - FTRACE(FPrint(_L("CDunIrPlugin::AllocateChannelL() complete"))); - } - -// --------------------------------------------------------------------------- -// Uninitializes this plugin -// --------------------------------------------------------------------------- -// -TInt CDunIrPlugin::Uninitialize() - { - FTRACE(FPrint(_L("CDunIrPlugin::Uninitialize()" ))); - ReportStateChangeDown( EDunStateTryUninitialize ); - if ( iIrPort.SubSessionHandle() ) - { - iTransporter->FreeChannel( &iIrPort ); - iIrPort.SetSignals( 0, KSignalDCEOutputs ); - iIrPort.Close(); - } - if ( iCommServer.Handle() ) - { - iCommServer.UnloadCommModule( KIrdaCsy ); - iCommServer.Close(); - } - ReportStateChangeUp( EDunStateUninitialized ); - ReportStateChangeUp( EDunStateTryLoad ); - ReportStateChangeUp( EDunStateLoaded ); - FTRACE(FPrint(_L("CDunIrPlugin::Uninitialize() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunLocalMediaPlugin. -// CDunIrPlugin::ConstructL -// --------------------------------------------------------------------------- -// -void CDunIrPlugin::ConstructL( MDunServerCallback* aServer, - CDunTransporter* aTransporter ) - { - FTRACE(FPrint(_L("CDunIrPlugin::ConstructL()"))); - if ( !aServer || !aTransporter ) - { - FTRACE(FPrint(_L("CDunIrPlugin::ConstructL() not initialized!"))); - User::Leave( KErrGeneral ); - } - iServer = aServer; - iTransporter = aTransporter; - FTRACE(FPrint(_L("CDunIrPlugin::ConstructL() complete"))); - } - -// --------------------------------------------------------------------------- -// From class MDunLocalMediaPlugin. -// Gets called when server changes a plugin's state -// --------------------------------------------------------------------------- -// -TInt CDunIrPlugin::NotifyServerStateChange( TDunPluginState aPluginState ) - { - FTRACE(FPrint(_L("CDunIrPlugin::NotifyServerStateChange()"))); - TInt retTemp; - switch ( aPluginState ) - { - case EDunStateTryListen: - if ( PluginState() != EDunStateLoaded ) - { - FTRACE(FPrint(_L("CDunIrPlugin::NotifyServerStateChange() (not ready) complete"))); - return KErrNotReady; - } - // Change to listening mode - retTemp = ConstructListener(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunIrPlugin::NotifyServerStateChange() (ERROR) complete (%d)"), retTemp)); - return retTemp; - } - break; - case EDunStateTryUninitialize: - if ( PluginState() == EDunStateUninitialized ) - { - FTRACE(FPrint(_L("CDunIrPlugin::NotifyServerStateChange() (not ready) complete"))); - return KErrNotReady; - } - // Uninitialize - retTemp = Uninitialize(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunIrPlugin::NotifyServerStateChange() (ERROR) complete (%d)"), retTemp)); - return retTemp; - } - break; - default: - FTRACE(FPrint(_L("CDunIrPlugin::NotifyServerStateChange() (unknown state) complete"))); - return KErrNotSupported; - } - FTRACE(FPrint(_L("CDunIrPlugin::NotifyServerStateChange() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunLocalMediaPlugin. -// Gets called when server needs to know the active connection -// --------------------------------------------------------------------------- -// -TConnId CDunIrPlugin::ActiveConnection() - { - FTRACE(FPrint(_L("CDunIrPlugin::ActiveConnection()"))); - FTRACE(FPrint(_L("CDunIrPlugin::ActiveConnection() (not found) complete"))); - return NULL; - } - -// --------------------------------------------------------------------------- -// From class MDunConnMon. -// Gets called when line status changes or when any type of error is detected -// --------------------------------------------------------------------------- -// -void CDunIrPlugin::NotifyProgressChangeL( - TConnId aConnId, - TDunConnectionReason /*aConnReason*/ ) - { - FTRACE(FPrint( _L( "CDunIrPlugin::NotifyProgressChangeL()" ) )); - RComm* irConn = static_cast( aConnId ); - if ( &iIrPort != irConn ) - { - FTRACE(FPrint( _L( "CDunIrPlugin::NotifyProgressChangeL() (not found) complete")) ); - User::Leave( KErrNotFound ); - } - // Now indications are down indications from local media side - FTRACE(FPrint( _L( "CDunIrPlugin::NotifyProgressChangeL() restart plugin" ) )); - iServer->NotifyPluginRestart( KDunIrPluginUid ); - FTRACE(FPrint( _L( "CDunIrPlugin::NotifyProgressChangeL() complete")) ); - } - -// ======== GLOBAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// NewLocalPluginL implements factory construction for -// the class CDunIrPlugin. -// The function is exported at ordinal 1. -// Returns: Pointer: The new instance of CDunIrPlugin -// --------------------------------------------------------------------------- -// -EXPORT_C MDunLocalMediaPlugin* NewLocalPluginL() - { - return new (ELeave) CDunIrPlugin; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/src/usb/DunUsbConfig.cpp --- a/localconnectivityservice/dun/plugins/src/usb/DunUsbConfig.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,292 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: DUN USB configuration accessor and listener -* -*/ - - -#include "DunUsbConfig.h" -#include "DunDebug.h" - -const TUint KDunUsbSupportedConfigVersion = 1; - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunUsbConfig* CDunUsbConfig::NewL( MDunServerCallback* aServer, - MDunUsbConfig* aCallback, - TUint8 aProtocol ) - { - CDunUsbConfig* self = new (ELeave) CDunUsbConfig( aServer, - aCallback, - aProtocol ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunUsbConfig::~CDunUsbConfig() - { - FTRACE(FPrint( _L("CDunUsbConfig::~CDunUsbConfig()" ))); - ResetData(); - FTRACE(FPrint( _L("CDunUsbConfig::~CDunUsbConfig() complete" ))); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunUsbConfig::ResetData() - { - // APIs affecting this: - // IssueRequest() - Stop(); - // NewL() - iAcmProperty.Close(); - // Internal - Initialize(); - } - -// --------------------------------------------------------------------------- -// Compares initialized protocol number to configuration by index -// --------------------------------------------------------------------------- -// -TInt CDunUsbConfig::GetConfigValidityByIndex( TInt aIndex, TBool& aValidity ) - { - FTRACE(FPrint( _L("CDunUsbConfig::GetConfigValidityByIndex()" ))); - if ( iConfigState != EUsbConfigStateIdle ) - { - FTRACE(FPrint( _L("CDunUsbConfig::GetConfigValidityByIndex() (not ready) complete" ))); - return KErrNotReady; - } - if ( !iConfigExist ) - { - TInt retTemp = GetConfiguration( iConfig ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunUsbConfig::GetConfigValidityByIndex() (get failed) complete" ))); - return retTemp; - } - } - if ( aIndex < 0 || - aIndex >= iConfig.iAcmCount || - aIndex >= TPublishedAcmConfigs::KAcmMaxFunctions ) - { - FTRACE(FPrint( _L("CDunUsbConfig::GetConfigValidityByIndex() (not found) complete" ))); - return KErrNotFound; - } - if ( iConfig.iAcmConfig[aIndex].iProtocol == iProtocol ) - { - aValidity = ETrue; - } - else - { - aValidity = EFalse; - } - FTRACE(FPrint( _L("CDunUsbConfig::GetConfigValidityByIndex() complete (%d/%d)" ), aIndex, aValidity)); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Starts listening for ACM configuration changes -// --------------------------------------------------------------------------- -// -TInt CDunUsbConfig::IssueRequest() - { - FTRACE(FPrint( _L("CDunUsbConfig::IssueRequest()" ))); - if ( iConfigState != EUsbConfigStateIdle ) - { - FTRACE(FPrint( _L("CDunUsbConfig::IssueRequest() (not ready) complete" ))); - return KErrNotReady; - } - iStatus = KRequestPending; - iAcmProperty.Subscribe( iStatus ); - SetActive(); - iConfigState = EUsbConfigStateWaiting; - FTRACE(FPrint( _L("CDunUsbConfig::IssueRequest() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Stops listening for ACM configuration changes -// --------------------------------------------------------------------------- -// -TInt CDunUsbConfig::Stop() - { - FTRACE(FPrint( _L("CDunUsbConfig::Stop()" ))); - if ( iConfigState != EUsbConfigStateWaiting ) - { - FTRACE(FPrint( _L("CDunUsbConfig::Stop() (not ready) complete" ))); - return KErrNotReady; - } - iAcmProperty.Cancel(); - Cancel(); - iConfigState = EUsbConfigStateIdle; - FTRACE(FPrint( _L("CDunUsbConfig::Stop() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CDunUsbConfig::CDunUsbConfig -// --------------------------------------------------------------------------- -// -CDunUsbConfig::CDunUsbConfig( MDunServerCallback* aServer, - MDunUsbConfig* aCallback, - TUint8 aProtocol ) : - CActive( EPriorityStandard ), - iServer( aServer ), - iCallback( aCallback ), - iProtocol( aProtocol ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunUsbConfig::ConstructL -// --------------------------------------------------------------------------- -// -void CDunUsbConfig::ConstructL() - { - FTRACE(FPrint( _L("CDunUsbConfig::ConstructL()" ))); - if ( !iServer || !iCallback ) - { - User::Leave( KErrGeneral ); - } - User::LeaveIfError( iAcmProperty.Attach(KUidSystemCategory,KAcmKey) ); - CActiveScheduler::Add( this ); - FTRACE(FPrint( _L("CDunUsbConfig::ConstructL() complete" ))); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunUsbConfig::Initialize() - { - // Don't initialize iCallback here (it is set through NewL) - // Don't initialize iProtocol here (it is set through NewL) - iConfigState = EUsbConfigStateIdle; - iConfig.iAcmConfigVersion = 0; - iConfig.iAcmCount = 0; - iConfigExist = EFalse; - } - -// --------------------------------------------------------------------------- -// Gets current ACM configuration -// --------------------------------------------------------------------------- -// -TInt CDunUsbConfig::GetConfiguration( TPublishedAcmConfigs& aConfig ) - { - FTRACE(FPrint( _L("CDunUsbConfig::GetConfiguration()" ))); - TPckgBuf configBuf; - TInt retTemp = iAcmProperty.Get( configBuf ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunUsbConfig::GetConfiguration() (ERROR) complete" ))); - return retTemp; - } - aConfig = configBuf(); - // Check that version is that which we currently support - if ( aConfig.iAcmConfigVersion != KDunUsbSupportedConfigVersion ) - { - FTRACE(FPrint( _L("CDunUsbConfig::GetConfiguration() (not supported) complete" ))); - return KErrNotSupported; - } - // Check that count is within bounds - if ( aConfig.iAcmCount > TPublishedAcmConfigs::KAcmMaxFunctions ) - { - FTRACE(FPrint( _L("CDunUsbConfig::GetConfiguration() (overflow) complete" ))); - return KErrOverflow; - } - iConfigExist = ETrue; - FTRACE(FPrint( _L("CDunUsbConfig::GetConfiguration() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called when ACM configuration changes -// --------------------------------------------------------------------------- -// -void CDunUsbConfig::RunL() - { - FTRACE(FPrint( _L("CDunUsbConfig::RunL()" ))); - iConfigState = EUsbConfigStateIdle; - - TPublishedAcmConfigs newConfig; - TInt retTemp = GetConfiguration( newConfig ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunUsbConfig::RunL() (ERROR) complete (%d)" ), retTemp)); - iServer->NotifyPluginCloseRequest( KDunUsbPluginUid, ETrue ); - return; - } - // Change that is same is not possible so check that first - if ( newConfig.iAcmCount == iConfig.iAcmCount ) - { - FTRACE(FPrint( _L("CDunUsbConfig::RunL() (no change) complete" ))); - iServer->NotifyPluginCloseRequest( KDunUsbPluginUid, ETrue ); - return; - } - - // Now we have the changed configuration so find out are there added or - // removed USB ACMs - - TInt i; - if ( newConfig.iAcmCount > iConfig.iAcmCount ) // addition - { - // Addition is always done to end of ACM queue by N entry addition - // Scan through new array and report change if necessary - for ( i=iConfig.iAcmCount; iNotifyConfigAddition( i ); - } - } - } - else // removal ( newConfig.iAcmCount < iConfig.iAcmCount ) - { - // Removal is always done to end of ACM queue by N entry removal - // Scan through old array and report change if necessary - for ( i=newConfig.iAcmCount; iNotifyConfigRemoval( i ); - } - } - } - - // Update config and restart listening - iConfig = newConfig; - IssueRequest(); - - FTRACE(FPrint( _L("CDunUsbConfig::RunL() complete" ))); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called on cancel -// --------------------------------------------------------------------------- -// -void CDunUsbConfig::DoCancel() - { - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/src/usb/DunUsbListen.cpp --- a/localconnectivityservice/dun/plugins/src/usb/DunUsbListen.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,259 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: DUN USB plugin's listener -* -*/ - - -#include -#include "DunUtils.h" -#include "DunUsbListen.h" -#include "DunDebug.h" - -const TUint KDunUsbDeviceStateMask = 0x00ff; - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunUsbListen* CDunUsbListen::NewL( MDunServerCallback* aServer, - MDunListenCallback* aParent, - RUsb& aUsbServer ) - { - CDunUsbListen* self = new (ELeave) CDunUsbListen( aServer, - aParent, - aUsbServer ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunUsbListen::~CDunUsbListen() - { - FTRACE(FPrint( _L( "CDunUsbListen::~CDunUsbListen()" ) )); - ResetData(); - FTRACE(FPrint( _L( "CDunUsbListen::~CDunUsbListen() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunUsbListen::ResetData() - { - // APIs affecting this: - // IssueRequestL() - Stop(); - // Internal - Initialize(); - } - -// --------------------------------------------------------------------------- -// IssueRequest to USB server for device state change notifications -// --------------------------------------------------------------------------- -// -TInt CDunUsbListen::IssueRequestL() - { - FTRACE(FPrint( _L( "CDunUsbListen::IssueRequestL()" ))); - - if ( iUsbServer.Handle() == KNullHandle ) - { - FTRACE(FPrint( _L( "CDunUsbListen::IssueRequestL() (iUsbServer) complete" ) )); - User::Leave( KErrGeneral ); - } - - TUsbDeviceState usbDeviceState; - User::LeaveIfError( iUsbServer.GetDeviceState(usbDeviceState) ); - FTRACE(FPrint( _L( "CDunUsbListen::IssueRequestL() Usb device state = %X" ), usbDeviceState)); - if ( iDeviceState == EUsbDeviceStateUndefined ) - { - iDeviceState = usbDeviceState; - } - - // USB device state now set; if configured already, notify parent - // If not yet configured, start listening - - if ( usbDeviceState == EUsbDeviceStateConfigured ) - { - FTRACE(FPrint( _L( "CDunUsbListen::IssueRequestL() (already exists) complete" ) )); - return KErrAlreadyExists; - } - - Activate(); - - FTRACE(FPrint( _L( "CDunUsbListen::IssueRequestL() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Stops listening -// --------------------------------------------------------------------------- -// -TInt CDunUsbListen::Stop() - { - FTRACE(FPrint( _L( "CDunUsbListen::Stop()" ) )); - if ( iListenState != EUsbListenStateListening ) - { - FTRACE(FPrint( _L( "CDunUsbListen::Stop() (not ready) complete" ) )); - return KErrNotReady; - } - iUsbServer.DeviceStateNotificationCancel(); - Cancel(); - iListenState = EUsbListenStateIdle; - iDeviceState = EUsbDeviceStateUndefined; - iDeviceStatePrev = EUsbDeviceStateUndefined; - FTRACE(FPrint( _L( "CDunUsbListen::Stop() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CDunUsbListen::CDunUsbListen -// --------------------------------------------------------------------------- -// -CDunUsbListen::CDunUsbListen( MDunServerCallback* aServer, - MDunListenCallback* aParent, - RUsb& aUsbServer ) : - CActive( EPriorityStandard ), - iServer( aServer ), - iParent( aParent ), - iUsbServer( aUsbServer ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunUsbListen::ConstructL -// --------------------------------------------------------------------------- -// -void CDunUsbListen::ConstructL() - { - FTRACE(FPrint( _L( "CDunUsbListen::ConstructL()" ) )); - if ( !iServer || !iParent ) - { - User::Leave( KErrGeneral ); - } - CActiveScheduler::Add( this ); - FTRACE(FPrint( _L( "CDunUsbListen::ConstructL() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunUsbListen::Initialize() - { - // Don't initialize iServer here (it is set through NewL) - // Don't initialize iParent here (it is set through NewL) - // Don't initialize iUsbServer here (it is set through NewL) - iDeviceState = EUsbDeviceStateUndefined; - iDeviceStatePrev = EUsbDeviceStateUndefined; - } - -// --------------------------------------------------------------------------- -// Activates listening request -// --------------------------------------------------------------------------- -// -TInt CDunUsbListen::Activate() - { - FTRACE(FPrint( _L( "CDunUsbListen::Activate()" ) )); - - if ( iListenState != EUsbListenStateIdle ) - { - FTRACE(FPrint( _L( "CDunUsbListen::Activate() (not ready) complete" ) )); - return KErrNotReady; - } - iDeviceStatePrev = iDeviceState; - iStatus = KRequestPending; - iUsbServer.DeviceStateNotification( KDunUsbDeviceStateMask, - iDeviceState, - iStatus ); - SetActive(); - iListenState = EUsbListenStateListening; - FTRACE(FPrint( _L( "CDunUsbListen::Activate() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Called when read or write operation is ready. -// --------------------------------------------------------------------------- -// -void CDunUsbListen::RunL() - { - FTRACE(FPrint( _L( "CDunUsbListen::RunL() iStatus=%d"), iStatus.Int() )); - iListenState = EUsbListenStateIdle; - - if ( iStatus.Int() != KErrNone ) - { - FTRACE(FPrint( _L( "CDunUsbListen::RunL() (ERROR) complete" ))); - iServer->NotifyPluginCloseRequest( KDunUsbPluginUid, ETrue ); - return; - } - - FTRACE(FPrint( _L( "CDunUsbListen::RunL() Usb device state =%X, Issue request" ), iDeviceState)); - - TDunPluginState parentState = iServer->GetPluginStateByUid( KDunUsbPluginUid ); - - TInt retTemp = KErrNone; - if ( iDeviceState == EUsbDeviceStateConfigured && - iDeviceStatePrev != EUsbDeviceStateConfigured && - parentState != EDunStateChanneled ) - { - // USB has been connected&configured and we are in PC Suite mode - FTRACE(FPrint( _L( "CDunUsbListen::RunL() DeviceState is configured -> open connection" ) )); - TBool noFreeChans = EFalse; - // noFreeChans will be omitted (not needed to set to RComm) - retTemp = iParent->NotifyChannelAllocate( noFreeChans ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L( "CDunUsbListen::RunL() channel allocation failed!" ) )); - iServer->NotifyPluginCloseRequest( KDunUsbPluginUid, ETrue ); - return; - } - } - else if ( iDeviceState < EUsbDeviceStateConfigured && - iDeviceStatePrev >= EUsbDeviceStateConfigured && - parentState == EDunStateChanneled ) - { - FTRACE(FPrint( _L( "CDunUsbListen::RunL() DeviceState is not configured -> close connection" ) )); - retTemp = iParent->NotifyChannelFree(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L( "CDunUsbListen::RunL() channel free failed!" ) )); - iServer->NotifyPluginCloseRequest( KDunUsbPluginUid, ETrue ); - return; - } - } - - // Start listening again - Activate(); - - FTRACE(FPrint( _L( "CDunUsbListen::RunL() complete" ))); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Cancel current activity. -// --------------------------------------------------------------------------- -// -void CDunUsbListen::DoCancel() - { - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/plugins/src/usb/DunUsbPlugin.cpp --- a/localconnectivityservice/dun/plugins/src/usb/DunUsbPlugin.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,781 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: DUN USB plugin -* -*/ - - -#include -#include -#include "DunPlugin.h" -#include "DunUtils.h" -#include "DunUsbPlugin.h" -#include "DunDebug.h" - -_LIT( KUsbCsyName, "ECACM" ); -_LIT( KUsbPortName, "ACM" ); -_LIT( KUsbPortPort, "::" ); -_LIT( KUsbLddName, "EUSBC" ); -_LIT( KUsbChannelName, "DUNUSB::" ); - -const TInt KCharactersInTInt = 10; // For "2147483648" -const TUint8 KDefaultAcmProtocolNum = 0x01; // Hayes compatible modem - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CDunUsbPlugin::CDunUsbPlugin -// --------------------------------------------------------------------------- -// -CDunUsbPlugin::CDunUsbPlugin() : - iServer( NULL ), - iUsbListen( NULL ), - iUsbConfig( NULL ), - iTransporter( NULL ) - { - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunUsbPlugin::~CDunUsbPlugin() - { - FTRACE(FPrint( _L( "CDunUsbPlugin::~CDunUsbPlugin()" ) )); - Uninitialize(); - FTRACE(FPrint( _L( "CDunUsbPlugin::~CDunUsbPlugin() complete" ) )); - } - -// --------------------------------------------------------------------------- -// State of this plugin -// --------------------------------------------------------------------------- -// -TDunPluginState CDunUsbPlugin::PluginState() - { - return iServer->GetPluginStateByUid( KDunUsbPluginUid ); - } - -// --------------------------------------------------------------------------- -// Constructs a listener object for this plugin -// --------------------------------------------------------------------------- -// -void CDunUsbPlugin::ConstructListenerL() - { - FTRACE(FPrint(_L("CDunUsbPlugin::ConstructListenerL()"))); - if ( PluginState() != EDunStateLoaded ) - { - FTRACE(FPrint(_L("CDunUsbPlugin::ConstructListenerL() (not ready) complete"))); - User::Leave( KErrNotReady ); - } - ReportStateChangeUp( EDunStateTryListen ); - if ( iUsbListen ) - { - FTRACE(FPrint(_L("CDunUsbPlugin::ConstructListenerL() (already exists) complete"))); - User::Leave( KErrAlreadyExists ); - } - InitUsbL(); - CDunUsbListen* listen = CDunUsbListen::NewL( iServer, this, iUsbServer ); - CleanupStack::PushL( listen ); - TInt retTemp = listen->IssueRequestL(); - CleanupStack::Pop( listen ); - iUsbListen = listen; - // Here return value of KErrAlreadyExists means the device is already - // configured - // In this case we have to switch directly to channeled mode - ReportStateChangeUp( EDunStateListening ); - if ( retTemp == KErrAlreadyExists ) - { - TBool noFreeChans = EFalse; - // noFreeChans will be omitted (not needed to set to RComm) - NotifyChannelAllocate( noFreeChans ); // Create channel and change state - } - FTRACE(FPrint(_L("CDunUsbPlugin::ConstructListenerL() complete"))); - } - -// --------------------------------------------------------------------------- -// Initializes USB by loading LDD -// --------------------------------------------------------------------------- -// -void CDunUsbPlugin::InitUsbL() - { - FTRACE(FPrint( _L( "CDunUsbPlugin::InitUsbL()") )); - // Load Logical device driver for USB - FTRACE(FPrint( _L( "CDunUsbPlugin::InitUsbL() LoadLogicalDevice") )); - TInt retTemp = User::LoadLogicalDevice( KUsbLddName ); - if ( retTemp!=KErrAlreadyExists && retTemp!=KErrNone ) - { - User::Leave( retTemp ); - } - // Connect to the USB Manager server - FTRACE(FPrint( _L( "CDunUsbPlugin::InitUsbL() Connect()") )); - User::LeaveIfError( iUsbServer.Connect() ); - // Create USB configuration accessor and listener - iUsbConfig = CDunUsbConfig::NewL( iServer, this, KDefaultAcmProtocolNum ); - FTRACE(FPrint( _L( "CDunUsbPlugin::InitUsbL() complete") )); - } - -// --------------------------------------------------------------------------- -// Initializes all usable USB ports for DUN -// --------------------------------------------------------------------------- -// -TInt CDunUsbPlugin::InitPorts() - { - FTRACE(FPrint( _L( "CDunUsbPlugin::InitPorts() (num=%d)" ), iUsbPorts.Count())); - TInt i; - TInt retTemp = CreateAllPorts(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::InitPorts() (ERROR) complete" ))); - return retTemp; - } - TInt count = iUsbPorts.Count(); - for ( i=0; iStop(); - // Find out what ports can be supported and append them to array - TBool validConfig; - TUsbPortEntity entity; - for ( TInt i=0;; i++ ) - { - retTemp = iUsbConfig->GetConfigValidityByIndex( i, validConfig ); - if ( retTemp != KErrNone ) - { - break; - } - if ( !validConfig ) - { - continue; - } - // Valid config found, append it to array - entity.iPortNum = i; - retTemp = iUsbPorts.Append( entity ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::CreateAllPorts() (append failed!) complete" ) )); - return retTemp; - } - } - FTRACE(FPrint( _L( "CDunUsbPlugin::CreateAllPorts() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Initializes one USB port for DUN -// --------------------------------------------------------------------------- -// -TInt CDunUsbPlugin::InitOnePort( TUsbPortEntity* aEntity ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::InitOnePort()" ))); - if ( !aEntity ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::InitOnePort() (not initialized!) complete" ))); - return KErrGeneral; - } - TInt retTemp; - TName portName; - portName.Copy( KUsbPortName ); - portName.Append( KUsbPortPort ); - portName.AppendNum( aEntity->iPortNum ); - retTemp = aEntity->iUsbPort.Open( iCommServer, - portName, - ECommExclusive, - ECommRoleDCE ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::InitOnePort() Open failed (%d)" ), retTemp)); - return retTemp; - } - TRAPD( retTrap, SetChannelL(aEntity) ); - if ( retTrap != KErrNone ) - { - iTransporter->FreeChannel( &aEntity->iUsbPort ); - FTRACE(FPrint( _L( "CDunUsbPlugin::InitOnePort() (trapped!) complete" ))); - return retTrap; - } - FTRACE(FPrint( _L( "CDunUsbPlugin::InitOnePort() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Sets channel for one USB port -// --------------------------------------------------------------------------- -// -void CDunUsbPlugin::SetChannelL( TUsbPortEntity* aEntity ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::SetChannelL()" ))); - if ( !aEntity ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::SetChannelL() (not initialized!) complete" ))); - User::Leave( KErrGeneral ); - } - HBufC8* channelName = HBufC8::NewMaxLC( KUsbChannelName().Length() + - KCharactersInTInt ); - TPtr8 channelNamePtr = channelName->Des(); - channelNamePtr.Copy( KUsbChannelName ); - channelNamePtr.AppendNum( aEntity->iPortNum ); - iTransporter->AllocateChannelL( &aEntity->iUsbPort, - KDunUsbPluginUid, - channelNamePtr, - ETrue, - this ); - AddSkippedErrorL( KErrUsbInterfaceChange, &aEntity->iUsbPort ); - iTransporter->AddConnMonCallbackL( &aEntity->iUsbPort, - this, - EDunReaderUpstream, - EFalse ); - iTransporter->AddConnMonCallbackL( &aEntity->iUsbPort, - this, - EDunWriterUpstream, - EFalse ); - iTransporter->AddConnMonCallbackL( &aEntity->iUsbPort, - this, - EDunReaderDownstream, - EFalse ); - iTransporter->AddConnMonCallbackL( &aEntity->iUsbPort, - this, - EDunWriterDownstream, - EFalse ); - iTransporter->IssueTransferRequestsL( &aEntity->iUsbPort ); - CleanupStack::PopAndDestroy( channelName ); - FTRACE(FPrint( _L( "CDunUsbPlugin::SetChannelL() complete" ))); - } - -// --------------------------------------------------------------------------- -// Adds skipped error code to Transporter -// The skipped error is added to local media's read and write operations -// --------------------------------------------------------------------------- -// -void CDunUsbPlugin::AddSkippedErrorL( TInt aError, RComm* aComm ) - { - iTransporter->AddSkippedErrorL( aError, aComm, EDunReaderUpstream ); - iTransporter->AddSkippedErrorL( aError, aComm, EDunWriterDownstream ); - } - -// --------------------------------------------------------------------------- -// Sets new state -// New state must be one more than the old state -// --------------------------------------------------------------------------- -// -TInt CDunUsbPlugin::ReportStateChangeUp( TDunPluginState aPluginState ) - { - FTRACE(FPrint(_L("CDunUsbPlugin::ReportStateChangeUp()"))); - TInt retTemp = iServer->NotifyPluginStateChangeUp( aPluginState, - KDunUsbPluginUid ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunUsbPlugin::ReportStateChangeUp() (ERROR) complete"))); - return retTemp; - } - FTRACE(FPrint(_L("CDunUsbPlugin::ReportStateChangeUp() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Sets new state -// New state must be one less than the old state -// --------------------------------------------------------------------------- -// -TInt CDunUsbPlugin::ReportStateChangeDown( TDunPluginState aPluginState ) - { - FTRACE(FPrint(_L("CDunUsbPlugin::ReportStateChangeDown()"))); - TInt retTemp = iServer->NotifyPluginStateChangeDown( aPluginState, - KDunUsbPluginUid ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunUsbPlugin::ReportStateChangeDown() (ERROR) complete"))); - return retTemp; - } - FTRACE(FPrint(_L("CDunUsbPlugin::ReportStateChangeDown() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Frees existing channels -// --------------------------------------------------------------------------- -// -TInt CDunUsbPlugin::FreeChannels() - { - FTRACE(FPrint(_L("CDunUsbPlugin::FreeChannels()"))); - if ( PluginState() != EDunStateTryUninitialize ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::FreeChannels() (not ready) complete" ) )); - return KErrNotReady; - } - TInt i; - TInt count = iUsbPorts.Count(); - for ( i=0; iFreeChannel( &iUsbPorts[i].iUsbPort ); - iUsbPorts[i].iUsbPort.SetSignals( 0, KSignalDCEOutputs ); - iUsbPorts[i].iUsbPort.Close(); - } - } - iUsbPorts.Close(); - if ( iCommServer.Handle() != KNullHandle ) - { - iCommServer.UnloadCommModule( KUsbCsyName ); - iCommServer.Close(); - } - FTRACE(FPrint(_L("CDunUsbPlugin::FreeChannels() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Uninitializes this plugin -// --------------------------------------------------------------------------- -// -TInt CDunUsbPlugin::Uninitialize() - { - FTRACE(FPrint( _L( "CDunUsbPlugin::Uninitialize()" ) )); - ReportStateChangeDown( EDunStateTryUninitialize ); - // Free channel(s), ignore errors - FreeChannels(); - delete iUsbListen; // delete before iUsbServer close - iUsbListen = NULL; - delete iUsbConfig; - iUsbConfig = NULL; - if ( iUsbServer.Handle() != KNullHandle ) - { - iUsbServer.Close(); - } - User::FreeLogicalDevice( KUsbLddName ); - ReportStateChangeUp( EDunStateUninitialized ); - ReportStateChangeUp( EDunStateTryLoad ); - ReportStateChangeUp( EDunStateLoaded ); - FTRACE(FPrint( _L( "CDunUsbPlugin::Uninitialize() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Gets port's index and entity by connection ID -// --------------------------------------------------------------------------- -// -TInt CDunUsbPlugin::GetEntityByConnId( TConnId aConnId, - TUsbPortEntity*& aEntity ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::GetEntityByConnId()")) ); - TInt i; - TInt count = iUsbPorts.Count(); - for ( i=0; iIssueRequest(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunUsbPlugin::NotifyChannelAllocate() (ERROR) complete"))); - return retTemp; - } - iShutdown = EFalse; - ReportStateChangeUp( EDunStateChanneled ); - FTRACE(FPrint(_L("CDunUsbPlugin::NotifyChannelAllocate() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunListenCallback. -// Gets called when an existing channel must be freed -// --------------------------------------------------------------------------- -// -TInt CDunUsbPlugin::NotifyChannelFree() - { - FTRACE(FPrint(_L("CDunUsbPlugin::NotifyChannelFree()"))); - if ( PluginState() != EDunStateChanneled ) - { - FTRACE(FPrint(_L("CDunUsbPlugin::NotifyChannelFree() (not ready) complete"))); - return KErrNotReady; - } - // Cable removed or PC sleep, hibernate or reset. - // Just remove channels. - ReportStateChangeDown( EDunStateTryUninitialize ); - TInt retTemp = FreeChannels(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunUsbPlugin::NotifyChannelFree() (ERROR) complete"))); - return retTemp; - } - ReportStateChangeUp( EDunStateUninitialized ); - ReportStateChangeUp( EDunStateTryLoad ); - ReportStateChangeUp( EDunStateLoaded ); - ReportStateChangeUp( EDunStateTryListen ); - ReportStateChangeUp( EDunStateListening ); - FTRACE(FPrint(_L("CDunUsbPlugin::NotifyChannelFree() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunConnMon. -// Gets called when line status changes or when any type of error is detected -// --------------------------------------------------------------------------- -// -void CDunUsbPlugin::NotifyProgressChangeL( - TConnId aConnId, - TDunConnectionReason aConnReason ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::NotifyProgressChangeL()")) ); - // Find matching failed ID - TUsbPortEntity* foundEntity = NULL; - TInt foundIndex = GetEntityByConnId( aConnId, foundEntity ); - if ( !foundEntity ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::NotifyProgressChangeL() (not found) complete")) ); - User::Leave( KErrNotFound ); - } - if ( aConnReason.iReasonType == EDunReasonTypeRW || - aConnReason.iReasonType == EDunReasonTypeRunL ) - { - // The following check will make it possible for CDunUsbListen to react - // to cable removal (iUsbPort.SubSessionHandle() ) - { - iTransporter->FreeChannel( &foundEntity->iUsbPort ); - foundEntity->iUsbPort.SetSignals( 0, KSignalDCEOutputs ); - foundEntity->iUsbPort.Close(); - } - TInt retTemp = InitOnePort( foundEntity ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::NotifyProgressChangeL() (ERROR) complete")) ); - User::Leave( KErrGeneral ); - } - // Now this plugin was basically "restarted", but only for one - // channel. Because transporter has channels with waiters, notify - // server to reopen queued plugin(s) - iServer->NotifyPluginReopenRequest(); - FTRACE(FPrint( _L( "CDunUsbPlugin::NotifyProgressChangeL() complete")) ); - } - -// --------------------------------------------------------------------------- -// From class MDunBufferCorrection. -// Gets called when request to change local media's buffer size -// --------------------------------------------------------------------------- -// -TInt CDunUsbPlugin::NotifyBufferCorrection( TInt aLength ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::NotifyBufferCorrection()")) ); - /* - * This method modifies the default buffer length to match the maximum value - * used by "CanHandleZLP=0" configuration option. This length is nearest length - * divisible by 64 - 1. With slow USB compared to high speed HSDPA some products - * can start to collect data to Dataport which results in full packet writes to - * USB. However, the default full packet must not be divisible by 64, which results - * in the ACM to send the full packet to LDD plus one extra packet with one byte - * (disabling interrupts for a long time with current non-DMA USB driver). - */ - TInt newLength = aLength; - if ( newLength % 64 == 0 ) - { - newLength = ((aLength >> 6) << 6) - 1; - } - FTRACE(FPrint( _L( "CDunUsbPlugin::NotifyBufferCorrection() complete")) ); - return newLength; - } - -// --------------------------------------------------------------------------- -// From class MDunUsbConfig. -// Gets called when one or more ACM configurations are added -// --------------------------------------------------------------------------- -// -TInt CDunUsbPlugin::NotifyConfigAddition( TInt aIndex ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::NotifyConfigAddition()")) ); - // Configuration added so aIndex is the port number to be added to array. - // This port number must not already exist in the array. - TUsbPortEntity* foundEntity = NULL; - TInt foundIndex = GetEntityByPortNumber( aIndex, foundEntity ); - if ( foundEntity ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::NotifyConfigAddition() (already exists) complete")) ); - return KErrAlreadyExists; - } - // Now either find port with KErrNotFound set as port number or if that is - // not found then try to append to array - foundIndex = GetFirstFreeEntity( foundEntity ); - if ( !foundEntity ) // free not found so add new - { - // Now append the new port to array - TUsbPortEntity newEntity; - newEntity.iPortNum = aIndex; - TInt retTemp = iUsbPorts.Append( newEntity ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::NotifyConfigAddition() (append failed!) complete")) ); - return KErrGeneral; - } - // entity not valid here so set now - foundEntity = &iUsbPorts[iUsbPorts.Count()-1]; - } - else // free found so change array - { - foundEntity->iPortNum = aIndex; - } - // Open port and create channel for it - TInt retTemp = InitOnePort( foundEntity ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::NotifyConfigAddition() (ERROR) complete" ))); - return KErrGeneral; - } - FTRACE(FPrint( _L( "CDunUsbPlugin::NotifyConfigAddition() complete")) ); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunUsbConfig. -// Gets called when one or more ACM configurations are removed -// --------------------------------------------------------------------------- -// -TInt CDunUsbPlugin::NotifyConfigRemoval( TInt aIndex ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::NotifyConfigRemoval()")) ); - // Configuration removed so aIndex is the port number to be added to array. - // This port number must already exist in the array. - TUsbPortEntity* foundEntity = NULL; - TInt foundIndex = GetEntityByPortNumber( aIndex, foundEntity ); - if ( !foundEntity ) - { - FTRACE(FPrint( _L( "CDunUsbPlugin::NotifyConfigRemoval() (not found) complete")) ); - return KErrNotFound; - } - // Now free channel and mark as unused - iTransporter->FreeChannel( &foundEntity->iUsbPort ); - foundEntity->iUsbPort.SetSignals( 0, KSignalDCEOutputs ); - foundEntity->iUsbPort.Close(); - iUsbPorts[foundIndex].iPortNum = KErrNotFound; - FTRACE(FPrint( _L( "CDunUsbPlugin::NotifyConfigRemoval() complete")) ); - return KErrNone; - } - -// ======== GLOBAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// NewLocalPluginL implements factory construction for -// the class CDunUsbPlugin. -// The function is exported at ordinal 1. -// Returns: Pointer: The new instance of CDunUsbPlugin -// --------------------------------------------------------------------------- -// -EXPORT_C MDunLocalMediaPlugin* NewLocalPluginL() - { - return new (ELeave) CDunUsbPlugin; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/rom/dunatext.iby --- a/localconnectivityservice/dun/rom/dunatext.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2008 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: Image description file for project DUN ATEXT -* -*/ - - -#ifndef __DUNATEXT_IBY__ -#define __DUNATEXT_IBY__ - -#ifdef __DIALUP_NETWORKING -file=ABI_DIR\BUILD_DIR\dunatext.dll SHARED_LIB_DIR\dunatext.dll -#endif - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/rom/dunbt.iby --- a/localconnectivityservice/dun/rom/dunbt.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Image description file for project DUN BT plugin -* -*/ - - -#ifndef __DUNBT_IBY__ -#define __DUNBT_IBY__ - -#ifdef __DIALUP_NETWORKING -#ifdef __BT -file=ABI_DIR\BUILD_DIR\dunbt.dll SHARED_LIB_DIR\dunbt.dll -#endif -#endif - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/rom/dunclient.iby --- a/localconnectivityservice/dun/rom/dunclient.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Image description file for project DUN -* -*/ - - -#ifndef __DUNCLIENT_IBY__ -#define __DUNCLIENT_IBY__ - -#ifdef __DIALUP_NETWORKING -ECOM_PLUGIN(dunclient.dll,dunclient.rsc) -#endif - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/rom/dunir.iby --- a/localconnectivityservice/dun/rom/dunir.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Image description file for project DUN IR plugin -* -*/ - - -#ifndef __DUNIR_IBY__ -#define __DUNIR_IBY__ - -#ifdef __DIALUP_NETWORKING -#ifdef __IRDA -file=ABI_DIR\BUILD_DIR\dunir.dll SHARED_LIB_DIR\dunir.dll -#endif -#endif - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/rom/dunresources.iby --- a/localconnectivityservice/dun/rom/dunresources.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Image description file for project DUN utilities -* -*/ - - -#ifndef __DUNRESOURCES_IBY__ -#define __DUNRESOURCES_IBY__ - -#ifdef __DIALUP_NETWORKING -data=DATAZ_\RESOURCE_FILES_DIR\dunutils.rsc RESOURCE_FILES_DIR\dunutils.rsc -#endif - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/rom/dunserver.iby --- a/localconnectivityservice/dun/rom/dunserver.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Image description file for project DUN -* -*/ - - -#ifndef __DUNSERVER_IBY__ -#define __DUNSERVER_IBY__ - -#ifdef __DIALUP_NETWORKING -file=ABI_DIR\BUILD_DIR\dunserver.exe PROGRAMS_DIR\dunserver.exe -#endif - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/rom/dunusb.iby --- a/localconnectivityservice/dun/rom/dunusb.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Image description file for project DUN USB plugin -* -*/ - - -#ifndef __DUNUSB_IBY__ -#define __DUNUSB_IBY__ - -#ifdef __DIALUP_NETWORKING -#ifdef __USB -file=ABI_DIR\BUILD_DIR\dunusb.dll SHARED_LIB_DIR\dunusb.dll -#endif -#endif - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/rom/dunutils.iby --- a/localconnectivityservice/dun/rom/dunutils.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Image description file for project DUN utilities -* -*/ - - -#ifndef __DUNUTILS_IBY__ -#define __DUNUTILS_IBY__ - -#ifdef __DIALUP_NETWORKING -file=ABI_DIR\BUILD_DIR\dunutils.dll SHARED_LIB_DIR\dunutils.dll -#endif - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/server/group/bld.inf --- a/localconnectivityservice/dun/server/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +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: -* This file provides the information required for building the -* whole of a DUN server -* -*/ - -#include - -PRJ_PLATFORMS - -PRJ_EXPORTS -../../rom/dunserver.iby CORE_MW_LAYER_IBY_EXPORT_PATH(dunserver.iby) - -PRJ_MMPFILES -dunserver.mmp - -PRJ_TESTMMPFILES diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/server/group/dunserver.mmp --- a/localconnectivityservice/dun/server/group/dunserver.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Project definition file for project DUN server -* -*/ - - -#include - -TARGET dunserver.exe -TARGETTYPE EXE -UID 0x1000008d 0x0100387D - -CAPABILITY CAP_SERVER NetworkControl CommDD LocalServices WriteDeviceData -VENDORID VID_DEFAULT - -SOURCEPATH ../src -SOURCE DunSession.cpp -SOURCE DunServer.cpp -SOURCE DunServerUtils.cpp -SOURCE DunCloseWait.cpp - -USERINCLUDE ../inc ../../utils/inc - -MW_LAYER_SYSTEMINCLUDE - -// Note: -// The only other SYSTEMINCLUDE should you shall add are Symbian specific ones. -// If there is a S60 header in the subdirectory then that should be -// added into the include statements (like #include ) -//SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE ../../../inc ../../../../inc - -LIBRARY euser.lib -LIBRARY dunutils.lib -LIBRARY btfeatures.lib -DEBUGLIBRARY flogger.lib diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/server/inc/DunCloseWait.h --- a/localconnectivityservice/dun/server/inc/DunCloseWait.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Common waiter for closing self-destruct plugins -* -*/ - -#ifndef C_CDUNCLOSEWAIT_H -#define C_CDUNCLOSEWAIT_H - -#include - -class MDunLocalMediaPlugin; - -/** - * Notification interface class to report requst for closing a plugin - * - * @since S60 v5.0 - */ -NONSHARABLE_CLASS( MDunCloseWait ) - { - -public: - - /** - * Gets called when closing of plugins should be done - * - * @since S60 5.0 - * @param aPluginsToClose Plugins to be closed - * @return Symbian error code on error, KErrNone otherwise - */ - virtual void NotifyPluginCloseAfterWait( - RPointerArray& aPluginsToClose ) = 0; - - }; - -/** - * Common waiter for closing self-destruct plugins - * - * @since S60 v5.0 - */ -NONSHARABLE_CLASS( CDunCloseWait ) : public CActive - { - -public: - - /** - * Two-phased constructor. - * @param aCallback Callback to call when notification via MDunCloseWait - * to be made - * @return Instance of self - */ - static CDunCloseWait* NewL( MDunCloseWait* aCallback ); - - /** - * Destructor. - */ - virtual ~CDunCloseWait(); - - /** - * Resets data to initial values - * - * @since S60 5.0 - * @return None - */ - void ResetData(); - - /** - * Adds a new plugin to be closed to the list - * - * @since S60 5.0 - * @param aPluginToClose The plugin to be closed - * @return Symbian error code on error, KErrNone otherwise - */ - TInt AddPluginToClose( MDunLocalMediaPlugin* aPluginToClose ); - - /** - * Issues request to start closing the objects in the close list - * - * @since S60 5.0 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt IssueRequest(); - - /** - * Stops closing the objects in the close list - * - * @since S60 5.0 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Stop(); - -private: - - CDunCloseWait( MDunCloseWait* aCallback ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since S60 5.0 - * @return None - */ - void Initialize(); - -// from base class CActive - - /** - * From CActive. - * Gets called when closing of the plugins should be done - * - * @since S60 5.0 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Gets called on cancel - * - * @since S60 5.0 - * @return None - */ - void DoCancel(); - -private: // data - - /** - * Callback to call when notification via MDunCloseWait to be made - */ - MDunCloseWait* iCallback; - - /** - * List of plugins to be closed - * Not own. - */ - RPointerArray iCloseList; - -}; - -#endif // C_CDUNCLOSEWAIT_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/server/inc/DunServer.h --- a/localconnectivityservice/dun/server/inc/DunServer.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,361 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: DUN server -* -*/ - - -#ifndef C_CDUNSERVER_H -#define C_CDUNSERVER_H - -#include -#include "DunPlugin.h" -#include "DunCloseWait.h" -#include "dunserverdef.h" -#include "dundomainpskeys.h" - -_LIT( KDunPluginBt, "dunbt.dll" ); -_LIT( KDunPluginIrda, "dunir.dll" ); -_LIT( KDunPluginUsb, "dunusb.dll" ); - -class MDunSession; -class MDunServerUtility; - -/** - * Class used to store data needed for each separate plugin - * One TDunConnectionData data contains objects needed for one plugin - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TDunConnectionData ) - { - -public: - - /** - * Pointer to plugin DLL - * Not own. - */ - MDunLocalMediaPlugin* iLocalModulePtr; - - /** - * Current state of plugin - */ - TDunPluginState iPluginState; - - /** - * DLL library server needed to open/close existing plugin - */ - RLibrary iModuleLibrary; - - /** - * Loaded plugin's UID - */ - TUid iLocalModuleUid; - - }; - -/** - * Main DUN server's class - * - * @since S60 v3.2 - */ -class CDunServer : public CPolicyServer, - public MDunServerCallback, - public MDunCloseWait - { - - friend class CDunServerUtils; - -public: - - /** - * Two-phased constructor. - * @return Instance of self - */ - static CDunServer* NewL(); - - /** - * Destructor. - */ - virtual ~CDunServer(); - - /** - * Notification to manage local media On request - * This comes from client - * - * @since S60 3.2 - * @param aPluginUid UID of the local media plugin to open - * @return None - */ - TInt NotifyMediaOpenRequest( TUid aPluginUid ); - - /** - * Notification to manage local media Off request - * This comes from client - * - * @since S60 3.2 - * @param aPluginUid UID of the local media plugin to close - * @return None - */ - TInt NotifyMediaCloseRequest( TUid aPluginUid ); - - /** - * Current active connection - * (For testing purposes only) - * - * @since S60 5.0 - * @return Active connection, NULL otherwise - */ - TConnId ActiveConnection(); - - /** - * Increases reference count made by sessions - * This comes from client - * - * @since S60 3.2 - * @return None - */ - void IncRefCount(); - - /** - * Decreases reference count made by sessions - * This comes from client - * - * @since S60 3.2 - * @return None - */ - void DecRefCount(); - -// from base class CServer2 (CPolicyServer -> CServer2) - - /** - * From CServer2 (CPolicyServer derived from CServer2). - * Creates a server-side client session object. - * - * @since S60 3.2 - * @param aVersion Version information supplied by the client - * @return A pointer to the newly created server-side client session - */ - CSession2* NewSessionL( const TVersion& aVersion, const RMessage2& ) const; - -private: - - CDunServer( TInt aPriority ); - - void ConstructL(); - - /** - * Opens local media plugin by UID - * - * @since S60 3.2 - * @param aPluginUid UID of local media plugin to open - * @param aDequeue ETrue if restarting of queued plugins and plugin - * dequeue wanted after successful plugin close - * (normal case, see also TryClosePlugin()), - * EFalse if no restarting of queued plugins and plugin - * dequeue wanted after successful plugin close - * (in this case caller is reopener itself, see also - * ReopenQeueuedPlugins()) - * @return Symbian error code on error, KErrNone otherwise - */ - TInt OpenMediaByUid( TUid aPluginUid, TBool aDequeue ); - - /** - * Closes local media plugin by UID - * - * @since S60 3.2 - * @param aPluginUid UID of local media plugin to close - * @param aClearQueued ETrue if clear from plugin queue wanted, - * EFalse otherwise - * @param aClientClose ETrue if close originator is client - * @param aSelfDelete ETrue if plugin closes itself, EFalse otherwise - * @return Symbian error code on error, KErrNone otherwise - */ - TInt CloseMediaByUid( TUid aPluginUid, - TBool aClearQueued, - TBool aClientClose, - TBool aSelfDelete ); - - /** - * Reopens plugins from plugin queue - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt ReopenQueuedPlugins(); - -// from base class MDunServerCallback - - /** - * From MDunServerCallback. - * Searches for plugin in connection data and returns its state - * - * @since S60 3.2 - * @param aPluginUid UID of local media plugin to search for - * @return State of plugin - */ - TDunPluginState GetPluginStateByUid( TUid aPluginUid ); - - /** - * From MDunServerCallback. - * Notification about request to change plugin state up by one level - * - * @since S60 3.2 - * @param aPluginState New state to set for a local media plugin - * @param aPluginUid UID of the local media plugin whose state to change - * @return KErrNotFound if plugin not found by UID, - KErrNotSupported if unknown state, - KErrNone otherwise - */ - TInt NotifyPluginStateChangeUp( TDunPluginState aPluginState, - TUid aPluginUid ); - - /** - * From MDunServerCallback. - * Notification about request to change plugin state down by one level - * - * @since S60 3.2 - * @param aPluginState New state to set for a local media plugin - * @param aPluginUid UID of the local media plugin whose state to change - * @return KErrNotFound if plugin not found by UID, - KErrNotSupported if unknown state, - KErrNone otherwise - */ - TInt NotifyPluginStateChangeDown( TDunPluginState aPluginState, - TUid aPluginUid ); - - /** - * From MDunServerCallback. - * Notification about plugin restart request - * - * @since S60 3.2 - * @param aPluginUid UID of the local media plugin to restart - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyPluginRestart( TUid aPluginUid ); - - /** - * From MDunServerCallback. - * Notification about plugin reopen request - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyPluginReopenRequest(); - -// from base class MDunPluginManager (MDunServerCallback->MDunPluginManager). - - /** - * From MDunPluginManager (MDunServerCallback->MDunPluginManager). - * Notification about request to enqueue a plugin to plugin queue - * - * @since S60 3.2 - * @param aPluginUid UID of the local media plugin to enqueue - * @return KErrNotFound = plugin not found by UID, - KErrAlreadyExists = plugin already in queue, - KErrNone otherwise - */ - TInt NotifyPluginEnqueueRequest( TUid aPluginUid ); - - /** - * From MDunPluginManager (MDunServerCallback->MDunPluginManager). - * Notification about request to dequeue a plugin from plugin queue - * Just removes a found UID from the queue - * - * @since S60 3.2 - * @param aPluginUid UID of the local media plugin to dequeue - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyPluginDequeueRequest( TUid aPluginUid ); - - /** - * From MDunPluginManager (MDunServerCallback->MDunPluginManager). - * Notification about request to close a plugin - * - * @since S60 3.2 - * @param aPluginUid UID of the local media plugin to close - * @param aSelfClose ETrue if plugin closes itself, EFalse otherwise - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyPluginCloseRequest( TUid aPluginUid, - TBool aSelfClose ); - -// from base class MDunCloseWait - - /** - * From MDunCloseWait. - * Notification about request to close a plugin after wait - * - * @since S60 5.0 - * @param aPluginsToClose Plugins to be closed - * @return Symbian error code on error, KErrNone otherwise - */ - void NotifyPluginCloseAfterWait( - RPointerArray& aPluginsToClose ); - -private: // data - - /** - * Pointer to common utility class - * Own. - */ - MDunServerUtility* iUtility; - - /** - * Transporter to use for network side communication - * Own. - */ - CDunTransporter* iTransporter; - - /** - * Waiter for closing self-destruct plugins - * Own. - */ - CDunCloseWait* iCloseWait; - - /** - * Array of TDunConnectionData needed for each loaded plugin - */ - RArray iConnData; - - /** - * Array of plugin UIDs - * Used for queuing plugins that have no resources to use - * Used for dequeuing plugins when free resources detected - */ - RArray iPluginQueue; - - /** - * Array of plugin UIDs - * Used for queuing plugins that were successfully closed outside - * this server. This is to avoid returning KErrNotFound to LOCOD - * when NotifyMediaCloseRequest() is caught - */ - RArray iClosedQueue; - - /** - * Connection status of dialup: active or inactive - * Used for updating KPSUidDialupConnStatus Pub&Sub key - */ - TDialupConnStatus iConnStatus; - - /** - * Reference count of client sides - */ - TInt iRefCount; - - }; - -#endif // C_CDUNSERVER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/server/inc/DunServerSecurityPolicy.h --- a/localconnectivityservice/dun/server/inc/DunServerSecurityPolicy.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: DUN server security policy definition -* -*/ - - -#ifndef DUNSERVER_SECURITYPOLICY_H -#define DUNSERVER_SECURITYPOLICY_H - -#include "dunserverdef.h" - -// First range for KServerRanges[] definition, do not change -const TInt KFirstServerRange = 0; - -// First range for KServerElementsIndex[] definition, do not change -const TInt KFirstElementRange = 0; - -// --------------------------------------------------------------------------- -// DunServer's policy -// --------------------------------------------------------------------------- -// - -// Definition of the ranges of IPC numbers -const TInt KServerRanges[] = - { - KFirstServerRange, // Range 1: all client APIs - EInvalidIpc // Range 2: Invalid IPC opcode - }; - -const TUint KServerRangeCount = sizeof( KServerRanges ) / sizeof( TInt ); - -// Policy to implement for each of the above ranges -const TUint8 KServerElementsIndex[KServerRangeCount] = - { - KFirstElementRange, // applies to 0th range - CPolicyServer::ENotSupported // out of range DUN's IPC - }; - -//Specific capability checks -const CPolicyServer::TPolicyElement KServerElements[] = - { - {_INIT_SECURITY_POLICY_C2(ECapabilityLocalServices, ECapabilityNetworkServices), - CPolicyServer::EFailClient - } // Policy 0 - }; - -// Policy structure for DunServer. This is passed to DunServer's constructor -const CPolicyServer::TPolicy KDunServerPolicy = - { - CPolicyServer::EAlwaysPass, // Indicates that Connect attempts should be processed without any further checks. - KServerRangeCount, // Range count - KServerRanges, // ranges array - KServerElementsIndex, // elements' index - KServerElements // array of elements - }; - -#endif // DUNSERVER_SECURITYPOLICY_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/server/inc/DunServerUtils.h --- a/localconnectivityservice/dun/server/inc/DunServerUtils.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,389 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Utility class for CDunServer -* -*/ - - -#ifndef C_CDUNSERVERUTILS_H -#define C_CDUNSERVERUTILS_H - -#include -#include "DunPlugin.h" - -class CDunServer; - -/** - * Utility accessor class for CDunServer class - * Basically a collection of miscellaneous helper methods - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunServerUtility ) - { - -public: - - /** - * From MDunServerUtility. - * Closes plugins with state marked as zombie - * - * @since S60 3.2 - * @return KErrGeneral = close on any of the plugins failed, - KErrNone otherwise - */ - virtual TInt RemoveZombiePlugins() = 0; - - /** - * From MDunServerUtility. - * Loads local media module - * - * @since S60 3.2 - * @param aPluginUid UID of the local media module to load - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt CreateNewPlugin( TUid aPluginUid ) = 0; - - /** - * From MDunServerUtility. - * Constructs local media module - * - * @since S60 3.2 - * @param aPluginUid UID of the local media module to construct - * @param aDllName Name of the DLL to the constructed local media module - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt ConstructLocalMediaModule( const TUid& aPluginUid, - const TPtrC& aDllName ) = 0; - - /** - * From MDunServerUtility. - * Clears queued UIDs - * - * @since S60 3.2 - * @param aPluginUid UID of local media plugin to remove - * @param aClearClosed ETrue if clear from closed queued wanted - * @param aClearQueued ETrue if clear from plugin queue wanted - * @return ETrue if plugin UID was removed, EFalse otherwise - */ - virtual TBool ClearQueuedUIDs( TUid aPluginUid, - TBool aClearClosed, - TBool aClearQueued ) = 0; - - /** - * From MDunServerUtility. - * Tries to close loaded local media plugin - * - * @since S60 3.2 - * @param aIndex Index of plugin in connectiondata - * @param aDequeue ETrue if restarting of queued plugins and plugin - * dequeue wanted after successful plugin close - * (normal case, see also OpenMediaByUid()), - * EFalse if no restarting of queued plugins and plugin - * dequeue wanted after successful plugin close - * (in this case caller is reopener itself, see also - * ReopenQeueuedPlugins()) - * @param aClientClose ETrue if close originator is client - * @param aSelfClose ETrue if plugin closes itself, EFalse otherwise - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt TryClosePlugin( TInt aIndex, - TBool aDequeue, - TBool aClientClose, - TBool aSelfClose ) = 0; - - /** - * From MDunServerUtility. - * Closes a plugin directly without uninitializing it - * - * @since S60 5.0 - * @param aIndex Index of plugin in connectiondata - * @param aDequeue ETrue if restarting of queued plugins and plugin - * dequeue wanted after successful plugin close - * (normal case, see also OpenMediaByUid()), - * EFalse if no restarting of queued plugins and plugin - * dequeue wanted after successful plugin close - * (in this case caller is reopener itself, see also - * ReopenQeueuedPlugins()) - * @param aClientClose ETrue if close originator is client - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt DoClosePlugin( TInt aIndex, - TBool aDequeue, - TBool aClientClose ) = 0; - - /** - * From MDunServerUtility. - * Does immediate close of plugin - * - * @since S60 3.2 - * @param aIndex Index of plugin in connectiondata - * @param aDequeue ETrue if restarting of queued plugins and plugin - * dequeue wanted after successful plugin close - * (normal case, see also OpenMediaByUid()), - * EFalse if no restarting of queued plugins and plugin - * dequeue wanted after successful plugin close - * (in this case caller is reopener itself, see also - * ReopenQeueuedPlugins()) - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt DoImmediatePluginClose( TInt aIndex, - TBool aDequeue ) = 0; - - /** - * From MDunServerUtility. - * Tries uninitialization and after that listening state switch on a plugin - * - * @since S60 3.2 - * @param aPluginUid UID of the plugin to initialize to listening state - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt TryInitializeToListening( TUid aPluginUid ) = 0; - - /** - * From MDunServerUtility. - * Tries listening state switch on a plugin - * - * @since S60 3.2 - * @param aIndex Index of plugin in connectiondata - * @return KErrNotFound = plugin not found, - KErrNotReady = wrong state, - KErrNone otherwise - */ - virtual TInt TryListening( TInt aIndex ) = 0; - - /** - * From MDunServerUtility. - * Tries uninitialization of a plugin - * - * @since S60 3.2 - * @param aIndex Index of plugin in connectiondata - * @return KErrNotFound = plugin not found, KErrNone otherwise - */ - virtual TInt TryUninitialize( TInt aIndex ) = 0; - - }; - -/** - * DUN server's utility class - * - * @since S60 v3.2 - */ -class CDunServerUtils : public CBase, - public MDunServerUtility - { - -public: - - /** - * Two-phased constructor. - * @param aParent Parent class owning this friend class (CDunServer) - * @return Instance of self - */ - static CDunServerUtils* NewL( CDunServer& aParent ); - - /** - * Destructor. - */ - virtual ~CDunServerUtils(); - -private: - - CDunServerUtils( CDunServer& aParent ); - - void ConstructL(); - -// from base class MDunServerUtility - - /** - * From MDunServerUtility. - * Closes plugins with state marked as zombie - * - * @since S60 3.2 - * @return KErrGeneral = close on any of the plugins failed, - KErrNone otherwise - */ - TInt RemoveZombiePlugins(); - - /** - * From MDunServerUtility. - * Loads local media module - * - * @since S60 3.2 - * @param aPluginUid UID of the local media module to load - * @return Symbian error code on error, KErrNone otherwise - */ - TInt CreateNewPlugin( TUid aPluginUid ); - - /** - * From MDunServerUtility. - * Constructs local media module - * - * @since S60 3.2 - * @param aPluginUid UID of the local media module to construct - * @param aDllName Name of the DLL to the constructed local media module - * @return Symbian error code on error, KErrNone otherwise - */ - TInt ConstructLocalMediaModule( const TUid& aPluginUid, - const TPtrC& aDllName ); - - /** - * From MDunServerUtility. - * Clears queued UIDs - * - * @since S60 3.2 - * @param aPluginUid UID of local media plugin to remove - * @param aClearClosed ETrue if clear from closed queued wanted - * @param aClearQueued ETrue if clear from plugin queue wanted - * @return ETrue if plugin UID was removed, EFalse otherwise - */ - TBool ClearQueuedUIDs( TUid aPluginUid, - TBool aClearClosed, - TBool aClearQueued ); - - /** - * From MDunServerUtility. - * Tries to close loaded local media plugin - * - * @since S60 3.2 - * @param aIndex Index of plugin in connectiondata - * @param aDequeue ETrue if restarting of queued plugins and plugin - * dequeue wanted after successful plugin close - * (normal case, see also OpenMediaByUid()), - * EFalse if no restarting of queued plugins and plugin - * dequeue wanted after successful plugin close - * (in this case caller is reopener itself, see also - * ReopenQeueuedPlugins()) - * @param aClientClose ETrue if close originator is client - * @param aSelfClose ETrue if plugin closes itself, EFalse otherwise - * @return Symbian error code on error, KErrNone otherwise - */ - TInt TryClosePlugin( TInt aIndex, - TBool aDequeue, - TBool aClientClose, - TBool aSelfClose ); - - /** - * From MDunServerUtility. - * Closes a plugin directly without uninitializing it - * - * @since S60 5.0 - * @param aIndex Index of plugin in connectiondata - * @param aDequeue ETrue if restarting of queued plugins and plugin - * dequeue wanted after successful plugin close - * (normal case, see also OpenMediaByUid()), - * EFalse if no restarting of queued plugins and plugin - * dequeue wanted after successful plugin close - * (in this case caller is reopener itself, see also - * ReopenQeueuedPlugins()) - * @param aClientClose ETrue if close originator is client - * @return Symbian error code on error, KErrNone otherwise - */ - TInt DoClosePlugin( TInt aIndex, - TBool aDequeue, - TBool aClientClose ); - - /** - * From MDunServerUtility. - * Does immediate close of plugin - * - * @since S60 3.2 - * @param aIndex Index of plugin in connectiondata - * @param aDequeue ETrue if restarting of queued plugins and plugin - * dequeue wanted after successful plugin close - * (normal case, see also OpenMediaByUid()), - * EFalse if no restarting of queued plugins and plugin - * dequeue wanted after successful plugin close - * (in this case caller is reopener itself, see also - * ReopenQeueuedPlugins()) - * @return Symbian error code on error, KErrNone otherwise - */ - TInt DoImmediatePluginClose( TInt aIndex, - TBool aDequeue ); - - /** - * From MDunServerUtility. - * Tries uninitialization and after that listening state switch on a plugin - * - * @since S60 3.2 - * @param aPluginUid UID of the plugin to initialize to listening state - * @return Symbian error code on error, KErrNone otherwise - */ - TInt TryInitializeToListening( TUid aPluginUid ); - - /** - * From MDunServerUtility. - * Tries listening state switch on a plugin - * - * @since S60 3.2 - * @param aIndex Index of plugin in connectiondata - * @return KErrNotFound = plugin not found, - KErrNotReady = wrong state, - KErrNone otherwise - */ - TInt TryListening( TInt aIndex ); - - /** - * From MDunServerUtility. - * Tries uninitialization of a plugin - * - * @since S60 3.2 - * @param aIndex Index of plugin in connectiondata - * @return KErrNotFound = plugin not found, KErrNone otherwise - */ - TInt TryUninitialize( TInt aIndex ); - -private: // data - - /** - * Parent class owning this friend class (CDunServer) - */ - CDunServer& iParent; - - /** - * Transporter to use for network side communication - * (from parent iParent) - */ - CDunTransporter*& iTransporter; - - /** - * Waiter for closing self-destruct plugins - * (from parent iParent) - */ - CDunCloseWait*& iCloseWait; - - /** - * Array of TDunConnectionData needed for each loaded plugin - * (from parent iParent) - */ - RArray& iConnData; - - /** - * Array of plugin UIDs (from parent iParent) - * Used for queuing plugins that have no resources to use - * Used for dequeuing plugins when free resources detected - */ - RArray& iPluginQueue; - - /** - * Array of plugin UIDs (from parent iParent) - * Used for queuing plugins that were successfully closed outside - * this server. This is to avoid returning KErrNotFound to LOCOD - * when NotifyMediaCloseRequest() is caught - */ - RArray& iClosedQueue; - - }; - -#endif // C_CDUNSERVERUTILS_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/server/inc/DunSession.h --- a/localconnectivityservice/dun/server/inc/DunSession.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: The session object for DUN server -* -*/ - - -#include "DunServer.h" - -#ifndef C_CDUNSESSION_H -#define C_CDUNSESSION_H - -/** - * Manages separate DUN server sessions for client(s) - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunSession ) : public CSession2 - { - -public: - - CDunSession( CDunServer* aDunServer ); - - /** - * Destructor. - */ - virtual ~CDunSession(); - - /** - * Return the version number - * - * @since S60 3.2 - * @return Version number - */ - TVersion Version() const; - -// from base class CSession2 - - /** - * From CSession2. - * Handles the servicing of client requests passed to the server - * - * @since S60 3.2 - * @param aMessage Message containing the client request - * @return None - */ - void ServiceL( const RMessage2 &aMessage ); - - /** - * From CSession2. - * Return a reference to DUN server - * - * @since S60 3.2 - * @return Server reference - */ - CDunServer& Server() const; - -private: - - /** - * Handles incoming service messages - * - * @since S60 3.2 - * @param aMessage Message containing the client request - * @return Symbian error code on error, KErrNone otherwise - */ - TInt DoService( const RMessage2& aMessage ); - - /** - * Handles incoming test service messages - * - * @since S60 5.0 - * @param aMessage Message containing the client request - * @return Symbian error code on error, KErrNone otherwise - */ - TInt DoTestService( const RMessage2& aMessage ); - -private: // data - - /** - * Message containing the client request - */ - RMessage2 iMessage; - - /** - * Pointer to DUN server - * Not own. - */ - CDunServer* iDunServer; - -}; - -#endif // C_CDUNSESSION_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/server/inc/dunserverdef.h --- a/localconnectivityservice/dun/server/inc/dunserverdef.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* Copyright (c) 2008 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: Definitions for server -* -*/ - - -#ifndef DUN_SERVERDEF_H -#define DUN_SERVERDEF_H - -// INCLUDES -#include -#include - -// DATA TYPES -enum TDunIpc - { - EDunFuncManageService, - EDunFuncActiveConnection, // For testing purposes only - EInvalidIpc - }; - -// GLOBAL CONSTANTS - -_LIT( KDialupServerName, "dunserver" ); - -const TUint KDunServerMajorVersionNumber = 2; -const TUint KDunServerMinorVersionNumber = 0; -const TUint KDunServerBuildVersionNumber = 0; - -#endif // DUN_SERVERDEF_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/server/src/DunCloseWait.cpp --- a/localconnectivityservice/dun/server/src/DunCloseWait.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,178 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Common waiter for closing self-destruct plugins -* -*/ - -#include "DunCloseWait.h" -#include "DunDebug.h" - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunCloseWait* CDunCloseWait::NewL( MDunCloseWait* aCallback ) - { - CDunCloseWait* self = new (ELeave) CDunCloseWait( aCallback ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunCloseWait::~CDunCloseWait() - { - FTRACE(FPrint( _L("CDunCloseWait::~CDunCloseWait()" ))); - ResetData(); - FTRACE(FPrint( _L("CDunCloseWait::~CDunCloseWait() complete" ))); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunCloseWait::ResetData() - { - // IssueRequest() - Stop(); - // AddPluginToClose() - iCloseList.Close(); - // Internal - Initialize(); - } - -// --------------------------------------------------------------------------- -// Adds a new object to be destructed to the list -// --------------------------------------------------------------------------- -// -TInt CDunCloseWait::AddPluginToClose( MDunLocalMediaPlugin* aPluginToClose ) - { - FTRACE(FPrint( _L("CDunCloseWait::AddPluginToClose()" ) )); - if ( !aPluginToClose ) - { - FTRACE(FPrint( _L("CDunCloseWait::AddPluginToClose() (ERROR) complete" ) )); - return KErrGeneral; - } - TInt retTemp = iCloseList.Find( aPluginToClose ); - if ( retTemp != KErrNotFound ) - { - FTRACE(FPrint( _L("CDunCloseWait::AddPluginToClose() (already exists) complete" ) )); - return KErrAlreadyExists; - } - retTemp = iCloseList.Append( aPluginToClose ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunCloseWait::AddPluginToClose() (append failed!) complete" ) )); - return retTemp; - } - FTRACE(FPrint( _L("CDunCloseWait::AddPluginToClose() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Issues request to start closing the objects in the close list -// --------------------------------------------------------------------------- -// -TInt CDunCloseWait::IssueRequest() - { - FTRACE(FPrint( _L("CDunCloseWait::IssueRequest()" ))); - if ( IsActive() ) - { - FTRACE(FPrint( _L("CDunCloseWait::IssueRequest() (not ready) complete" ))); - return KErrNotReady; - } - iStatus = KRequestPending; - SetActive(); - TRequestStatus* requestStatus = &iStatus; - User::RequestComplete( requestStatus, KErrNone ); - FTRACE(FPrint( _L("CDunCloseWait::IssueRequest() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Stops closing the objects in the close list -// --------------------------------------------------------------------------- -// -TInt CDunCloseWait::Stop() - { - FTRACE(FPrint( _L("CDunCloseWait::Stop()" ))); - if ( !IsActive() ) - { - FTRACE(FPrint( _L("CDunCloseWait::Stop() (not ready) complete" ))); - return KErrNotReady; - } - Cancel(); - FTRACE(FPrint( _L("CDunCloseWait::Stop() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CDunCloseWait::CDunCloseWait -// --------------------------------------------------------------------------- -// -CDunCloseWait::CDunCloseWait( MDunCloseWait* aCallback ) : - CActive( EPriorityHigh ), - iCallback( aCallback ) - { - } - -// --------------------------------------------------------------------------- -// CDunCloseWait::ConstructL -// --------------------------------------------------------------------------- -// -void CDunCloseWait::ConstructL() - { - FTRACE(FPrint( _L("CDunCloseWait::ConstructL()" ) )); - if ( !iCallback ) - { - User::Leave( KErrGeneral ); - } - CActiveScheduler::Add( this ); - FTRACE(FPrint( _L("CDunCloseWait::ConstructL() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunCloseWait::Initialize() - { - // Don't initialize iCallback here (it is set through NewL) - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called when closing of the plugins should be done -// --------------------------------------------------------------------------- -// -void CDunCloseWait::RunL() - { - FTRACE(FPrint( _L("CDunCloseWait::RunL()" ))); - iCallback->NotifyPluginCloseAfterWait( iCloseList ); - iCloseList.Reset(); - FTRACE(FPrint( _L("CDunCloseWait::RunL() complete" ))); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called on cancel -// --------------------------------------------------------------------------- -// -void CDunCloseWait::DoCancel() - { - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/server/src/DunServer.cpp --- a/localconnectivityservice/dun/server/src/DunServer.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,674 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: DUN server -* -*/ - - -#include -#include "DunServer.h" -#include "DunServerUtils.h" -#include "DunSession.h" -#include "DunDebug.h" -#include "DunServerSecurityPolicy.h" -#include "dundomainpskeys.h" -#include "DunTransporter.h" - -// PubSub security settings constants -_LIT_SECURITY_POLICY_PASS( KConnStatusReadPolicy ); -_LIT_SECURITY_POLICY_C2( KConnStatusWritePolicy, - ECapabilityLocalServices, - ECapabilityWriteDeviceData ); - -// ======== LOCAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// StartServerL Create Active Scheduler and CDunServer. -// --------------------------------------------------------------------------- -// -static void StartServerL() - { - FTRACE(FPrint( _L("CDunServer::StartServerL()") )); - CActiveScheduler* scheduler = new (ELeave) CActiveScheduler; - CleanupStack::PushL( scheduler ); - CActiveScheduler::Install( scheduler ); - - CDunServer* server = CDunServer::NewL(); - CleanupStack::PushL( server ); - - User::RenameThread( KDialupServerName ); - RProcess::Rendezvous( KErrNone ); - FTRACE(FPrint( _L("CDunServer::StartServerL() Initialization done. Server is running.") )); - - CActiveScheduler::Start(); // run the server - - CleanupStack::PopAndDestroy( server ); - CleanupStack::PopAndDestroy( scheduler ); - FTRACE(FPrint( _L("CDunServer::StartServerL() complete") )); - } - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunServer* CDunServer::NewL() - { - CDunServer* self = new (ELeave) CDunServer( EPriorityStandard ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunServer::~CDunServer() - { - FTRACE(FPrint(_L("CDunServer::~CDunServer()"))); - // Destroy iConnData - TInt i; - for ( i=iConnData.Count()-1; i>=0; i-- ) - { - if ( iUtility ) - { - iUtility->TryClosePlugin( i, EFalse, EFalse, EFalse ); - } - } - if ( iConnData.Count() == 0 ) - { - iConnData.Close(); - } - else - { - FTRACE(FPrint(_L("CDunServer::~CDunServer() (ERROR) complete"))); - } - // Destroy iPluginQueue - iPluginQueue.Close(); - // Destroy iClosedQueue - iClosedQueue.Close(); - // Destroy transporter - delete iTransporter; - iTransporter = NULL; - // Destroy utility - CDunServerUtils* utility = static_cast( iUtility ); - delete utility; - iUtility = NULL; - // Destroy close waiter - delete iCloseWait; - iCloseWait = NULL; - // Remove key - RProperty::Delete( KPSUidDialupConnStatus, KDialupConnStatus ); - FTRACE(FPrint(_L("CDunServer::~CDunServer() complete"))); - } - -// --------------------------------------------------------------------------- -// Notification to manage local media On request -// This comes from client -// --------------------------------------------------------------------------- -// -TInt CDunServer::NotifyMediaOpenRequest( TUid aPluginUid ) - { - FTRACE(FPrint(_L("CDunServer::NotifyMediaOpenRequest()"))); - iUtility->ClearQueuedUIDs( aPluginUid, ETrue, ETrue ); - iUtility->RemoveZombiePlugins(); - TInt retVal = OpenMediaByUid( aPluginUid, ETrue ); - FTRACE(FPrint(_L("CDunServer::NotifyMediaOpenRequest() complete (%d)"), retVal)); - return retVal; - } - -// --------------------------------------------------------------------------- -// Notification to manage local media Off request -// This comes from client -// --------------------------------------------------------------------------- -// -TInt CDunServer::NotifyMediaCloseRequest( TUid aPluginUid ) - { - FTRACE(FPrint(_L("CDunServer::NotifyMediaCloseRequest()"))); - // If plugin can be found with iEnqueue or iClosed marked ETrue, - // Close also them in the same way (no special processing needed) - TInt retVal = CloseMediaByUid( aPluginUid, ETrue, ETrue, ETrue ); - FTRACE(FPrint(_L("CDunServer::NotifyMediaCloseRequest() complete (%d)"), retVal)); - return retVal; - } - -// --------------------------------------------------------------------------- -// Current active connection -// This comes from client -// --------------------------------------------------------------------------- -// -TConnId CDunServer::ActiveConnection() - { - FTRACE(FPrint(_L("CDunServer::ActiveConnection()"))); - if ( iConnData.Count()<1 || iConnData.Count()>1 ) - { - FTRACE(FPrint(_L("CDunServer::ActiveConnection() (unknown plugin amount) complete"))); - return NULL; - } - TDunConnectionData& plugin = iConnData[0]; - if ( !plugin.iLocalModulePtr ) - { - FTRACE(FPrint(_L("CDunServer::ActiveConnection() (no instance) complete"))); - return NULL; - } - TConnId connId = plugin.iLocalModulePtr->ActiveConnection(); - FTRACE(FPrint(_L("CDunServer::ActiveConnection() complete"))); - return connId; - } - -// --------------------------------------------------------------------------- -// Increases reference count made by sessions -// This comes from client -// --------------------------------------------------------------------------- -// -void CDunServer::IncRefCount() - { - FTRACE(FPrint(_L("CDunServer::IncRefCount()"))); - iRefCount++; - FTRACE(FPrint(_L("CDunServer::IncRefCount() complete"))); - } - -// --------------------------------------------------------------------------- -// Decreases reference count made by sessions -// This comes from client -// --------------------------------------------------------------------------- -// -void CDunServer::DecRefCount() - { - FTRACE(FPrint(_L("CDunServer::DecRefCount()"))); - if ( iRefCount > 0 ) - { - iRefCount--; - FTRACE(FPrint(_L("CDunServer::DecRefCount() reference count decreased"))); - if ( iRefCount == 0 ) - { - FTRACE(FPrint(_L("CDunServer::DecRefCount() stopping activescheduler..."))); - CActiveScheduler::Stop(); - } - } - FTRACE(FPrint(_L("CDunServer::DecRefCount() complete"))); - } - -// --------------------------------------------------------------------------- -// From class CServer2 (CPolicyServer -> CServer2). -// Creates a server-side client session object. -// --------------------------------------------------------------------------- -// -CSession2* CDunServer::NewSessionL( const TVersion& aVersion, - const RMessage2& /*aMessage*/ ) const - { - FTRACE(FPrint(_L("CDunServer::NewSessionL()"))); - TVersion version(KDunServerMajorVersionNumber, - KDunServerMinorVersionNumber, - KDunServerBuildVersionNumber ); - TBool supported = User::QueryVersionSupported( version, aVersion ); - if ( !supported ) - { - FTRACE(FPrint(_L("CDunServer::NewSessionL() (not supported) complete"))); - User::Leave( KErrNotSupported ); - } - CDunSession* session = new (ELeave) CDunSession(const_cast( this )); - FTRACE(FPrint(_L("CDunServer::NewSessionL() complete"))); - return session; - } - -// --------------------------------------------------------------------------- -// CDunServer::CDunServer -// --------------------------------------------------------------------------- -// -CDunServer::CDunServer( TInt aPriority ) : - // aPriority: priority of AO - // KDunServerPolicy: TPolicy structure of DUN - CPolicyServer( aPriority, KDunServerPolicy ), - iTransporter( NULL ), - iConnStatus( EDialupUndefined ), - iRefCount( 0 ) - { - FTRACE( FPrint( _L( "CDunServer::CDunServer()" ))); - } - -// --------------------------------------------------------------------------- -// CDunServer::ConstructL -// --------------------------------------------------------------------------- -// -void CDunServer::ConstructL() - { - FTRACE( FPrint( _L( "CDunServer::ConstructL()" ))); - StartL( KDialupServerName ); - // Initialize pubsub key properties - User::LeaveIfError( - RProperty::Define( KPSUidDialupConnStatus, - KDialupConnStatus, - RProperty::EInt, - KConnStatusReadPolicy, - KConnStatusWritePolicy) ); - // Set key to initial value - RProperty::Set( KPSUidDialupConnStatus, - KDialupConnStatus, - EDialupInactive ); - // Create waiter for closing self-destruct plugins - CDunCloseWait* closeWait = CDunCloseWait::NewL( this ); - CleanupStack::PushL( closeWait ); - // Create transporter - CDunTransporter* transporter = CDunTransporter::NewL( this ); - CleanupStack::PushL( transporter ); - // Create utility - CDunServerUtils* utility = CDunServerUtils::NewL( *this ); - iUtility = static_cast( utility ); - iTransporter = transporter; - iCloseWait = closeWait; - CleanupStack::Pop( transporter ); - CleanupStack::Pop( closeWait ); - FTRACE( FPrint( _L( "CDunServer::ConstructL() complete"))); - } - -// --------------------------------------------------------------------------- -// Opens local media plugin by UID -// --------------------------------------------------------------------------- -// -TInt CDunServer::OpenMediaByUid( TUid aPluginUid, TBool aDequeue ) - { - FTRACE(FPrint(_L("CDunServer::OpenMediaByUid()"))); - TInt i; - TInt count = iConnData.Count(); - for ( i=0; iCreateNewPlugin( aPluginUid ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunServer::OpenMediaByUid() (ERROR) complete"))); - return retTemp; - } - TInt pluginIndex = iConnData.Count() - 1; - FTRACE(FPrint(_L("CDunServer::OpenMediaByUid() trying listen at index %d"), pluginIndex)); - retTemp = iUtility->TryListening( pluginIndex ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunServer::OpenMediaByUid() trying close at index %d"), pluginIndex)); - iUtility->TryClosePlugin( pluginIndex, aDequeue, EFalse, EFalse ); - // Ignore error(s), TryClosePlugin()'s TryUninitialize already sets to Zombie if error(s) - FTRACE(FPrint(_L("CDunServer::OpenMediaByUid() (ERROR) complete"))); - return retTemp; - } - // Clear queued also from queued plugin UIDs, just to be safe - iUtility->ClearQueuedUIDs( aPluginUid, ETrue, ETrue ); - FTRACE(FPrint(_L("CDunServer::OpenMediaByUid() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Closes local media plugin by UID -// --------------------------------------------------------------------------- -// -TInt CDunServer::CloseMediaByUid( TUid aPluginUid, - TBool aClearQueued, - TBool aClientClose, - TBool aSelfDelete ) - { - FTRACE(FPrint(_L("CDunServer::CloseMediaByUid()"))); - TInt i; - TBool cleared = EFalse; - if ( aClearQueued ) - { - cleared = iUtility->ClearQueuedUIDs( aPluginUid, ETrue, ETrue ); - } - TInt count = iConnData.Count(); - for ( i=0; i= count ) - { - FTRACE(FPrint(_L("CDunServer::CloseMediaByUid() (not found) complete"))); - return KErrNotFound; - } - FTRACE(FPrint(_L("CDunServer::CloseMediaByUid() trying close at index %d"), i)); - // Plugin found from main list, now close - TInt retTemp = iUtility->TryClosePlugin( i, - ETrue, - aClientClose, - aSelfDelete ); - if ( retTemp!=KErrNone && !cleared ) - { - FTRACE(FPrint(_L("CDunServer::CloseMediaByUid() (ERROR) complete"))); - return retTemp; - } - FTRACE(FPrint(_L("CDunServer::CloseMediaByUid() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Reopens plugins from plugin queue -// --------------------------------------------------------------------------- -// -TInt CDunServer::ReopenQueuedPlugins() - { - FTRACE(FPrint(_L("CDunServer::ReopenQueuedPlugins() (%d)"), iPluginQueue.Count())); - TInt i = iPluginQueue.Count() - 1; - while ( i >= 0 ) - { - TInt retTemp = OpenMediaByUid( iPluginQueue[i], EFalse ); - if ( retTemp == KErrNone ) - { - // Open succeeded so plugin UID was removed by ClearQueuedUIDs(). - // Recalculate i because this method can remove more than one - // match. - i = iPluginQueue.Count() - 1; - } - else - { - // Open failed so the plugin UID was not removed from queue. - // Just decrease index (avoid forever loop). - i--; - } - } - FTRACE(FPrint(_L("CDunServer::ReopenQueuedPlugin()"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunServerCallback. -// Searches for plugin in connection data and returns its state -// --------------------------------------------------------------------------- -// -TDunPluginState CDunServer::GetPluginStateByUid( TUid aPluginUid ) - { - FTRACE(FPrint(_L("CDunServer::GetPluginStateByUid()"))); - TInt i; - TInt count = iConnData.Count(); - for ( i=0; i= count ) - { - FTRACE(FPrint(_L("CDunServer::GetPluginStateByUid() (not found) complete"))); - return EDunStateNone; - } - FTRACE(FPrint(_L("CDunServer::GetPluginStateByUid() state at index %d is %d"), i, iConnData[i].iPluginState)); - FTRACE(FPrint(_L("CDunServer::GetPluginStateByUid() complete"))); - return iConnData[i].iPluginState; - } - -// --------------------------------------------------------------------------- -// From class MDunServerCallback. -// Notification about request to change plugin state up by one level -// --------------------------------------------------------------------------- -// -TInt CDunServer::NotifyPluginStateChangeUp( TDunPluginState aPluginState, - TUid aPluginUid ) - { - FTRACE(FPrint(_L("CDunServer::NotifyPluginStateChangeUp()"))); - TInt i; - TInt count = iConnData.Count(); - for ( i=0; i= count ) - { - FTRACE(FPrint(_L("CDunServer::NotifyPluginStateChangeUp() (not found) complete"))); - return KErrNotFound; - } - FTRACE(FPrint(_L("CDunServer::NotifyPluginStateChangeUp() found at index %d"), i)); - TDunPluginState pluginState = iConnData[i].iPluginState; - if ( pluginState= count ) - { - FTRACE(FPrint(_L("CDunServer::NotifyPluginStateChangeDown() (not found) complete"))); - return KErrNotFound; - } - FTRACE(FPrint(_L("CDunServer::NotifyPluginStateChangeDown() found at index %d"), i)); - TDunPluginState pluginState = iConnData[i].iPluginState; - if ( aPluginState >= pluginState ) - { - FTRACE(FPrint(_L("CDunServer::NotifyPluginStateChangeDown() (unknown state) complete (%d/%d)"), pluginState, aPluginState)); - return KErrNotSupported; - } - // Next catch the cases where state is not "try" - if ( aPluginState != EDunStateTryUninitialize && - aPluginState != EDunStateTryLoad && - aPluginState != EDunStateTryListen && - aPluginState != EDunStateTryChannel ) - { - FTRACE(FPrint(_L("CDunServer::NotifyPluginStateChangeDown() (unknown state) complete (%d/%d)"), pluginState, aPluginState)); - return KErrNotSupported; - } - iConnData[i].iPluginState = aPluginState; - FTRACE(FPrint(_L("CDunServer::NotifyPluginStateChangeDown() state changed to %d(%d)"), aPluginState, pluginState)); - FTRACE(FPrint(_L("CDunServer::NotifyPluginStateChangeDown() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunServerCallback. -// Notification about plugin restart request -// --------------------------------------------------------------------------- -// -TInt CDunServer::NotifyPluginRestart( TUid aPluginUid ) - { - FTRACE(FPrint(_L("CDunServer::NotifyPluginRestart()"))); - TInt retTemp = iUtility->TryInitializeToListening( aPluginUid ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunServer::NotifyPluginRestart() (ERROR) initialize failed"))); - return retTemp; - } - // Restarting may have freed channel(s), - // try to reopen queued plugins (ignore error(s)) - ReopenQueuedPlugins(); - FTRACE(FPrint(_L("CDunServer::NotifyPluginRestart() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunServerCallback. -// Notification about plugin restart request -// --------------------------------------------------------------------------- -// -TInt CDunServer::NotifyPluginReopenRequest() - { - FTRACE(FPrint(_L("CDunServer::NotifyPluginReopenRequest()"))); - TInt retVal = ReopenQueuedPlugins(); - FTRACE(FPrint(_L("CDunServer::NotifyPluginReopenRequest() complete"))); - return retVal; - } - -// --------------------------------------------------------------------------- -// From class MDunPluginManager (MDunServerCallback->MDunPluginManager). -// Notification about request to enqueue a plugin to plugin queue -// --------------------------------------------------------------------------- -// -TInt CDunServer::NotifyPluginEnqueueRequest( TUid aPluginUid ) - { - FTRACE(FPrint(_L("CDunServer::NotifyPluginEnqueueRequest()"))); - TInt i; - TInt count = iConnData.Count(); - for ( i=0; i= count ) - { - FTRACE(FPrint(_L("CDunServer::NotifyPluginEnqueueRequest() (not found) complete"))); - return KErrNotFound; - } - FTRACE(FPrint(_L("CDunServer::NotifyPluginEnqueueRequest() found at index %d"), i)); - // Plugin exists, now try to find it from plugin queue - count = iPluginQueue.Count(); - for ( i=0; iMDunPluginManager). -// Notification about request to dequeue a plugin from plugin queue -// --------------------------------------------------------------------------- -// -TInt CDunServer::NotifyPluginDequeueRequest( TUid aPluginUid ) - { - FTRACE(FPrint(_L("CDunServer::NotifyPluginDequeueRequest()"))); - TBool cleared = iUtility->ClearQueuedUIDs( aPluginUid, ETrue, ETrue ); - if ( !cleared ) - { - FTRACE(FPrint(_L("CDunServer::NotifyPluginDequeueRequest() (not found) complete"))); - return KErrNotFound; - } - FTRACE(FPrint(_L("CDunServer::NotifyPluginDequeueRequest() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunPluginManager (MDunServerCallback->MDunPluginManager). -// Notification about request to close a plugin -// --------------------------------------------------------------------------- -// -TInt CDunServer::NotifyPluginCloseRequest( TUid aPluginUid, TBool aSelfClose ) - { - FTRACE(FPrint(_L("CDunServer::NotifyPluginCloseRequest()"))); - TInt retTemp = CloseMediaByUid( aPluginUid, ETrue, EFalse, aSelfClose ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunServer::NotifyPluginCloseRequest() (ERROR) complete"))); - return retTemp; - } - FTRACE(FPrint(_L("CDunServer::NotifyPluginCloseRequest() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From MDunCloseWait. -// Notification about request to close a plugin after wait -// --------------------------------------------------------------------------- -// -void CDunServer::NotifyPluginCloseAfterWait( - RPointerArray& aPluginsToClose ) - { - FTRACE(FPrint(_L("CDunServer::NotifyPluginCloseAfterWait()"))); - TInt i; - TInt j; - TInt closeCount = aPluginsToClose.Count(); - for ( i=0; iDoClosePlugin( j, ETrue, EFalse ); - } - } - } - FTRACE(FPrint(_L("CDunServer::NotifyPluginCloseAfterWait() complete"))); - } - -// ======== GLOBAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// WinsMain/E32Main implements main function for DUN -// exe. -// Create Cleanup Stack, initialise server and start Active -// Scheduler. -// Returns: Error value: General error value -// --------------------------------------------------------------------------- -// -TInt E32Main() - { - FTRACE(FPrint( _L("CDunServer::Main() Process started.") )); -__UHEAP_MARK; - CTrapCleanup* cleanup = CTrapCleanup::New(); - TInt retVal = KErrNoMemory; - - if ( cleanup ) - { - TRAP( retVal, StartServerL() ); // perform all other initialisation - delete cleanup; - } -__UHEAP_MARKEND; - - FTRACE(FPrint( _L("CDunServer::Main() Process exit code = %d"), retVal)); - return retVal; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/server/src/DunServerUtils.cpp --- a/localconnectivityservice/dun/server/src/DunServerUtils.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,497 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Utility class for CDunServer -* -*/ - - -#include -#include "DunServer.h" -#include "DunServerUtils.h" -#include "DunDebug.h" - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunServerUtils* CDunServerUtils::NewL( CDunServer& aParent ) - { - CDunServerUtils* self = new (ELeave) CDunServerUtils( aParent ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunServerUtils::~CDunServerUtils() - { - FTRACE(FPrint(_L("CDunServerUtils::~CDunServerUtils()"))); - FTRACE(FPrint(_L("CDunServerUtils::~CDunServerUtils() complete"))); - } - -// --------------------------------------------------------------------------- -// CDunServerUtils::CDunServerUtils -// --------------------------------------------------------------------------- -// -CDunServerUtils::CDunServerUtils( CDunServer& aParent ) : - iParent( aParent ), - iTransporter( aParent.iTransporter ), - iCloseWait( aParent.iCloseWait ), - iConnData( aParent.iConnData ), - iPluginQueue( aParent.iPluginQueue ), - iClosedQueue( aParent.iClosedQueue ) - { - } - -// --------------------------------------------------------------------------- -// CDunServerUtils::ConstructL -// --------------------------------------------------------------------------- -// -void CDunServerUtils::ConstructL() - { - FTRACE(FPrint( _L("CDunServerUtils::ConstructL()" ) )); - FTRACE(FPrint( _L("CDunServerUtils::ConstructL() complete" ) )); - } - -// --------------------------------------------------------------------------- -// From class MDunServerUtility. -// Closes plugins with state marked as zombie -// --------------------------------------------------------------------------- -// -TInt CDunServerUtils::RemoveZombiePlugins() - { - FTRACE(FPrint(_L("CDunServerUtils::RemoveZombiePlugins()"))); - TInt i; - TInt retVal = KErrNone; - for ( i=iConnData.Count()-1; i>=0; i-- ) - { - if ( iConnData[i].iPluginState == EDunStateZombie ) - { - // Following closes and removes if remove ok - FTRACE(FPrint(_L("CDunServerUtils::RemoveZombiePlugins() trying close at index %d"), i)); - TInt retTemp = TryClosePlugin( i, ETrue, EFalse, EFalse ); - if ( retTemp != KErrNone ) - { - retVal = KErrGeneral; - } - } - } - FTRACE(FPrint(_L("CDunServerUtils::RemoveZombiePlugins() complete"))); - return retVal; - } - -// --------------------------------------------------------------------------- -// From class MDunServerUtility. -// Loads local media module -// --------------------------------------------------------------------------- -// -TInt CDunServerUtils::CreateNewPlugin( TUid aPluginUid ) - { - FTRACE(FPrint(_L("CDunServerUtils::CreateNewPlugin()"))); - // plugin not constructed, construct now - TFileName pluginFile; - switch ( aPluginUid.iUid ) - { - case KDunBtPluginUidValue: - pluginFile.Copy( KDunPluginBt ); - break; - case KDunIrPluginUidValue: - pluginFile.Copy( KDunPluginIrda ); - break; - case KDunUsbPluginUidValue: - pluginFile.Copy( KDunPluginUsb ); - break; - default: - FTRACE(FPrint(_L("CDunServerUtils::CreateNewPlugin() (not supported) complete"))); - return KErrNotSupported; - } - TDunConnectionData emptyConn; - emptyConn.iLocalModulePtr = NULL; - emptyConn.iLocalModuleUid = TUid::Null(); - emptyConn.iPluginState = EDunStateNone; - TInt retTemp = iConnData.Append( emptyConn ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunServerUtils::CreateNewPlugin() (append failed!) complete"))); - return retTemp; - } - retTemp = ConstructLocalMediaModule( aPluginUid, pluginFile ); - if ( retTemp != KErrNone ) - { - iConnData.Remove( iConnData.Count()-1 ); - FTRACE(FPrint(_L("CDunServerUtils::CreateNewPlugin() (ERROR) complete"))); - return retTemp; - } - FTRACE(FPrint(_L("CDunServerUtils::CreateNewPlugin() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunServerUtility. -// Constructs local media module -// --------------------------------------------------------------------------- -// -TInt CDunServerUtils::ConstructLocalMediaModule( const TUid& aPluginUid, - const TPtrC& aDllName ) - { - FTRACE(FPrint(_L("CDunServerUtils::ConstructLocalMediaModule()"))); - // Create a new library object - if ( iConnData.Count() == 0 ) - { - FTRACE(FPrint(_L("CDunServerUtils::ConstructLocalMediaModule() (not ready) complete"))); - return KErrNotReady; - } - TInt index = iConnData.Count() - 1; - iConnData[index].iLocalModuleUid = aPluginUid; - iConnData[index].iPluginState = EDunStateTryLoad; - // Load the DLL containing the plug-in - TUidType uidType( KDynamicLibraryUid, - KDunLocalMediaPluginInterfaceUid, - aPluginUid ); - FTRACE(FPrint(_L("CDunServerUtils::ConstructLocalMediaModule() loading"))); - TInt retTemp = iConnData[index].iModuleLibrary.Load( aDllName, uidType ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunServerUtils::ConstructLocalMediaModule() (ERROR) complete"))); - return retTemp; - } - FTRACE(FPrint(_L("CDunServerUtils::ConstructLocalMediaModule() plugin 0x%08X loaded"), aPluginUid.iUid)); - // Create the plugin object. - FTRACE(FPrint(_L("CDunServerUtils::ConstructLocalMediaModule() looking up"))); - TLibraryFunction factoryFunction = iConnData[index].iModuleLibrary.Lookup( 1 ); - if ( !factoryFunction ) - { - iConnData[index].iModuleLibrary.Close(); - FTRACE(FPrint(_L("CDunServerUtils::ConstructLocalMediaModule() (ERROR) complete"))); - return KErrNotFound; - } - MDunLocalMediaPlugin* localPlugin = - reinterpret_cast( factoryFunction() ); - if ( !localPlugin ) - { - iConnData[index].iModuleLibrary.Close(); - FTRACE(FPrint(_L("CDunServerUtils::ConstructLocalMediaModule() (ERROR) complete"))); - return KErrGeneral; - } - iConnData[index].iLocalModulePtr = localPlugin; - FTRACE(FPrint(_L("CDunServerUtils::ConstructLocalMediaModule() constructing"))); - TRAPD( retTrap, localPlugin->ConstructL(&iParent, iTransporter) ); - if ( retTrap != KErrNone ) - { - delete iConnData[index].iLocalModulePtr; - iConnData[index].iLocalModulePtr = NULL; - iConnData[index].iModuleLibrary.Close(); - FTRACE(FPrint(_L("CDunServerUtils::ConstructLocalMediaModule() (ERROR) complete"))); - return retTrap; - } - iConnData[index].iPluginState = EDunStateLoaded; - FTRACE(FPrint(_L("CDunServerUtils::ConstructLocalMediaModule() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunServerUtility. -// Clears queued UIDs -// --------------------------------------------------------------------------- -// -TBool CDunServerUtils::ClearQueuedUIDs( TUid aPluginUid, - TBool aClearClosed, - TBool aClearQueued ) - { - FTRACE(FPrint(_L("CDunServerUtils::ClearQueuedUIDs()"))); - TInt i; - TBool cleared = EFalse; - if ( aClearClosed ) - { - for ( i=iClosedQueue.Count()-1; i>=0; i-- ) - { - if ( iClosedQueue[i] == aPluginUid ) - { - iClosedQueue.Remove( i ); - cleared = ETrue; - FTRACE(FPrint(_L("CDunServerUtils::ClearQueuedUIDs() removed from closed queue at %d"), i)); - } - } - } - if ( aClearQueued ) - { - for ( i=iPluginQueue.Count()-1; i>=0; i-- ) - { - if ( iPluginQueue[i] == aPluginUid ) - { - iPluginQueue.Remove( i ); - cleared = ETrue; - FTRACE(FPrint(_L("CDunServerUtils::ClearQueuedUIDs() removed from plugin queue at %d"), i)); - } - } - } - FTRACE(FPrint(_L("CDunServerUtils::ClearQueuedUIDs() complete"))); - return cleared; - } - -// --------------------------------------------------------------------------- -// From class MDunServerUtility. -// Tries to close loaded local media plugin -// --------------------------------------------------------------------------- -// -TInt CDunServerUtils::TryClosePlugin( TInt aIndex, - TBool aDequeue, - TBool aClientClose, - TBool aSelfClose ) - { - FTRACE(FPrint(_L("CDunServerUtils::TryClosePlugin()"))); - if ( aIndex < 0 || - aIndex >= iConnData.Count() ) - { - FTRACE(FPrint(_L("CDunServerUtils::TryClosePlugin() (not found) complete"))); - return KErrNotFound; - } - TInt retTemp = TryUninitialize( aIndex ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunServerUtils::TryClosePlugin() (ERROR) complete"))); - return retTemp; - } - if ( !aSelfClose ) - { - retTemp = DoClosePlugin( aIndex, aDequeue, aClientClose ); - FTRACE(FPrint(_L("CDunServerUtils::TryClosePlugin() complete"))); - return retTemp; - } - retTemp = iCloseWait->AddPluginToClose( iConnData[aIndex].iLocalModulePtr ); - if ( retTemp != KErrNone ) - { - iConnData[aIndex].iPluginState = EDunStateZombie; - FTRACE(FPrint(_L("CDunServerUtils::TryClosePlugin() state changed to %d"), EDunStateZombie)); - return retTemp; - } - retTemp = iCloseWait->IssueRequest(); - if ( retTemp != KErrNone ) - { - iConnData[aIndex].iPluginState = EDunStateZombie; - FTRACE(FPrint(_L("CDunServerUtils::TryClosePlugin() state changed to %d"), EDunStateZombie)); - return retTemp; - } - FTRACE(FPrint(_L("CDunServerUtils::TryClosePlugin() (waiting) complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunServerUtility. -// Closes a plugin directly without uninitializing it -// --------------------------------------------------------------------------- -// -TInt CDunServerUtils::DoClosePlugin( - TInt aIndex, - TBool aDequeue, - TBool aClientClose ) - { - FTRACE(FPrint(_L("CDunServerUtils::DoClosePlugin()"))); - if ( aIndex < 0 || - aIndex >= iConnData.Count() ) - { - FTRACE(FPrint(_L("CDunServerUtils::DoClosePlugin() (not found) complete"))); - return KErrNotFound; - } - TUid pluginUid = iConnData[aIndex].iLocalModuleUid; - DoImmediatePluginClose( aIndex, aDequeue ); - if ( !aClientClose ) - { - // Plugin was closed by something else than client - // Enqueue it to closed queue - TInt i; - TInt count = iClosedQueue.Count(); - for ( i=0; i= iConnData.Count() ) - { - FTRACE(FPrint(_L("CDunServerUtils::DoImmediatePluginClose() (not found) complete"))); - return KErrNotFound; - } - delete iConnData[aIndex].iLocalModulePtr; - iConnData[aIndex].iLocalModulePtr = NULL; - if ( iConnData[aIndex].iModuleLibrary.Handle() != KNullHandle ) - { - iConnData[aIndex].iModuleLibrary.Close(); - } - iConnData.Remove( aIndex ); - // Now, the following check is needed to avoid recursion by: - // ReopenQueuedPlugins()->OpenMediaByUid()->TryClosePlugin()-> - // DoImmediatePluginClose()->ReopenQueuedPlugins() - if ( aDequeue ) - { - iParent.ReopenQueuedPlugins(); - } - // Ignore error(s); this function must only report it's own operation status - FTRACE(FPrint(_L("CDunServerUtils::DoImmediatePluginClose() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunServerUtility. -// Tries uninitialization and after that listening state switch on a plugin -// --------------------------------------------------------------------------- -// -TInt CDunServerUtils::TryInitializeToListening( TUid aPluginUid ) - { - FTRACE(FPrint(_L("CDunServerUtils::TryInitializeToListening()"))); - TInt i; - TInt count = iConnData.Count(); - for ( i=0; i= count ) - { - FTRACE(FPrint(_L("CDunServerUtils::TryInitializeToListening() (not found) complete"))); - return KErrNotFound; - } - TInt retTemp = TryUninitialize( i ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunServerUtils::TryInitializeToListening() (uninitialize error) complete"))); - return retTemp; - } - // Change from Uninitialized to Loaded because listening mode needs it - // (plugin is already loaded anyway) - iConnData[i].iPluginState = EDunStateLoaded; - retTemp = TryListening( i ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L("CDunServerUtils::TryInitializeToListening() (listening error) complete"))); - return retTemp; - } - FTRACE(FPrint(_L("CDunServerUtils::TryInitializeToListening() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunServerUtility. -// Tries listening state switch on a plugin -// --------------------------------------------------------------------------- -// -TInt CDunServerUtils::TryListening( TInt aIndex ) - { - FTRACE(FPrint(_L("CDunServerUtils::TryListening()"))); - if ( aIndex < 0 || - aIndex >= iConnData.Count() ) - { - FTRACE(FPrint(_L("CDunServerUtils::TryListening() (not found) complete"))); - return KErrNotFound; - } - if ( iConnData[aIndex].iPluginState != EDunStateLoaded ) - { - FTRACE(FPrint(_L("CDunServerUtils::TryListening() (not ready) complete"))); - return KErrNotReady; - } - FTRACE(FPrint(_L("CDunServerUtils::TryListening() notifying server state change (%d)"), EDunStateTryListen)); - TInt retTemp = - iConnData[aIndex].iLocalModulePtr->NotifyServerStateChange( EDunStateTryListen ); - if ( retTemp != KErrNone ) - { - iConnData[aIndex].iPluginState = EDunStateZombie; - FTRACE(FPrint(_L("CDunServerUtils::TryListening() state changed to %d"), EDunStateZombie)); - FTRACE(FPrint(_L("CDunServerUtils::TryListening() (ERROR) complete"))); - return retTemp; - } - // Plugin could have changed state, only change state if possible - // This can happen if plugin has no real listening and switches directly - // from listening mode to channeled mode - if ( iConnData[aIndex].iPluginState == EDunStateTryListen ) - { - iConnData[aIndex].iPluginState = EDunStateListening; - } - FTRACE(FPrint(_L("CDunServerUtils::TryListening() state changed to %d"), EDunStateListening)); - FTRACE(FPrint(_L("CDunServerUtils::TryListening() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunServerUtility. -// Tries uninitialization of a plugin -// --------------------------------------------------------------------------- -// -TInt CDunServerUtils::TryUninitialize( TInt aIndex ) - { - FTRACE(FPrint(_L("CDunServerUtils::TryUninitialize()"))); - if ( aIndex < 0 || - aIndex >= iConnData.Count() ) - { - FTRACE(FPrint(_L("CDunServerUtils::TryUninitialize() (not found) complete"))); - return KErrNotFound; - } - if ( iConnData[aIndex].iPluginState == EDunStateUninitialized ) - { - FTRACE(FPrint(_L("CDunServerUtils::TryUninitialize() (already uninitialized) complete"))); - return KErrNotReady; - } - FTRACE(FPrint(_L("CDunServerUtils::TryUninitialize() notifying server state change (%d)"), EDunStateTryUninitialize)); - TInt retTemp = - iConnData[aIndex].iLocalModulePtr->NotifyServerStateChange( EDunStateTryUninitialize ); - if ( retTemp != KErrNone ) - { - iConnData[aIndex].iPluginState = EDunStateZombie; - FTRACE(FPrint(_L("CDunServerUtils::TryUninitialize() state changed to %d"), EDunStateZombie)); - FTRACE(FPrint(_L("CDunServerUtils::TryUninitialize() (ERROR) complete"))); - return retTemp; - } - // Plugin state must be EDunStateLoaded after uninitialization - if ( iConnData[aIndex].iPluginState == EDunStateLoaded ) - { - iConnData[aIndex].iPluginState = EDunStateUninitialized; - FTRACE(FPrint(_L("CDunServerUtils::TryUninitialize() state changed to %d"), EDunStateUninitialized)); - } - else - { - // Should never come here - iConnData[aIndex].iPluginState = EDunStateZombie; - FTRACE(FPrint(_L("CDunServerUtils::TryUninitialize() state changed to %d"), EDunStateZombie)); - } - FTRACE(FPrint(_L("CDunServerUtils::TryUninitialize() complete"))); - return KErrNone; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/server/src/DunSession.cpp --- a/localconnectivityservice/dun/server/src/DunSession.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,195 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: The session object for DUN server -* -*/ - - -#include -#include -#include -#include -#include -#include -#include "dunserverdef.h" -#include "DunSession.h" -#include "DunServer.h" -#include "DunPlugin.h" -#include "DunDebug.h" - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CDunSession::CDunSession -// --------------------------------------------------------------------------- -// -CDunSession::CDunSession( CDunServer* aDunServer ) : - CSession2(), - iDunServer( aDunServer ) - { - FTRACE(FPrint( _L( "CDunSession::CDunSession()") )); - iDunServer->IncRefCount(); - FTRACE(FPrint( _L( "CDunSession::CDunSession() complete") )); - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunSession::~CDunSession() - { - FTRACE(FPrint(_L("CDunSession::~CDunSession()"))); - if ( iDunServer ) - { - iDunServer->DecRefCount(); - iDunServer = NULL; - } - FTRACE(FPrint(_L("CDunSession::~CDunSession() complete"))); - } - -// --------------------------------------------------------------------------- -// Return the version number -// --------------------------------------------------------------------------- -// -TVersion CDunSession::Version(void) const - { - return (TVersion( KDunServerMajorVersionNumber, - KDunServerMinorVersionNumber, - KDunServerBuildVersionNumber )); - } - -// --------------------------------------------------------------------------- -// From class CSession2. -// Handles the servicing of client requests passed to the server -// --------------------------------------------------------------------------- -// -void CDunSession::ServiceL( const RMessage2& aMessage ) - { - FTRACE(FPrint(_L("CDunSession::ServiceL()"))); - TBool hasCapability = aMessage.HasCapability( ECapabilityLocalServices ); - if ( !hasCapability ) - { - aMessage.Complete( KErrPermissionDenied ); - FTRACE(FPrint(_L("CDunSession::ServiceL() (no capability) complete"))); - return; - } - TInt retVal = KErrNotSupported; - switch ( aMessage.Function() ) - { - case EDunFuncManageService: - retVal = DoService( aMessage ); - break; - case EDunFuncActiveConnection: - retVal = DoTestService( aMessage ); - break; - default: - FTRACE(FPrint(_L("CDunSession::ServiceL() (not supported) complete"))); - break; - } - aMessage.Complete( retVal ); - FTRACE(FPrint(_L("CDunSession::ServiceL() complete"))); - } - -// --------------------------------------------------------------------------- -// From class CSession2. -// Return a reference to DUN server -// --------------------------------------------------------------------------- -// -CDunServer& CDunSession::Server() const - { - return *iDunServer; - } - -// --------------------------------------------------------------------------- -// Handles incoming service messages -// --------------------------------------------------------------------------- -// -TInt CDunSession::DoService( const RMessage2& aMessage ) - { - FTRACE(FPrint(_L("CDunSession::DoService()"))); - if ( !iDunServer ) - { - FTRACE(FPrint(_L("CDunSession::DoService() (iDunServer) not initialized!"))); - return KErrGeneral; - } - - TLocodBearer bearer = static_cast( aMessage.Int0() ); - TBool bearerStatus = static_cast( aMessage.Int1() ); - - TUid pluginUid; - switch ( bearer ) - { - case ELocodBearerBT: - { - pluginUid = KDunBtPluginUid; - FTRACE(FPrint(_L("CDunSession::DoService() Managing service for BT, bearer status %d"), bearerStatus)); - - BluetoothFeatures::TEnterpriseEnablementMode mode = BluetoothFeatures::EDisabled; - TRAPD(err, mode = BluetoothFeatures::EnterpriseEnablementL()); - if ( err ) - { - FTRACE(FPrint(_L("CDunSession::DoService() complete: failed to get BluetoothFeatures::EnterpriseEnablementL"))); - return err; - } - if ( mode != BluetoothFeatures::EEnabled ) - { - FTRACE(FPrint(_L("CDunSession::DoService() complete: !BluetoothFeatures::EEnabled"))); - return KErrNotSupported; - } - } - break; - case ELocodBearerIR: - pluginUid = KDunIrPluginUid; - FTRACE(FPrint(_L("CDunSession::DoService() Managing service for IR, bearer status %d"), bearerStatus)); - break; - case ELocodBearerUSB: - pluginUid = KDunUsbPluginUid; - FTRACE(FPrint(_L("CDunSession::DoService() Managing service for USB, bearer status %d"), bearerStatus)); - break; - default: - FTRACE(FPrint(_L("CDunSession::DoService() Unknown service %d, bearer status %d!"), bearer, bearerStatus)); - return KErrNotSupported; - } - TInt retVal = KErrNone; - if ( bearerStatus ) // ON - { - retVal = iDunServer->NotifyMediaOpenRequest( pluginUid ); - } - else // OFF - { - retVal = iDunServer->NotifyMediaCloseRequest( pluginUid ); - } - FTRACE(FPrint(_L("CDunSession::DoService() complete"))); - return retVal; - } - -// --------------------------------------------------------------------------- -// Handles incoming test service messages -// --------------------------------------------------------------------------- -// -TInt CDunSession::DoTestService( const RMessage2& aMessage ) - { - FTRACE(FPrint(_L("CDunSession::DoTestService()"))); - if ( !iDunServer ) - { - FTRACE(FPrint(_L("CDunSession::DoTestService() (iDunServer) not initialized!"))); - return KErrGeneral; - } - TConnId connId = iDunServer->ActiveConnection(); - TPckgBuf connIdPckg( connId ); - aMessage.Write( 0, connIdPckg ); // First argument in EDunFuncActiveConnection - FTRACE(FPrint(_L("CDunSession::DoTestService() complete"))); - return KErrNone; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/bwins/dunutilsu.def --- a/localconnectivityservice/dun/utils/bwins/dunutilsu.def Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -EXPORTS - ?NewL@CDunTransporter@@SAPAV1@PAVMDunPluginManager@@H@Z @ 1 NONAME ; class CDunTransporter * CDunTransporter::NewL(class MDunPluginManager *, int) - ?NumberOfAllocatedChannels@CDunTransporter@@QAEHXZ @ 2 NONAME ; int CDunTransporter::NumberOfAllocatedChannels(void) - ?AllocateChannelL@CDunTransporter@@QAEXPAVRComm@@VTUid@@ABVTDesC8@@HPAVMDunBufferCorrection@@@Z @ 3 NONAME ; void CDunTransporter::AllocateChannelL(class RComm *, class TUid, class TDesC8 const &, int, class MDunBufferCorrection *) - ?SetAdvertisementMonitorL@CDunTransporter@@QAEXVTUid@@PAVMDunServAdvMon@@@Z @ 4 NONAME ; void CDunTransporter::SetAdvertisementMonitorL(class TUid, class MDunServAdvMon *) - ?InitializeL@CDunTransporter@@AAEHXZ @ 5 NONAME ; int CDunTransporter::InitializeL(void) - ?AllocateChannelL@CDunTransporter@@QAEXPAVRSocket@@VTUid@@ABVTDesC8@@HAAH@Z @ 6 NONAME ; void CDunTransporter::AllocateChannelL(class RSocket *, class TUid, class TDesC8 const &, int, int &) - ?GetNumberOfAllocatedChannelsByUid@CDunTransporter@@QAEHVTUid@@@Z @ 7 NONAME ; int CDunTransporter::GetNumberOfAllocatedChannelsByUid(class TUid) - ?FreeChannel@CDunTransporter@@QAEHPAVRComm@@@Z @ 8 NONAME ; int CDunTransporter::FreeChannel(class RComm *) - ?FreeChannel@CDunTransporter@@QAEHPAVRSocket@@@Z @ 9 NONAME ; int CDunTransporter::FreeChannel(class RSocket *) - ?FreeAdvertisementMonitor@CDunTransporter@@QAEHVTUid@@PAVMDunServAdvMon@@@Z @ 10 NONAME ; int CDunTransporter::FreeAdvertisementMonitor(class TUid, class MDunServAdvMon *) - ?GetNumberOfWaitingChannelsByUid@CDunTransporter@@QAEHVTUid@@@Z @ 11 NONAME ; int CDunTransporter::GetNumberOfWaitingChannelsByUid(class TUid) - ?StopTransfers@CDunTransporter@@QAEHPAVRComm@@@Z @ 12 NONAME ; int CDunTransporter::StopTransfers(class RComm *) - ?NumberOfWaitingChannels@CDunTransporter@@QAEHXZ @ 13 NONAME ; int CDunTransporter::NumberOfWaitingChannels(void) - ?AddSkippedErrorL@CDunTransporter@@QAEXHPAVRComm@@W4TDunDirection@@@Z @ 14 NONAME ; void CDunTransporter::AddSkippedErrorL(int, class RComm *, enum TDunDirection) - ?ConnectCommsServer@CDunUtils@@SAHAAVRCommServ@@@Z @ 15 NONAME ; int CDunUtils::ConnectCommsServer(class RCommServ &) - ?IssueTransferRequestsL@CDunTransporter@@QAEXPAVRSocket@@@Z @ 16 NONAME ; void CDunTransporter::IssueTransferRequestsL(class RSocket *) - ?AddConnMonCallbackL@CDunTransporter@@QAEXPAVRSocket@@PAVMDunConnMon@@W4TDunDirection@@H@Z @ 17 NONAME ; void CDunTransporter::AddConnMonCallbackL(class RSocket *, class MDunConnMon *, enum TDunDirection, int) - ?UnInitialize@CDunTransporter@@AAEXXZ @ 18 NONAME ; void CDunTransporter::UnInitialize(void) - ?StopTransfers@CDunTransporter@@QAEHPAVRSocket@@@Z @ 19 NONAME ; int CDunTransporter::StopTransfers(class RSocket *) - ?AddSkippedErrorL@CDunTransporter@@QAEXHPAVRSocket@@W4TDunDirection@@@Z @ 20 NONAME ; void CDunTransporter::AddSkippedErrorL(int, class RSocket *, enum TDunDirection) - ?AddConnMonCallbackL@CDunTransporter@@QAEXPAVRComm@@PAVMDunConnMon@@W4TDunDirection@@H@Z @ 21 NONAME ; void CDunTransporter::AddConnMonCallbackL(class RComm *, class MDunConnMon *, enum TDunDirection, int) - ?IssueTransferRequestsL@CDunTransporter@@QAEXPAVRComm@@@Z @ 22 NONAME ; void CDunTransporter::IssueTransferRequestsL(class RComm *) - ?SetRCommBufferLength@CDunUtils@@SAHAAVRComm@@H@Z @ 23 NONAME ; int CDunUtils::SetRCommBufferLength(class RComm &, int) - ?AdvertisementStatus@CDunTransporter@@QAEHXZ @ 24 NONAME ; int CDunTransporter::AdvertisementStatus(void) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/data/dunutils.rss --- a/localconnectivityservice/dun/utils/data/dunutils.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2007 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: Resource definitions for project DUN -* -*/ - - -NAME DUNX - -#include -#include - -RESOURCE RSS_SIGNATURE { } -RESOURCE TBUF r_dun_maximum_dialups { buf=qtn_dun_max_number; } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/eabi/dunutilsu.def --- a/localconnectivityservice/dun/utils/eabi/dunutilsu.def Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -EXPORTS - _ZN15CDunTransporter11FreeChannelEP5RComm @ 1 NONAME - _ZN15CDunTransporter11FreeChannelEP7RSocket @ 2 NONAME - _ZN15CDunTransporter11InitializeLEv @ 3 NONAME - _ZN15CDunTransporter12UnInitializeEv @ 4 NONAME - _ZN15CDunTransporter13StopTransfersEP5RComm @ 5 NONAME - _ZN15CDunTransporter13StopTransfersEP7RSocket @ 6 NONAME - _ZN15CDunTransporter16AddSkippedErrorLEiP5RComm13TDunDirection @ 7 NONAME - _ZN15CDunTransporter16AddSkippedErrorLEiP7RSocket13TDunDirection @ 8 NONAME - _ZN15CDunTransporter16AllocateChannelLEP5RComm4TUidRK6TDesC8iP20MDunBufferCorrection @ 9 NONAME - _ZN15CDunTransporter16AllocateChannelLEP7RSocket4TUidRK6TDesC8iRi @ 10 NONAME - _ZN15CDunTransporter19AddConnMonCallbackLEP5RCommP11MDunConnMon13TDunDirectioni @ 11 NONAME - _ZN15CDunTransporter19AddConnMonCallbackLEP7RSocketP11MDunConnMon13TDunDirectioni @ 12 NONAME - _ZN15CDunTransporter19AdvertisementStatusEv @ 13 NONAME - _ZN15CDunTransporter22IssueTransferRequestsLEP5RComm @ 14 NONAME - _ZN15CDunTransporter22IssueTransferRequestsLEP7RSocket @ 15 NONAME - _ZN15CDunTransporter23NumberOfWaitingChannelsEv @ 16 NONAME - _ZN15CDunTransporter24FreeAdvertisementMonitorE4TUidP14MDunServAdvMon @ 17 NONAME - _ZN15CDunTransporter24SetAdvertisementMonitorLE4TUidP14MDunServAdvMon @ 18 NONAME - _ZN15CDunTransporter25NumberOfAllocatedChannelsEv @ 19 NONAME - _ZN15CDunTransporter31GetNumberOfWaitingChannelsByUidE4TUid @ 20 NONAME - _ZN15CDunTransporter33GetNumberOfAllocatedChannelsByUidE4TUid @ 21 NONAME - _ZN15CDunTransporter4NewLEP17MDunPluginManageri @ 22 NONAME - _ZN9CDunUtils18ConnectCommsServerER9RCommServ @ 23 NONAME - _ZN9CDunUtils20SetRCommBufferLengthER5RCommi @ 24 NONAME - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/group/bld.inf --- a/localconnectivityservice/dun/utils/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2007 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: -* This file provides the information required for building the -* whole of DUN utilities -* -*/ - -#include - -PRJ_PLATFORMS - -PRJ_EXPORTS -../../rom/dunutils.iby CORE_MW_LAYER_IBY_EXPORT_PATH(dunutils.iby) -../../rom/dunresources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(dunresources.iby) -../loc/dunutils.loc MW_LAYER_LOC_EXPORT_PATH(dunutils.loc) - -PRJ_MMPFILES -dunutils.mmp - -PRJ_TESTMMPFILES diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/group/dunutils.mmp --- a/localconnectivityservice/dun/utils/group/dunutils.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: Project definition file for project DUN utilities -* -*/ - - -// Define the following flag to enable network side logging. -// This makes it possible to test AT commands with idle Telephony/RComm. -// Note that because RComm is a stub the only way to test the connection -// is via RSocket (Bluetooth). - -#undef ENABLE_NETWORK_STUBS - -#include -#include - -#ifdef ENABLE_NETWORK_STUBS -MACRO PRJ_USE_NETWORK_STUBS -#define PRJ_USE_NETWORK_STUBS -#endif // ENABLE_NETWORK_STUBS - -TARGET dunutils.dll -TARGETTYPE DLL -UID 0x1000008d 0x101F6E2A - -CAPABILITY CAP_GENERAL_DLL -VENDORID VID_DEFAULT - -SOURCEPATH ../src -SOURCE DunStream.cpp -SOURCE DunUpstream.cpp -SOURCE DunDownstream.cpp -SOURCE DunSignalCopy.cpp -SOURCE DunSignalNotify.cpp -SOURCE DunSignalWaiter.cpp -SOURCE DunDataWaiter.cpp -SOURCE DunNetDataport.cpp -SOURCE DunTransUtils.cpp -SOURCE DunTransporter.cpp -SOURCE DunChanMan.cpp -SOURCE DunDataPusher.cpp -SOURCE DunNoteHandler.cpp -SOURCE DunUtils.cpp - -START RESOURCE ../data/dunutils.rss -TARGETPATH RESOURCE_FILES_DIR -HEADER -LANGUAGE_IDS -END // RESOURCE - -USERINCLUDE ../inc ../../atext/inc - -MW_LAYER_SYSTEMINCLUDE - -// Note: -// The only other SYSTEMINCLUDE should you shall add are Symbian specific ones. -// If there is a S60 header in the subdirectory then that should be -// added into the include statements (like #include ) -//SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE ../../../inc - -LIBRARY aknnotify.lib -LIBRARY bafl.lib -#ifdef PRJ_USE_NETWORK_STUBS -LIBRARY c32comm_stub.lib -LIBRARY etelmm_stub.lib -#else -LIBRARY c32.lib -LIBRARY etel.lib -LIBRARY etelmm.lib -#endif -LIBRARY esock.lib -LIBRARY dunatext.lib -LIBRARY efsrv.lib -LIBRARY euser.lib -DEBUGLIBRARY flogger.lib diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/inc/DunChanMan.h --- a/localconnectivityservice/dun/utils/inc/DunChanMan.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,407 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: RComm channel management related functionality (waiter) -* -*/ - - -#ifndef C_CDUNCHANMAN_H -#define C_CDUNCHANMAN_H - -#include "DunTransUtils.h" -#include "DunTransporter.h" - -class CDunSignalWaiter; -class CDunDataWaiter; - -/** - * Class for CDunDataWaiter's and CDunSignalWaiter's connection monitoring - * support - * When CDunDataWaiter or CDunSignalWaiter detects activity, data in this - * class is used as helper data to create subsequent calls to - * CDunTransporter::AddConnMonCallbackL - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TDunConnMonCallback ) - { - -public: - - /** - * Callback to call when notification via MDunConnMon to be made - * (CDunTransporter::AddConnMonCallbackL, aCallback parameter) - * Not own. - */ - MDunConnMon* iCallback; - - /** - * Direction where to add connection monitor - * (CDunTransporter::AddConnMonCallbackL, aDirection parameter) - */ - TDunDirection iDirection; - - }; - -/** - * Class for CDunDataWaiter's and CDunSignalWaiter's connection monitoring - * support - * When CDunConnWaiter or CDunSignalWaiter detects activity, data in this - * class is used as helper data to create subsequent calls to - * CDunTransporter::AddSkippedErrorL - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TDunSkippedError ) - { - -public: - - /** - * Error code of read/write condition that should be skipped - * (CDunTransporter::AddSkippedErrorL, aError parameter) - */ - TInt iError; - - /** - * Direction of read/write error condition - * (CDunTransporter::AddSkippedErrorL, aDirection parameter) - */ - TDunDirection iDirection; - - }; - -/** - * Class for CDunDataWaiter's or CDunSignalWaiter's connection monitoring - * support - * When CDunDataWaiter or CDunSignalWaiter detects activity, data in this - * class is used as helper - * data to create subsequent calls to the following APIs - * CDunTransporter::AddConnMonCallbackL - * CDunTransporter::AddSkippedErrorL - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TDunWaiterData ) - { - -public: - - /** - * RComm object of local media side - * Not own. - */ - RComm* iComm; - - /** - * Name for the channel - */ - HBufC8* iChannelName; - - /** - * Signal waiter object for a channel - * Not own. - */ - CDunSignalWaiter* iSignalWaiter; - - /** - * Data waiter object for a channel - * Not own. - */ - CDunDataWaiter* iDataWaiter; - - /** - * Pointer to object implementing buffer correction - * Not own. - */ - MDunBufferCorrection* iCorrection; - - /** - * Connection monitor raw data that will be added to TDunChannelData array - * after activity detected by iDataWaiter or iSignalWaiter - */ - RArray iConnMons; - - /** - * Skipped error raw data that will be added to TDunChannelData array - * after activity detected by iDataWaiter or iSignalWaiter - */ - RArray iOkErrors; - - /** - * Flag to indicate whether enqueued channel allocation required. - * Second option is to use service advertisement API. - */ - TBool iEnqueuedFail; - - /** - * UID of plugin that allocated this channel - * Used for making notification via MDunPluginManager callback - * Added to TDunChannelData array after activity detected by iDataWaiter - */ - TUid iOwnerUid; - - }; - -/** - * Notification interface class for creating new channel - * Used by CDunDataWaiter ro CDunSignalWaiter to create new channel when - * activity is detected - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunChannelAllocator ) - { - -public: - - /** - * CDunTransporter callback: gets called when waiter wants new channel - * - * @since S60 3.2 - * @param aComm Connection where new data exists - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyNewChannelRequest( RComm* aComm ) = 0; - - }; - -/** - * Class for RComm channel management related functionality (waiter) - * activity is detected by CDunDataWaiter or CDunSignalWaiter objects - * Also takes care of waiter object creation. - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunChanMan ) : public CBase, - public MDunChannelAllocator - { - -public: - - /** - * Two-phased constructor. - * @param aParent Parent class owning this friend class (CDunTransporter) - * @param aUtility Pointer to common utility class - * @param aUtilityAux Pointer to other than CDunTransporter utility class - * @param aPluginManager Callback to call when notification via - * MDunPluginManager to be made - * @return Instance of self - */ - static CDunChanMan* NewL( CDunTransporter& aParent, - MDunTransporterUtility* aUtility, - MDunTransporterUtilityAux* aUtilityAux, - MDunPluginManager* aPluginManager ); - - /** - * Destructor. - */ - virtual ~CDunChanMan(); - - /** - * Resets data to initial values - * - * @since S60 3.2 - * @return None - */ - void ResetData(); - - /** - * Number of waiters - * - * @since S60 3.2 - * @return Number of waiters - */ - TInt NumberOfWaiters(); - - /** - * Gets number of waiters by owner UID - * - * @since S60 5.0 - * @param aOwnerUid UID of the channel owner - * @return Number of waiters - */ - TInt GetNumberOfWaitersByUid( TUid aOwnerUid ); - - /** - * Adds new connection waiter to connection waiter array - * - * @since S60 3.2 - * @param aComm Pointer to opened local media RComm ID object - * @param aOwnerUid UID of the channel owner - * @param aName Name for the channel - * @param aEnqueuedFail ETrue if enqueued failure, EFalse otherwise - * @param aCorrection Pointer to object implementing buffer correction - * @return None - */ - void AddConnWaiterL( RComm* aComm, - TUid aOwnerUid, - const TDesC8& aName, - TBool aEnqueuedFail, - MDunBufferCorrection* aCorrection ); - - /** - * Removes existing waiter from connection waiter array - * - * @since S60 3.2 - * @param aComm Pointer to opened local media RComm ID object - * @return KErrNotFound if waiter not found, KErrNone if removed - */ - TInt RemoveConnWaiter( RComm* aComm ); - - /** - * Makes CDunDataWaiter and CDunSignalWaiter ready to detect activity - * - * @since S60 3.2 - * @param aComm Pointer to opened local media RComm ID object - * @return KErrNotFound if waiter not found, KErrNone if request issued - */ - TInt IssueConnWaiterRequest( RComm* aComm ); - - /** - * Stops CDunDataWaiter and CDunSignalWaiter to detect new data - * - * @since S60 3.2 - * @param aComm Pointer to opened local media RComm ID object - * @return KErrNotFound if waiter not found, KErrNone if stopped - */ - TInt StopConnWaiter( RComm* aComm ); - - /** - * Saves waiter's connection monitor callback data - * - * @since S60 3.2 - * @param aComm Pointer to opened local media RComm ID object - * @param aCallback Pointer to object whose callbacks will be called - * @param aDirection Direction of operation to monitor for read/write - * error - * @return Symbian error code on error, KErrNone otherwise - */ - TInt SaveWaiterConnMonCallbackL( RComm* aComm, - MDunConnMon* aCallback, - TDunDirection aDirection ); - - /** - * Saves waiter's skipped error data - * - * @since S60 3.2 - * @param aError Error code to consider as "no error" - * @param aComm Pointer to opened local media RComm ID object - * @param aDirection One of four data transfer endpoints where to add a - * skipped error code - * @return Symbian error code on error, KErrNone otherwise - */ - TInt SaveWaiterSkippedErrorL( TInt aError, - RComm* aComm, - TDunDirection aDirection ); - -private: - - CDunChanMan( CDunTransporter& aParent, - MDunTransporterUtility* aUtility, - MDunTransporterUtilityAux* aUtilityAux, - MDunPluginManager* aPluginManager ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since S60 3.2 - * @return None - */ - void Initialize(); - - /** - * Fills data for channel created by waiter - * - * @since S60 3.2 - * @param aComm Pointer to opened local media RComm ID object - * @param aFirstFree Index to first free channel - * @return Symbian error code on error, KErrNone otherwise - */ - TInt FillNewWaiterChannelData(RComm* aComm, TInt aFirstFree); - - /** - * Restores saved waiter data to connection data - * - * @since S60 3.2 - * @param aWaiterIndex Index to waiter data - * @param aChannelIndex Index to connection data - * @return Symbian error code on error, KErrNone otherwise - */ - TInt RestoreWaiterData( TInt aWaiterIndex, TInt aChannelIndex ); - - /** - * Deletes waiter objects of aIndex:th waiters - * - * @since S60 3.2 - * @param aIndex Index of waiters to delete - * @param aNewOwnership ETrue if ownership transferred, EFalse otherwise - * @return Symbian error code on error, KErrNone otherwise - */ - TInt DeleteWaiters( TInt aIndex, TBool aNewOwnership=EFalse ); - -// from base class MDunChannelAllocator - - /** - * From MDunChannelAllocator. - * Notifies when new channel is wanted - * - * @since S60 3.2 - * @param aComm Connection where new data exists - * @return KErrNone - */ - TInt NotifyNewChannelRequest( RComm* aComm ); - -private: // data - - /** - * Parent class owning this friend class (CDunTransporter) - */ - CDunTransporter& iParent; - - /** - * Pointer to common utility class - * Not own. - */ - MDunTransporterUtility* iUtility; - - /** - * Pointer to other than CDunTransporter utility class - * Not own. - */ - MDunTransporterUtilityAux* iUtilityAux; - - /** - * Callback to call when notification via MDunPluginManager to be made - * Not own. - */ - MDunPluginManager* iPluginManager; - - /** - * Waiter's data that will be added to iChannelData when waiter detects - * read activity. After copying to iChannelData the data will be removed - * from this array. - */ - RArray iWaiterData; - - }; - -#endif // C_CDUNCHANMAN_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/inc/DunDataPusher.h --- a/localconnectivityservice/dun/utils/inc/DunDataPusher.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,284 +0,0 @@ -/* -* Copyright (c) 2008-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: Pushes data to existing stream from outside -* -*/ - - -#ifndef C_CDUNDATAPUSHER_H -#define C_CDUNDATAPUSHER_H - -#include "DunTransporter.h" - -class MDunCompletionReporter; - -/** - * Class used for storing data related to data push - * (data coming from MDunStreamManipulator::NotifyDataPushRequest()) - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TDunDataPush ) - { - -public: - - /** - * Data to push to the stream (not copied) - */ - const TDesC8* iDataToPush; - - /** - * Callback to call when data is processed by the stream - * If this is NULL then no callback will be made - */ - MDunCompletionReporter* iCallback; - - }; - -/** - * Class for notifications of stream manipulator's completion events - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunCompletionReporter ) - { - -public: - - /** - * Gets called when data from - * MDunStreamManipulator::NotifyDataPushRequest() has been processed and - * CDunDownstream is ready to process more data. - * - * @since S60 5.0 - * @param aAllPushed ETrue if all in the queue were pushed, EFalse otherwise - * @return None - */ - virtual void NotifyDataPushComplete( TBool aAllPushed ) = 0; - - }; - -/** - * Class for pushing data to existing CDunDownstream stream from outside - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunDataPusher ) : public CActive - { - -public: - - /** - * Two-phased constructor. - * @param aParent Parent class owning this friend class (CDunDownstream) - * @param aStreamCallback Callback to call when events processed - * @return Instance of self - */ - static CDunDataPusher* NewL( CDunDownstream& aParent, - MDunCompletionReporter* aStreamCallback ); - - /** - * Destructor. - */ - virtual ~CDunDataPusher(); - - /** - * Resets data to initial values - * - * @since S60 3.2 - * @return None - */ - void ResetData(); - - /** - * Sets media to be used for this endpoint - * - * @since S60 3.2 - * @param aComm RComm pointer to use as the endpoint - * @return Symbian error code on error, KErrNone otherwise - */ - TInt SetMedia( RComm* aComm ); - - /** - * Sets media to be used for this endpoint - * - * @since S60 3.2 - * @param aSocket RSocket pointer to use as the endpoint - * @return Symbian error code on error, KErrNone otherwise - */ - TInt SetMedia( RSocket* aSocket ); - - /** - * Adds event notification to queue - * - * @since S60 3.2 - * @param aDataToPush Data to push to the stream (not copied) - * @param aCallback Callback to call when data is processed by the stream - * @return Symbian error code on error, KErrNone otherwise - */ - TInt AddToEventQueue( const TDesC8* aDataToPush, - MDunCompletionReporter* aCallback ); - - /** - * Finds an event from queue - * - * @since S60 5.0 - * @param aDataToPush Data to push to the stream (not copied) - * @return Index of found event, Symbian error code otherwise - */ - TInt FindEventFromQueue( const TDesC8* aDataToPush ); - - /** - * Stops one event in the event queue - * - * @since S60 5.0 - * @param aDataToPush Data to push to the stream (not copied) - * @return Symbian error code on error, KErrNone otherwise - */ - TInt StopOneEvent( const TDesC8* aDataToPush ); - - /** - * Sends queued data in round robin - * - * @since S60 3.2 - * @return ETrue if sending started, EFalse if nothing to do - */ - TBool SendQueuedData(); - - /** - * Stops sending for write endpoint - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Stop(); - - /** - * Stops sending for write endpoint and clears event queue - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt StopAndClearQueue(); - - /** - * Signals completion status in round robin and clears event queue - * - * @return Symbian error code on error, KErrNone otherwise - * @return None - */ - TInt SignalCompletionAndClearQueue(); - -private: - - CDunDataPusher( CDunDownstream& aParent, - MDunCompletionReporter* aStreamCallback ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since S60 3.2 - * @return None - */ - void Initialize(); - - /** - * Manages one event's data push - * - * @since S60 3.2 - * @return None - */ - TInt ManageOneEvent(); - - /** - * Check whether an error code is severe error or not - * - * @since S60 3.2 - * @param aError Error code to check for severity - * @param aIsError ETrue if error code is error, EFalse if not error - * @return ETrue if severe error detected, EFalse if not severe error - */ - TBool ProcessErrorCondition( TInt aError, TBool& aIsError ); - -// from base class CActive - - /** - * From CActive. - * Gets called when endpoint data write complete - * - * @since S60 3.2 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Gets called on cancel - * - * @since S60 3.2 - * @return None - */ - void DoCancel(); - -private: // data - - /** - * Parent class owning this friend class (CDunDownstream) - */ - CDunDownstream& iParent; - - /** - * Callback to call when notification via MDunCompletionReporter to be made - * Not own. - */ - MDunCompletionReporter* iStreamCallback; - - /** - * Event queue for pushed data requests - */ - RArray iEventQueue; - - /** - * Current state of data push: active or inactive - */ - TDunState iPushState; - - /** - * Index of current event to serve - */ - TInt iEventIndex; - - /** - * RSocket object of local media side - * If this is set then iComm is not used - * Not own. - */ - RSocket* iSocket; - - /** - * RComm object of local media or network side - * If this is set then iSocket is not used - * Not own. - */ - RComm* iComm; - - }; - -#endif // C_DUNDATAPUSHER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/inc/DunDataWaiter.h --- a/localconnectivityservice/dun/utils/inc/DunDataWaiter.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,156 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Monitors for new data in RComm local media side -* -*/ - - -#ifndef C_CDUNDATAWAITER_H -#define C_CDUNDATAWAITER_H - -#include "DunChanMan.h" - -/** - * Class to monitor for new data in RComm local media side - * This class is needed to avoid unnecessary resource allocation of Dataport - * side when number of supported Dataport ports for DUN is less than the - * number of local media side plugins that use RComm - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunDataWaiter ) : public CActive - { - -public: - - /** - * Two-phased constructor. - * @param aChannelCallback Callback to call when notification via - * MDunChannelAllocator to be made - * @return Instance of self - */ - static CDunDataWaiter* NewL( MDunChannelAllocator* aChannelCallback ); - - /** - * Destructor. - */ - virtual ~CDunDataWaiter(); - - /** - * Resets data to initial values - * - * @since S60 3.2 - * @return None - */ - void ResetData(); - - /** - * Adds callback for RunL error controlling - * The callback will be called when error is detected in asynchronous - * operation - * - * @since S60 3.2 - * @param aCallback Callback to call when line status changes - * @return Symbian error code on error, KErrNone otherwise - */ - TInt AddCallback( MDunConnMon* aCallback ); - - /** - * Sets media to use for this endpoint - * - * @since S60 3.2 - * @param aComm RComm pointer to use as the endpoint - * @return Symbian error code on error, KErrNone otherwise - */ - TInt SetMedia( RComm* aComm ); - - /** - * Issues request to start waiting for new data in RComm - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt IssueRequest(); - - /** - * Stops monitoring for new data - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Stop(); - -private: - - CDunDataWaiter( MDunChannelAllocator* aChannelCallback ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since S60 3.2 - * @return None - */ - void Initialize(); - -// from base class CActive - - /** - * From CActive. - * Gets called when new data in RComm object - * - * @since S60 3.2 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Gets called on cancel - * - * @since S60 3.2 - * @return None - */ - void DoCancel(); - -private: // data - - /** - * Callback(s) to call when notification(s) via MDunConnMon to be made - * Normally contains only one callback - */ - RPointerArray iCallbacks; - - /** - * Callback to call when notification via MDunChannelAllocator to be made - * Not own. - */ - MDunChannelAllocator* iChannelCallback; - - /** - * Current state of data monitoring: active or inactive - */ - TDunState iDataWaiterState; - - /** - * RComm object of local media side - * Not own. - */ - RComm* iComm; - - }; - -#endif // C_CDUNDATAWAITER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/inc/DunDebug.h --- a/localconnectivityservice/dun/utils/inc/DunDebug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Common debug functionality for this component -* -*/ - - -#ifndef DUN_DEBUG_H -#define DUN_DEBUG_H - -_LIT( KComponentName, "[DUN] " ); - -//#define FILE_LOGGING - -#ifdef _DEBUG - -#ifdef FILE_LOGGING - -#include -#include -#include - -#define FTRACE(a) {a;} - -_LIT( KLogFile,"dun.txt" ); -_LIT( KLogDir, "dun" ); -_LIT( KLogDirFullName,"c:\\logs\\dun\\" ); - -// Declare the FPrint function -// -inline void FPrint( const TRefByValue aFmt, ... ) - { - VA_LIST list; - VA_START( list, aFmt ); - RFileLogger::WriteFormat( KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list ); - } - -inline void FPrintRaw( const TDesC8& /*aDes*/ ) - { - } - -#else - -#include - -#define FTRACE(a) {a;} - -/** -Overflow handler for VA_LIST parsing into a fixed size buffer to -be printed out using RDebug. -*/ -NONSHARABLE_CLASS( TRDebugOverflowHander ) : public TDesOverflow -{ - /** - The function that will get called when the buffer is over-flowed. - In this case we just ignore the overflow, so the buffer will - effectively be truncated. - */ - virtual void Overflow( TDes16& /*aDes*/ ) { return; } -}; - -/** The maximum length of a log line (in characters) output using RDebug. */ -const TUint KRDebugMaxLineLen = 0x100; - -// Declare the FPrint function -// - -inline void FPrint( const TRefByValue aFmt, ... ) - { - VA_LIST list; - VA_START( list, aFmt ); - TRDebugOverflowHander overflow; - TBuf buf; - TRefByValue fmt = aFmt; - buf.Copy( KComponentName ); - buf.AppendFormatList( fmt, list, &overflow ); - RDebug::Print( buf ); - } - -inline void FPrintRaw( const TDesC8& aDes ) - { - RDebug::RawPrint( aDes ); - } - -#endif // FILE_LOGGING - -// =========================================================================== -#else // // No loggings --> Reduced binary size -// =========================================================================== -#define FTRACE( a ) - -#endif // _DEBUG - -#endif // DUN_DEBUG_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/inc/DunDownstream.h --- a/localconnectivityservice/dun/utils/inc/DunDownstream.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,276 +0,0 @@ -/* -* Copyright (c) 2007-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: Definitions needed for one "stream" of CDunTransporter -* -*/ - - -#ifndef C_CDUNDOWNSTREAM_H -#define C_CDUNDOWNSTREAM_H - -#include "DunTransUtils.h" -#include "DunStream.h" -#include "DunAtCmdHandler.h" -#include "DunDataPusher.h" - -class MDunCompletionReporter; -class MDunAtCmdHandler; - -/** - * Class used for storing data related to data pushing - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TDunPushData ) - { - -public: - - /** - * Flag for command mode notifier's MDunCmdModeMonitor callback - * This flag is needed to mark command mode start/end - */ - TBool iDataMode; - - /** - * Data pusher for stream manipulation - */ - CDunDataPusher* iDataPusher; - - /** - * AT command handling related functionality for CDunDownstream - * Not own. - */ - MDunAtCmdHandler* iAtCmdHandler; - - }; - -/** - * Class for manipulating existing stream's contents from outside - * (outside of class CDunDownstream) - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunStreamManipulator ) - { - -public: - - /** - * Gets called when outside party wants to push data to the existing stream - * - * @since S60 5.0 - * @param aDataToPush Data to push to the stream (not copied) - * @param aCallback Callback to call when data is processed by the stream - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyDataPushRequest( - const TDesC8* aDataToPush, - MDunCompletionReporter* aCallback ) = 0; - - /** - * Checks if data is in queue - * - * @since TB9.2 - * @param aDataToPush Data to check - * @return ETrue if data is in queue, EFalse otherwise - */ - virtual TBool IsDataInQueue( const TDesC8 *aDataToPush ) = 0; - - }; - -/** - * Class for data transmission of one "stream" from network to local media - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunDownstream ) : public CDunStream, - public MDunStreamManipulator, - public MDunCompletionReporter, - public MDunCmdModeMonitor - { - - friend class CDunDataPusher; - -public: - - /** - * Two-phased constructor. - * @param aUtility Pointer to common utility class - * @return Instance of self - */ - static CDunDownstream* NewL( MDunTransporterUtilityAux* aUtility ); - - /** - * Destructor. - */ - virtual ~CDunDownstream(); - - /** - * Resets data to initial values - * - * @since S60 3.2 - * @return None - */ - void ResetData(); - - /** - * Starts downstream by issuing read request - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt StartStream(); - - /** - * Stops transfer for read or write endpoints - * - * @since S60 3.2 - * @param aStopMplex ETrue if multiplexer stop, EFalse otherwise - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Stop( TBool aStopMplex=ETrue ); - - /** - * Initializes this stream for data pushing - * - * @since S60 3.2 - * @param aAtCmdHandler AT command handling related functionality - * @return Symbian error code on error, KErrNone otherwise - */ - TInt InitializeForDataPushing( MDunAtCmdHandler* aAtCmdHandler ); - - /** - * Checks if data is in queue - * - * @since TB9.2 - * @param aDataToPush Data to check - * @return ETrue if data is in queue, EFalse otherwise - */ - TBool IsDataInQueue( const TDesC8* aDataToPush ); - - /** - * Adds data to event queue and starts sending if needed - * - * @since S60 5.0 - * @param aDataToPush Data to push to the stream (not copied) - * @param aCallback Callback to call when data is processed by the stream - * @return Symbian error code on error, KErrNone otherwise - */ - TInt AddToQueueAndSend( const TDesC8* aDataToPush, - MDunCompletionReporter* aCallback ); - -private: - - CDunDownstream( MDunTransporterUtilityAux* aUtility ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since S60 3.2 - * @return None - */ - void Initialize(); - - /** - * Issues transfer request for this stream - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt IssueRequest(); - -// from base class CActive - - /** - * From CActive. - * Gets called when endpoint data read complete - * - * @since S60 3.2 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Gets called on cancel - * - * @since S60 3.2 - * @return None - */ - void DoCancel(); - -// from base class MDunStreamManipulator - - /** - * Gets called when outside party wants to push data to the existing stream - * - * @since S60 3.2 - * @param aDataToPush Data to push to the stream (not copied) - * @param aCallback Callback to call when data is processed by the stream - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyDataPushRequest( const TDesC8* aDataToPush, - MDunCompletionReporter* aCallback ); - -// from base class MDunCompletionReporter - - /** - * Gets called when data push is complete - * - * @since S60 5.0 - * @param aAllPushed ETrue if all in the queue were pushed, EFalse otherwise - * @return None - */ - void NotifyDataPushComplete( TBool aAllPushed ); - -// from base class MDunCmdModeMonitor - - /** - * Notifies about command mode start - * - * @since S60 5.0 - * @return None - */ - void NotifyCommandModeStart(); - - /** - * Notifies about command mode end - * - * @since S60 5.0 - * @return None - */ - void NotifyCommandModeEnd(); - -private: // data - - /** - * Pointer to common utility class - * Not own. - */ - MDunTransporterUtilityAux* iUtility; - - /** - * Data related to data pushing - */ - TDunPushData iPushData; - - }; - -#endif // C_CDUNDOWNSTREAM_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/inc/DunNetDataport.h --- a/localconnectivityservice/dun/utils/inc/DunNetDataport.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,286 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Dataport specific network resource accessor implementation -* -*/ - - -#ifndef C_CDUNNETDATAPORT_H -#define C_CDUNNETDATAPORT_H - -#include -#ifdef PRJ_USE_NETWORK_STUBS -#include -#include -#else -#include -#endif - -/** - * Class to store data needed for each separate "call" - * One TDunDataportEntity entity contains objects needed for one network data - * connection - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TDunDataportEntity ) - { - -public: - - /** - * Dataport for one call - */ - RComm iDataport; - - /** - * Call for this entity - */ - RMobileCall iMobileCall; - - /** - * Specifies whether this entity is in use or not - */ - TBool iEntityInUse; - - }; - -/** - * Class for common network resource usage - * This class provides network side independent functionality - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunNetwork ) - { - -public: - - /** - * Abstract; Initializes network - * Must be called before any other operation - * - * @since S60 3.2 - * @return None - */ - virtual void InitializeL() = 0; - - }; - -/** - * Class for Dataport specific network resource usage - * This class is provides Dataport (RComm) dependent functionality - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunNetDataport ) : public MDunNetwork - { - -public: - - /** - * Abstract; Called when channel was created by transporter - * Initializes network for channel creation - * - * @since S60 3.2 - * @param aComm Network ID returned when allocation successful - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt AllocateChannel( RComm*& aComm ) = 0; - - /** - * Abstract; Called when channel was deleted/closed by transporter - * Uninitializes network for channel deletion/close - * - * @since S60 3.2 - * @param aComm Network ID of owning entity that will be freed - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt FreeChannel( RComm* aComm ) = 0; - - /** - * Gets index by network ID for Dataport - * - * @since S60 3.2 - * @param aComm Index to get by this network ID - * @return Symbian error code on error, index otherwise - */ - virtual TInt GetIndexById( RComm* aComm ) = 0; - - }; - -/** - * Class for accessing network functionality through Dataport - * This class is needed by CDunTransporter to create abstract "channels" - * for data communication. - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunNetDataport ) : public CBase, public MDunNetDataport - { - -public: - - /** - * Two-phased constructor. - * @param aNumOfMaxChannels Maximum number of supported Dataport ports - * for DUN - * @return Instance of self - */ - static CDunNetDataport* NewL( TInt aNumOfMaxChannels ); - - /** - * Destructor. - */ - ~CDunNetDataport(); - -// from base class MDunNetwork (MDunNetDataport -> MDunNetwork) - - /** - * From MDunNetwork (MDunNetDataport -> MDunNetwork). - * Initializes network for Dataport - * Must be called before any other operation - * - * @since S60 3.2 - * @return None - */ - void InitializeL(); - -// from base class MDunNetDataport - - /** - * From MDunNetDataport. - * Called when channel was created by transporter for Dataport - * Initializes network for channel creation - * - * @since S60 3.2 - * @param aComm Network ID returned when allocation successful - * @return Symbian error code on error, KErrNone otherwise - */ - TInt AllocateChannel( RComm*& aComm ); - - /** - * From MDunNetDataport. - * Called when channel was deleted/closed by transporter for Dataport - * Uninitializes network for channel deletion/close - * - * @since S60 3.2 - * @param aComm Network ID of owning entity that will be freed - * @return Symbian error code on error, KErrNone otherwise - */ - TInt FreeChannel( RComm* aComm ); - - /** - * From MDunNetDataport. - * Gets index by network ID for Dataport - * - * @since S60 3.2 - * @param aComm Index to get by this network ID - * @return Symbian error code on error, index otherwise - */ - TInt GetIndexById( RComm* aComm ); - -private: - - CDunNetDataport( TInt aNumOfMaxChannels ); - - void ConstructL(); - - /** - * Allocates phone objects for use - * - * @since S60 3.2 - * @return None - */ - void AllocatePhoneObjectsL(); - - /** - * Initializes first free entity - * - * @since S60 3.2 - * @return Symbian error code on error, found index otherwise - */ - TInt InitializeFirstFreeEntity(); - - /** - * Remove network entity by index - * - * @since S60 3.2 - * @param aIndex Index which entity to remove - * @return Symbian error code on error, KErrNone otherwise - */ - TInt RemoveEntity( TInt aIndex ); - - /** - * Deletes own internal data - * - * @since S60 3.2 - * @return None - */ - void DeleteNetwork(); - - /** - * Deletes one network entity at index aIndex for Dataport - * - * @since S60 3.2 - * @param aIndex Index where to delete an entity - * @param aCheckFree Check free status before deletion - * @return Symbian error code on error, KErrNone otherwise - */ - TInt DeleteNetworkEntity( TInt aIndex, TBool aCheckFree ); - -private: // data - - /** - * Maximum number of supported Dataport ports for DUN - */ - TInt iNumOfMaxChannels; - - /** - * Array of abstractions of each "call". - * One TDunDataportEntity entity contains objects needed for one network - * data connection - */ - RArray iEntities; - - /** - * Communication server needed for Dataport port opening, port information - * fetching, and Dataport communication module loading and unloading - */ - RCommServ iCommServer; - - /** - * Telephony server needed for opening iMobilePhone mobile phone session - * and for telephony module loading and unloading - */ - RTelServer iTelServer; - - /** - * Mobile phone server needed for opening iMobileLine mobile line session - */ - RMobilePhone iMobilePhone; - - /** - * Mobile line server needed for opening new calls to Dataport. - * Each new call is also new network data connection - */ - RMobileLine iMobileLine; - - }; - -#endif // C_CDUNNETDATAPORT_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/inc/DunNoteHandler.h --- a/localconnectivityservice/dun/utils/inc/DunNoteHandler.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -/* -* Copyright (c) 2007 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: Manages note showing in UI -* -*/ - - -#ifndef C_CDUNNOTEHANDLER_H -#define C_CDUNNOTEHANDLER_H - -#include -#include -#include -#include -#include "DunTransporter.h" - -/** - * Class for managing note showing in UI - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunNoteHandler ) : public CActive - { - -public: - - /** - * Two-phased constructor. - * @return Instance of self - */ - static CDunNoteHandler* NewL(); - - /** - * Destructor. - */ - virtual ~CDunNoteHandler(); - - /** - * Resets data to initial values - * - * @since S60 3.2 - * @return None - */ - void ResetData(); - - /** - * Issues request to start showing UI note - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt IssueRequest(); - - /** - * Stops showing UI note - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Stop(); - -private: - - CDunNoteHandler(); - - void ConstructL(); - - /** - * Initializes this class - * - * @since S60 3.2 - * @return None - */ - void Initialize(); - - /** - * Issues request to start showing UI note - * - * @since S60 3.2 - * @return None - */ - void DoIssueRequestL(); - - /** - * Reads resource text - * - * @since S60 3.2 - * @param aResourceId Resource ID to read - * @param aUnicode Buffer containing the note string to show - * @return None - */ - void ReadResourceTextL( TInt aResourceId, HBufC16*& aUnicode ); - -// from base class CActive - - /* - * From CActive. - * Gets called when UI note dismissed - * - * @since S60 3.2 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Gets called on cancel - * - * @since S60 3.2 - * @return None - */ - void DoCancel(); - -private: // data - - /** - * Note to show - */ - CAknGlobalConfirmationQuery* iNote; - - /** - * Current state of note showing: active or inactive - */ - TDunState iNoteState; - - }; - -#endif // C_CDUNNOTEHANDLER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/inc/DunPlugin.h --- a/localconnectivityservice/dun/utils/inc/DunPlugin.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,243 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: Common definitions and classes needed by DUN plugins -* -*/ - - -#ifndef DUN_PLUGIN_H -#define DUN_PLUGIN_H - -#include - -typedef TAny* TConnId; // supported now: RSocket*, RComm* - -enum TDunPluginState - { - EDunStateNone = KErrNotFound, // -1 - EDunStateZombie = 0, // 0 - EDunStateTryUninitialize, // 1 - EDunStateUninitialized, // 2 - EDunStateTryLoad, // 3 - EDunStateLoaded, // 4 - EDunStateTryListen, // 5 - EDunStateListening, // 6 - EDunStateTryChannel, // 7 - EDunStateChanneled // 8 - }; - -const TInt KDunLocalMediaPluginInterfaceUidValue = 0x101F6E2D; -const TUid KDunLocalMediaPluginInterfaceUid = { KDunLocalMediaPluginInterfaceUidValue }; - -const TInt KDunBtPluginUidValue = 0x101F6E2B; -const TUid KDunBtPluginUid = { KDunBtPluginUidValue }; -const TInt KDunIrPluginUidValue = 0x101FBAEB; -const TUid KDunIrPluginUid = { KDunIrPluginUidValue }; -const TInt KDunUsbPluginUidValue = 0x101F6E2F; -const TUid KDunUsbPluginUid = { KDunUsbPluginUidValue }; - -class CDunTransporter; - -/** - * Notification interface class to report request for plugin enqueue - * This reqeust is made when there are not enough network resources for a - * certain plugin's needs - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunPluginManager ) - { - -public: - - /** - * Gets called when old plugin should be enqueued - * - * @since S60 3.2 - * @param aPluginUid UID of the plugin that should be enqueued - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyPluginEnqueueRequest( TUid aPluginUid ) = 0; - - /** - * Gets called when new plugin should be dequeued - * - * @since S60 3.2 - * @param aPluginUid UID of the local media plugin to dequeue - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyPluginDequeueRequest( TUid aPluginUid ) = 0; - - /** - * Get callen when plugin should be closed - * - * @since S60 3.2 - * @param aPluginUid UID of the local media plugin to close - * @param aSelfClose ETrue if plugin closes itself, EFalse otherwise - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyPluginCloseRequest( TUid aPluginUid, - TBool aSelfClose ) = 0; - - }; - -/** - * Interface class for accessing CDunServer's functionality - * Shares basic interface for all plugins to use when plugin needs to access - * server's functionality - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunServerCallback ) : public MDunPluginManager - { - -public: - - /** - * Callback from plugins to server to get a plugin's state - * - * @since S60 3.2 - * @param aPluginUid Plugin's UID which state to get - * @return Plugin's state - */ - virtual TDunPluginState GetPluginStateByUid( TUid aPluginUid ) = 0; - - /** - * Callback from plugins to server to set a new state - * New state must be one more than the old state - * - * @since S60 3.2 - * @param aPluginState New state to set for a plugin - * @param aPluginUid Plugin's UID for which to change state - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyPluginStateChangeUp( TDunPluginState aPluginState, - TUid aPluginUid ) = 0; - - /** - * Callback from plugins to server to set a new state - * New state must be one less than the old state - * - * @since S60 3.2 - * @param aPluginState New state to set for a plugin - * @param aPluginUid Plugin's UID for which to change state - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyPluginStateChangeDown( TDunPluginState aPluginState, - TUid aPluginUid ) = 0; - - /** - * Callback from plugins to server to restart a plugin - * Restarting must be done by uninitialization->listening switch since - * context is in plugin - * - * @since S60 3.2 - * @param aPluginUid Plugin's UID to restart - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyPluginRestart( TUid aPluginUid ) = 0; - - /** - * Callback from plugins to server to reopen a plugin from queue - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyPluginReopenRequest() = 0; - - }; - -/** - * Interface class for accessing plugins' functionality - * Shares basic interface for server to use when server needs to access - * plugin's functionality - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunLocalMediaPlugin ) - { - -public: - - /** - * Destructor. Derived class must have virtual destructor also as a plugin - * module is always destructed via M-class. - */ - inline virtual ~MDunLocalMediaPlugin() {}; - - /** - * Symbian 2nd phase constructor. - */ - virtual void ConstructL( MDunServerCallback* aServer, - CDunTransporter* aTransporter ) = 0; - - /** - * Callback from server to plugins to notify when server changes a - * plugin's state - * - * @since S60 3.2 - * @param aPluginState New changed state - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyServerStateChange( TDunPluginState aPluginState ) = 0; - - /** - * Callback from server to plugins to ask for current active connection - * (For testing purposes only) - * - * @since S60 5.0 - * @return Active connection, NULL otherwise - */ - virtual TConnId ActiveConnection() = 0; - - }; - -/** - * Interface class for accessing plugin's main class when its listener - * reports that channel can be created. Can be used also to notify plugin's - * main class when channel can be deleted. - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunListenCallback ) - { - -public: - - /** - * Callback from plugin's listener to plugin to notify about need to - * allocate new channel - * - * @since S60 3.2 - * @param aNoFreeChan ETrue if no free channels, EFalse otherwise - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyChannelAllocate( TBool& aNoFreeChans ) = 0; - - /** - * Callback from plugin's listener to plugin to notify about need to free - * an existing channel - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyChannelFree() = 0; - - }; - -#endif // DUN_PLUGIN_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/inc/DunSignalCopy.h --- a/localconnectivityservice/dun/utils/inc/DunSignalCopy.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,226 +0,0 @@ -/* -* Copyright (c) 2006-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: Copies signals changes between network and local media -* -*/ - - -#ifndef C_CDUNSIGNALCOPY_H -#define C_CDUNSIGNALCOPY_H - -#include "DunTransporter.h" -#include "DunTransUtils.h" -#include "DunAtCmdHandler.h" - -/** - * Class for copying signal changes between to endpoints - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunSignalCopy ) : public CActive - { - -public: - - /** - * Two-phased constructor. - * @return Instance of self - */ - static CDunSignalCopy* NewL(); - - /** - * Destructor. - */ - virtual ~CDunSignalCopy(); - - /** - * Resets data to initial values - * - * @since S60 3.2 - * @return None - */ - void ResetData(); - - /** - * Adds callback for line status change controlling - * The callback will be called when RunL error is detected - * - * @since S60 3.2 - * @param aCallback Callback to call when line status changes - * @return Symbian error code on error, KErrNone otherwise - */ - TInt AddCallback( MDunConnMon* aCallback ); - - /** - * Sets media to use for this endpoint monitor - * - * @since S60 3.2 - * @param aComm RComm pointer to local media side - * @param aNetwork RComm pointer to network side - * @param aStreamType Stream type for this endpoint - * @return Symbian error code on error, KErrNone otherwise - */ - TInt SetMedia( RComm* aComm, - RComm* aNetwork, - TDunStreamType aStreamType ); - - /** - * Issues request to start monitoring the endpoint for line status change - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt IssueRequest(); - - /** - * Stops monitoring the endpoint for line status change - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Stop(); - -private: - - CDunSignalCopy(); - - void ConstructL(); - - /** - * Initializes this class - * - * @since S60 3.2 - * @return None - */ - void Initialize(); - - /** - * Manages upstream signal changes - * - * @since S60 3.2 - * @return None - */ - void ManageSignalChange(); - - /** - * Manages signal changes - * - * @since S60 3.2 - * @return None - */ - void ManageSignalChangeUpstream(); - - /** - * Manages downstream signal changes - * - * @since S60 3.2 - * @return None - */ - void ManageSignalChangeDownstream(); - - /** - * Changes upstream signal - * - * @since S60 5.0 - * @param aSetMask Set the handshaking lines in the mask - * @param aClearMask Clear the handshaking lines in the mask - * @return None - */ - void ChangeUpstreamSignal( TUint aSetMask, TUint aClearMask ); - - /** - * Changes downstream signal - * - * @since S60 3.2 - * @param aSetMask Set the handshaking lines in the mask - * @param aClearMask Clear the handshaking lines in the mask - * @return None - */ - void ChangeDownstreamSignal( TUint aSetMask, TUint aClearMask ); - -// from base class CActive - - /* - * From CActive. - * Gets called when line status changes - * - * @since S60 3.2 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Gets called on cancel - * - * @since S60 3.2 - * @return None - */ - void DoCancel(); - -private: // data - - /** - * Callback(s) to call when notification(s) via MDunConnMon to be made - * Normally contains only one callback - */ - RPointerArray iCallbacks; - - /** - * Callback(s) to call when command mode starts or ends - * Usually two needed: one for upstream and second for downstream - */ - RPointerArray iCmdCallbacks; - - /** - * Used media context: network or local - */ - TDunMediaContext iContextInUse; - - /** - * Used stream type: upstream or downstream - */ - TDunStreamType iStreamType; - - /** - * Current state of connection monitoring: active or inactive - */ - TDunState iSignalCopyState; - - /** - * Signal to listen with RComm::NotifySignalChange() - */ - TUint iListenSignals; - - /** - * Signals set when RComm::NotifySignalChange() request completes - */ - TUint iSignals; - - /** - * RComm object of network side - * Not own. - */ - RComm* iNetwork; - - /** - * RComm object of local media side - * Not own. - */ - RComm* iComm; - - }; - -#endif // C_CDUNSIGNALCOPY_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/inc/DunSignalNotify.h --- a/localconnectivityservice/dun/utils/inc/DunSignalNotify.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,181 +0,0 @@ -/* -* Copyright (c) 2006-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: Monitors signal changes on network side and reports changes -* -*/ - - -#ifndef C_CDUNSIGNALNOTIFY_H -#define C_CDUNSIGNALNOTIFY_H - -#include "DunTransUtils.h" -#include "DunAtCmdHandler.h" - -/** - * Class for monitoring line status and reporting changes - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunSignalNotify ) : public CActive - { - -public: - - /** - * Two-phased constructor. - * @param aUtility Pointer to common utility class - * @return Instance of self - */ - static CDunSignalNotify* NewL( MDunTransporterUtilityAux* aUtility ); - - /** - * Destructor. - */ - virtual ~CDunSignalNotify(); - - /** - * Resets data to initial values - * - * @since S60 3.2 - * @return None - */ - void ResetData(); - - /** - * Adds callback for line status change controlling - * The callback will be called when line status change is detected in - * endpoint - * - * @since S60 3.2 - * @param aCallback Callback to call when line status changes - * @return Symbian error code on error, KErrNone otherwise - */ - TInt AddCallback( MDunConnMon* aCallback ); - - /** - * Sets media to use for this endpoint monitor (network side) - * - * @since S60 3.2 - * @param aComm RComm pointer to use as the endpoint - * @return Symbian error code on error, KErrNone otherwise - */ - TInt SetMedia( RComm* aComm ); - - /** - * Issues request to start monitoring the endpoint for line status change - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt IssueRequest(); - - /** - * Stops monitoring the endpoint for line status change - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Stop(); - -private: - - CDunSignalNotify( MDunTransporterUtilityAux* aUtility ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since S60 3.2 - * @return None - */ - void Initialize(); - - /** - * Manages signal changes - * - * @since S60 3.2 - * @return None - */ - void ManageSignalChange(); - - /** - * Reports signal change - * - * @since S60 3.2 - * @param aSetMask Set the handshaking lines in the mask - * @param aClearMask Clear the handshaking lines in the mask. - * @return None - */ - void ReportSignalChange( TUint aSetMask, TUint aClearMask ); - -// from base class CActive - - /* - * From CActive. - * Gets called when line status changes - * - * @since S60 3.2 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Gets called on cancel - * - * @since S60 3.2 - * @return None - */ - void DoCancel(); - -private: // data - - /** - * Callback(s) to call when notification(s) via MDunConnMon to be made - * Normally contains only one callback - */ - RPointerArray iCallbacks; - - /** - * Pointer to common utility class - * Not own. - */ - MDunTransporterUtilityAux* iUtility; - - /** - * Current state of signal monitoring: active or inactive - */ - TDunState iSignalNotifyState; - - /** - * Signals to listen with RComm::NotifySignalChange() - */ - TUint iListenSignals; - - /** - * Signals set when RComm::NotifySignalChange() request completes - */ - TUint iSignals; - - /** - * RComm object of network side - * Not own. - */ - RComm* iNetwork; - - }; - -#endif // C_CDUNSIGNALNOTIFY_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/inc/DunSignalWaiter.h --- a/localconnectivityservice/dun/utils/inc/DunSignalWaiter.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Monitors for signal change in RComm local media side -* -*/ - - -#ifndef C_CDUNSIGNALWAITER_H -#define C_CDUNSIGNALWAITER_H - -#include "DunChanMan.h" - -/** - * Class to monitor for signal change in RComm local media side - * This class is needed to avoid unnecessary resource allocation of Dataport - * side when number of supported Dataport ports for DUN is less than the - * number of local media side plugins that use RComm - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunSignalWaiter ) : public CActive - { - -public: - - /** - * Two-phased constructor. - * @param aChannelCallback Callback to call when notification via - * MDunChannelAllocator to be made - * @return Instance of self - */ - static CDunSignalWaiter* NewL( MDunChannelAllocator* aChannelCallback ); - - /** - * Destructor. - */ - virtual ~CDunSignalWaiter(); - - /** - * Resets data to initial values - * - * @since S60 3.2 - * @return None - */ - void ResetData(); - - /** - * Adds callback for RunL error controlling - * The callback will be called when error is detected in asynchronous - * operation - * - * @since S60 3.2 - * @param aCallback Callback to call when line status changes - * @return Symbian error code on error, KErrNone otherwise - */ - TInt AddCallback( MDunConnMon* aCallback ); - - /** - * Sets media to use for this endpoint - * - * @since S60 3.2 - * @param aComm RComm pointer to use as the endpoint - * @return Symbian error code on error, KErrNone otherwise - */ - TInt SetMedia( RComm* aComm ); - - /** - * Issues request to start waiting for new data in RComm - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt IssueRequest(); - - /** - * Stops monitoring for new data - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Stop(); - -private: - - CDunSignalWaiter( MDunChannelAllocator* aChannelCallback ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since S60 3.2 - * @return None - */ - void Initialize(); - -// from base class CActive - - /** - * From CActive. - * Gets called when new data in RComm object - * - * @since S60 3.2 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Gets called on cancel - * - * @since S60 3.2 - * @return None - */ - void DoCancel(); - -private: // data - - /** - * Callback(s) to call when notification(s) via MDunConnMon to be made - * Normally contains only one callback - */ - RPointerArray iCallbacks; - - /** - * Callback to call when notification via MDunChannelAllocator to be made - * Not own. - */ - MDunChannelAllocator* iChannelCallback; - - /** - * Current state of data monitoring: active or inactive - */ - TDunState iSignalWaiterState; - - /** - * Signals set when RComm::NotifySignalChange() request completes - */ - TUint iSignals; - - /** - * RComm object of local media side - * Not own. - */ - RComm* iComm; - - }; - -#endif // C_CDUNSIGNALWAITER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/inc/DunStream.h --- a/localconnectivityservice/dun/utils/inc/DunStream.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,229 +0,0 @@ -/* -* Copyright (c) 2007 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: Definitions needed for common stream functionality -* -*/ - - -#ifndef C_CDUNSTREAM_H -#define C_CDUNSTREAM_H - -#include "DunTransporter.h" - -/** - * Class for common stream functionality - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunStream ) : public CActive - { - -public: - - /** - * Resets data to initial values - * - * @since S60 3.2 - * @return None - */ - void ResetData(); - - /** - * Adds error code to consider as "no error" to either endpoint - * - * @since S60 3.2 - * @param aError Error code to add - * @param aOperationType Type of operation for which to add error - * (read or write) - * @return Symbian error code on error, KErrNone otherwise - */ - TInt AddSkippedError( TInt aError, TDunOperationType aOperationType ); - - /** - * Adds callback for line status change controlling - * The callback will be called when serious read error is detected - * - * @since S60 3.2 - * @param aCallback Callback to call when read error occurs - * @param aOperationType Type of operation for which to add error - * (read or write) - * @return Symbian error code on error, KErrNone otherwise - */ - TInt AddConnMonCallback( MDunConnMon* aCallback, - TDunOperationType aOperationType ); - - /** - * Sets buffering for this stream - * - * @since S60 3.2 - * @param aBufferPtr Pointer to the buffer - * @return KErrGeneral if buffer pointer null, KErrNone otherwise - */ - TInt SetBuffering( TPtr8* aBufferPtr ); - - /** - * Sets media to be used for this endpoint - * - * @since S60 3.2 - * @param aComm RComm pointer to use as the endpoint - * @param aMediaContext Media context to use for this endpoint, either - * local or network - * @return Symbian error code on error, KErrNone otherwise - */ - TInt SetMedia( RComm* aComm, TDunMediaContext aMediaContext ); - - /** - * Sets media to be used for this endpoint - * - * @since S60 3.2 - * @param aSocket RSocket pointer to use as the endpoint - * @param aMediaContext Media context to use for this endpoint, either - * local or network - * @return Symbian error code on error, KErrNone otherwise - */ - TInt SetMedia( RSocket* aSocket, TDunMediaContext aMediaContext ); - - /** - * Gets media context - * - * @since S60 3.2 - * @param aStreamType Stream type - * @return Media context in use - */ - TDunMediaContext GetMediaContext( TDunStreamType aStreamType ); - -protected: - - CDunStream(); - - /** - * Destructor. - */ - virtual ~CDunStream(); - - /** - * Check whether an error code is severe error or not - * - * @since S60 3.2 - * @param aError Error code to check for severity - * @param aIsError ETrue if error code is error, EFalse if not error - * @return ETrue if severe error detected, EFalse if not severe error - */ - TBool ProcessErrorCondition( TInt aError, TBool& aIsError ); - -// from base class CActive - - /** - * From CActive. - * Gets called when endpoint data read/write complete - * - * @since S60 3.2 - * @return None - */ - virtual void RunL() {}; - - /** - * From CActive. - * Gets called on cancel - * - * @since S60 3.2 - * @return None - */ - virtual void DoCancel() {}; - -private: - - /** - * Initializes this class - * - * @since S60 3.2 - * @return None - */ - void Initialize(); - -protected: // data - - /** - * Pointer to stream's data buffer: upstream or downstream - * Not own. - */ - TPtr8* iBufferPtr; - - /** - * Callback(s) to call when notification(s) via MDunConnMon to be made - * These callbacks are called on read failures - */ - RPointerArray iCallbacksR; - - /** - * Callback(s) to call when notification(s) via MDunConnMon to be made - * These callbacks are called on write failures - */ - RPointerArray iCallbacksW; - - /** - * Read length set when RSocket::RecvOneOrMore() request completes - */ - TSockXfrLength iReadLengthSocket; - - /** - * Type of current operation: read or write - */ - TDunOperationType iOperationType; - - /** - * Current state of transfer: active or inactive - */ - TDunState iTransferState; - - /** - * Direction of data transfer - * This is set after iStreamType and iOperationType are known - */ - TDunDirection iDirection; - - /** - * Array of error codes that will be skipped for read operations - */ - RArray iOkErrorsR; - - /** - * Array of error codes that will be skipped for write operations - */ - RArray iOkErrorsW; - - /** - * RComm object of network side - * Not own. - */ - RComm* iNetwork; - - /** - * RSocket object of local media side - * If this is set then iComm is not used - * Not own. - */ - RSocket* iSocket; - - /** - * RComm object of local media side - * If this is set then iSocket is not used - * Not own. - */ - RComm* iComm; - - }; - -#endif // C_CDUNSTREAM_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/inc/DunTransUtils.h --- a/localconnectivityservice/dun/utils/inc/DunTransUtils.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,531 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: Utility class for other CDunTransporter classes -* -*/ - - -#ifndef C_CDUNTRANSUTILS_H -#define C_CDUNTRANSUTILS_H - -#include "DunTransporter.h" - -/** - * Notification interface class for managing channel's activity - * This class is needed to update KPSUidDialupConnStatus pub&sub key - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunActivityManager ) - { - -public: - - /** - * CDunTransporter callback: gets called when activity is detected on a - * channel - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt NotifyChannelActivity() = 0; - - /** - * CDunTransporter callback: gets called when inactivity is detected on a - * channel - * - * @since S60 3.2 - * @return KErrGeneral if mismatch in channel activity, KErrNone otherwise - */ - virtual TInt NotifyChannelInactivity() = 0; - - }; - -/** - * Utility accessor class for CDunTransporter class itself - * Shares basic functionality of CDunTransporter by simplifying it - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunTransporterUtility ) - { - -public: - - /** - * Initializes first free channel - * - * @since S60 3.2 - * @param aLocalIdNew Identifier of the new local endpoint - * @return Symbian error code on error, found index otherwise - */ - virtual TInt InitializeFirstFreeChannel( TConnId aLocalIdNew ) = 0; - - /** - * Allocates a channel by creating and setting local media independent - * objects - * This is a common method used by exported local media dependent methods - * - * @since S60 3.2 - * @param aBufferLength Buffer length selected for this channel - * @param aFirstFree Index to first free channel data - * @param aCorrection Pointer to object implementing buffer correction - * @return Symbian error code on error, KErrNone otherwise - */ - virtual void DoAllocateChannelL( - RComm* aComm, - TInt& aBufferLength, - TInt aFirstFree, - MDunBufferCorrection* aCorrection ) = 0; - - /** - * Adds connection monitor callback for either local media or network side - * by connection ID - * Error will be added to aIndex:th endpoint - * - * @since S60 3.2 - * @param aIndex Index where to add new connection monitor callback - * @param aCallback Pointer to object whose callbacks will be called - * @param aDirection Direction of operation to monitor for read/write error - * @param aSignal Receive also signal change if ETrue - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt DoAddConnMonCallback( TInt aIndex, - MDunConnMon* aCallback, - TDunDirection aDirection, - TBool aSignal ) = 0; - - /** - * Adds error to consider as no error condition when doing any of the four - * endpoint's read/writer operation - * Error will be added to aIndex:th endpoint - * - * @since S60 3.2 - * @param aIndex Index where to add new "no error" code - * @param aError Error code to consider as "no error" - * @param aDirection One of four data transfer endpoints where to add a - * skipped error code - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt DoAddSkippedError( TInt aIndex, - TInt aError, - TDunDirection aDirection ) = 0; - - /** - * Issues transfers requests for aIndex:th transfer objects - * - * @since S60 3.2 - * @param aIndex Index to transfer objects that will be activated - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt DoIssueTransferRequests( TInt aIndex ) = 0; - - /** - * Stops transfers for aIndex:th transfer objects - * - * @since S60 3.2 - * @param aIndex Index to transfer objects that will be stopped - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt DoStopTransfers( TInt aIndex ) = 0; - - /** - * Free aIndex:th channel's objects - * - * @since S60 3.2 - * @param aIndex Index of channel to free - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt DoFreeChannel( TInt aIndex ) = 0; - - }; - -/** - * Utility accessor class for other than CDunTransporter classes - * Basically a collection of miscellaneous helper methods - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunTransporterUtilityAux ) - { - -public: - - /** - * Gets local ID counterpart of a network ID - * - * @since S60 3.2 - * @param aComm Network ID to search for - * @return Null if ID not found, otherwise found ID - */ - virtual TConnId GetLocalId( RComm* aComm ) = 0; - - /** - * Notifies when serious read/write error is detected on a connection - * - * @since S60 3.2 - * @param aComm Non-null if error on RComm - * @param aSocket Non-null if error on RSocket - * @param aConnReason Reason of connection error - * @param aCallbacks Callbacks to notify on connections error - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt DoNotifyConnectionNotOk( - RComm* aComm, - RSocket* aSocket, - TDunConnectionReason& aConnReason, - RPointerArray& aCallbacks) = 0; - - }; - -/** - * Utility class for other CDunTransporter classes - * This class implements basic functionality that is shared by different - * CDunTransporter classes, also for simplifying CDunTransporter itself - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunTransUtils ) : public CBase, - public MDunActivityManager, - public MDunTransporterUtility, - public MDunTransporterUtilityAux - { - -public: - - /** - * Two-phased constructor. - * @param aParent Parent class owning this friend class (CDunTransporter) - * @param aPluginManager Callback to call when notification via - * MDunPluginManager to be made - * @return Instance of self - */ - static CDunTransUtils* NewL( CDunTransporter& aParent, - MDunPluginManager* aPluginManager ); - - /** - * Destructor. - */ - virtual ~CDunTransUtils(); - -private: - - CDunTransUtils( CDunTransporter& aParent, - MDunPluginManager* aPluginManager ); - - void ConstructL(); - - /** - * Manages service advertisement status changes - * - * @since S60 5.0 - * @param aAdvertise New advertisement status - * @param aCreation ETrue if channel creation - * EFalse if channel free - * @return None - */ - void ManageAdvertisementStatusChange( TBool aAdvertise, - TBool aCreation=EFalse ); - - /** - * Creates empty channel data - * - * @since S60 3.2 - * @param aChannel Channel data to set empty - * @return None - */ - void CreateEmptyChannelData( TDunChannelData& aChannel ); - - /** - * Creates new buffer if source buffer defined, otherwise already existing - * buffer will be used - * - * @since S60 3.2 - * @param aSrcBuffer Source buffer - * @param aSrcPtr Pointer to source buffer - * @param aDstBuffer Destination buffer - * @param aDstPtr Pointer to destination buffer - * @param aItemsInCs Items in cleanup stack, will be incremented if - * necessary - * @return None - */ - void DoCreateBufferLC( TUint8* aSrcBuffer, - TPtr8* aSrcPtr, - TUint8*& aDstBuffer, - TPtr8*& aDstPtr, - TInt aBufferLength, - TInt& aItemsInCs ); - - /** - * Creates new signal copy object if source defined, otherwise - * already existing will be used - * - * @since S60 3.2 - * @param aSrcSignalCopy Source signal copy object - * @param aDstSignalCopy Destination signal copy object - * @param aItemsInCs Items in cleanup stack, will be incremented if - * necessary - * @return None - */ - void DoCreateSignalCopyLC( CDunSignalCopy* aSrcSignalCopy, - CDunSignalCopy*& aDstSignalCopy, - TInt& aItemsInCs ); - - /** - * Creates new signal notify object if source defined, otherwise - * already existing will be used - * - * @since S60 3.2 - * @param aSrcSignalNotify Source signal notify object - * @param aDstSignalNotify Destination signal notify object - * @param aItemsInCs Items in cleanup stack, will be incremented if - * necessary - * @return None - */ - void DoCreateSignalNotifyLC( CDunSignalNotify* aSrcSignalNotify, - CDunSignalNotify*& aDstSignalNotify, - TInt& aItemsInCs ); - - /** - * Creates transfer objects for reader and writer if sources defined, - * otherwise already existing ones will be used - * - * @since S60 3.2 - * @param aSrcReader Source reader object - * @param aDstReader Destination reader object - * @param aItemsInCs Items in cleanup stack, will be incremented if - * necessary - * @return None - */ - void DoCreateUpTransferObjectL( CDunUpstream* aSrcReader, - CDunUpstream*& aDstReader, - TInt& aItemsInCs ); - - /** - * Creates transfer objects for reader and writer if sources defined, - * otherwise already existing ones will be used - * - * @since S60 3.2 - * @param aSrcReader Source reader object - * @param aDstReader Destination reader object - * @param aItemsInCs Items in cleanup stack, will be incremented if - * necessary - * @return None - */ - void DoCreateDownTransferObjectL( CDunDownstream* aSrcReader, - CDunDownstream*& aDstReader, - TInt& aItemsInCs ); - - /** - * Resets/frees network data of aIndex:th channel - * - * @since S60 3.2 - * @param aIndex Index of channel to reset/free - * @return Symbian error code on error, KErrNone otherwise - */ - TInt DeleteOneNetworkData( TInt aIndex ); - - /** - * Deletes local data of aIndex:th channel - * - * @since S60 3.2 - * @param aIndex Index of channel to delete - * @return Symbian error code on error, KErrNone otherwise - */ - TInt DeleteOneLocalData( TInt aIndex ); - - /** - * Deletes buffering objects of aIndex:th channel - * - * @since S60 3.2 - * @param aIndex Index of channel to delete - * @return Symbian error code on error, KErrNone otherwise - */ - TInt DeleteBuffering( TInt aIndex ); - -// from base class MDunTransporterUtility - - /** - * From MDunTransporterUtility. - * Initializes first free channel - * - * @since S60 3.2 - * @param aLocalIdNew Identifier of the new local endpoint - * @return Symbian error code on error, found index otherwise - */ - TInt InitializeFirstFreeChannel( TConnId aLocalIdNew ); - - /** - * From MDunTransporterUtility. - * Allocates a channel by creating and setting local media independent - * objects - * This is a common method used by exported local media dependent methods - * - * @since S60 3.2 - * @param aBufferLength Buffer length selected for this channel - * @param aFirstFree Index to first free channel data - * @param aCorrection Pointer to object implementing buffer correction - * @return Symbian error code on error, KErrNone otherwise - */ - void DoAllocateChannelL( RComm* aComm, - TInt& aBufferLength, - TInt aFirstFree, - MDunBufferCorrection* aCorrection ); - - /** - * From MDunTransporterUtility. - * Adds connection monitor callback for either local media or network side - * by connection ID - * Connection monitor will be added to aIndex:th endpoint - * - * @since S60 3.2 - * @param aIndex Index where to add new connection monitor callback - * @param aCallback Pointer to object whose callbacks will be called - * @param aDirection Direction of operation to monitor for read/write error - * @param aSignal Receive also signal change if ETrue - * @return Symbian error code on error, KErrNone otherwise - */ - TInt DoAddConnMonCallback( TInt aIndex, - MDunConnMon* aCallback, - TDunDirection aDirection, - TBool aSignal ); - - /** - * From MDunTransporterUtility. - * Adds error to consider as no error condition when doing any of the four - * endpoint's read/writer operation - * Error will be added to aIndex:th endpoint - * - * @since S60 3.2 - * @param aIndex Index where to add new "no error" code - * @param aError Error code to consider as "no error" - * @param aDirection One of four data transfer endpoints where to add a - * skipped error code - * @return Symbian error code on error, KErrNone otherwise - */ - TInt DoAddSkippedError( TInt aIndex, - TInt aError, - TDunDirection aDirection ); - - /** - * From MDunTransporterUtility. - * Issues transfers requests for aIndex:th transfer objects - * - * @since S60 3.2 - * @param aIndex Index to transfer objects that will be activated - * @return Symbian error code on error, KErrNone otherwise - */ - TInt DoIssueTransferRequests( TInt aIndex ); - - /** - * From MDunTransporterUtility. - * Stops transfers for aIndex:th transfer objects - * - * @since S60 3.2 - * @param aIndex Index to transfer objects that will be stopped - * @return Symbian error code on error, KErrNone otherwise - */ - TInt DoStopTransfers( TInt aIndex ); - - /** - * From MDunTransporterUtility. - * Free aIndex:th channel's objects - * - * @since S60 3.2 - * @param aIndex Index of channel to free - * @return Symbian error code on error, KErrNone otherwise - */ - TInt DoFreeChannel( TInt aIndex ); - -// from base class MDunTransporterUtilityAux - - /** - * From MDunTransporterUtilityAux. - * Gets local ID counterpart of a network ID - * - * @since S60 3.2 - * @param aComm Network ID to search for - * @return Null if ID not found, otherwise found ID - */ - TConnId GetLocalId( RComm* aComm ); - - /** - * From MDunTransporterUtilityAux. - * Notifies when serious read/write error is detected on a connection - * - * @since S60 3.2 - * @param aComm Non-null if error on RComm - * @param aSocket Non-null if error on RSocket - * @param aConnReason Reason of connection error - * @param aCallbacks Callbacks to notify on connections error - * @return Symbian error code on error, KErrNone otherwise - */ - TInt DoNotifyConnectionNotOk( - RComm* aComm, - RSocket* aSocket, - TDunConnectionReason& aConnReason, - RPointerArray& aCallbacks); - -// from base class MDunActivityManager - - /** - * From MDunActivityManager. - * Notifies about activity on a channel - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyChannelActivity(); - - /** - * From MDunActivityManager. - * Notifies about inactivity on a channel - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt NotifyChannelInactivity(); - -private: // data - - /** - * Parent class owning this friend class (CDunTransporter) - */ - CDunTransporter& iParent; - - /** - * Array of abstractions of each "channel" (from parent iParent) - * One TDunChannelData entry contains objects needed for one channel - */ - RArray& iChannelData; - - /** - * Array of service advertisement data for each plugin (from parent iParent) - * One TDunServAdvData entry contains objects needed for one plugin - */ - RArray& iServAdvData; - - /** - * Callback to call when notification via MDunPluginManager to be made - * Not own. - */ - MDunPluginManager* iPluginManager; - - }; - -#endif // C_CDUNTRANSUTILS_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/inc/DunTransporter.h --- a/localconnectivityservice/dun/utils/inc/DunTransporter.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,800 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: Managing abstracted "channels" of network side communication -* -*/ - - -#ifndef C_CDUNTRANSPORTER_H -#define C_CDUNTRANSPORTER_H - -#include -#ifdef PRJ_USE_NETWORK_STUBS -#include -#else -#include -#endif -#include -#include "DunNetDataport.h" - -typedef TAny* TConnId; // supported now: RSocket*, RComm* - -const TInt KDunStreamTypeMask = 0x02; // 10 -const TInt KDunOperationTypeMask = 0x01; // 01 - -enum TDunOperationType - { - EDunOperationTypeUndefined = KErrNotFound, - EDunOperationTypeRead = 0x00, // 00 - EDunOperationTypeWrite = 0x01 // 01 - }; - -enum TDunMediaContext - { - EDunMediaContextUndefined = KErrNotFound, - EDunMediaContextNetwork = 0, - EDunMediaContextLocal - }; - -enum TDunMedia - { - EDunMediaUndefined = KErrNotFound, - EDunMediaNetwork = 0, - EDunMediaRComm, - EDunMediaRSocket - }; - -enum TDunDirection - { - EDunDirectionUndefined = KErrNotFound, - EDunReaderUpstream = 0x00, // 00 - EDunWriterUpstream = 0x01, // 01 - EDunReaderDownstream = 0x02, // 10 - EDunWriterDownstream = 0x03 // 11 - }; - -enum TDunStreamType - { - EDunStreamTypeUndefined = KErrNotFound, - EDunStreamTypeUpstream = 0x00, // 00 - EDunStreamTypeDownstream = 0x02 // 10 - }; - -enum TDunState - { - EDunStateIdle, - EDunStateTransferring, // Transporter state for data tranfer (up/downstream) - EDunStateSignalCopy, // Transporter state for signal copying (RComm) - EDunStateSignalNotify, // Transporter state for signal notifying (RSocket) - EDunStateDataWaiting, // Transporter state for data waiting - EDunStateSignalWaiting, // Transporter state for signal waiting - EDunStateDataPushing, // Transporter state for data pushing (multiplexer) - EDunStateCallListen, // Transporter state for call state listening - EDunStateAtCmdHandling, // ATEXT state for AT command handling - EDunStateAtCmdPushing, // ATEXT state for AT command reply pushing - EDunStateAtCmdEchoing, // ATEXT state for AT command character echoing (text mode) - EDunStateAtUrcHandling, // ATEXT state for URC handling - EDunStateModeListening, // ATEXT state for mode change listening - EDunStateEcomListening, // ATEXT state for ECOM change listening - EDunStateNvramListening, // ATEXT state for NVRAM change listening - EDunStateUiNoting // Transporter state for UI note showing - }; - -enum TDunReasonType - { - EDunReasonTypeSignal, - EDunReasonTypeRW, - EDunReasonTypeRunL - }; - -class CDunChanMan; -class MDunPluginManager; -class MDunTransporterUtility; -class CDunTransUtils; -class CDunConnWaiter; -class TDunWaiterData; -class CDunUpstream; -class CDunDownstream; -class CDunSignalCopy; -class CDunSignalNotify; -class CDunNoteHandler; - -/** - * Class used for reporting connection error's reason and signal changes - * of network side - * Connection error can happen in read/write and RunL error cases - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TDunConnectionReason ) - { - -public: - - /** - * Reason type of error; either R/W or RunL - * or signal (network side) - * Set in all cases (signal, R/W, RunL) - */ - TDunReasonType iReasonType; - - /** - * Context of media where error occurred: network or local - * Set in all error cases (signal, R/W, RunL) - */ - TDunMediaContext iContext; - - /** - * Signal type of network side - * Set if signal case, 0 otherwise - */ - TUint iSignalType; - - /** - * Is signal high or low of network side - * Set if signal case, 0 otherwise - */ - TBool iSignalHigh; - - /** - * Direction of data transfer - * Set if R/W case, EDunDirectionUndefined otherwise - */ - TDunDirection iDirection; - - /** - * Error code of failure - * Set if R/W or RunL case, KErrNone otherwise - */ - TInt iErrorCode; - - }; - -/** - * Notification interface class to report line status - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunConnMon ) - { - -public: - - /** - * Gets called when line status changes or when any type of error is - * detected - * - * @since S60 3.2 - * @param aConnId Connection ID for callback - * @param aConnReason Reason for progress change - * @return None - */ - virtual void NotifyProgressChangeL( - TConnId aConnId, - TDunConnectionReason aConnReason ) = 0; - - }; - -/** - * Notification interface class to report service advertisement status changes - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunServAdvMon ) - { - -public: - - /** - * Gets called when advertisement status changes to start - * - * @since S60 5.0 - * @param aCreation ETrue if channel creation - * EFalse if channel free - * @return None - */ - virtual void NotifyAdvertisementStart( TBool aCreation ) = 0; - - /** - * Gets called when advertisement status changes to end - * - * @since S60 5.0 - * @return None - */ - virtual void NotifyAdvertisementEnd() = 0; - - }; - -/** - * Notification interface class for buffer correction - * This interface makes possible to change suggested local media buffer size - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunBufferCorrection ) - { - -public: - - /** - * Notifies about request to change local media's buffer size - * - * @since S60 3.2 - * @param aLength Suggested buffer length that will be used if no - * correction done - * @return New (corrected) buffer length - */ - virtual TInt NotifyBufferCorrection( TInt aLength ) = 0; - - }; - -/** - * Class to store data needed for each separate "channel" - * One TDunChannelData data contains objects needed for one channel - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TDunChannelData ) - { - -public: - - /** - * RComm object of network side - * Not own. - */ - RComm* iNetwork; - - /** - * RComm object of local media side - * If this is set then iSocket is not used - * Not own. - */ - RComm* iComm; - - /** - * RSocket object of local media side - * If this is set then iComm is not used - * Not own. - */ - RSocket* iSocket; - - /** - * Name for the channel - */ - HBufC8* iChannelName; - - /** - * Upstream read/write object - * Reads data from local media and writes to network - * Not own. - */ - CDunUpstream* iUpstreamRW; - - /** - * Downstream read/write object - * Reads data from network and writes to local media - * Not own. - */ - CDunDownstream* iDownstreamRW; - - /** - * Upstream buffer (Local -> Network) - * Not own. - */ - TUint8* iBufferUpstream; - - /** - * Downstream buffer (Local <- Network) - * Not own. - */ - TUint8* iBufferDownstream; - - /** - * Pointer to upstream's buffer (Local -> Network) - * Not own. - */ - TPtr8* iBufferUpPtr; - - /** - * Pointer to downstream's buffer (Local <- Network) - * Not own. - */ - TPtr8* iBufferDownPtr; - - /** - * Upstream signal copy - * If this is set then iSignalNotify is not used - * Not own. - */ - CDunSignalCopy* iUpstreamSignalCopy; - - /** - * Downstream signal copy - * If this is set then iSignalNotify is not used - * Not own. - */ - CDunSignalCopy* iDownstreamSignalCopy; - - /** - * Signal notifier - * If this is set then the following are not used: - * iUpstreamSignalCopy, iDownstreamSignalCopy - * Not own. - */ - CDunSignalNotify* iSignalNotify; - - /** - * Owner's UID - */ - TUid iOwnerUid; - - /** - * Flag that indicates whether this channel is allocated or not - */ - TBool iChannelInUse; - - }; - -/** - * Class to store data needed for each plugin service advertisement - * One TDunChannelData data contains objects needed for one plugin - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TDunServAdvData ) - { - -public: - - /** - * Owner's UID for which to have the monitor - */ - TUid iOwnerUid; - - /** - * Service advertisement monitor - * Not own. - */ - MDunServAdvMon* iServAdvMon; - - }; - -/** - * Class for managing abstracted "channels" of network side communication - * This is main class to be used by other components - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunTransporter ) : public CBase - { - - friend class CDunTransUtils; - friend class CDunChanMan; - -public: - - /** - * Two-phased constructor. - * @param aPluginManager Callback to call when notification via - * MDunPluginManager to be made - * @param aNumOfMaxChannels Number of wanted maximum channels - * (can be omitted with 0) - * @return Instance of self - */ - IMPORT_C static CDunTransporter* NewL( MDunPluginManager* aPluginManager, - TInt aNumOfMaxChannels=0 ); - - /** - * Destructor. - */ - virtual ~CDunTransporter(); - - /** - * Number of allocated channels, is the same number as allocated and active - * (non-waiting) channels - * - * @since S60 3.2 - * @return Number of allocated channels - */ - IMPORT_C TInt NumberOfAllocatedChannels(); - - /** - * Number of waiting channels, is the same number as allocated and inactive - * (waiting) channels - * - * @since S60 3.2 - * @return Number of waiting channels - */ - IMPORT_C TInt NumberOfWaitingChannels(); - - /** - * Gets the number of allocated channels by owner UID, is the same number - * as allocated and active (non-waiting) channels - * - * @since S60 5.0 - * @param aOwnerUid UID of the channel owner - * @return Number of allocated channels by UID - */ - IMPORT_C TInt GetNumberOfAllocatedChannelsByUid( TUid aOwnerUid ); - - /** - * Gets the number of waiting channels by owner UID, is the same number - * as allocated and inactive (waiting) channels - * - * @since S60 5.0 - * @param aOwnerUid UID of the channel owner - * @return Number of waiting channels by UID - */ - IMPORT_C TInt GetNumberOfWaitingChannelsByUid( TUid aOwnerUid ); - - /** - * Service advertisement status - * - * @since S60 5.0 - * @return ETrue if OK to advertise, EFalse otherwise - */ - IMPORT_C TBool AdvertisementStatus(); - - /** - * Creates a channel of communication between local media (aComm) and - * network - * Local media object pointer also works as a connection ID for the - * allocated channel - * - * @since S60 3.2 - * @param aComm Pointer to opened local media RComm ID object - * @param aOwnerUid UID of the channel owner - * @param aName Name for the channel - * @param aEnqueuedFail ETrue if enqueued failure, EFalse otherwise - * @param aCorrection Pointer to object implementing buffer correction - * @return None - */ - IMPORT_C void AllocateChannelL( - RComm* aComm, - TUid aOwnerUid, - const TDesC8& aName, - TBool aEnqueuedFail, - MDunBufferCorrection* aCorrection=NULL ); - - /** - * Creates a channel of communication between local media (aSocket) and - * network - * Local media object pointer also works as a connection ID for the - * allocated channel - * - * @since S60 3.2 - * @param aSocket Pointer to opened local media RSocket ID object - * @param aOwnerUid UID of the channel owner - * @param aName Name for the channel - * @param aEnqueuedFail ETrue if enqueued failure, EFalse otherwise - * @param aNoFreeChans ETrue if no free channels, EFalse otherwise - * @return None - */ - IMPORT_C void AllocateChannelL( - RSocket* aSocket, - TUid aOwnerUid, - const TDesC8& aName, - TBool aEnqueuedFail, - TBool& aNoFreeChans ); - - /** - * Frees an allocated channel by local media (aComm) connection ID - * - * @since S60 3.2 - * @param aComm Pointer to opened local media RComm ID object - * @return Symbian error code on error, KErrNone otherwise - */ - IMPORT_C TInt FreeChannel( RComm* aComm ); - - /** - * Frees an allocated channel by local media (aSocket) connection ID - * - * @since S60 3.2 - * @param aSocket Pointer to opened local media RSocket ID object - * @return Symbian error code on error, KErrNone otherwise - */ - IMPORT_C TInt FreeChannel( RSocket* aSocket ); - - /** - * Issues transfer requests for all transfer objects by local media - * (aComm) connection ID - * This will cause the Transporter by be ready for transferring data - * - * @since S60 3.2 - * @param aComm Pointer to opened local media RComm ID object - * @return None - */ - IMPORT_C void IssueTransferRequestsL( RComm* aComm ); - - /** - * Issues transfer requests for all transfer objects by local media - * (aSocket) connection ID - * This will cause the Transporter by be ready for transferring data - * - * @since S60 3.2 - * @param aSocket Pointer to opened local media RSocket ID object - * @return None - */ - IMPORT_C void IssueTransferRequestsL( RSocket* aSocket ); - - /** - * Stops transfers for all transfer objects by local media (aComm) - * connection ID - * - * @since S60 3.2 - * @param aComm Pointer to opened local media RComm ID object - * @return Symbian error code on error, KErrNone otherwise - */ - IMPORT_C TInt StopTransfers( RComm* aComm ); - - /** - * Stops transfers for all transfer objects by local media (aSocket) - * connection ID - * - * @since S60 3.2 - * @param aSocket Pointer to opened local media RSocket ID object - * @return Symbian error code on error, KErrNone otherwise - */ - IMPORT_C TInt StopTransfers( RSocket* aSocket ); - - /** - * Adds connection monitor callback for either local media or network side - * by connection ID - * Callbacks will be called read/write error is detected during endpoint - * operation - * - * @since S60 3.2 - * @param aComm Pointer to opened local media RComm ID object - * @param aCallback Pointer to object whose callbacks will be called - * @param aDirection Direction of operation to monitor for read/write error - * @param aSignal ETrue if also signal notification wanted from network side - * @return None - */ - IMPORT_C void AddConnMonCallbackL( RComm* aComm, - MDunConnMon* aCallback, - TDunDirection aDirection, - TBool aSignal ); - - /** - * Adds connection monitor callback for either local media or network side - * by connection ID - * Callbacks will be called when line status switches to high or low - * - * @since S60 3.2 - * @param aSocket Pointer to opened local media RSocket ID object - * @param aCallback Pointer to object whose callbacks will be called - * @param aDirection Direction of operation to monitor for read/write error - * @param aSignal ETrue if also signal notification wanted from network side - * @return None - */ - IMPORT_C void AddConnMonCallbackL( RSocket* aSocket, - MDunConnMon* aCallback, - TDunDirection aDirection, - TBool aSignal ); - - /** - * Adds error to consider as no error condition when doing any of the four - * endpoint's read/writer operation - * - * @since S60 3.2 - * @param aError Error code to consider as "no error" - * @param aComm Pointer to opened local media RComm ID object - * @param aDirection One of four data transfer endpoints where to add a - * skipped error code - * @return None - */ - IMPORT_C void AddSkippedErrorL( TInt aError, - RComm* aComm, - TDunDirection aDirection ); - - /** - * Adds error to consider as no error condition when doing any of the four - * endpoint's read/writer operation - * - * @since S60 3.2 - * @param aError Error code to consider as "no error" - * @param aSocket Pointer to opened local media RSocket ID object - * @param aDirection One of four data transfer endpoints where to add a - * skipped error code - * @return None - */ - IMPORT_C void AddSkippedErrorL( TInt aError, - RSocket* aSocket, - TDunDirection aDirection ); - - /** - * Sets service advertisement monitor callback by owner UID - * Callbacks will be called when advertisement status changes. - * The callbacks are updated with every successfully completed - * channel allocation/free (and allocation failure) so it is recommended - * to call this method after AllocateChannelL(). - * - * @since S60 5.0 - * @param aOwnerUid Owner's UID for which to have the monitor - * @param aCallback Pointer to object whose callbacks will be called - * @return None - */ - IMPORT_C void SetAdvertisementMonitorL( TUid aOwnerUid, - MDunServAdvMon* aCallback ); - - /** - * Frees service advertisement monitor callback by owner UID - * - * @since S60 5.0 - * @param aOwnerUid Owner's UID for which to have the monitor - * @param aCallback Pointer to object whose callbacks will be called - * @return Symbian error code on error, KErrNone otherwise - */ - IMPORT_C TInt FreeAdvertisementMonitor( TUid aOwnerUid, - MDunServAdvMon* aCallback ); - -private: - - CDunTransporter( MDunPluginManager* aPluginManager, - TInt aNumOfMaxChannels ); - - void ConstructL(); - - /** - * Initializes the transporter, must be called as the first operation - * - * @since S60 3.2 - * @return KErrAlreadyExists = already initialized, - * KErrGeneral = network initialization failed, - * KErrNone otherwise - */ - TInt InitializeL(); - - /** - * UnInitializes the transporter, can be called as the last operation - * - * @since S60 3.2 - * @return None - */ - void UnInitialize(); - - /** - * Initialize the transporter - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt InitializeOnDemand(); - - /** - * UnInitialize the transporter - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt UnInitializeOnDemand(); - - /** - * Returns index of media for connection ID - * - * @since S60 3.2 - * @param aConnId Connection ID for media - * @param aMediaContext Context of media to search for; either local or - * network - * @return Symbian error code on error, found index otherwise - */ - TInt GetMediaIndex( TConnId aConnId, - TDunMediaContext aMediaContext=EDunMediaContextLocal ); - - /** - * Returns index of media for connection ID - * - * @since S60 3.2 - * @param aConnId Connection ID for media - * @param aMediaContext Context of media to search for; either local or - * network - * @return Found index - */ - TInt GetMediaIndexL( TConnId aConnId, - TDunMediaContext aMediaContext=EDunMediaContextLocal ); - - /** - * Checks initialization and RSubSessionBase() handle - * - * @since S60 3.2 - * @param aConnId Connection ID for media - * @return KErrNotReady if not initialized, KErrBadHandle if no handle - */ - TInt CheckInitAndHandle( TConnId aConnId ); - - /** - * Deletes own internal data - * - * @since S60 3.2 - * @return None - */ - void DeleteTransporter(); - -private: // data - - /** - * Pointer to common utility class - * Own. - */ - MDunTransporterUtility* iUtility; - - /** - * Pointer to RComm channel manager class - * Own. - */ - CDunChanMan* iChanMan; - - /** - * Pointer to note handler class - * Own. - */ - CDunNoteHandler* iNoteHandler; - - /** - * Array of abstractions of each "channel" - * One TDunChannelData entry contains objects needed for one channel - */ - RArray iChannelData; - - /** - * Array of service advertisement data for each plugin - * One TDunServAdvData entry contains objects needed for one plugin - */ - RArray iServAdvData; - - /** - * Callback to call when notification via MDunPluginManager to be made - * Not own. - */ - MDunPluginManager* iPluginManager; - - /** - * Number of channels that are active - * Used for updating KPSUidDialupConnStatus Pub&Sub key - */ - TInt iActiveChannels; - - /** - * Number of wanted maximum channels (can be omitted with 0) - * Used for initialization of this class - */ - TInt iNumOfMaxChannels; - - /** - * Indicates whether this class is initialized or not - */ - TBool iInitialized; - - /** - * Indicates whether or not it is OK to advertise services - */ - TBool iAdvertise; - - /** - * Instance of network side abstraction - * Own. - */ - CDunNetDataport* iNetwork; - - }; - -#endif // C_CDUNTRANSPORTER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/inc/DunUpstream.h --- a/localconnectivityservice/dun/utils/inc/DunUpstream.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,347 +0,0 @@ -/* -* Copyright (c) 2007-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: Definitions needed for one "stream" of CDunTransporter -* -*/ - - -#ifndef C_CDUNUPSTREAM_H -#define C_CDUNUPSTREAM_H - -#include "DunTransUtils.h" -#include "DunStream.h" -#include "DunAtCmdHandler.h" -#include "DunAtCmdEchoer.h" -#include "DunDataPusher.h" - -class MDunCmdModeMonitor; - -/** - * Class used for storing data related to activity monitoring - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TDunActivityData ) - { - -public: - - /** - * Callback to call when notification via MDunActivityManager to be made - * Not own. - */ - MDunActivityManager* iActivityCallback; - - /** - * Flag for data read activity's MDunActivityManager callback - * This flag is needed to prevent multiple notifications of same activity - */ - TBool iDataRead; - - /** - * Used as a flag for the first notification of read activity - * This flag is needed to keep MDunActivityManager notifications in sync - * (inactivity notification done only if activity notification done first) - */ - TBool iNotified; - - }; - -/** - * Class used for storing data related to AT command parsing - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( TDunParseData ) - { - -public: - - /** - * Flag for command mode notifier's MDunCmdModeMonitor callback - * This flag is needed to mark command mode start/end for parse start/end - */ - TBool iDataMode; - - /** - * AT Command handler. - */ - CDunAtCmdHandler* iAtCmdHandler; - - }; - -/** - * Accessor class for AT command handling related functionality - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( MDunAtCmdHandler ) - { - -public: - - /** - * Starts URC message handling - * This is an accessor for CDunDownstream's StartStream() - * - * @since S60 5.0 - * @return Symbian error code on error, KErrNone otherwise - */ - virtual TInt StartUrc() = 0; - - /** - * Stops AT command handling downstream related activity (also URC) - * This is an accessor for CDunDownstream's Stop() - * - * @since S60 3.2 - * @return None - */ - virtual TInt StopAtCmdHandling() = 0; - - }; - -/** - * Class for data transmission of one "stream" from local media to network - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunUpstream ) : public CDunStream, - public MDunAtCmdHandler, - public MDunCmdModeMonitor, - public MDunAtCmdStatusReporter, - public MDunAtCmdEchoer - { - -public: - - /** - * Two-phased constructor. - * @param aUtility Pointer to common utility class - * @return Instance of self - */ - static CDunUpstream* NewL( MDunTransporterUtilityAux* aUtility ); - - /** - * Destructor. - */ - virtual ~CDunUpstream(); - - /** - * Resets data to initial values - * - * @since S60 3.2 - * @return None - */ - void ResetData(); - - /** - * Sets activity callback for this stream - * - * @since S60 3.2 - * @param aActivityCallback Pointer to activity callback - * @return KErrGeneral if callback null, KErrNone otherwise - */ - TInt SetActivityCallback( MDunActivityManager* aActivityCallback ); - - /** - * Initializes this stream for AT command notifications - * - * @since S60 5.0 - * @param aStreamCallback Pointer to stream callback - * @param aConnectionName Connection identifier name - * @param aCallbackUp Upstream callback to call when command mode starts or - * ends - * @param aCallbackDown Downstream callback to call when command mode starts - * or ends - * @return Symbian error code on error, KErrNone otherwise - */ - TInt InitializeForAtParsing( MDunStreamManipulator* aStreamCallback, - const TDesC8* aConnectionName, - MDunCmdModeMonitor* aCallbackUp, - MDunCmdModeMonitor* aCallbackDown ); - - /** - * Starts upstream by issuing read request - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt StartStream(); - - /** - * Stops transfer for read & write endpoints - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt Stop(); - - /** - * Data transmission state (if read completed) - * - * @since S60 3.2 - * @return ETrue if data successfully read, EFalse otherwise - */ - TBool DataReadStatus(); - -private: - - CDunUpstream( MDunTransporterUtilityAux* aUtility ); - - void ConstructL(); - - /** - * Initializes this class - * - * @since S60 3.2 - * @return None - */ - void Initialize(); - - /** - * Issues transfer request for this stream - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt IssueRequest(); - - /** - * Processes data that was read - * - * @since S60 5.0 - * @return ETrue if request to be reissued, EFalse otherwise - */ - TBool ProcessReadData(); - - /** - * Manages activity in a channel - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt ManageChannelActivity(); - -// from base class CActive - - /** - * From CActive. - * Gets called when endpoint data read/write complete - * - * @since S60 3.2 - * @return None - */ - void RunL(); - - /** - * From CActive. - * Gets called on cancel - * - * @since S60 3.2 - * @return None - */ - void DoCancel(); - -// from base class MDunAtCmdStatusReporter - - /** - * Notifies about parser's need to get more data - * - * @since TB9.2 - * @return None - */ - void NotifyParserNeedsMoreData(); - - /** - * Notifies about editor mode reply - * - * @since TB9.2 - * @param aStart ETrue if start of editor mode, EFalse otherwise - * @return Symbian error code on error, KErrNone otherwise - */ - void NotifyEditorModeReply( TBool aStart ); - -// from base class MDunAtCmdHandler - - /** - * Starts URC message handling - * This is an accessor for CDunDownstream's StartStream() - * - * @since S60 5.0 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt StartUrc(); - - /** - * Stops AT command handling downstream related activity (also URC) - * This is an accessor for CDunDownstream's Stop() - * - * @since S60 3.2 - * @return Symbian error code on error, KErrNone otherwise - */ - TInt StopAtCmdHandling(); - -// from base class MDunCmdModeMonitor - - /** - * Notifies about command mode start - * - * @since S60 5.0 - * @return None - */ - void NotifyCommandModeStart(); - - /** - * Notifies about command mode end - * - * @since S60 5.0 - * @return None - */ - void NotifyCommandModeEnd(); - -// from base class MDunAtCmdEchoer - - /** - * Notifies about completed echo in text mode - * - * @since TB9.2 - * @return None - */ - void NotifyEchoComplete(); - -private: // data - - /** - * Pointer to common utility class - * Not own. - */ - MDunTransporterUtilityAux* iUtility; - - /** - * Data related to activity monitoring - */ - TDunActivityData iActivityData; - - /** - * Data related to AT command parsing - */ - TDunParseData iParseData; - - }; - -#endif // C_CDUNUPSTREAM_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/inc/DunUtils.h --- a/localconnectivityservice/dun/utils/inc/DunUtils.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: Common utility methods for DUN -* -*/ - - -#ifndef C_CDUNUTILS_H -#define C_CDUNUTILS_H - -#ifdef PRJ_USE_NETWORK_STUBS -#include -#else -#include -#endif -#include - -/** - * This class contains common utility methods for DUN - * - * @lib dunutils.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDunUtils ) : public CBase - { - -public: - - /** - * Connects to comms server - * - * @since S60 3.2 - * @param aCommServer Comms server where to connect - * @return Symbian error code on error, KErrNone otherwise - */ - IMPORT_C static TInt ConnectCommsServer( RCommServ& aCommServer ); - - /** - * Sets RComm buffer length - * - * @since S60 3.2 - * @param aComm RComm object whose length to set - * @param aLength Length to set to aComm - * @return Symbian error code on error, KErrNone otherwise - */ - IMPORT_C static TInt SetRCommBufferLength( RComm& aComm, TInt aLength ); - - }; - -#endif // C_CDUNUTILS_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/loc/dunutils.loc --- a/localconnectivityservice/dun/utils/loc/dunutils.loc Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2007 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: Localization strings for project DUN -* -*/ - - -// d: When a maximum number of dial-up connections with any bearer are already established -// d: and the user tries to set up another one, a global query with this text is shown. -// d: Query has only left softkey OK $text.softkey.ok$. This softkey confirms that user -// d: see the note. User has to press softkey or Selection key and after that the note -// d: disappears. -// l: popup_note_window -// w: -// r: 5.0 -#define qtn_dun_max_number "Maximum number of dialup-connections. Dial-up failed." diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/src/DunChanMan.cpp --- a/localconnectivityservice/dun/utils/src/DunChanMan.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,577 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: RComm channel management related functionality (waiter) -* -*/ - - -#include "DunSignalWaiter.h" -#include "DunDataWaiter.h" -#include "DunUpstream.h" -#include "DunDownstream.h" -#include "DunSignalCopy.h" -#include "DunChanMan.h" -#include "DunUtils.h" -#include "DunDebug.h" -#include "DunPlugin.h" - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunChanMan* CDunChanMan::NewL( CDunTransporter& aParent, - MDunTransporterUtility* aUtility, - MDunTransporterUtilityAux* aUtilityAux, - MDunPluginManager* aPluginManager ) - { - CDunChanMan* self = new (ELeave) CDunChanMan( aParent, - aUtility, - aUtilityAux, - aPluginManager ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunChanMan::~CDunChanMan() - { - FTRACE(FPrint( _L("CDunChanMan::~CDunChanMan()") )); - ResetData(); - FTRACE(FPrint( _L("CDunChanMan::~CDunChanMan() complete") )); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunChanMan::ResetData() - { - FTRACE(FPrint( _L("CDunChanMan::ResetData()") )); - // APIs affecting this: - // AddConnWaiterL() - // IssueConnWaiterRequest() - TInt i; - TInt count = iWaiterData.Count(); - for ( i=0; iSetMedia( aComm ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunChanMan::AddConnWaiterL() (ERROR) complete" ))); - User::Leave( retTemp ); - } - CDunDataWaiter* dataWaiter = CDunDataWaiter::NewL( this ); - CleanupStack::PushL( dataWaiter ); - retTemp = dataWaiter->SetMedia( aComm ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunChanMan::AddConnWaiterL() (ERROR) complete" ))); - User::Leave( retTemp ); - } - TDunWaiterData waiterData; - waiterData.iComm = aComm; - waiterData.iChannelName = HBufC8::NewMaxL( aName.Length() ); - TPtr8 chanNamePtr = waiterData.iChannelName->Des(); - chanNamePtr.Copy( aName ); - waiterData.iSignalWaiter = signalWaiter; - waiterData.iDataWaiter = dataWaiter; - waiterData.iCorrection = aCorrection; - waiterData.iEnqueuedFail = aEnqueuedFail; - waiterData.iOwnerUid = aOwnerUid; - iWaiterData.AppendL( waiterData ); - CleanupStack::Pop( dataWaiter ); - CleanupStack::Pop( signalWaiter ); - FTRACE(FPrint( _L("CDunChanMan::AddConnWaiterL() complete" ))); - } - -// --------------------------------------------------------------------------- -// Removes existing waiter from connection waiter array -// --------------------------------------------------------------------------- -// -TInt CDunChanMan::RemoveConnWaiter( RComm* aComm ) - { - FTRACE(FPrint( _L("CDunChanMan::RemoveConnWaiter()" ))); - TInt i; - for ( i=iWaiterData.Count()-1; i>=0; i-- ) - { - TDunWaiterData& waiterData = iWaiterData[i]; - if ( waiterData.iComm == aComm ) - { - DeleteWaiters( i ); - iWaiterData.Remove( i ); - FTRACE(FPrint( _L("CDunChanMan::RemoveConnWaiter() complete" ))); - return KErrNone; - } - } - FTRACE(FPrint( _L("CDunChanMan::RemoveConnWaiter() (not found) complete" ))); - return KErrNotFound; - } - -// --------------------------------------------------------------------------- -// Makes CDunConnWaiter ready to detect new data -// --------------------------------------------------------------------------- -// -TInt CDunChanMan::IssueConnWaiterRequest( RComm* aComm ) - { - FTRACE(FPrint( _L("CDunChanMan::IssueConnWaiterRequest()" ))); - TInt i; - TInt count = iWaiterData.Count(); - for ( i=0; iIssueRequest(); - waiterData.iDataWaiter->IssueRequest(); - FTRACE(FPrint( _L("CDunChanMan::IssueConnWaiterRequest() complete" ))); - return KErrNone; - } - } - FTRACE(FPrint( _L("CDunChanMan::IssueConnWaiterRequest() (not found) complete" ))); - return KErrNotFound; - } - -// --------------------------------------------------------------------------- -// Stops CDunConnWaiter to detect new data -// --------------------------------------------------------------------------- -// -TInt CDunChanMan::StopConnWaiter( RComm* aComm ) - { - FTRACE(FPrint( _L("CDunChanMan::StopConnWaiter()" ))); - TInt i; - TInt count = iWaiterData.Count(); - for ( i=0; iStop(); - waiterData.iDataWaiter->Stop(); - FTRACE(FPrint( _L("CDunChanMan::StopConnWaiter() complete" ))); - return KErrNone; - } - } - FTRACE(FPrint( _L("CDunChanMan::StopConnWaiter() (not found) complete" ))); - return KErrNotFound; - } - -// --------------------------------------------------------------------------- -// Saves waiter's connection monitor callback data -// --------------------------------------------------------------------------- -// -TInt CDunChanMan::SaveWaiterConnMonCallbackL( RComm* aComm, - MDunConnMon* aCallback, - TDunDirection aDirection ) - { - FTRACE(FPrint( _L("CDunChanMan::SaveWaiterConnMonCallbackL()" ))); - TInt i; - TInt count = iWaiterData.Count(); - for ( i=0; i add to object - // Add signal waiter's callback (for RunL error monitoring) - if ( !waiterData.iSignalWaiter ) - { - FTRACE(FPrint( _L("CDunTransUtils::SaveWaiterConnMonCallbackL() (ERROR) complete" ))); - return KErrGeneral; - } - waiterData.iSignalWaiter->AddCallback( aCallback ); - // Add data waiter's callback (for RunL error monitoring) - if ( !waiterData.iDataWaiter ) - { - FTRACE(FPrint( _L("CDunTransUtils::SaveWaiterConnMonCallbackL() (ERROR) complete" ))); - return KErrGeneral; - } - waiterData.iDataWaiter->AddCallback( aCallback ); - // Now just store information for R/W case - waiterData.iConnMons.AppendL( connMon ); - FTRACE(FPrint( _L("CDunChanMan::SaveWaiterConnMonCallbackL() complete" ))); - return KErrNone; - } - else if ( aDirection==EDunWriterUpstream || - aDirection==EDunReaderDownstream ) - { - // Network -> just store information for R/W case - waiterData.iConnMons.AppendL( connMon ); - FTRACE(FPrint( _L("CDunChanMan::SaveWaiterConnMonCallbackL() complete" ))); - return KErrNone; - } - else - { - FTRACE(FPrint( _L("CDunTransUtils::SaveWaiterConnMonCallbackL() (ERROR) complete" ))); - return KErrGeneral; - } - } - FTRACE(FPrint( _L("CDunChanMan::SaveWaiterConnMonCallbackL() (not found) complete" ))); - return KErrNotFound; - } - -// --------------------------------------------------------------------------- -// Saves waiter's skipped error data -// --------------------------------------------------------------------------- -// -TInt CDunChanMan::SaveWaiterSkippedErrorL( TInt aError, - RComm* aComm, - TDunDirection aDirection ) - { - FTRACE(FPrint( _L("CDunChanMan::SaveWaiterSkippedErrorL()" ))); - TInt i; - TInt count = iWaiterData.Count(); - for ( i=0; iSubSessionHandle() ) - { - FTRACE(FPrint( _L("CDunChanMan::NotifyNewChannelRequest() (RComm) (bad handle) complete" ) )); - return KErrBadHandle; - } - // Get plugin UID for connection ID - TInt i; - TUid foundUid = TUid::Null(); - TInt count = iWaiterData.Count(); - for ( i=0; i= count ) - { - FTRACE(FPrint( _L("CDunChanMan::NotifyNewChannelRequest() (RComm) (not found) complete" ))); - return KErrNotFound; - } - TDunWaiterData& waiterData = iWaiterData[i]; - // Try to stop if either one of the waiters are still runnig - waiterData.iSignalWaiter->Stop(); - waiterData.iDataWaiter->Stop(); - // enqueued will be omitted (not needed to set to RComm) - TInt firstFree = iUtility->InitializeFirstFreeChannel( aComm ); - if ( firstFree < 0 ) - { - FTRACE(FPrint( _L("CDunChanMan::NotifyNewChannelRequest() (RComm) (firstfree failed!) complete" ) )); - return firstFree; - } - if ( firstFree >= iParent.iChannelData.Count() ) - { - FTRACE(FPrint( _L("CDunChanMan::NotifyNewChannelRequest() (RComm) (firstfree failed!) complete" ))); - return KErrGeneral; - } - TInt bufferLength = KErrNotFound; - MDunBufferCorrection* correction = waiterData.iCorrection; - TRAPD( retTrap, - iUtility->DoAllocateChannelL(aComm, bufferLength, firstFree, correction) ); - if ( retTrap != KErrNone ) - { - FTRACE(FPrint( _L("CDunChanMan::NotifyNewChannelRequest() trapped!" ) )); - iParent.UnInitializeOnDemand(); // remove unused initialized channel - if ( retTrap == KErrTooBig ) - { - if ( waiterData.iEnqueuedFail ) - { - // Inform plugin enqueue request - iPluginManager->NotifyPluginEnqueueRequest( foundUid ); - } - FTRACE(FPrint( _L("CDunTransporter::AllocateChannel() (RSocket) complete" ))); - return KErrTooBig; - } - iPluginManager->NotifyPluginCloseRequest( foundUid, EFalse ); - FTRACE(FPrint( _L("CDunChanMan::NotifyNewChannelRequest() (ERROR) complete" ))); - return retTrap; - } - TInt retTemp = CDunUtils::SetRCommBufferLength( *aComm, bufferLength ); - if ( retTemp != KErrNone ) - { - iParent.UnInitializeOnDemand(); // remove unused initialized channel - iPluginManager->NotifyPluginCloseRequest( foundUid, EFalse ); - FTRACE(FPrint( _L("CDunChanMan::NotifyNewChannelRequest() (ERROR) complete" ))); - } - // Next find aComm from iWaiterData and copy its contents to channel data - retTemp = FillNewWaiterChannelData( aComm, firstFree ); - if ( retTemp != KErrNone ) - { - iParent.UnInitializeOnDemand(); // remove unused initialized channel - iPluginManager->NotifyPluginCloseRequest( foundUid, EFalse ); - FTRACE(FPrint( _L("CDunChanMan::NotifyNewChannelRequest() (RComm) (not found) complete" ))); - } - FTRACE(FPrint( _L("CDunChanMan::NotifyNewChannelRequest() (RComm) complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Fills data for channel created by waiter -// --------------------------------------------------------------------------- -// -TInt CDunChanMan::FillNewWaiterChannelData( RComm* aComm, - TInt aFirstFree ) - { - FTRACE(FPrint( _L("CDunChanMan::FillNewWaiterChannelData()" ))); - TInt i; - TInt count = iWaiterData.Count(); - for ( i=0; i= count || - aFirstFree < 0 || - aFirstFree >= iParent.iChannelData.Count() ) - { - FTRACE(FPrint( _L("CDunChanMan::FillNewWaiterChannelData() (not found) complete" ))); - return KErrNotFound; - } - TUid thisUid = iWaiterData[i].iOwnerUid; // pick up before remove - TDunChannelData& channelData = iParent.iChannelData[aFirstFree]; - TDunWaiterData& waiterData = iWaiterData[i]; - channelData.iComm = waiterData.iComm; - channelData.iChannelName = waiterData.iChannelName; - channelData.iUpstreamRW->SetMedia( aComm, EDunMediaContextLocal ); - channelData.iDownstreamRW->SetMedia( aComm, EDunMediaContextLocal ); - channelData.iOwnerUid = thisUid; - // Channel now occupied - channelData.iChannelInUse = ETrue; - // Restore data from waiter to transfer objects - RestoreWaiterData( i, aFirstFree ); - // Now delete waiters before request issuing - DeleteWaiters( i, ETrue ); - iWaiterData.Remove( i ); - // Issue transfer requests - iUtility->DoIssueTransferRequests( aFirstFree ); - // Clear the queue, just to be sure - iPluginManager->NotifyPluginDequeueRequest( thisUid ); - FTRACE(FPrint( _L("CDunChanMan::FillNewWaiterChannelData() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Restores saved waiter data to connection data -// --------------------------------------------------------------------------- -// -TInt CDunChanMan::RestoreWaiterData( TInt aWaiterIndex, - TInt aChannelIndex ) - { - FTRACE(FPrint( _L("CDunChanMan::RestoreWaiterData()" ))); - if ( aWaiterIndex < 0 || - aWaiterIndex >= iWaiterData.Count() || - aChannelIndex < 0 || - aChannelIndex >= iParent.iChannelData.Count() ) - { - FTRACE(FPrint( _L("CDunChanMan::RestoreWaiterData() (not found) complete" ))); - return KErrNotFound; - } - TInt i; - TInt count = iWaiterData[aWaiterIndex].iConnMons.Count(); - for ( i=0; iDoAddConnMonCallback( aChannelIndex, - connMon.iCallback, - connMon.iDirection, - NULL ); - } - count = iWaiterData[aWaiterIndex].iOkErrors.Count(); - for (i=0; iDoAddSkippedError( aChannelIndex, - skippedError.iError, - skippedError.iDirection ); - } - FTRACE(FPrint( _L("CDunChanMan::RestoreWaiterData() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Deletes waiter objects of aIndex:th waiters -// --------------------------------------------------------------------------- -// -TInt CDunChanMan::DeleteWaiters( TInt aIndex, TBool aNewOwnership ) - { - FTRACE(FPrint( _L("CDunChanMan::DeleteWaiters()" ))); - - if ( aIndex < 0 || - aIndex >= iWaiterData.Count() ) - { - FTRACE(FPrint( _L("CDunChanMan::DeleteWaiters() (not found) complete" ))); - return KErrNotFound; - } - - TDunWaiterData& waiterData = iWaiterData[aIndex]; - if ( !aNewOwnership ) - { - delete waiterData.iChannelName; - } - waiterData.iChannelName = NULL; - delete waiterData.iSignalWaiter; - waiterData.iSignalWaiter = NULL; - delete waiterData.iDataWaiter; - waiterData.iDataWaiter = NULL; - - waiterData.iConnMons.Close(); - waiterData.iOkErrors.Close(); - - FTRACE(FPrint( _L("CDunChanMan::DeleteWaiters() complete" ))); - return KErrNone; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/src/DunDataPusher.cpp --- a/localconnectivityservice/dun/utils/src/DunDataPusher.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,450 +0,0 @@ -/* -* Copyright (c) 2009-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: Pushes data to existing stream from outside -* -*/ - - -#include "DunDataPusher.h" -#include "DunDownstream.h" -#include "DunDebug.h" - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunDataPusher* CDunDataPusher::NewL( CDunDownstream& aParent, - MDunCompletionReporter* aStreamCallback ) - { - CDunDataPusher* self = new (ELeave) CDunDataPusher( aParent, - aStreamCallback ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunDataPusher::~CDunDataPusher() - { - FTRACE(FPrint( _L("CDunDataPusher::~CDunDataPusher()" ))); - ResetData(); - FTRACE(FPrint( _L("CDunDataPusher::~CDunDataPusher() complete" ))); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunDataPusher::ResetData() - { - // APIs affecting this: - // SendQueuedData() - Stop(); - // AddToEventQueue() - iEventQueue.Close(); - // Internal - Initialize(); - } - -// --------------------------------------------------------------------------- -// Sets media to be used for this endpoint -// --------------------------------------------------------------------------- -// -TInt CDunDataPusher::SetMedia( RComm* aComm ) - { - FTRACE(FPrint( _L("CDunDataPusher::SetMedia() (RComm)" ))); - if ( !aComm ) - { - FTRACE(FPrint( _L("CDunDataPusher::SetMedia() (RComm) (not initialized!) complete" ))); - return KErrGeneral; - } - iComm = aComm; - FTRACE(FPrint( _L("CDunDataPusher::SetMedia() (RComm) complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Sets media to be used for this endpoint -// --------------------------------------------------------------------------- -// -TInt CDunDataPusher::SetMedia( RSocket* aSocket ) - { - FTRACE(FPrint( _L("CDunDataPusher::SetMedia() (RSocket)" ))); - if ( !aSocket ) - { - FTRACE(FPrint( _L("CDunDataPusher::SetMedia() (RSocket) (not initialized!) complete" ))); - return KErrGeneral; - } - iSocket = aSocket; - FTRACE(FPrint( _L("CDunDataPusher::SetMedia() (RSocket) complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Adds event notification to queue -// --------------------------------------------------------------------------- -// -TInt CDunDataPusher::AddToEventQueue( const TDesC8* aDataToPush, - MDunCompletionReporter* aCallback ) - { - FTRACE(FPrint( _L("CDunDataPusher::AddToQueue()" ))); - if ( !aDataToPush || aDataToPush->Length()<0 ) - { - FTRACE(FPrint( _L("CDunDataPusher::AddToQueue() (unknown data) complete" ))); - return KErrGeneral; - } - // Check if identical pointer to data already exists - TInt foundIndex = FindEventFromQueue( aDataToPush ); - if ( foundIndex >= 0 ) - { - FTRACE(FPrint( _L("CDunDataPusher::AddToQueue() (already exists) complete" ))); - return KErrAlreadyExists; - } - // Unique pointer -> add to event queue - TDunDataPush dataPush; - dataPush.iDataToPush = aDataToPush; - dataPush.iCallback = aCallback; - TInt retTemp = iEventQueue.Append( dataPush ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunDataPusher::AddToQueue() (append failed!) complete" ))); - return retTemp; - } - FTRACE(FPrint( _L("CDunDataPusher::AddToQueue() complete (count=%d)" ), iEventQueue.Count() )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Finds an event from queue -// --------------------------------------------------------------------------- -// -TInt CDunDataPusher::FindEventFromQueue( const TDesC8* aDataToPush ) - { - FTRACE(FPrint( _L("CDunDataPusher::FindEventFromQueue()" ))); - TInt i; - TInt count = iEventQueue.Count(); - for ( i=0; i= 0 ) - { - if ( iEventIndex == foundIndex ) - { - Stop(); - } - FTRACE(FPrint( _L("CDunDataPusher::StopOneEvent() complete" ))); - return KErrNone; - } - FTRACE(FPrint( _L("CDunDataPusher::StopOneEvent() (not found) complete" ))); - return KErrNotFound; - } - -// --------------------------------------------------------------------------- -// Sends queued data in round robin -// --------------------------------------------------------------------------- -// -TBool CDunDataPusher::SendQueuedData() - { - FTRACE(FPrint( _L("CDunDataPusher::SendQueuedData()" ))); - if ( iPushState!=EDunStateIdle || iEventQueue.Count()==0 ) - { - FTRACE(FPrint( _L("CDunDataPusher::SendQueuedData() (not ready) complete" ))); - return EFalse; - } - TInt retTemp = ManageOneEvent(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunDataPusher::SendQueuedData() (ERROR) complete" ))); - return EFalse; - } - iPushState = EDunStateDataPushing; - FTRACE(FPrint( _L("CDunDataPusher::SendQueuedData() complete (%d)" ), iEventQueue.Count() )); - return ETrue; - } - -// --------------------------------------------------------------------------- -// Stops sending for write endpoint -// --------------------------------------------------------------------------- -// -TInt CDunDataPusher::Stop() - { - FTRACE(FPrint( _L("CDunDataPusher::Stop()" ))); - if ( iPushState != EDunStateDataPushing ) - { - FTRACE(FPrint( _L("CDunDataPusher::Stop() (not ready) complete" ))); - return KErrNotReady; - } - // As the EDunStateDataPushing can be on even with multiple requests, - // cancel the actual operation in DoCancel() - Cancel(); - iPushState = EDunStateIdle; - FTRACE(FPrint( _L("CDunDataPusher::Stop() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Stops sending for write endpoint and clears event queue -// --------------------------------------------------------------------------- -// -TInt CDunDataPusher::StopAndClearQueue() - { - FTRACE(FPrint( _L("CDunDataPusher::StopAndClearQueue()" ))); - TInt retVal = Stop(); - iEventQueue.Reset(); - iEventIndex = 0; - FTRACE(FPrint( _L("CDunDataPusher::StopAndClearQueue() complete" ))); - return retVal; - } - -// --------------------------------------------------------------------------- -// Signals completion status in round robin and clears event queue -// --------------------------------------------------------------------------- -// -TInt CDunDataPusher::SignalCompletionAndClearQueue() - { - FTRACE(FPrint( _L("CDunDataPusher::SignalCompletionAndClearQueue()" ))); - // First copy the event queue to temporary notitication queue and - // reset the real event queue before notifications. This is done because - // implementor of NotifyDataPushComplete() can call AddToEventQueue() - // (and KErrAlreadyExists will happen there) - TInt i; - TInt retTemp; - RPointerArray notify; - TInt count = iEventQueue.Count(); - for ( i=0; iNotifyDataPushComplete( EFalse ); - } - notify.Close(); - FTRACE(FPrint( _L("CDunDataPusher::SignalCompletionAndClearQueue() complete (%d)" ), count )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CDunDataPusher::CDunDataPusher -// --------------------------------------------------------------------------- -// -CDunDataPusher::CDunDataPusher( CDunDownstream& aParent, - MDunCompletionReporter* aStreamCallback ) : - CActive( EPriorityHigh ), - iParent( aParent ), - iStreamCallback( aStreamCallback ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunDataPusher::ConstructL -// --------------------------------------------------------------------------- -// -void CDunDataPusher::ConstructL() - { - FTRACE(FPrint( _L("CDunDataPusher::ConstructL()" ))); - if ( !iStreamCallback ) - { - User::Leave( KErrGeneral ); - } - CActiveScheduler::Add( this ); - FTRACE(FPrint( _L("CDunDataPusher::ConstructL() complete" ))); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunDataPusher::Initialize() - { - // Don't initialize iUtility here (it is set through NewL) - // Don't initialize iStreamCallback here (it is set through NewL) - iPushState = EDunStateIdle; - iEventIndex = 0; - iSocket = NULL; - iComm = NULL; - } - -// --------------------------------------------------------------------------- -// Manages one event's data push -// --------------------------------------------------------------------------- -// -TInt CDunDataPusher::ManageOneEvent() - { - FTRACE(FPrint( _L("CDunDataPusher::ManageOneEvent()" ))); - if ( IsActive() ) - { - FTRACE(FPrint( _L("CDunDataPusher::ManageOneEvent() (not ready) complete" ))); - return KErrNotReady; - } - if ( iEventIndex < 0 || - iEventIndex >= iEventQueue.Count() ) - { - FTRACE(FPrint( _L("CDunDataPusher::ManageOneEvent() (buffer mismatch) complete" ))); - return KErrGeneral; - } - const TDesC8* dataToPush = iEventQueue[iEventIndex].iDataToPush; - if ( iComm ) - { - iStatus = KRequestPending; - iComm->Write( iStatus, *dataToPush ); - FTRACE(FPrint( _L("CDunDataPusher::ManageOneEvent() RComm Write() requested (buffer=0x%08X)" ), dataToPush )); - } - else if ( iSocket ) - { - iStatus = KRequestPending; - iSocket->Send( *dataToPush, 0, iStatus ); - FTRACE(FPrint( _L("CDunDataPusher::ManageOneEvent() RSocket Send() requested (buffer=0x%08X)" ), dataToPush )); - } - else - { - FTRACE(FPrint( _L("CDunDataPusher::ManageOneEvent() (ERROR) complete" ))); - return KErrGeneral; - } - SetActive(); - FTRACE(FPrint( _L("CDunDataPusher::ManageOneEvent() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Check whether an error code is severe error or not -// --------------------------------------------------------------------------- -// -TInt CDunDataPusher::ProcessErrorCondition( TInt aError, TBool& aIsError ) - { - FTRACE(FPrint( _L("CDunDataPusher::ProcessErrorCondition() (Dir=%d)" ), EDunWriterDownstream)); - aIsError = EFalse; - if ( aError != KErrNone ) - { - aIsError = ETrue; - TInt retTemp = iParent.iOkErrorsW.Find( aError ); - if ( retTemp == KErrNotFound ) - { - FTRACE(FPrint( _L("CDunDataPusher::ProcessErrorCondition() (Dir=%d) (%d=ETrue) complete" ), EDunWriterDownstream, aError)); - return ETrue; - } - } - FTRACE(FPrint( _L("CDunDataPusher::ProcessErrorCondition() (Dir=%d) (%d=EFalse) complete" ), EDunWriterDownstream, aError)); - return EFalse; - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called when endpoint data write complete -// --------------------------------------------------------------------------- -// -void CDunDataPusher::RunL() - { - FTRACE(FPrint( _L("CDunDataPusher::RunL() (buffer=0x%08X)" ), iEventQueue[iEventIndex].iDataToPush )); - - TBool isError; - TInt retTemp = iStatus.Int(); - TInt stop = ProcessErrorCondition( retTemp, isError ); - - if ( !stop ) // no real error detected -> continue - { - if ( !isError ) - { - iEventIndex++; - } - if ( iEventIndex < iEventQueue.Count() ) - { - // More to serve so start again - ManageOneEvent(); - } - else - { - // Last was served so stop processing and notify - iPushState = EDunStateIdle; - iStreamCallback->NotifyDataPushComplete( ETrue ); - } - } // if ( !stop ) - else // stop -> tear down connection - { - TDunConnectionReason connReason; - connReason.iReasonType = EDunReasonTypeRW; - connReason.iContext = EDunMediaContextLocal; - connReason.iSignalType = 0; - connReason.iSignalHigh = EFalse; - connReason.iDirection = EDunWriterDownstream; - connReason.iErrorCode = retTemp; - iParent.iUtility->DoNotifyConnectionNotOk( iComm, - iSocket, - connReason, - iParent.iCallbacksW ); - } // else - - FTRACE(FPrint( _L("CDunDataPusher::RunL() complete" ))); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called on cancel -// --------------------------------------------------------------------------- -// -void CDunDataPusher::DoCancel() - { - FTRACE(FPrint( _L("CDunDataPusher::DoCancel()" ))); - if ( iComm ) - { - iComm->WriteCancel(); - FTRACE(FPrint( _L("CDunDataPusher::DoCancel() (RComm) cancelled" ))); - } - else if ( iSocket ) - { - iSocket->CancelWrite(); - FTRACE(FPrint( _L("CDunDataPusher::DoCancel() (RSocket) cancelled" ))); - } - FTRACE(FPrint( _L("CDunDataPusher::DoCancel() complete" ))); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/src/DunDataWaiter.cpp --- a/localconnectivityservice/dun/utils/src/DunDataWaiter.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,253 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Monitors for new data in RComm local media side -* -*/ - - -#include "DunTransporter.h" -#include "DunDataWaiter.h" -#include "DunSignalCopy.h" -#include "DunDebug.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunDataWaiter* CDunDataWaiter::NewL( MDunChannelAllocator* aChannelCallback ) - { - CDunDataWaiter* self = new (ELeave) CDunDataWaiter( aChannelCallback ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunDataWaiter::~CDunDataWaiter() - { - FTRACE(FPrint( _L("CDunDataWaiter::~CDunDataWaiter()") )); - ResetData(); - FTRACE(FPrint( _L("CDunDataWaiter::~CDunDataWaiter() complete") )); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunDataWaiter::ResetData() - { - FTRACE(FPrint( _L("CDunDataWaiter::ResetData()") )); - Stop(); - // APIs affecting this: - // AddConnMonCallbackL() - iCallbacks.Close(); - // Internal - Initialize(); - FTRACE(FPrint( _L("CDunDataWaiter::ResetData() complete") )); - } - -// --------------------------------------------------------------------------- -// Adds callback for RunL error controlling -// The callback will be called when error is detected in asynchronous -// operation -// --------------------------------------------------------------------------- -// -TInt CDunDataWaiter::AddCallback( MDunConnMon* aCallback ) - { - FTRACE(FPrint( _L("CDunDataWaiter::AddCallback()" ) )); - if ( !aCallback ) - { - FTRACE(FPrint( _L("CDunDataWaiter::AddCallback() (ERROR) complete" ) )); - return KErrGeneral; - } - TInt retTemp = iCallbacks.Find( aCallback ); - if ( retTemp != KErrNotFound ) - { - FTRACE(FPrint( _L("CDunDataWaiter::AddCallback() (already exists) complete" ) )); - return KErrAlreadyExists; - } - retTemp = iCallbacks.Append( aCallback ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunDataWaiter::AddCallback() (append failed!) complete" ) )); - return retTemp; - } - FTRACE(FPrint( _L("CDunDataWaiter::AddCallback() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Sets media to use for this endpoint -// --------------------------------------------------------------------------- -// -TInt CDunDataWaiter::SetMedia( RComm* aComm ) - { - FTRACE(FPrint( _L("CDunDataWaiter::SetMedia(RComm) (addr=0x%08X)" ), aComm)); - if ( !aComm ) - { - FTRACE(FPrint( _L("CDunDataWaiter::SetMedia() (aComm) not initialized!" ))); - return KErrGeneral; - } - TCommCaps2 caps; - aComm->Caps( caps ); - if ( !(caps().iNotificationCaps & KNotifyDataAvailableSupported) ) - { - FTRACE(FPrint( _L("CDunDataWaiter::SetMedia() (RComm) (not supported) complete" ))); - return KErrNotSupported; - } - iComm = aComm; - FTRACE(FPrint( _L("CDunDataWaiter::SetMedia() (RComm) complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Issues request to start waiting for new data in RComm -// --------------------------------------------------------------------------- -// -TInt CDunDataWaiter::IssueRequest() - { - FTRACE(FPrint( _L("CDunDataWaiter::IssueRequest()" ))); - if ( iDataWaiterState != EDunStateIdle ) - { - FTRACE(FPrint( _L("CDunDataWaiter::IssueRequest() (not ready) complete" ))); - return KErrNotReady; - } - if ( !iComm ) - { - FTRACE(FPrint( _L("CDunDataWaiter::IssueRequest() (iComm) not initialized!" ) )); - return KErrGeneral; - } - iStatus = KRequestPending; - iComm->ResetBuffers(); - iComm->NotifyDataAvailable( iStatus ); - SetActive(); - iDataWaiterState = EDunStateDataWaiting; - FTRACE(FPrint( _L("CDunDataWaiter::IssueRequest() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Stops monitoring for new data -// --------------------------------------------------------------------------- -// -TInt CDunDataWaiter::Stop() - { - FTRACE(FPrint( _L("CDunDataWaiter::Stop()" ))); - if ( iDataWaiterState != EDunStateDataWaiting ) - { - FTRACE(FPrint( _L("CDunDataWaiter::Stop() (not ready) complete" ))); - return KErrNotReady; - } - if ( !iComm ) - { - FTRACE(FPrint( _L("CDunDataWaiter::Stop() (iComm) not initialized!" ))); - return KErrGeneral; - } - iComm->NotifyDataAvailableCancel(); - Cancel(); - iDataWaiterState = EDunStateIdle; - FTRACE(FPrint( _L("CDunDataWaiter::Stop() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CDunDataWaiter::CDunDataWaiter -// --------------------------------------------------------------------------- -// -CDunDataWaiter::CDunDataWaiter( MDunChannelAllocator* aChannelCallback ) : - CActive( EPriorityHigh ), - iChannelCallback( aChannelCallback ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunDataWaiter::ConstructL -// --------------------------------------------------------------------------- -// -void CDunDataWaiter::ConstructL() - { - FTRACE(FPrint( _L("CDunDataWaiter::ConstructL()" ) )); - if ( !iChannelCallback ) - { - User::Leave( KErrGeneral ); - } - CActiveScheduler::Add( this ); - FTRACE(FPrint( _L("CDunDataWaiter::ConstructL() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunDataWaiter::Initialize() - { - FTRACE(FPrint( _L("CDunDataWaiter::Initialize()" ) )); - // Don't initialize iChannelCallback here (it is set through NewL) - iDataWaiterState = EDunStateIdle; - iComm = NULL; - FTRACE(FPrint( _L("CDunDataWaiter::Initialize() complete" ) )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called when new data in RComm object -// --------------------------------------------------------------------------- -// -void CDunDataWaiter::RunL() - { - FTRACE(FPrint( _L("CDunDataWaiter::RunL()" ) )); - iDataWaiterState = EDunStateIdle; - TInt retTemp = iStatus.Int(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunDataWaiter::RunL() (failed) complete (%d)"), retTemp)); - TInt count = iCallbacks.Count(); - TDunConnectionReason connReason; - connReason.iReasonType = EDunReasonTypeRunL; - connReason.iContext = EDunMediaContextLocal; - connReason.iSignalType = 0; - connReason.iSignalHigh = EFalse; - connReason.iDirection = EDunDirectionUndefined; - connReason.iErrorCode = retTemp; - for ( TInt i=0; iNotifyProgressChangeL( iComm, connReason ) ); - } - return; - } - if ( iChannelCallback ) - { - iChannelCallback->NotifyNewChannelRequest( iComm ); - } - // Don't check other iMediaInUse values here - // They can't be other than EDunMediaRComm (checked in IssueRequest()) - FTRACE(FPrint( _L("CDunDataWaiter::RunL() complete" ) )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called on cancel -// --------------------------------------------------------------------------- -// -void CDunDataWaiter::DoCancel() - { - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/src/DunDownstream.cpp --- a/localconnectivityservice/dun/utils/src/DunDownstream.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,468 +0,0 @@ -/* -* Copyright (c) 2009-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: Definitions needed for one "stream" of CDunTransporter -* -*/ - - -/* - * TODO: When local media is of type RComm, listening on it is started with - * RComm::NotifyDataAvailable() call. Check that USB ACM port and Irda RCOMM - * (and any other new media in the future) behaves correctly so that when - * RComm::ReadOneOrMore() is issued, the read is issued immediately without - * checking for new data. If waiting for new data happens in this - * NotifyDataAvailable/ReadOneOrMore combination, raise a defect to Symbian. - */ - -#include "DunTransporter.h" -#include "DunDownstream.h" -#include "DunUpstream.h" -#include "DunDebug.h" - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunDownstream* CDunDownstream::NewL( MDunTransporterUtilityAux* aUtility ) - { - CDunDownstream* self = new (ELeave) CDunDownstream( aUtility ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunDownstream::~CDunDownstream() - { - FTRACE(FPrint( _L("CDunDownstream::~CDunDownstream()" ))); - ResetData(); - FTRACE(FPrint( _L("CDunDownstream::~CDunDownstream() complete" ))); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunDownstream::ResetData() - { - // APIs affecting this: - // IssueRequest() - Stop(); - // InitializeForDataPushing() - delete iPushData.iDataPusher; - iPushData.iDataPusher = NULL; - // AddConnMonCallbackL() - iCallbacksR.Close(); - iCallbacksW.Close(); - // AddSkippedErrorL() - iOkErrorsR.Close(); - iOkErrorsW.Close(); - // Internal - Initialize(); - } - -// --------------------------------------------------------------------------- -// Initializes this stream for AT command notifications -// --------------------------------------------------------------------------- -// -TInt CDunDownstream::InitializeForDataPushing( - MDunAtCmdHandler* aAtCmdHandler ) - { - FTRACE(FPrint( _L("CDunDownstream::InitializeForDataPushing()" ) )); - if ( iPushData.iDataPusher || iPushData.iAtCmdHandler ) // optional - { - FTRACE(FPrint( _L("CDunDownstream::InitializeForDataPushing() (already exists) complete" ) )); - return KErrAlreadyExists; - } - if ( !aAtCmdHandler ) - { - FTRACE(FPrint( _L("CDunDownstream::InitializeForDataPushing() (aAtCmdHandler) not initialized!" ) )); - return KErrGeneral; - } - CDunDataPusher* dataPusher = NULL; - TRAPD( retTrap, dataPusher = CDunDataPusher::NewL(*this,this) ); - if ( retTrap != KErrNone ) - { - FTRACE(FPrint( _L("CDunDownstream::InitializeForDataPushing() (trapped!) complete" ) )); - return retTrap; - } - if ( iComm ) - { - dataPusher->SetMedia( iComm ); - } - else if ( iSocket ) - { - dataPusher->SetMedia( iSocket ); - } - iPushData.iDataPusher = dataPusher; - iPushData.iAtCmdHandler = aAtCmdHandler; - FTRACE(FPrint( _L("CDunDownstream::InitializeForDataPushing() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Checks if data is in queue -// --------------------------------------------------------------------------- -// -TBool CDunDownstream::IsDataInQueue( const TDesC8* aDataToPush ) - { - FTRACE(FPrint( _L("CDunDownstream::IsDataInQueue()" ) )); - if ( !iPushData.iDataPusher ) - { - FTRACE(FPrint( _L("CDunDownstream::IsDataInQueue() (iPushData.iDataPusher not initialized!) complete" ))); - return EFalse; - } - TInt foundIndex = iPushData.iDataPusher->FindEventFromQueue( aDataToPush ); - FTRACE(FPrint( _L("CDunDownstream::IsDataInQueue() complete" ) )); - return ( foundIndex >= 0 ) ? ETrue : EFalse; - } - -// --------------------------------------------------------------------------- -// Adds data to event queue and starts sending if needed -// --------------------------------------------------------------------------- -// -TInt CDunDownstream::AddToQueueAndSend( const TDesC8* aDataToPush, - MDunCompletionReporter* aCallback ) - { - FTRACE(FPrint( _L("CDunDownstream::AddToQueueAndSend()" ) )); - if ( !iPushData.iDataPusher ) - { - FTRACE(FPrint( _L("CDunDownstream::AddToQueueAndSend() (iPushData.iDataPusher not initialized!) complete" ))); - return KErrGeneral; - } - // Add to event queue. If something went wrong, just return - TInt retTemp = iPushData.iDataPusher->AddToEventQueue( aDataToPush, aCallback ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunDownstream::AddToQueueAndSend() (ERROR) complete" ))); - return retTemp; - } - // Now push the data. If already active, push will start later, if not - // active it will start immediately. - iPushData.iDataPusher->SendQueuedData(); - FTRACE(FPrint( _L("CDunDownstream::AddToQueueAndSend() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Starts downstream by issuing read request -// --------------------------------------------------------------------------- -// -TInt CDunDownstream::StartStream() - { - FTRACE(FPrint( _L("CDunDownstream::StartStream()" ) )); - FTRACE(FPrint( _L("CDunDownstream::StartStream() (buffer=0x%08X)" ), iBufferPtr )); - // Note: only start URC here. - // The downstream read request is started when command mode ends. - // This is done to make the data arrive in the correct order (reply vs. - // data) with "ATD" command. - TInt retVal = KErrNone; - if ( iPushData.iAtCmdHandler ) - { - retVal = iPushData.iAtCmdHandler->StartUrc(); - } - FTRACE(FPrint( _L("CDunDownstream::StartStream() complete" ) )); - return retVal; - } - -// --------------------------------------------------------------------------- -// Stops transfer for read or write endpoints -// --------------------------------------------------------------------------- -// -TInt CDunDownstream::Stop( TBool aStopMplex ) - { - FTRACE(FPrint( _L("CDunDownstream::Stop() (Dir=%d)" ), iDirection)); - if ( !iPushData.iDataPusher ) - { - FTRACE(FPrint( _L("CDunDownstream::Stop() (iPushData.iDatapusher not initialized!) complete" ))); - return KErrGeneral; - } - // Stop the downstream related AT command handling functionality - if ( aStopMplex ) // optional - { - if ( iPushData.iAtCmdHandler ) - { - iPushData.iAtCmdHandler->StopAtCmdHandling(); - } - // Stop the multiplexer separately - iPushData.iDataPusher->Stop(); - } - if ( iTransferState != EDunStateTransferring ) - { - FTRACE(FPrint( _L("CDunDownstream::Stop() (not ready) complete" ))); - return KErrNotReady; - } - // Stop only current operation - if ( iOperationType == EDunOperationTypeRead ) - { - if ( iNetwork ) - { - iNetwork->ReadCancel(); - Cancel(); - FTRACE(FPrint( _L("CDunDownstream::Stop() (Network) cancelled" ))); - } - } - else if ( iOperationType == EDunOperationTypeWrite ) - { - iPushData.iDataPusher->StopOneEvent( iBufferPtr ); - } - iTransferState = EDunStateIdle; - FTRACE(FPrint( _L("CDunDownstream::Stop() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CDunDownstream::CDunDownstream -// --------------------------------------------------------------------------- -// -CDunDownstream::CDunDownstream( MDunTransporterUtilityAux* aUtility ) : - iUtility( aUtility ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunDownstream::ConstructL -// --------------------------------------------------------------------------- -// -void CDunDownstream::ConstructL() - { - FTRACE(FPrint( _L("CDunDownstream::ConstructL()" ) )); - if ( !iUtility ) - { - User::Leave( KErrGeneral ); - } - FTRACE(FPrint( _L("CDunDownstream::ConstructL() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunDownstream::Initialize() - { - // Don't initialize iUtility here (it is set through NewL) - iPushData.iDataMode = EFalse; - iPushData.iDataPusher = NULL; - iPushData.iAtCmdHandler = NULL; - } - -// --------------------------------------------------------------------------- -// Issues transfer request for this stream -// --------------------------------------------------------------------------- -// -TInt CDunDownstream::IssueRequest() - { - // Set direction - iDirection = static_cast( EDunStreamTypeDownstream | iOperationType ); - - FTRACE(FPrint( _L("CDunDownstream::IssueRequest() (Dir=%d)" ), iDirection)); - if ( !iPushData.iDataPusher ) - { - FTRACE(FPrint( _L("CDunDownstream::IssueRequest() (iPushData.iDataPusher not initialized!) complete" ) )); - return KErrGeneral; - } - - if ( iTransferState != EDunStateIdle ) - { - FTRACE(FPrint( _L("CDunDownstream::IssueRequest() (not ready) complete" ) )); - return KErrNotReady; - } - - if ( iOperationType == EDunOperationTypeRead ) - { - iBufferPtr->SetLength( iBufferPtr->MaxLength() ); - FTRACE(FPrint( _L("CDunDownstream::IssueRequest() trying to read %d bytes... (Dir=%d)" ), iBufferPtr->Length(), iDirection)); - } - else // iOperationType == EDunOperationTypeWrite - { - FTRACE(FPrint( _L("CDunDownstream::IssueRequest() writing %d bytes... (Dir=%d)" ), iBufferPtr->Length(), iDirection)); - } - - switch ( iDirection ) - { - case EDunReaderDownstream: - iStatus = KRequestPending; - iNetwork->ReadOneOrMore( iStatus, *iBufferPtr ); - SetActive(); - FTRACE(FPrint( _L("CDunDownstream::IssueRequest() RComm ReadOneOrMore() requested" ) )); - break; - case EDunWriterDownstream: - AddToQueueAndSend( iBufferPtr, this ); - break; - default: - FTRACE(FPrint( _L("CDunDownstream::IssueRequest() (ERROR) complete" ) )); - return KErrGeneral; - } - - iTransferState = EDunStateTransferring; - - FTRACE(FPrint( _L("CDunDownstream::IssueRequest() (Dir=%d) complete" ), iDirection)); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called when endpoint data read complete -// --------------------------------------------------------------------------- -// -void CDunDownstream::RunL() - { - FTRACE(FPrint( _L("CDunDownstream::RunL() (Dir=%d)" ), iDirection)); - iTransferState = EDunStateIdle; - if ( iOperationType != EDunOperationTypeRead ) - { - FTRACE(FPrint( _L("CDunDownstream::RunL() (wrong operation type!) complete" ))); - return; - } - - TBool isError; - TInt retTemp = iStatus.Int(); - TInt stop = ProcessErrorCondition( retTemp, isError ); - - if ( !stop ) // no real error detected -> continue - { - if ( !isError ) - { - // Operation type was read so now set to write - iOperationType = EDunOperationTypeWrite; - } // if ( !isError ) - - IssueRequest(); - - } // if ( !stop ) - else // stop -> tear down connection - { - // Now CDunDataPusher notifies to write case so here we just notify the - // read case. - TDunConnectionReason connReason; - connReason.iReasonType = EDunReasonTypeRW; - connReason.iContext = GetMediaContext( EDunStreamTypeDownstream ); - connReason.iSignalType = 0; - connReason.iSignalHigh = EFalse; - connReason.iDirection = iDirection; - connReason.iErrorCode = retTemp; - iUtility->DoNotifyConnectionNotOk( iComm, - iSocket, - connReason, - iCallbacksR ); - FTRACE(FPrint( _L("CDunDownstream::RunL() stop" ))); - } // else - - FTRACE(FPrint( _L("CDunDownstream::RunL() complete" ))); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called on cancel -// --------------------------------------------------------------------------- -// -void CDunDownstream::DoCancel() - { - } - -// --------------------------------------------------------------------------- -// From class MDunStreamManipulator. -// Gets called when outside party wants to push data to the existing stream -// --------------------------------------------------------------------------- -// -TInt CDunDownstream::NotifyDataPushRequest( const TDesC8* aDataToPush, - MDunCompletionReporter* aCallback ) - { - FTRACE(FPrint( _L("CDunDownstream::NotifyDataPushRequest()" ))); - // If in data mode push the reply anyway as "CONNECT" or "NO CARRIER" - // reply could arrive before/after the command mode information itself. - TInt retVal = AddToQueueAndSend( aDataToPush, aCallback ); - FTRACE(FPrint( _L("CDunDownstream::NotifyDataPushRequest() complete" ))); - return retVal; - } - -// --------------------------------------------------------------------------- -// From class MDunCompletionReporter. -// Gets called when data push is complete -// --------------------------------------------------------------------------- -// -void CDunDownstream::NotifyDataPushComplete( TBool aAllPushed ) - { - FTRACE(FPrint( _L("CDunDownstream::NotifyDataPushComplete()" ))); - // Next just skip the notifications of atomic operations because also this - // class initiates the pushing of atomic data. - if ( !aAllPushed ) - { - FTRACE(FPrint( _L("CDunDownstream::NotifyDataPushComplete() (continue) complete" ))); - return; - } - iTransferState = EDunStateIdle; - iOperationType = EDunOperationTypeUndefined; - if ( !iPushData.iDataPusher ) - { - FTRACE(FPrint( _L("CDunDownstream::NotifyDataPushComplete() (iPushData.iDataPusher not initialized!) complete" ))); - return; - } - // Now the multiplexer might have pushed the contained data in this class - // or it might have pushed only the external data. If the pushed data - // contains this classes data then reissue request, otherwise just clear - // the queue. - TInt foundIndex = iPushData.iDataPusher->FindEventFromQueue( iBufferPtr ); - iPushData.iDataPusher->SignalCompletionAndClearQueue(); - FTRACE(FPrint( _L("CDunDownstream::NotifyDataPushComplete() (find event)" ))); - if ( foundIndex >= 0 ) - { - // Restart the reading from Dataport only if in data mode - FTRACE(FPrint( _L("CDunDownstream::NotifyDataPushComplete() (issue request)" ))); - if ( iPushData.iDataMode ) - { - iOperationType = EDunOperationTypeRead; - IssueRequest(); - } - } - FTRACE(FPrint( _L("CDunDownstream::NotifyDataPushComplete() complete" ))); - } - -// --------------------------------------------------------------------------- -// From class MDunCmdModeMonitor. -// Notifies about command mode start -// --------------------------------------------------------------------------- -// -void CDunDownstream::NotifyCommandModeStart() - { - FTRACE(FPrint( _L("CDunDownstream::NotifyCommandModeStart()" ))); - iPushData.iDataMode = EFalse; - // Now the data mode has ended. - // If read operation then cancel it. - if ( iOperationType == EDunOperationTypeRead ) - { - Stop( EFalse ); - } - FTRACE(FPrint( _L("CDunDownstream::NotifyCommandModeStart() complete" ))); - } - -// --------------------------------------------------------------------------- -// From class MDunCmdModeMonitor. -// Notifies about command mode end -// --------------------------------------------------------------------------- -// -void CDunDownstream::NotifyCommandModeEnd() - { - FTRACE(FPrint( _L("CDunDownstream::NotifyCommandModeEnd()" ))); - iPushData.iDataMode = ETrue; - // Command mode ends here so start reading from Dataport - iOperationType = EDunOperationTypeRead; - IssueRequest(); - FTRACE(FPrint( _L("CDunDownstream::NotifyCommandModeEnd() complete" ))); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/src/DunNetDataport.cpp --- a/localconnectivityservice/dun/utils/src/DunNetDataport.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,395 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: Dataport specific network resource accessor implementation -* -*/ - - -#include -#include "DunNetDataport.h" -#include "DunUtils.h" -#include "DunDebug.h" - -_LIT(DUN_GGP_DATAPORT_CSY_PORT, "::DUN"); -_LIT(DUN_GGP_DATAPORT_CSY, "DATAPORT"); - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunNetDataport* CDunNetDataport::NewL( TInt aNumOfMaxChannels ) - { - CDunNetDataport* self = new (ELeave) CDunNetDataport( aNumOfMaxChannels ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunNetDataport::~CDunNetDataport() - { - FTRACE(FPrint(_L( "CDunNetDataport::~CDunNetDataport()"))); - TInt i; - TInt count = iEntities.Count(); - for ( i=0; i MDunNetwork). -// Initializes network for Dataport -// Must be called before any other operation -// --------------------------------------------------------------------------- -// -void CDunNetDataport::InitializeL() - { - FTRACE(FPrint(_L( "CDunNetDataport::InitializeL()"))); - AllocatePhoneObjectsL(); - FTRACE(FPrint(_L( "CDunNetDataport::InitializeL() complete"))); - } - -// --------------------------------------------------------------------------- -// From class MDunNetDataport. -// Called when channel was created by transporter for Dataport -// Initializes network for channel creation -// --------------------------------------------------------------------------- -// -TInt CDunNetDataport::AllocateChannel( RComm*& aComm ) - { - FTRACE(FPrint(_L( "CDunNetDataport::AllocateChannel()"))); - TInt firstFree = InitializeFirstFreeEntity(); - if ( firstFree < 0 ) - { - FTRACE(FPrint(_L( "CDunNetDataport::AllocateChannel() (not found) complete"))); - return firstFree; - } - if ( firstFree >= iEntities.Count() ) - { - FTRACE(FPrint(_L( "CDunNetDataport::AllocateChannel() (firstfree failed!) complete"))); - return KErrGeneral; - } - TInt retTemp = iEntities[firstFree].iMobileCall.OpenNewCall( iMobileLine ); - if ( retTemp != KErrNone ) - { - RemoveEntity( firstFree ); // remove unused initialized channel - FTRACE(FPrint(_L( "CDunNetDataport::AllocateChannel() OpenNewCall FAILED %d" ), retTemp)); - return KErrGeneral; - } - retTemp = iEntities[firstFree].iMobileCall.Connect(); - if ( retTemp != KErrNone ) - { - RemoveEntity( firstFree ); // remove unused initialized channel - FTRACE(FPrint(_L( "CDunNetDataport::AllocateChannel() iEntities[%d]->iMobileCall.Connect FAILED %d" ), firstFree, retTemp)); - return KErrGeneral; - } - RCall::TCommPort portName; - portName.iPort.Copy( DUN_GGP_DATAPORT_CSY ); - portName.iPort.Append( DUN_GGP_DATAPORT_CSY_PORT ); - retTemp = iEntities[firstFree].iMobileCall.LoanDataPort( portName ); - if ( retTemp != KErrNone ) - { - RemoveEntity( firstFree ); // remove unused initialized channel - if ( retTemp == KErrEtelPortNotLoanedToClient ) - { - FTRACE(FPrint(_L( "CDunNetDataport::AllocateChannel() (too big) complete"))); - return KErrTooBig; - } - FTRACE(FPrint(_L( "CDunNetDataport::AllocateChannel() iEntities[%d]->iMobileCall.LoanDataPort FAILED %d" ), firstFree, retTemp)); - return KErrGeneral; - } - FTRACE(FPrint(_L( "CDunNetDataport::AllocateChannel() Created call object at index %d" ), firstFree)); - retTemp = iEntities[firstFree].iDataport.Open( iCommServer, - portName.iPort, - ECommExclusive, - ECommRoleDTE ); - if ( retTemp != KErrNone ) - { - RemoveEntity( firstFree ); // remove unused initialized channel - FTRACE(FPrint(_L( "CDunNetDataport::AllocateChannel() FAILED to open dataport %d"), retTemp)); - return KErrGeneral; - } - iEntities[firstFree].iDataport.ResetBuffers(); - iEntities[firstFree].iEntityInUse = ETrue; - aComm = &iEntities[firstFree].iDataport; - FTRACE(FPrint(_L( "CDunNetDataport::AllocateChannel() (iEntities[%d]->iDataport) opened"), firstFree)); - FTRACE(FPrint(_L( "CDunNetDataport::AllocateChannel() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunNetDataport. -// Called when channel was deleted/closed by transporter for Dataport -// Uninitializes network for channel deletion/close -// --------------------------------------------------------------------------- -// -TInt CDunNetDataport::FreeChannel( RComm* aComm ) - { - FTRACE(FPrint(_L( "CDunNetDataport::FreeChannel()"))); - TInt i; - TInt count = iEntities.Count(); - for ( i=0; i= count ) - { - FTRACE(FPrint(_L( "CDunNetDataport::FreeChannel() (not found) complete"))); - return KErrNotFound; - } - DeleteNetworkEntity( i, ETrue ); - FTRACE(FPrint(_L( "CDunNetDataport::FreeChannel() (iEntities[%d]->iDataport) freed"), i)); - FTRACE(FPrint(_L( "CDunNetDataport::FreeChannel() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunNetDataport. -// Gets index by network ID for Dataport -// --------------------------------------------------------------------------- -// -TInt CDunNetDataport::GetIndexById( RComm* aComm ) - { - FTRACE(FPrint(_L( "CDunNetDataport::GetIndexById()"))); - TInt i; - TInt count = iEntities.Count(); - for ( i=0; i=iNumOfMaxChannels ) - { - FTRACE(FPrint( _L("CDunNetDataport::InitializeFirstFreeEntity() (too big) complete" ))); - return KErrTooBig; - } - TDunDataportEntity emptyEntity; - emptyEntity.iEntityInUse = EFalse; - retTemp = iEntities.Append( emptyEntity ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunNetDataport::InitializeFirstFreeEntity() (append failed!) complete" ))); - return retTemp; - } - FTRACE(FPrint(_L( "CDunNetDataport::InitializeFirstFreeEntity() complete"))); - return i; - } - -// --------------------------------------------------------------------------- -// Remove network entity by index -// --------------------------------------------------------------------------- -// -TInt CDunNetDataport::RemoveEntity( TInt aIndex ) - { - FTRACE(FPrint(_L( "CDunNetDataport::RemoveEntity()"))); - if ( aIndex < 0 || - aIndex >= iEntities.Count() ) - { - FTRACE(FPrint(_L( "CDunNetDataport::RemoveEntity() (not found) complete"))); - return KErrNotFound; - } - DeleteNetworkEntity( aIndex, EFalse ); - FTRACE(FPrint(_L( "CDunNetDataport::RemoveEntity() complete"))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Deletes own internal data -// --------------------------------------------------------------------------- -// -void CDunNetDataport::DeleteNetwork() - { - FTRACE(FPrint(_L( "CDunNetDataport::DeleteNetwork()"))); - if ( iMobileLine.SubSessionHandle() ) - { - iMobileLine.Close(); - FTRACE(FPrint(_L( "CDunNetDataport::DeleteNetwork() mobile line closed"))); - } - if ( iMobilePhone.SubSessionHandle() ) - { - iMobilePhone.Close(); - FTRACE(FPrint(_L( "CDunNetDataport::DeleteNetwork() mobile phone closed"))); - } - if ( iTelServer.Handle() ) - { - iTelServer.UnloadPhoneModule( KMmTsyModuleName ); - FTRACE(FPrint(_L( "CDunNetDataport::DeleteNetwork() phone module unloaded"))); - iTelServer.Close(); - FTRACE(FPrint(_L( "CDunNetDataport::DeleteNetwork() phone module closed"))); - } - if ( iCommServer.Handle() ) - { - iCommServer.UnloadCommModule( DUN_GGP_DATAPORT_CSY ); - FTRACE(FPrint(_L( "CDunNetDataport::DeleteNetwork() comm module unloaded"))); - iCommServer.Close(); - FTRACE(FPrint(_L( "CDunNetDataport::DeleteNetwork() comm module closed"))); - } - iEntities.Close(); - FTRACE(FPrint(_L( "CDunNetDataport::DeleteNetwork() complete"))); - } - -// --------------------------------------------------------------------------- -// Deletes one network entity at index aIndex for Dataport -// --------------------------------------------------------------------------- -// -TInt CDunNetDataport::DeleteNetworkEntity( TInt aIndex, TBool aCheckFree ) - { - FTRACE(FPrint(_L( "CDunNetDataport::DeleteNetworkEntity()"))); - if ( aIndex < 0 || - aIndex >= iEntities.Count() ) - { - FTRACE(FPrint(_L( "CDunNetDataport::DeleteNetworkEntity() (not found) complete"), aIndex)); - return KErrGeneral; - } - TDunDataportEntity& entity = iEntities[aIndex]; - if ( (aCheckFree&&entity.iEntityInUse) || !aCheckFree ) - { - if ( entity.iDataport.SubSessionHandle() ) - { - // The next will set KSignalDTEOutputs down twice for RComm - // local media case because CDunSignalCopy clears them also which - // in turn causes plugin to free channel. But this probably won't - // cause any harm. - entity.iDataport.SetSignals( 0, KSignalDTEOutputs ); - FTRACE(FPrint(_L( "CDunNetDataport::DeleteNetworkEntity() RComm signals set"))); - entity.iDataport.Close(); - FTRACE(FPrint(_L( "CDunNetDataport::DeleteNetworkEntity() RComm closed"))); - } - if ( entity.iMobileCall.SubSessionHandle() ) - { - entity.iMobileCall.RecoverDataPort(); - FTRACE(FPrint(_L( "CDunNetDataport::DeleteNetworkEntity() Dataport recovered"))); - entity.iMobileCall.Close(); - FTRACE(FPrint(_L( "CDunNetDataport::DeleteNetworkEntity() Dataport closed"))); - } - entity.iEntityInUse = EFalse; - } - FTRACE(FPrint(_L( "CDunNetDataport::DeleteNetworkEntity() complete"))); - return KErrNone; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/src/DunNoteHandler.cpp --- a/localconnectivityservice/dun/utils/src/DunNoteHandler.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,248 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Manages note showing in UI -* -*/ - - -#include -#include -#include -#include -#include "DunNoteHandler.h" -#include "DunDebug.h" - -_LIT( KDunUtilsDriveSpec, "z:" ); -_LIT( KDunUtilsResourceFileName, "dunutils.rsc" ); - -const TInt KDunCoverEnumStart = (ECmdNone + 1); // start after ECmdNone -const TInt KDunPtr8toPtr16Divider = 2; // Divider for converting -const TInt KDunThreeItemsToPop = 3; - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunNoteHandler* CDunNoteHandler::NewL() - { - CDunNoteHandler* self = new (ELeave) CDunNoteHandler(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CDunNoteHandler::~CDunNoteHandler() - { - FTRACE(FPrint( _L("CDunNoteHandler::~CDunNoteHandler()") )); - ResetData(); - FTRACE(FPrint( _L("CDunNoteHandler::~CDunNoteHandler() complete") )); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunNoteHandler::ResetData() - { - FTRACE(FPrint( _L("CDunNoteHandler::ResetData()") )); - // APIs affecting this: - // IssueRequest() - Stop(); - delete iNote; - iNote = NULL; - // Internal - Initialize(); - FTRACE(FPrint( _L("CDunNoteHandler::ResetData() complete") )); - } - -// --------------------------------------------------------------------------- -// Issues request to start showing UI note -// --------------------------------------------------------------------------- -// -TInt CDunNoteHandler::IssueRequest() - { - FTRACE(FPrint( _L("CDunNoteHandler::IssueRequest()") )); - if ( iNoteState != EDunStateIdle ) - { - FTRACE(FPrint( _L("CDunNoteHandler::IssueRequest() (not ready) complete") )); - return KErrNotReady; - } - TRAPD( retTrap, DoIssueRequestL() ); - if ( retTrap != KErrNone ) - { - FTRACE(FPrint( _L("CDunNoteHandler::IssueRequest() (trapped!) complete (%d)"), retTrap)); - return retTrap; - } - SetActive(); - iNoteState = EDunStateUiNoting; - FTRACE(FPrint( _L("CDunNoteHandler::IssueRequest() complete") )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Stops showing UI note -// --------------------------------------------------------------------------- -// -TInt CDunNoteHandler::Stop() - { - FTRACE(FPrint( _L("CDunNoteHandler::Stop()") )); - if ( iNoteState != EDunStateUiNoting ) - { - FTRACE(FPrint( _L("CDunNoteHandler::Stop() (not ready) complete") )); - return KErrNotReady; - } - if ( !iNote ) - { - FTRACE(FPrint( _L("CDunNoteHandler::Stop() (iNote not initialized!) complete") )); - return KErrGeneral; - } - iNote->CancelConfirmationQuery(); - Cancel(); - iNoteState = EDunStateIdle; - FTRACE(FPrint( _L("CDunNoteHandler::Stop() complete") )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CDunNoteHandler::CDunNoteHandler -// --------------------------------------------------------------------------- -// -CDunNoteHandler::CDunNoteHandler() : - CActive( EPriorityStandard ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunNoteHandler::ConstructL -// --------------------------------------------------------------------------- -// -void CDunNoteHandler::ConstructL() - { - FTRACE(FPrint( _L("CDunNoteHandler::ConstructL()") )); - CActiveScheduler::Add( this ); - FTRACE(FPrint( _L("CDunNoteHandler::ConstructL() complete") )); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunNoteHandler::Initialize() - { - FTRACE(FPrint( _L("CDunNoteHandler::Initialize()" ) )); - iNote = NULL; - iNoteState = EDunStateIdle; - FTRACE(FPrint( _L("CDunNoteHandler::Initialize() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Issues request to start showing UI note -// --------------------------------------------------------------------------- -// -void CDunNoteHandler::DoIssueRequestL() - { - FTRACE(FPrint( _L("CDunNoteHandler::DoIssueRequestL()") )); - if ( iNote ) - { - FTRACE(FPrint( _L("CDunNoteHandler::DoIssueRequestL() (ERROR) complete") )); - User::Leave( KErrGeneral ); - } - HBufC16* unicodeString = NULL; - ReadResourceTextL( R_DUN_MAXIMUM_DIALUPS, unicodeString ); - CAknGlobalConfirmationQuery* note = CAknGlobalConfirmationQuery::NewLC(); - // Publish cover UI note data - CAknSDData* sdData = CAknSDData::NewL( KDunNoteCategory, - ECmdMaxNumber - KDunCoverEnumStart, - KNullDesC8 ); - note->SetSecondaryDisplayData( sdData ); // ownership transferred - // Start to show note - iStatus = KRequestPending; - note->ShowConfirmationQueryL( iStatus, - *unicodeString, - R_AVKON_SOFTKEYS_OK_EMPTY, - R_QGN_NOTE_ERROR_ANIM, - KNullDesC, - 0, - 0, - CAknQueryDialog::EErrorTone ); - CleanupStack::Pop( note ); - delete unicodeString; - iNote = note; - FTRACE(FPrint( _L("CDunNoteHandler::DoIssueRequestL() complete") )); - } - -// --------------------------------------------------------------------------- -// Reads resource string -// --------------------------------------------------------------------------- -// -void CDunNoteHandler::ReadResourceTextL( TInt aResourceId, HBufC16*& aUnicode ) - { - FTRACE(FPrint( _L("CDunNoteHandler::ReadNoteResourceL()") )); - // Connect to file server (for resource file reading) - RFs fileSession; - CleanupClosePushL( fileSession ); - User::LeaveIfError( fileSession.Connect() ); - // Create dunutils.rsc path and file name - TFileName fileName; - fileName = KDunUtilsDriveSpec; - fileName += KDC_RESOURCE_FILES_DIR; - fileName += KDunUtilsResourceFileName; - // Find nearest language file for resource - BaflUtils::NearestLanguageFile( fileSession, fileName ); - // Read note resource - RResourceFile resourceFile; - CleanupClosePushL( resourceFile ); - resourceFile.OpenL( fileSession, fileName ); - resourceFile.ConfirmSignatureL(); - HBufC8* readBuffer = resourceFile.AllocReadLC( aResourceId ); - // Convert read HBufC8 to HBufC16 - const TPtrC16 ptr16(reinterpret_cast - (readBuffer->Ptr()), - (readBuffer->Size() / KDunPtr8toPtr16Divider) ); - aUnicode = HBufC16::NewL( ptr16.Length() ); - *aUnicode = ptr16; - CleanupStack::PopAndDestroy( KDunThreeItemsToPop ); // readBuffer, resourceFile, fileSession - FTRACE(FPrint( _L("CDunNoteHandler::ReadNoteResourceL() complete") )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called when UI note dismissed -// --------------------------------------------------------------------------- -// -void CDunNoteHandler::RunL() - { - FTRACE(FPrint( _L("CDunNoteHandler::RunL()" ) )); - iNoteState = EDunStateIdle; - delete iNote; - iNote = NULL; - FTRACE(FPrint( _L("CDunNoteHandler::RunL() complete" ) )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called on cancel -// --------------------------------------------------------------------------- -// -void CDunNoteHandler::DoCancel() - { - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/src/DunSignalCopy.cpp --- a/localconnectivityservice/dun/utils/src/DunSignalCopy.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,475 +0,0 @@ -/* -* Copyright (c) 2008-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: Copies signals changes between network and local media -* -*/ - - -#ifdef PRJ_USE_NETWORK_STUBS -#include -#else -#include -#endif -#include "DunTransporter.h" -#include "DunSignalCopy.h" -#include "DunDebug.h" - -const TUint KDunSixLowestBitsMask = 0x3F; // Symbian magic - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunSignalCopy* CDunSignalCopy::NewL() - { - CDunSignalCopy* self = new (ELeave) CDunSignalCopy(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CDunSignalCopy::~CDunSignalCopy() - { - FTRACE(FPrint( _L("CDunSignalCopy::~CDunSignalCopy()") )); - ResetData(); - FTRACE(FPrint( _L("CDunSignalCopy::~CDunSignalCopy() complete") )); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunSignalCopy::ResetData() - { - FTRACE(FPrint( _L("CDunSignalCopy::ResetData()") )); - // APIs affecting this: - // IssueRequest() - Stop(); - // AddCallback() - iCallbacks.Close(); - // Internal - Initialize(); - FTRACE(FPrint( _L("CDunSignalCopy::ResetData() complete") )); - } - -// --------------------------------------------------------------------------- -// Adds callback for line status change controlling -// The callback will be called when RunL error is detected -// --------------------------------------------------------------------------- -// -TInt CDunSignalCopy::AddCallback( MDunConnMon* aCallback ) - { - FTRACE(FPrint( _L("CDunSignalCopy::AddCallback()" ) )); - if ( !aCallback ) - { - FTRACE(FPrint( _L("CDunSignalCopy::AddCallback() (aCallback) not initialized!" ) )); - return KErrGeneral; - } - TInt retTemp = iCallbacks.Find( aCallback ); - if ( retTemp != KErrNotFound ) - { - FTRACE(FPrint( _L("CDunSignalCopy::AddCallback() (already exists) complete" ) )); - return KErrAlreadyExists; - } - retTemp = iCallbacks.Append( aCallback ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunSignalCopy::AddCallback() (append failed!) complete" ) )); - return retTemp; - } - FTRACE(FPrint( _L("CDunSignalCopy::AddCallback() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Sets media to use for this endpoint monitor -// --------------------------------------------------------------------------- -// -TInt CDunSignalCopy::SetMedia( RComm* aComm, - RComm* aNetwork, - TDunStreamType aStreamType ) - { - FTRACE(FPrint( _L("CDunSignalCopy::SetMedia()" ))); - if ( !aNetwork ) - { - FTRACE(FPrint( _L("CDunSignalCopy::SetMedia() (aComm) not initialized!" ))); - return KErrGeneral; - } - RComm* comm = NULL; - if ( aStreamType == EDunStreamTypeUpstream ) - { - iContextInUse = EDunMediaContextLocal; - comm = aComm; - } - else if ( aStreamType == EDunStreamTypeDownstream ) - { - iContextInUse = EDunMediaContextNetwork; - comm = aNetwork; - } - else - { - FTRACE(FPrint( _L("CDunSignalCopy::SetMedia() (aStreamtype) not initialized!" ))); - return KErrGeneral; - } - // No possibility to do iUtility->GetLocalId() here as aComm is not yet - // in channel data; use aComm directly - TCommCaps2 caps; - comm->Caps( caps ); - if ( !(caps().iNotificationCaps & KNotifySignalsChangeSupported) ) - { - FTRACE(FPrint( _L("CDunSignalCopy::SetMedia() (RComm) (not supported) complete" ))); - return KErrNotSupported; - } - iComm = aComm; - iNetwork = aNetwork; - iStreamType = aStreamType; - FTRACE(FPrint( _L("CDunSignalCopy::SetMedia() (RComm) complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Issues request to start monitoring the endpoint for line status change -// --------------------------------------------------------------------------- -// -TInt CDunSignalCopy::IssueRequest() - { - FTRACE(FPrint( _L("CDunSignalCopy::IssueRequest()" ))); - if ( iSignalCopyState != EDunStateIdle ) - { - FTRACE(FPrint( _L("CDunSignalCopy::IssueRequest() (not ready) complete" ) )); - return KErrNotReady; - } - RComm* comm = NULL; - if ( iStreamType == EDunStreamTypeUpstream ) - { - iListenSignals = KSignalDCEInputs; - comm = iComm; - } - else if ( iStreamType == EDunStreamTypeDownstream ) - { - iListenSignals = KSignalDTEInputs; - comm = iNetwork; - } - else - { - FTRACE(FPrint( _L("CDunSignalCopy::IssueRequest() (ERROR) complete" ) )); - return KErrGeneral; - } - TUint currentSignals = comm->Signals( iListenSignals ); - TUint oldSignalsLow = iSignals & KDunSixLowestBitsMask; - TUint newSignalsLow = currentSignals & KDunSixLowestBitsMask; - TUint oldSignalsHigh = oldSignalsLow * KSignalChanged; - TUint newSignalsHigh = newSignalsLow * KSignalChanged; - FTRACE(FPrint( _L("CDunSignalCopy::IssueRequest() oldSignalsLow=0x%08X" ), oldSignalsLow )); - FTRACE(FPrint( _L("CDunSignalCopy::IssueRequest() newSignalsLow=0x%08X" ), newSignalsLow )); - FTRACE(FPrint( _L("CDunSignalCopy::IssueRequest() oldSignalsHigh=0x%08X" ), oldSignalsHigh )); - FTRACE(FPrint( _L("CDunSignalCopy::IssueRequest() newSignalsHigh=0x%08X" ), newSignalsHigh )); - if ( newSignalsLow != oldSignalsLow ) - { - FTRACE(FPrint( _L("CDunSignalCopy::IssueRequest() signals already set..." ) )); - iSignals = newSignalsLow | (oldSignalsHigh ^ newSignalsHigh); - ManageSignalChange(); - } - else - { - FTRACE(FPrint( _L("CDunSignalCopy::IssueRequest() start waiting for change..." ) )); - iStatus = KRequestPending; - comm->NotifySignalChange( iStatus, iSignals, iListenSignals ); - SetActive(); - iSignalCopyState = EDunStateSignalCopy; - } - FTRACE(FPrint( _L("CDunSignalCopy::IssueRequest() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Stops monitoring the endpoint for line status change -// --------------------------------------------------------------------------- -// -TInt CDunSignalCopy::Stop() - { - FTRACE(FPrint( _L("CDunSignalCopy::Stop()" ))); - if ( iSignalCopyState != EDunStateSignalCopy ) - { - FTRACE(FPrint( _L("CDunSignalCopy::Stop() (not ready) complete" ))); - return KErrNotReady; - } - if ( iStreamType == EDunStreamTypeUpstream ) - { - iComm->NotifySignalChangeCancel(); - } - else if ( iStreamType == EDunStreamTypeDownstream ) - { - iNetwork->NotifySignalChangeCancel(); - } - else - { - FTRACE(FPrint( _L("CDunSignalCopy::Stop() (ERROR) complete" ))); - return KErrGeneral; - } - Cancel(); - iSignalCopyState = EDunStateIdle; - FTRACE(FPrint( _L("CDunSignalCopy::Stop() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CDunSignalCopy::CDunSignalCopy -// --------------------------------------------------------------------------- -// -CDunSignalCopy::CDunSignalCopy() : - CActive( EPriorityHigh ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunSignalCopy::ConstructL -// --------------------------------------------------------------------------- -// -void CDunSignalCopy::ConstructL() - { - FTRACE(FPrint( _L("CDunSignalCopy::ConstructL()" ) )); - CActiveScheduler::Add( this ); - FTRACE(FPrint( _L("CDunSignalCopy::ConstructL() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunSignalCopy::Initialize() - { - FTRACE(FPrint( _L("CDunSignalCopy::Initialize()" ) )); - iContextInUse = EDunMediaContextUndefined; - iStreamType = EDunStreamTypeUndefined; - iSignalCopyState = EDunStateIdle; - iListenSignals = 0; - iSignals = 0; - iNetwork = NULL; - iComm = NULL; - FTRACE(FPrint( _L("CDunSignalCopy::Initialize() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Manages signal changes -// --------------------------------------------------------------------------- -// -void CDunSignalCopy::ManageSignalChange() - { - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChange()" ) )); - - if ( iStreamType == EDunStreamTypeUpstream ) - { - // Manage upstream case - ManageSignalChangeUpstream(); - } - else // iStreamType == EDunStreamTypeDownstream - { - // Manage downstream case - ManageSignalChangeDownstream(); - } - - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChange() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Manages upstream signal changes -// --------------------------------------------------------------------------- -// -void CDunSignalCopy::ManageSignalChangeUpstream() - { - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeUpstream()" ) )); - // For upstream the following signals are set for local media: - // KSignalDCEInputs = KSignalRTS | KSignalDTR - if ( iSignals & KRTSChanged ) - { - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeUpstream() checking RTS..." ) )); - if ( iSignals & KSignalRTS ) // RTS changed to high - { - ChangeUpstreamSignal( KSignalRTS, 0 ); - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeUpstream() RTS changed high" ) )); - } - else // RTS changed to low - { - ChangeUpstreamSignal( 0, KSignalRTS ); - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeUpstream() RTS changed low" ) )); - } - } - if ( iSignals & KDTRChanged ) - { - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeUpstream() checking DTR..." ) )); - if ( iSignals & KSignalDTR ) // DTR changed to high - { - ChangeUpstreamSignal( KSignalDTR, 0 ); - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeUpstream() DTR changed high" ) )); - } - else // DTR changed to low - { - ChangeUpstreamSignal( 0, KSignalDTR ); - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeUpstream() DTR changed low" ) )); - } - } - IssueRequest(); - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeUpstream() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Manages downstream signal changes -// --------------------------------------------------------------------------- -// -void CDunSignalCopy::ManageSignalChangeDownstream() - { - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream()" ) )); - // For downstream the following signals are set for network: - // KSignalDTEInputs = KSignalCTS | KSignalDSR | KSignalDCD | KSignalRNG - if ( iSignals & KCTSChanged ) - { - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() checking CTS..." ) )); - if ( iSignals & KSignalCTS ) // CTS changed to high or initially high - { - ChangeDownstreamSignal( KSignalCTS, 0 ); - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() CTS changed high" ) )); - } - else // CTS changed to low - { - ChangeDownstreamSignal( 0, KSignalCTS ); - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() CTS changed low" ) )); - } - } - if ( iSignals & KDSRChanged ) - { - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() checking DSR..." ) )); - if ( iSignals & KSignalDSR ) // DSR changed to high - { - ChangeDownstreamSignal( KSignalDSR, 0 ); - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() DSR changed high" ) )); - } - else // DSR changed to low - { - ChangeDownstreamSignal( 0, KSignalDSR ); - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() DSR changed low" ) )); - } - } - if ( iSignals & KDCDChanged ) - { - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() checking DCD..." ) )); - if ( iSignals & KSignalDCD ) // DCD changed to high - { - ChangeDownstreamSignal( KSignalDCD, 0 ); - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() DCD changed high" ) )); - } - else // DCD changed to low - { - ChangeDownstreamSignal( 0, KSignalDCD ); - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() DCD changed low" ) )); - } - } - if ( iSignals & KRNGChanged ) - { - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() checking RNG..." ) )); - if ( iSignals & KSignalRNG ) // RNG changed to high - { - ChangeDownstreamSignal( KSignalRNG, 0 ); - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() RNG changed high" ) )); - } - else // RNG changed to low - { - ChangeDownstreamSignal( 0, KSignalRNG ); - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() RNG changed low" ) )); - } - } - IssueRequest(); - FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Changes upstream signal -// --------------------------------------------------------------------------- -// -void CDunSignalCopy::ChangeUpstreamSignal( TUint aSetMask, TUint aClearMask ) - { - FTRACE(FPrint( _L("CDunSignalCopy::ChangeUpstreamSignal()" ) )); - if ( iNetwork ) - { - iNetwork->SetSignals( aSetMask, aClearMask ); - } - // Add other cases here if necessary - FTRACE(FPrint( _L("CDunSignalCopy::ChangeUpstreamSignal() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Changes downstream signal -// --------------------------------------------------------------------------- -// -void CDunSignalCopy::ChangeDownstreamSignal( TUint aSetMask, TUint aClearMask ) - { - FTRACE(FPrint( _L("CDunSignalCopy::ChangeDownstreamSignal()" ) )); - if ( iComm ) - { - iComm->SetSignals( aSetMask, aClearMask ); - } - // Add other cases here if necessary - FTRACE(FPrint( _L("CDunSignalCopy::ChangeDownstreamSignal() complete" ) )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called when line status changes -// --------------------------------------------------------------------------- -// -void CDunSignalCopy::RunL() - { - FTRACE(FPrint( _L("CDunSignalCopy::RunL()" ) )); - iSignalCopyState = EDunStateIdle; - TInt retTemp = iStatus.Int(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunSignalCopy::RunL() (failed) complete (%d)"), retTemp)); - TInt i; - TInt count = iCallbacks.Count(); - TDunConnectionReason connReason; - connReason.iReasonType = EDunReasonTypeRunL; - connReason.iContext = iContextInUse; - connReason.iSignalType = 0; - connReason.iSignalHigh = EFalse; - connReason.iDirection = EDunDirectionUndefined; - connReason.iErrorCode = retTemp; - for ( i=0; iNotifyProgressChangeL( iComm, connReason ) ); - } - return; - } - FTRACE(FPrint( _L("CDunSignalCopy::RunL() managing signal 0x%08X" ), iSignals )); - ManageSignalChange(); - FTRACE(FPrint( _L("CDunSignalCopy::RunL() complete" ) )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called on cancel -// --------------------------------------------------------------------------- -// -void CDunSignalCopy::DoCancel() - { - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/src/DunSignalNotify.cpp --- a/localconnectivityservice/dun/utils/src/DunSignalNotify.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,385 +0,0 @@ -/* -* Copyright (c) 2006-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: Monitors signal changes on network side and reports changes -* -*/ - - -#ifdef PRJ_USE_NETWORK_STUBS -#include -#else -#include -#endif -#include "DunTransporter.h" -#include "DunSignalNotify.h" -#include "DunDebug.h" - -const TUint KDunSixLowestBitsMask = 0x3F; // Symbian magic - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunSignalNotify* CDunSignalNotify::NewL( MDunTransporterUtilityAux* aUtility ) - { - CDunSignalNotify* self = new (ELeave) CDunSignalNotify( aUtility ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CDunSignalNotify::~CDunSignalNotify() - { - FTRACE(FPrint( _L("CDunSignalNotify::~CDunSignalNotify()") )); - ResetData(); - FTRACE(FPrint( _L("CDunSignalNotify::~CDunSignalNotify() complete") )); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunSignalNotify::ResetData() - { - FTRACE(FPrint( _L("CDunSignalNotify::ResetData()") )); - // APIs affecting this: - // IssueRequest() - Stop(); - // AddCallback() - iCallbacks.Close(); - // Internal - Initialize(); - FTRACE(FPrint( _L("CDunSignalNotify::ResetData() complete") )); - } - -// --------------------------------------------------------------------------- -// Adds callback for line status change controlling -// The callback will be called when line status change is detected in -// endpoint -// --------------------------------------------------------------------------- -// -TInt CDunSignalNotify::AddCallback( MDunConnMon* aCallback ) - { - FTRACE(FPrint( _L("CDunSignalNotify::AddCallback()" ) )); - if ( !aCallback ) - { - FTRACE(FPrint( _L("CDunSignalNotify::AddCallback() (ERROR) complete" ) )); - return KErrGeneral; - } - TInt retTemp = iCallbacks.Find( aCallback ); - if ( retTemp != KErrNotFound ) - { - FTRACE(FPrint( _L("CDunSignalNotify::AddCallback() (already exists) complete" ) )); - return KErrAlreadyExists; - } - retTemp = iCallbacks.Append( aCallback ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunSignalNotify::AddCallback() (append failed!) complete" ) )); - return retTemp; - } - FTRACE(FPrint( _L("CDunSignalNotify::AddCallback() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Sets media to use for this endpoint monitor -// --------------------------------------------------------------------------- -// -TInt CDunSignalNotify::SetMedia( RComm* aComm ) - { - FTRACE(FPrint( _L("CDunSignalNotify::SetMedia()" ))); - if ( !aComm ) - { - FTRACE(FPrint( _L("CDunSignalNotify::SetMedia() (aComm) not initialized!" ))); - return KErrGeneral; - } - // As it's not possible to listen for RFCOMM signal changes the RTS and DTR - // signals should be anyway set high to Dataport - aComm->SetSignals( KSignalRTS|KSignalDTR, 0 ); - // Next check if signal change notification from Dataport supported - TCommCaps2 caps; - aComm->Caps( caps ); - if ( !(caps().iNotificationCaps & KNotifySignalsChangeSupported) ) - { - FTRACE(FPrint( _L("CDunSignalNotify::SetMedia() (RComm) (not supported) complete" ))); - return KErrNotSupported; - } - iListenSignals = KSignalDTEInputs; - iNetwork = aComm; - FTRACE(FPrint( _L("CDunSignalNotify::SetMedia() (RComm) complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Issues request to start monitoring the endpoint for line status change -// --------------------------------------------------------------------------- -// -TInt CDunSignalNotify::IssueRequest() - { - FTRACE(FPrint( _L("CDunSignalNotify::IssueRequest()" ))); - if ( iSignalNotifyState != EDunStateIdle ) - { - FTRACE(FPrint( _L("CDunSignalNotify::IssueRequest() (not ready) complete" ))); - return KErrNotReady; - } - if ( !iNetwork ) - { - FTRACE(FPrint( _L("CDunSignalNotify::IssueRequest() (iNetwork) not initialized!" ) )); - return KErrGeneral; - } - TUint currentSignals = iNetwork->Signals( iListenSignals ); - TUint oldSignalsLow = iSignals & KDunSixLowestBitsMask; - TUint newSignalsLow = currentSignals & KDunSixLowestBitsMask; - TUint oldSignalsHigh = oldSignalsLow * KSignalChanged; - TUint newSignalsHigh = newSignalsLow * KSignalChanged; - FTRACE(FPrint( _L("CDunSignalNotify::IssueRequest() oldSignalsLow=0x%08X" ), oldSignalsLow )); - FTRACE(FPrint( _L("CDunSignalNotify::IssueRequest() newSignalsLow=0x%08X" ), newSignalsLow )); - FTRACE(FPrint( _L("CDunSignalNotify::IssueRequest() oldSignalsHigh=0x%08X" ), oldSignalsHigh )); - FTRACE(FPrint( _L("CDunSignalNotify::IssueRequest() newSignalsHigh=0x%08X" ), newSignalsHigh )); - if ( newSignalsLow != oldSignalsLow ) - { - FTRACE(FPrint( _L("CDunSignalNotify::IssueRequest() signals already set..." ) )); - iSignals = newSignalsLow | (oldSignalsHigh ^ newSignalsHigh); - ManageSignalChange(); - } - else - { - FTRACE(FPrint( _L("CDunSignalNotify::IssueRequest() start waiting for change..." ) )); - iStatus = KRequestPending; - iNetwork->NotifySignalChange( iStatus, iSignals, iListenSignals ); - SetActive(); - iSignalNotifyState = EDunStateSignalNotify; - } - FTRACE(FPrint( _L("CDunSignalNotify::IssueRequest() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Stops monitoring the endpoint for line status change -// --------------------------------------------------------------------------- -// -TInt CDunSignalNotify::Stop() - { - FTRACE(FPrint( _L("CDunSignalNotify::Stop()" ))); - if ( iSignalNotifyState != EDunStateSignalNotify ) - { - FTRACE(FPrint( _L("CDunSignalNotify::Stop() (not ready) complete" ))); - return KErrNotReady; - } - if ( !iNetwork ) - { - FTRACE(FPrint( _L("CDunSignalNotify::Stop() (iNetwork) not initialized!" ))); - return KErrGeneral; - } - iNetwork->NotifySignalChangeCancel(); - Cancel(); - iSignalNotifyState = EDunStateIdle; - FTRACE(FPrint( _L("CDunSignalNotify::Stop() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CDunSignalNotify::CDunSignalNotify -// --------------------------------------------------------------------------- -// -CDunSignalNotify::CDunSignalNotify( MDunTransporterUtilityAux* aUtility ) : - CActive( EPriorityHigh ), - iUtility( aUtility ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunSignalNotify::ConstructL -// --------------------------------------------------------------------------- -// -void CDunSignalNotify::ConstructL() - { - FTRACE(FPrint( _L("CDunSignalNotify::ConstructL()" ) )); - if ( !iUtility ) - { - User::Leave( KErrGeneral ); - } - CActiveScheduler::Add( this ); - FTRACE(FPrint( _L("CDunSignalNotify::ConstructL() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunSignalNotify::Initialize() - { - FTRACE(FPrint( _L("CDunSignalNotify::Initialize()" ) )); - // Don't initialize iUtility here (it is set through NewL) - iSignalNotifyState = EDunStateIdle; - iListenSignals = 0; - iSignals = 0; - iNetwork = NULL; - FTRACE(FPrint( _L("CDunSignalNotify::Initialize() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Manages signal changes -// --------------------------------------------------------------------------- -// -void CDunSignalNotify::ManageSignalChange() - { - FTRACE(FPrint( _L("CDunSignalNotify::ManageSignalChange()" ) )); - // The following signals are input signals from network side: - // KSignalDTEInputs = KSignalCTS | KSignalDSR | KSignalDCD | KSignalRNG - if ( iSignals & KCTSChanged ) - { - FTRACE(FPrint( _L("CDunSignalNotify::ManageSignalChange() checking CTS..." ) )); - if ( iSignals & KSignalCTS ) // CTS changed to high - { - ReportSignalChange( KSignalCTS, 0 ); - FTRACE(FPrint( _L("CDunSignalNotify::ManageSignalChange() CTS changed high" ) )); - } - else // CTS changed to low - { - ReportSignalChange( 0, KSignalCTS ); - FTRACE(FPrint( _L("CDunSignalNotify::ManageSignalChange() CTS changed low" ) )); - } - } - if ( iSignals & KDSRChanged ) - { - FTRACE(FPrint( _L("CDunSignalNotify::ManageSignalChange() checking DSR..." ) )); - if ( iSignals & KSignalDSR ) // DSR changed to high - { - ReportSignalChange( KSignalDSR, 0 ); - FTRACE(FPrint( _L("CDunSignalNotify::ManageSignalChange() DSR changed high" ) )); - } - else // DSR changed to low - { - ReportSignalChange( 0, KSignalDSR ); - FTRACE(FPrint( _L("CDunSignalNotify::ManageSignalChange() DSR changed low" ) )); - } - } - if ( iSignals & KDCDChanged ) - { - FTRACE(FPrint( _L("CDunSignalNotify::ManageSignalChange() checking DCD..." ) )); - if ( iSignals & KSignalDCD ) // DCD changed to high - { - ReportSignalChange( KSignalDCD, 0 ); - FTRACE(FPrint( _L("CDunSignalNotify::ManageSignalChange() DCD changed high" ) )); - } - else // DCD changed to low - { - ReportSignalChange( 0, KSignalDCD ); - FTRACE(FPrint( _L("CDunSignalNotify::ManageSignalChange() DCD changed low" ) )); - } - } - if ( iSignals & KRNGChanged ) - { - FTRACE(FPrint( _L("CDunSignalNotify::ManageSignalChange() checking RNG..." ) )); - if ( iSignals & KSignalRNG ) // RNG changed to high - { - ReportSignalChange( KSignalRNG, 0 ); - FTRACE(FPrint( _L("CDunSignalNotify::ManageSignalChange() RNG changed high" ) )); - } - else // RNG changed to low - { - ReportSignalChange( 0, KSignalRNG ); - FTRACE(FPrint( _L("CDunSignalNotify::ManageSignalChange() RNG changed low" ) )); - } - } - IssueRequest(); - FTRACE(FPrint( _L("CDunSignalNotify::ManageSignalChange() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Reports signal change -// --------------------------------------------------------------------------- -// -void CDunSignalNotify::ReportSignalChange( TUint aSetMask, TUint aClearMask ) - { - FTRACE(FPrint( _L("CDunSignalNotify::ReportSignalChange()" ) )); - - TUint signalType = aClearMask; - TUint signalHigh = EFalse; - if ( aSetMask != 0 ) - { - signalType = aSetMask; - signalHigh = ETrue; - } - TInt i; - TInt count = iCallbacks.Count(); - TDunConnectionReason connReason; - TConnId localId = iUtility->GetLocalId( iNetwork ); - connReason.iReasonType = EDunReasonTypeSignal; - connReason.iContext = EDunMediaContextNetwork; - connReason.iSignalType = signalType; - connReason.iSignalHigh = signalHigh; - connReason.iDirection = EDunDirectionUndefined; - connReason.iErrorCode = KErrNone; - for ( i=0; iNotifyProgressChangeL( localId, connReason ) ); - } - - FTRACE(FPrint( _L("CDunSignalNotify::ReportSignalChange() complete" ) )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called when line status changes -// --------------------------------------------------------------------------- -// -void CDunSignalNotify::RunL() - { - FTRACE(FPrint( _L("CDunSignalNotify::RunL()" ) )); - iSignalNotifyState = EDunStateIdle; - TInt retTemp = iStatus.Int(); - if ( retTemp != KErrNone ) - { - TInt i; - TInt count = iCallbacks.Count(); - TDunConnectionReason connReason; - TConnId localId = iUtility->GetLocalId( iNetwork ); - connReason.iReasonType = EDunReasonTypeRunL; - connReason.iContext = EDunMediaContextNetwork; - connReason.iSignalType = 0; - connReason.iSignalHigh = EFalse; - connReason.iDirection = EDunDirectionUndefined; - connReason.iErrorCode = retTemp; - for ( i=0; iNotifyProgressChangeL( localId, connReason ) ); - } - return; - } - FTRACE(FPrint( _L("CDunSignalNotify::RunL() managing signal 0x%08X" ), iSignals )); - ManageSignalChange(); - FTRACE(FPrint( _L("CDunSignalNotify::RunL() complete" ) )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called on cancel -// --------------------------------------------------------------------------- -// -void CDunSignalNotify::DoCancel() - { - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/src/DunSignalWaiter.cpp --- a/localconnectivityservice/dun/utils/src/DunSignalWaiter.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,257 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Monitors for new data in RComm local media side -* -*/ - - -#ifdef PRJ_USE_NETWORK_STUBS -#include -#else -#include -#endif -#include "DunTransporter.h" -#include "DunSignalWaiter.h" -#include "DunSignalCopy.h" -#include "DunDebug.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunSignalWaiter* CDunSignalWaiter::NewL( MDunChannelAllocator* aChannelCallback ) - { - CDunSignalWaiter* self = new (ELeave) CDunSignalWaiter( aChannelCallback ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunSignalWaiter::~CDunSignalWaiter() - { - FTRACE(FPrint( _L("CDunSignalWaiter::~CDunSignalWaiter()") )); - ResetData(); - FTRACE(FPrint( _L("CDunSignalWaiter::~CDunSignalWaiter() complete") )); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunSignalWaiter::ResetData() - { - FTRACE(FPrint( _L("CDunSignalWaiter::ResetData()") )); - // APIs affecting this: - // IssueRequest() - Stop(); - // AddConnMonCallbackL() - iCallbacks.Close(); - // Internal - Initialize(); - FTRACE(FPrint( _L("CDunSignalWaiter::ResetData() complete") )); - } - -// --------------------------------------------------------------------------- -// Adds callback for RunL error controlling -// The callback will be called when error is detected in asynchronous -// operation -// --------------------------------------------------------------------------- -// -TInt CDunSignalWaiter::AddCallback( MDunConnMon* aCallback ) - { - FTRACE(FPrint( _L("CDunSignalWaiter::AddCallback()" ) )); - if ( !aCallback ) - { - FTRACE(FPrint( _L("CDunSignalWaiter::AddCallback() (ERROR) complete" ) )); - return KErrGeneral; - } - TInt retTemp = iCallbacks.Find( aCallback ); - if ( retTemp != KErrNotFound ) - { - FTRACE(FPrint( _L("CDunSignalWaiter::AddCallback() (already exists) complete" ) )); - return KErrAlreadyExists; - } - retTemp = iCallbacks.Append( aCallback ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunSignalWaiter::AddCallback() (append failed!) complete" ) )); - return retTemp; - } - FTRACE(FPrint( _L("CDunSignalWaiter::AddCallback() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Sets media to use for this endpoint -// --------------------------------------------------------------------------- -// -TInt CDunSignalWaiter::SetMedia( RComm* aComm ) - { - FTRACE(FPrint( _L("CDunSignalWaiter::SetMedia(RComm) (addr=0x%08X)" ), aComm)); - if ( !aComm ) - { - FTRACE(FPrint( _L("CDunSignalWaiter::SetMedia() (aComm) not initialized!" ))); - return KErrGeneral; - } - TCommCaps2 caps; - aComm->Caps( caps ); - if ( !(caps().iNotificationCaps & KNotifySignalsChangeSupported) ) - { - FTRACE(FPrint( _L("CDunSignalWaiter::SetMedia() (RComm) (not supported) complete" ))); - return KErrNotSupported; - } - iComm = aComm; - FTRACE(FPrint( _L("CDunSignalWaiter::SetMedia() (RComm) complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Issues request to start waiting for new data in RComm -// --------------------------------------------------------------------------- -// -TInt CDunSignalWaiter::IssueRequest() - { - FTRACE(FPrint( _L("CDunSignalWaiter::IssueRequest()" ))); - if ( iSignalWaiterState != EDunStateIdle ) - { - FTRACE(FPrint( _L("CDunSignalWaiter::IssueRequest() (not ready) complete" ))); - return KErrNotReady; - } - if ( !iComm ) - { - FTRACE(FPrint( _L("CDunSignalWaiter::IssueRequest() (iComm) not initialized!" ) )); - return KErrGeneral; - } - iStatus = KRequestPending; - iComm->NotifySignalChange( iStatus, iSignals, KSignalDCEInputs ); - SetActive(); - iSignalWaiterState = EDunStateSignalWaiting; - FTRACE(FPrint( _L("CDunSignalWaiter::IssueRequest() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Stops monitoring for new data -// --------------------------------------------------------------------------- -// -TInt CDunSignalWaiter::Stop() - { - FTRACE(FPrint( _L("CDunSignalWaiter::Stop()" ))); - if ( iSignalWaiterState != EDunStateSignalWaiting ) - { - FTRACE(FPrint( _L("CDunSignalWaiter::Stop() (not ready) complete" ))); - return KErrNotReady; - } - if ( !iComm ) - { - FTRACE(FPrint( _L("CDunSignalWaiter::Stop() (iComm) not initialized!" ))); - return KErrGeneral; - } - iComm->NotifySignalChangeCancel(); - Cancel(); - iSignalWaiterState = EDunStateIdle; - FTRACE(FPrint( _L("CDunSignalWaiter::Stop() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CDunSignalWaiter::CDunSignalWaiter -// --------------------------------------------------------------------------- -// -CDunSignalWaiter::CDunSignalWaiter( MDunChannelAllocator* aChannelCallback ) : - CActive( EPriorityHigh ), - iChannelCallback( aChannelCallback ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunSignalWaiter::ConstructL -// --------------------------------------------------------------------------- -// -void CDunSignalWaiter::ConstructL() - { - FTRACE(FPrint( _L("CDunSignalWaiter::ConstructL()" ) )); - if ( !iChannelCallback ) - { - User::Leave( KErrGeneral ); - } - CActiveScheduler::Add( this ); - FTRACE(FPrint( _L("CDunSignalWaiter::ConstructL() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunSignalWaiter::Initialize() - { - FTRACE(FPrint( _L("CDunSignalWaiter::Initialize()" ) )); - // Don't initialize iChannelCallback here (it is set through NewL) - iSignalWaiterState = EDunStateIdle; - iSignals = 0; - iComm = NULL; - FTRACE(FPrint( _L("CDunSignalWaiter::Initialize() complete" ) )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called when signals changed in RComm object -// --------------------------------------------------------------------------- -// -void CDunSignalWaiter::RunL() - { - FTRACE(FPrint( _L("CDunSignalWaiter::RunL()" ) )); - iSignalWaiterState = EDunStateIdle; - TInt retTemp = iStatus.Int(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunSignalWaiter::RunL() (failed) complete (%d)"), retTemp)); - TInt count = iCallbacks.Count(); - TDunConnectionReason connReason; - connReason.iReasonType = EDunReasonTypeRunL; - connReason.iContext = EDunMediaContextLocal; - connReason.iSignalType = 0; - connReason.iSignalHigh = EFalse; - connReason.iDirection = EDunDirectionUndefined; - connReason.iErrorCode = retTemp; - for ( TInt i=0; iNotifyProgressChangeL( iComm, connReason ) ); - } - return; - } - if ( iChannelCallback ) - { - iChannelCallback->NotifyNewChannelRequest( iComm ); - } - FTRACE(FPrint( _L("CDunSignalWaiter::RunL() complete" ) )); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called on cancel -// --------------------------------------------------------------------------- -// -void CDunSignalWaiter::DoCancel() - { - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/src/DunStream.cpp --- a/localconnectivityservice/dun/utils/src/DunStream.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,320 +0,0 @@ -/* -* Copyright (c) 2007 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: Definitions needed for common stream functionality -* -*/ - - -/* - * TODO: When local media is of type RComm, listening on it is started with - * RComm::NotifyDataAvailable() call. Check that USB ACM port and Irda RCOMM - * (and any other new media in the future) behaves correctly so that when - * RComm::ReadOneOrMore() is issued, the read is issued immediately without - * checking for new data. If waiting for new data happens in this - * NotifyDataAvailable/ReadOneOrMore combination, raise a defect to Symbian. - */ - -#include "DunStream.h" -#include "DunDebug.h" - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunStream::~CDunStream() - { - FTRACE(FPrint( _L("CDunStream::~CDunStream()" ))); - ResetData(); - FTRACE(FPrint( _L("CDunStream::~CDunStream() complete" ))); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunStream::ResetData() - { - // APIs affecting this: - // AddConnMonCallback() - iCallbacksR.Close(); - iCallbacksW.Close(); - // AddSkippedError() - iOkErrorsR.Close(); - iOkErrorsW.Close(); - // Internal - Initialize(); - } - -// --------------------------------------------------------------------------- -// Adds error code to consider as "no error" to either endpoint -// --------------------------------------------------------------------------- -// -TInt CDunStream::AddSkippedError( TInt aError, - TDunOperationType aOperationType ) - { - FTRACE(FPrint( _L("CDunStream::AddSkippedError()" ) )); - RArray* okErrors = NULL; - if ( aOperationType == EDunOperationTypeRead ) - { - okErrors = &iOkErrorsR; - } - else if ( aOperationType == EDunOperationTypeWrite ) - { - okErrors = &iOkErrorsW; - } - else - { - FTRACE(FPrint( _L("CDunStream::AddSkippedError() (ERROR) complete" ) )); - return KErrGeneral; - } - if ( aError >= 0 ) // errors can't be >= 0 - { - FTRACE(FPrint( _L("CDunStream::AddSkippedError() (ERROR) complete" ) )); - return KErrGeneral; - } - TInt retTemp = okErrors->Find( aError ); - if ( retTemp != KErrNotFound ) - { - FTRACE(FPrint( _L("CDunStream::AddSkippedError() (already exists) complete" ) )); - return KErrAlreadyExists; - } - retTemp = okErrors->Append( aError ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunStream::AddSkippedError() (append failed!) complete" ) )); - return retTemp; - } - FTRACE(FPrint( _L("CDunStream::AddSkippedError() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Adds callback for line status change controlling -// The callback will be called when serious read error is detected -// --------------------------------------------------------------------------- -// -TInt CDunStream::AddConnMonCallback( MDunConnMon* aCallback, - TDunOperationType aOperationType ) - { - FTRACE(FPrint( _L("CDunStream::AddConnMonCallback()" ) )); - RPointerArray* callbacks = NULL; - if ( aOperationType == EDunOperationTypeRead ) - { - callbacks = &iCallbacksR; - } - else if ( aOperationType == EDunOperationTypeWrite ) - { - callbacks = &iCallbacksW; - } - else - { - FTRACE(FPrint( _L("CDunStream::AddConnMonCallback() (ERROR) complete" ) )); - return KErrGeneral; - } - if ( !aCallback ) - { - FTRACE(FPrint( _L("CDunStream::AddConnMonCallback() (aCallback) not initialized!" ) )); - return KErrGeneral; - } - TInt retTemp = callbacks->Find( aCallback ); - if ( retTemp != KErrNotFound ) - { - FTRACE(FPrint( _L("CDunStream::AddCallback() (already exists) complete" ) )); - return KErrAlreadyExists; - } - retTemp = callbacks->Append( aCallback ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunStream::AddCallback() (append failed!) complete" ) )); - return retTemp; - } - FTRACE(FPrint( _L("CDunStream::AddCallback() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Sets buffering for this stream -// --------------------------------------------------------------------------- -// -TInt CDunStream::SetBuffering( TPtr8* aBufferPtr ) - { - FTRACE(FPrint( _L("CDunStream::SetBuffering()" ) )); - if ( !aBufferPtr ) - { - FTRACE(FPrint( _L("CDunStream::SetBuffering() (aBufferPtr) not initialized!" ) )); - return KErrGeneral; - } - if ( iBufferPtr ) - { - FTRACE(FPrint( _L("CDunStream::SetBuffering() (already exists) complete" ) )); - return KErrAlreadyExists; - } - iBufferPtr = aBufferPtr; - FTRACE(FPrint( _L("CDunStream::SetBuffering() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Sets media to use for this endpoint -// --------------------------------------------------------------------------- -// -TInt CDunStream::SetMedia( RComm* aComm, TDunMediaContext aMediaContext ) - { - FTRACE(FPrint( _L("CDunStream::SetMedia() (RComm)" ) )); - if ( !aComm ) - { - FTRACE(FPrint( _L("CDunStream::SetMedia() (RComm) (aComm not initialized!) complete" ) )); - return KErrGeneral; - } - if ( aMediaContext == EDunMediaContextNetwork ) - { - iNetwork = aComm; - } - else if ( aMediaContext == EDunMediaContextLocal ) - { - iComm = aComm; - } - else - { - FTRACE(FPrint( _L("CDunStream::SetMedia() (RComm) (ERROR) complete" ))); - return KErrGeneral; - } - FTRACE(FPrint( _L("CDunStream::SetMedia() (RComm) complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Sets media to use for this endpoint -// --------------------------------------------------------------------------- -// -TInt CDunStream::SetMedia( RSocket* aSocket, - TDunMediaContext aMediaContext ) - { - FTRACE(FPrint( _L("CDunStream::SetMedia() (RSocket)" ) )); - if ( !aSocket ) - { - FTRACE(FPrint( _L("CDunStream::SetMedia() (RSocket) (aSocket not initialized!) complete" ) )); - return KErrGeneral; - } - if ( aMediaContext == EDunMediaContextLocal ) - { - iSocket = aSocket; - } - else - { - FTRACE(FPrint( _L("CDunStream::SetMedia() (RSocket) (not supported) complete" ) )); - return KErrNotSupported; - } - FTRACE(FPrint( _L("CDunStream::SetMedia() (RSocket) complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Gets media context -// --------------------------------------------------------------------------- -// -TDunMediaContext CDunStream::GetMediaContext( TDunStreamType aStreamType ) - { - FTRACE(FPrint( _L("CDunStream::GetMediaContext()" ) )); - if ( aStreamType == EDunStreamTypeUpstream ) - { - if ( iOperationType == EDunOperationTypeRead ) - { - return EDunMediaContextLocal; - } - else if ( iOperationType == EDunOperationTypeWrite ) - { - return EDunMediaContextNetwork; - } - else - { - return EDunMediaContextUndefined; - } - } - else if ( aStreamType == EDunStreamTypeDownstream ) - { - if ( iOperationType == EDunOperationTypeRead ) - { - return EDunMediaContextNetwork; - } - else if ( iOperationType == EDunOperationTypeWrite ) - { - return EDunMediaContextLocal; - } - else - { - return EDunMediaContextUndefined; - } - } - FTRACE(FPrint( _L("CDunStream::GetMediaContext() complete" ) )); - return EDunMediaContextUndefined; - } - -// --------------------------------------------------------------------------- -// Check whether an error code is severe error or not -// --------------------------------------------------------------------------- -// -TInt CDunStream::ProcessErrorCondition( TInt aError, TBool& aIsError ) - { - FTRACE(FPrint( _L("CDunStream::ProcessErrorCondition() (Dir=%d)" ), iDirection)); - aIsError = EFalse; - if ( aError != KErrNone ) - { - aIsError = ETrue; - RArray* okErrors = NULL; - if ( iOperationType == EDunOperationTypeRead ) - { - okErrors = &iOkErrorsR; - } - else // iOperationType == EDunOperationTypeWrite - { - okErrors = &iOkErrorsW; - } - TInt retTemp = okErrors->Find( aError ); - if ( retTemp == KErrNotFound ) - { - FTRACE(FPrint( _L("CDunStream::ProcessErrorCondition() (Dir=%d) (%d=ETrue) complete" ), iDirection, aError)); - return ETrue; - } - } - FTRACE(FPrint( _L("CDunStream::ProcessErrorCondition() (Dir=%d) (%d=EFalse) complete" ), iDirection, aError)); - return EFalse; - } - -// --------------------------------------------------------------------------- -// CDunStream::CDunStream -// --------------------------------------------------------------------------- -// -CDunStream::CDunStream() : CActive( EPriorityHigh ) - { - Initialize(); - CActiveScheduler::Add( this ); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunStream::Initialize() - { - // Don't initialize iUtility here (it is set through NewL) - iBufferPtr = NULL; - iReadLengthSocket = 0; - iOperationType = EDunOperationTypeUndefined; - iTransferState = EDunStateIdle; - iDirection = EDunDirectionUndefined; - iNetwork = NULL; - iSocket = NULL; - iComm = NULL; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/src/DunTransUtils.cpp --- a/localconnectivityservice/dun/utils/src/DunTransUtils.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1077 +0,0 @@ -/* -* Copyright (c) 2006-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: Utility class for other CDunTransporter classes -* -*/ - - -#include -#include -#include "dundomainpskeys.h" -#include "DunTransUtils.h" -#include "DunDataWaiter.h" -#include "DunUpstream.h" -#include "DunDownstream.h" -#include "DunSignalCopy.h" -#include "DunSignalNotify.h" -#include "DunNoteHandler.h" -#include "DunUtils.h" -#include "DunDebug.h" - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunTransUtils* CDunTransUtils::NewL( CDunTransporter& aParent, - MDunPluginManager* aPluginManager ) - { - CDunTransUtils* self = new (ELeave) CDunTransUtils( aParent, - aPluginManager ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunTransUtils::~CDunTransUtils() - { - FTRACE(FPrint( _L("CDunTransUtils::~CDunTransUtils()" ))); - FTRACE(FPrint( _L("CDunTransUtils::~CDunTransUtils() complete" ))); - } - -// --------------------------------------------------------------------------- -// CDunTransUtils::CDunTransUtils -// --------------------------------------------------------------------------- -// -CDunTransUtils::CDunTransUtils( CDunTransporter& aParent, - MDunPluginManager* aPluginManager ) : - iParent( aParent ), - iChannelData( aParent.iChannelData ), - iServAdvData( aParent.iServAdvData ), - iPluginManager( aPluginManager ) - { - } - -// --------------------------------------------------------------------------- -// CDunTransUtils::ConstructL -// --------------------------------------------------------------------------- -// -void CDunTransUtils::ConstructL() - { - FTRACE(FPrint( _L("CDunTransUtils::ConstructL()" ))); - if ( !iPluginManager ) - { - User::Leave( KErrGeneral ); - } - FTRACE(FPrint( _L("CDunTransUtils::ConstructL() complete" ))); - } - -// --------------------------------------------------------------------------- -// Manages service advertisement status changes -// --------------------------------------------------------------------------- -// -void CDunTransUtils::ManageAdvertisementStatusChange( TBool aAdvertise, - TBool aCreation ) - { - FTRACE(FPrint( _L("CDunTransUtils::ManageAdvertisementStatusChange()" ))); - TInt i; - TInt count; - iParent.iAdvertise = aAdvertise; - count = iServAdvData.Count(); - for ( i=0; iNotifyAdvertisementStart( aCreation ); - } - else - { - servAdvData.iServAdvMon->NotifyAdvertisementEnd(); - } - } - } - FTRACE(FPrint( _L("CDunTransUtils::ManageAdvertisementStatusChange() complete" ))); - } - -// --------------------------------------------------------------------------- -// Creates empty channel data -// --------------------------------------------------------------------------- -// -void CDunTransUtils::CreateEmptyChannelData( TDunChannelData& aChannel ) - { - FTRACE(FPrint( _L("CDunTransUtils::CreateEmptyChannelData()" ))); - aChannel.iNetwork = NULL; - aChannel.iComm = NULL; - aChannel.iSocket = NULL; - aChannel.iChannelName = NULL; - aChannel.iUpstreamRW = NULL; - aChannel.iDownstreamRW = NULL; - aChannel.iBufferUpstream = NULL; - aChannel.iBufferDownstream = NULL; - aChannel.iBufferUpPtr = NULL; - aChannel.iBufferDownPtr = NULL; - aChannel.iUpstreamSignalCopy = NULL; - aChannel.iDownstreamSignalCopy = NULL; - aChannel.iSignalNotify = NULL; - aChannel.iOwnerUid = TUid::Null(); - aChannel.iChannelInUse = EFalse; - FTRACE(FPrint( _L("CDunTransUtils::CreateEmptyChannelData() complete" ))); - } - -// --------------------------------------------------------------------------- -// Creates new buffer if source buffer defined, otherwise already existing -// buffer will be used -// --------------------------------------------------------------------------- -// -void CDunTransUtils::DoCreateBufferLC( TUint8* aSrcBuffer, - TPtr8* aSrcPtr, - TUint8*& aDstBuffer, - TPtr8*& aDstPtr, - TInt aBufferLength, - TInt& aItemsInCs ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoCreateBufferLC()" ))); - TUint8* buffer; - if ( !aSrcBuffer ) - { - buffer = new (ELeave) TUint8[aBufferLength]; - CleanupStack::PushL( buffer ); - aItemsInCs++; - FTRACE(FPrint( _L("CDunTransUtils::DoCreateBufferLC() new created" ))); - } - else - { - buffer = aSrcBuffer; - FTRACE(FPrint( _L("CDunTransUtils::DoCreateBufferLC() existing set" ))); - } - TPtr8* bufferPtr; - if ( !aSrcPtr ) - { - bufferPtr = new (ELeave) TPtr8( buffer, aBufferLength, aBufferLength ); - CleanupStack::PushL( bufferPtr ); - aItemsInCs++; - FTRACE(FPrint( _L("CDunTransUtils::DoCreateBufferLC() new created" ))); - } - else - { - bufferPtr = aSrcPtr; - FTRACE(FPrint( _L("CDunTransUtils::DoCreateBufferLC() existing set" ))); - } - aDstBuffer = buffer; - aDstPtr = bufferPtr; - FTRACE(FPrint( _L("CDunTransUtils::DoCreateBufferLC() complete" ))); - } - -// --------------------------------------------------------------------------- -// Creates new signal copy object if source defined, otherwise already -// existing will be used -// --------------------------------------------------------------------------- -// -void CDunTransUtils::DoCreateSignalCopyLC( CDunSignalCopy* aSrcSignalCopy, - CDunSignalCopy*& aDstSignalCopy, - TInt& aItemsInCs ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoCreateSignalCopyLC()" ))); - CDunSignalCopy* signalCopy; - if ( !aSrcSignalCopy ) - { - signalCopy = CDunSignalCopy::NewL(); - CleanupStack::PushL( signalCopy ); - aItemsInCs++; - FTRACE(FPrint( _L("CDunTransUtils::DoCreateSignalCopyLC() new created" ))); - } - else - { - signalCopy = aSrcSignalCopy; - FTRACE(FPrint( _L("CDunTransUtils::DoCreateSignalCopyLC() existing set" ))); - } - aDstSignalCopy = signalCopy; - FTRACE(FPrint( _L("CDunTransUtils::DoCreateSignalCopyLC() complete" ))); - } - -// --------------------------------------------------------------------------- -// Creates new signal notify object if source defined, otherwise already -// existing will be used -// --------------------------------------------------------------------------- -// -void CDunTransUtils::DoCreateSignalNotifyLC( - CDunSignalNotify* aSrcSignalNotify, - CDunSignalNotify*& aDstSignalNotify, - TInt& aItemsInCs ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoCreateSignalNotifyLC()" ))); - CDunSignalNotify* signalNotify; - if ( !aSrcSignalNotify ) - { - signalNotify = CDunSignalNotify::NewL( this ); - CleanupStack::PushL( signalNotify ); - aItemsInCs++; - FTRACE(FPrint( _L("CDunTransUtils::DoCreateSignalNotifyLC() new created" ))); - } - else - { - signalNotify = aSrcSignalNotify; - FTRACE(FPrint( _L("CDunTransUtils::DoCreateSignalNotifyLC() existing set" ))); - } - aDstSignalNotify = signalNotify; - FTRACE(FPrint( _L("CDunTransUtils::DoCreateSignalNotifyLC() complete" ))); - } - -// --------------------------------------------------------------------------- -// Creates transfer objects for reader and writer if sources defined, -// otherwise already existing ones will be used -// --------------------------------------------------------------------------- -// -void CDunTransUtils::DoCreateUpTransferObjectL( CDunUpstream* aSrcReader, - CDunUpstream*& aDstReader, - TInt& aItemsInCs ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoCreateUpTransferObjectL()" ))); - CDunUpstream* dunReader; - if ( !aSrcReader ) - { - dunReader = CDunUpstream::NewL( this ); - CleanupStack::PushL( dunReader ); - aItemsInCs++; - FTRACE(FPrint( _L("CDunTransUtils::DoCreateUpTransferObjectL() new created" ))); - } - else - { - dunReader = aSrcReader; - FTRACE(FPrint( _L("CDunTransUtils::DoCreateUpTransferObjectL() existing set" ))); - } - aDstReader = dunReader; - FTRACE(FPrint( _L("CDunTransUtils::DoCreateUpTransferObjectL() complete" ))); - } - -// --------------------------------------------------------------------------- -// Creates transfer objects for reader and writer if sources defined, -// otherwise already existing ones will be used -// --------------------------------------------------------------------------- -// -void CDunTransUtils::DoCreateDownTransferObjectL( CDunDownstream* aSrcReader, - CDunDownstream*& aDstReader, - TInt& aItemsInCs ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoCreateDownTransferObjectL()" ))); - CDunDownstream* dunReader; - if ( !aSrcReader ) - { - dunReader = CDunDownstream::NewL( this ); - CleanupStack::PushL( dunReader ); - aItemsInCs++; - FTRACE(FPrint( _L("CDunTransUtils::DoCreateDownTransferObjectL() new created" ))); - } - else - { - dunReader = aSrcReader; - FTRACE(FPrint( _L("CDunTransUtils::DoCreateDownTransferObjectL() existing set" ))); - } - aDstReader = dunReader; - FTRACE(FPrint( _L("CDunTransUtils::DoCreateDownTransferObjectL() complete" ))); - } - -// --------------------------------------------------------------------------- -// Resets/frees network data of aIndex:th channel -// --------------------------------------------------------------------------- -// -TInt CDunTransUtils::DeleteOneNetworkData( TInt aIndex ) - { - FTRACE(FPrint( _L("CDunTransUtils::DeleteOneNetworkData()" ))); - - if ( aIndex < 0 || - aIndex >= iChannelData.Count() ) - { - FTRACE(FPrint( _L("CDunTransUtils::DeleteOneNetworkData (not found) complete" ))); - return KErrNotFound; - } - - TDunChannelData& channelData = iChannelData[aIndex]; - if ( !channelData.iChannelInUse ) - { - FTRACE(FPrint( _L("CDunTransUtils::DeleteOneNetworkData() (channel not found) complete" ), aIndex)); - return KErrGeneral; - } - - // channelData.iDownstreamSignalCopy may or may not exist (optional) - // channelData.iSignalNotify may or may not exist (optional) - delete channelData.iDownstreamSignalCopy; - channelData.iDownstreamSignalCopy = NULL; - delete channelData.iSignalNotify; - channelData.iSignalNotify = NULL; - delete channelData.iDownstreamRW; - channelData.iDownstreamRW = NULL; - - FTRACE(FPrint( _L("CDunTransUtils::DeleteOneNetworkData complete()" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Resets/frees network data of aIndex:th channel -// --------------------------------------------------------------------------- -// -TInt CDunTransUtils::DeleteOneLocalData( TInt aIndex ) - { - FTRACE(FPrint( _L("CDunTransUtils::DeleteOneLocalData()" ))); - - if ( aIndex < 0 || - aIndex >= iChannelData.Count() ) - { - FTRACE(FPrint( _L("CDunTransUtils::DeleteOneLocalData() (not found) complete" ))); - return KErrNotFound; - } - - TDunChannelData& channelData = iChannelData[aIndex]; - if ( !channelData.iChannelInUse ) - { - FTRACE(FPrint( _L("CDunTransUtils::DeleteOneLocalData() (channel not found) complete" ), aIndex)); - return KErrGeneral; - } - - // channelData.iUpstreamSignalCopy may or may not exist (optional) - delete channelData.iUpstreamSignalCopy; - channelData.iUpstreamSignalCopy = NULL; - delete channelData.iUpstreamRW; - channelData.iUpstreamRW = NULL; - - FTRACE(FPrint( _L("CDunTransUtils::DeleteOneLocalData() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Deletes buffering objects of aIndex:th channel -// --------------------------------------------------------------------------- -// -TInt CDunTransUtils::DeleteBuffering( TInt aIndex ) - { - FTRACE(FPrint( _L("CDunTransUtils::DeleteBuffering()" ))); - - if ( aIndex < 0 || - aIndex >= iChannelData.Count() ) - { - FTRACE(FPrint( _L("CDunTransUtils::DeleteBuffering() (not found) complete" ))); - return KErrNotFound; - } - TDunChannelData& channelData = iChannelData[aIndex]; - if ( !channelData.iChannelInUse ) - { - FTRACE(FPrint( _L("CDunTransUtils::DeleteBuffering() (channel not found) complete" ), aIndex)); - return KErrGeneral; - } - - delete channelData.iChannelName; - channelData.iChannelName = NULL; - delete channelData.iBufferUpstream; - channelData.iBufferUpstream = NULL; - delete channelData.iBufferDownstream; - channelData.iBufferDownstream = NULL; - delete channelData.iBufferUpPtr; - channelData.iBufferUpPtr = NULL; - delete channelData.iBufferDownPtr; - channelData.iBufferDownPtr = NULL; - - FTRACE(FPrint( _L("CDunTransUtils::DeleteBuffering() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Initializes first free channel -// --------------------------------------------------------------------------- -// -TInt CDunTransUtils::InitializeFirstFreeChannel( TConnId aLocalIdNew ) - { - FTRACE(FPrint( _L("CDunTransUtils::InitializeFirstFreeChannel()" ))); - TInt i; - TInt count; - TInt retTemp; - TInt firstFree = KErrNotFound; - count = iChannelData.Count(); - for ( i=0; i= 0 ) - { - FTRACE(FPrint( _L("CDunTransUtils::InitializeFirstFreeChannel() complete" ))); - return i; - } - // Free channel not found, now create new if possible - TDunChannelData emptyChannel; - CreateEmptyChannelData( emptyChannel ); - retTemp = iChannelData.Append( emptyChannel ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunTransUtils::InitializeFirstFreeChannel() (append failed!) complete" ))); - return retTemp; - } - FTRACE(FPrint( _L("CDunTransUtils::InitializeFirstFreeChannel() complete" ))); - return i; - } - -// --------------------------------------------------------------------------- -// From class MDunTransporterUtility. -// Allocates a channel by creating and setting local media independent -// objects -// This is a common method used by exported local media dependent methods -// --------------------------------------------------------------------------- -// -void CDunTransUtils::DoAllocateChannelL( RComm* aComm, - TInt& aBufferLength, - TInt aFirstFree, - MDunBufferCorrection* aCorrection ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL()" ))); - TInt retTemp; - TInt itemsInCs = 0; - - if ( !iParent.iNetwork ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() (iNetwork) not initialized!" ))); - User::Leave( KErrGeneral ); - } - - FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() aFirstFree = %d" ), aFirstFree)); - - // Allocate network channel - RComm* networkEntity; - retTemp = iParent.iNetwork->AllocateChannel( networkEntity ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() network allocation failed" ))); - if ( retTemp == KErrTooBig ) - { - // Start to show note - if ( iParent.iNoteHandler ) - { - iParent.iNoteHandler->IssueRequest(); - } - // Set flag to indicate that advertisement is not possible anymore - ManageAdvertisementStatusChange( EFalse ); - FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() (too big) complete" ))); - User::Leave( KErrTooBig ); - } - FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() (ERROR) complete" ))); - User::Leave( KErrGeneral ); - } - - TInt currentLength = networkEntity->ReceiveBufferLength(); - TInt newLength = currentLength; - FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() buffer length before = %d" ), currentLength)); - if ( aCorrection ) - { - // Get network side buffer length and request change if required. - // Check "newlength>currentLength" here as it is not possible to - // increase Dataport's buffer length - newLength = aCorrection->NotifyBufferCorrection( currentLength ); - if ( newLength<=0 || newLength>currentLength ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() unknown buffer length" ))); - User::Leave( KErrGeneral ); - } - // It is not possible to set Dataport side receive buffer length to any - // arbitrary value (currently only 8kB..20kB are supported but that - // can't be queried via an API). So here only default buffer size will - // be used from Dataport while this component's local buffering uses - // Dataport's default buffer size if not adjusted via plugin side. - // NOTE: If Dataport side starts to support arbitrary receive buffer - // size, it should be changed here if newLength != currentLength. - } - aBufferLength = newLength; - FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() buffer length after = %d" ), newLength)); - - // Get channel data - - TDunChannelData& channelData = iChannelData[aFirstFree]; - - // Create buffers and set length - - TUint8* bufferUpstream; - TPtr8* bufferUpPtr; - DoCreateBufferLC( channelData.iBufferUpstream, - channelData.iBufferUpPtr, - bufferUpstream, - bufferUpPtr, - newLength, - itemsInCs ); - - TUint8* bufferDownstream; - TPtr8* bufferDownPtr; - DoCreateBufferLC( channelData.iBufferDownstream, - channelData.iBufferDownPtr, - bufferDownstream, - bufferDownPtr, - newLength, - itemsInCs ); - - // Create signal copy objects - - CDunSignalCopy* upstreamCopy = channelData.iUpstreamSignalCopy; - CDunSignalCopy* downstreamCopy = channelData.iDownstreamSignalCopy; - if ( aComm ) - { - DoCreateSignalCopyLC( channelData.iUpstreamSignalCopy, - upstreamCopy, - itemsInCs ); - DoCreateSignalCopyLC( channelData.iDownstreamSignalCopy, - downstreamCopy, - itemsInCs ); - retTemp = upstreamCopy->SetMedia( aComm, - networkEntity, - EDunStreamTypeUpstream ); - if ( retTemp != KErrNone ) - { - delete upstreamCopy; - upstreamCopy = NULL; - } - retTemp = downstreamCopy->SetMedia( aComm, - networkEntity, - EDunStreamTypeDownstream ); - if ( retTemp != KErrNone ) - { - delete downstreamCopy; - downstreamCopy = NULL; - } - } - - // Create signal notify objects - - CDunSignalNotify* signalNotify = channelData.iSignalNotify; - if ( !aComm ) // RSocket - { - DoCreateSignalNotifyLC( channelData.iSignalNotify, - signalNotify, - itemsInCs ); - retTemp = signalNotify->SetMedia( networkEntity ); - if ( retTemp != KErrNone ) - { - delete signalNotify; - signalNotify = NULL; - } - } - - // Create upstream objects - - CDunUpstream* upstreamRW; - DoCreateUpTransferObjectL( channelData.iUpstreamRW, - upstreamRW, - itemsInCs ); - upstreamRW->SetBuffering( bufferUpPtr ); - upstreamRW->SetMedia( networkEntity, EDunMediaContextNetwork ); - upstreamRW->SetActivityCallback( this ); - - // Create downstream objects - - CDunDownstream* downstreamRW; - DoCreateDownTransferObjectL( channelData.iDownstreamRW, - downstreamRW, - itemsInCs ); - downstreamRW->SetBuffering( bufferDownPtr ); - downstreamRW->SetMedia( networkEntity, EDunMediaContextNetwork ); - - // Save values - - channelData.iNetwork = networkEntity; - channelData.iUpstreamRW = upstreamRW; - channelData.iDownstreamRW = downstreamRW; - channelData.iBufferUpstream = bufferUpstream; - channelData.iBufferDownstream = bufferDownstream; - channelData.iBufferUpPtr = bufferUpPtr; - channelData.iBufferDownPtr = bufferDownPtr; - channelData.iUpstreamSignalCopy = upstreamCopy; - channelData.iDownstreamSignalCopy = downstreamCopy; - channelData.iSignalNotify = signalNotify; - - CleanupStack::Pop( itemsInCs ); - - // Set flag to indicate that advertisement is now possible - ManageAdvertisementStatusChange( ETrue, ETrue ); - - FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() complete" ))); - } - -// --------------------------------------------------------------------------- -// From class MDunTransporterUtility. -// Adds connection monitor callback for either local media or network side -// by connection ID -// Connection monitor will be added to aIndex:th endpoint -// --------------------------------------------------------------------------- -// -TInt CDunTransUtils::DoAddConnMonCallback( TInt aIndex, - MDunConnMon* aCallback, - TDunDirection aDirection, - TBool aSignal ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoAddConnMonCallback()" ))); - - if ( !iParent.iNetwork ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoAddConnMonCallback() (iNetwork) not initialized!" ))); - return KErrGeneral; - } - - if ( aIndex < 0 || - aIndex >= iChannelData.Count() ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoAddConnMonCallback() (not found) complete" ))); - return KErrNotFound; - } - - TDunChannelData& channelData = iChannelData[aIndex]; - - // Get upstream and downstream - CDunUpstream* upstream = channelData.iUpstreamRW; - CDunDownstream* downstream = channelData.iDownstreamRW; - - if ( aDirection == EDunReaderUpstream ) - { - // Initialize stream for AT parsing (ignore errors) - upstream->InitializeForAtParsing( downstream, - channelData.iChannelName, - upstream, - downstream ); - downstream->InitializeForDataPushing( upstream ); - } - - // Get stream type and operation type - - TDunStreamType streamType = - static_cast( aDirection & KDunStreamTypeMask ); - TDunOperationType operationType = - static_cast( aDirection & KDunOperationTypeMask ); - - if ( streamType == EDunStreamTypeUpstream ) - { - // If signal copy object(s) exist then add RunL error monitoring for them - if ( channelData.iUpstreamSignalCopy ) // optional - { - // Add callback (ignore errors) - channelData.iUpstreamSignalCopy->AddCallback( aCallback ); - } - } - else if ( streamType == EDunStreamTypeDownstream ) - { - // If signal copy object(s) exist then add RunL error monitoring for them - if ( channelData.iDownstreamSignalCopy ) // optional - { - // Add callback (ignore errors) - channelData.iDownstreamSignalCopy->AddCallback( aCallback ); - } - } - else - { - FTRACE(FPrint( _L("CDunTransUtils::DoAddConnMonCallback() (stream) not initialized!" ) )); - return KErrGeneral; - } - - // Set signal notify callback - - if ( aSignal && aDirection==EDunReaderDownstream ) - { - if ( !channelData.iSignalNotify ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoAddConnMonCallback() (iSignalNotify) not initialized" ))); - return KErrGeneral; - } - // Add callback (ignore errors) - channelData.iSignalNotify->AddCallback( aCallback ); - } - - // Add callback (ignore errors) - if ( streamType == EDunStreamTypeUpstream ) - { - upstream->AddConnMonCallback( aCallback, operationType ); - } - else // streamType == EDunStreamTypeDownstream - { - downstream->AddConnMonCallback( aCallback, operationType ); - } - - FTRACE(FPrint( _L("CDunTransUtils::DoAddConnMonCallback() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunTransporterUtility. -// Adds error to consider as no error condition when doing any of the four -// endpoint's read/writer operation -// Error will be added to aIndex:th endpoint -// --------------------------------------------------------------------------- -// -TInt CDunTransUtils::DoAddSkippedError( TInt aIndex, - TInt aError, - TDunDirection aDirection ) - { - FTRACE(FPrint( _L("CDunTransUtils::AddOneSkippedError" ) )); - if ( aIndex < 0 || - aIndex >= iChannelData.Count() ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoAddSkippedError() (not found) complete" ))); - return KErrNotFound; - } - TDunChannelData& channelData = iChannelData[aIndex]; - if ( !channelData.iChannelInUse ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoAddSkippedError() (channel not found) complete" ), aIndex)); - return KErrGeneral; - } - - if ( aDirection != EDunReaderUpstream && - aDirection != EDunWriterUpstream && - aDirection != EDunReaderDownstream && - aDirection != EDunWriterDownstream ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoAddSkippedError() (ERROR) added" ) )); - return KErrNotSupported; - } - - TDunStreamType streamType = - static_cast( aDirection & KDunStreamTypeMask ); - TDunOperationType operationType = - static_cast( aDirection & KDunOperationTypeMask ); - - if ( streamType != EDunStreamTypeUpstream && - streamType != EDunStreamTypeDownstream ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoAddSkippedError() (stream) not initialized!" ) )); - return KErrGeneral; - } - - // Add skipped error (ignore errors) - - if ( streamType == EDunStreamTypeUpstream ) - { - channelData.iUpstreamRW->AddSkippedError( aError, operationType ); - } - else if ( streamType == EDunStreamTypeDownstream ) - { - channelData.iDownstreamRW->AddSkippedError( aError, operationType ); - } - else - { - FTRACE(FPrint( _L("CDunTransUtils::DoAddSkippedError() (stream) not initialized!" ) )); - return KErrGeneral; - } - - FTRACE(FPrint( _L("CDunTransUtils::DoAddSkippedError() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunTransporterUtility. -// Issues transfers requests for aIndex:th transfer objects -// --------------------------------------------------------------------------- -// -TInt CDunTransUtils::DoIssueTransferRequests( TInt aIndex ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoIssueTransferRequests()" ))); - if ( aIndex < 0 || - aIndex >= iChannelData.Count() ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoIssueTransferRequests() (not found) complete" ))); - return KErrNotFound; - } - TDunChannelData& channelData = iChannelData[aIndex]; - if ( !channelData.iChannelInUse ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoIssueTransferRequests() (channel not found) complete" ), aIndex)); - return KErrGeneral; - } - - if ( !channelData.iUpstreamRW ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoIssueTransferRequests() (iUpstreamRW) not initialized!" ))); - return KErrGeneral; - } - if ( !channelData.iDownstreamRW ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoIssueTransferRequests() (iDownstreamRW) not initialized!" ))); - return KErrGeneral; - } - - // Below issuing requests on signal objects (CDunSignalCopy, - // CDunSignalNotify) before issuing request on read/write objects - // (CDunUpstream/CDunDownstream). This is to guarantee that if signals are - // already set in local media side then they will be copied to network side - // before data. - - if ( channelData.iUpstreamSignalCopy ) // optional (RComm) - { - channelData.iUpstreamSignalCopy->IssueRequest(); - } - if ( channelData.iDownstreamSignalCopy ) // optional (RComm) - { - channelData.iDownstreamSignalCopy->IssueRequest(); - } - if ( channelData.iSignalNotify ) // optional (RSocket) - { - channelData.iSignalNotify->IssueRequest(); - } - channelData.iUpstreamRW->StartStream(); - channelData.iDownstreamRW->StartStream(); - - FTRACE(FPrint( _L("CDunTransUtils::DoIssueTransferRequests() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunTransporterUtility. -// Stops transfers for aIndex:th transfer objects -// --------------------------------------------------------------------------- -// -TInt CDunTransUtils::DoStopTransfers( TInt aIndex ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoStopTransfers()" ))); - if ( aIndex < 0 || - aIndex >= iChannelData.Count() ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoStopTransfers() (not found) complete" ))); - return KErrNotFound; - } - - TDunChannelData& channelData = iChannelData[aIndex]; - if ( !channelData.iChannelInUse ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoStopTransfers() (channel not found) complete" ), aIndex)); - return KErrGeneral; - } - - if ( !channelData.iUpstreamRW ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoStopTransfers() (iUpstreamRW) not initialized!" ))); - return KErrGeneral; - } - if ( !channelData.iDownstreamRW ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoStopTransfers() (iDownstreamRW) not initialized!" ))); - return KErrGeneral; - } - - // Now stop operation of signal objects (CDunSignalCopy, CDunSignalNotify) - // before stopping operation on read/write objects (CDunUpstream/ - // CDunDownstream). This is to ensure that signals don't change after - // stopping read/write which in turn could cause problems. - - if ( channelData.iUpstreamSignalCopy ) // optional (RComm) - { - channelData.iUpstreamSignalCopy->Stop(); - } - if ( channelData.iDownstreamSignalCopy ) // optional (RComm) - { - channelData.iDownstreamSignalCopy->Stop(); - } - if ( channelData.iSignalNotify ) // optional (RSocket) - { - channelData.iSignalNotify->Stop(); - } - channelData.iUpstreamRW->Stop(); - channelData.iDownstreamRW->Stop(); - - FTRACE(FPrint( _L("CDunTransUtils::DoStopTransfers() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunTransporterUtility. -// Free aIndex:th channel's objects -// --------------------------------------------------------------------------- -// -TInt CDunTransUtils::DoFreeChannel( TInt aIndex ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoFreeChannel()" ))); - - TDunChannelData& channelData = iChannelData[aIndex]; - if ( aIndex < 0 || - aIndex >= iChannelData.Count() ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoFreeChannel (not found) complete" ))); - return KErrNotFound; - } - if ( !channelData.iChannelInUse ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoFreeChannel (already free) complete" ))); - return KErrNone; - } - if ( !iParent.iNetwork ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoFreeChannel (iNetwork) not initialized!" ))); - return KErrGeneral; - } - - DoStopTransfers( aIndex ); - DeleteOneNetworkData( aIndex ); - DeleteOneLocalData( aIndex ); - DeleteBuffering( aIndex ); - - iParent.iNetwork->FreeChannel( channelData.iNetwork ); - - channelData.iNetwork = NULL; - channelData.iComm = NULL; - channelData.iSocket = NULL; - channelData.iChannelInUse = EFalse; - - // If note exist then stop it now as no reason to show it anymore - if ( iParent.iNoteHandler ) - { - iParent.iNoteHandler->Stop(); - } - // Set flag to indicate that advertisement is now possible - ManageAdvertisementStatusChange( ETrue, EFalse ); - - FTRACE(FPrint( _L("CDunTransUtils::DoFreeChannel() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunTransporterUtilityAux. -// Gets local ID counterpart of a network ID -// --------------------------------------------------------------------------- -// -TConnId CDunTransUtils::GetLocalId( RComm* aComm ) - { - FTRACE(FPrint( _L("CDunTransUtils::GetLocalId()" ))); - TInt mediaIndex = iParent.GetMediaIndex( aComm, EDunMediaContextNetwork ); - if ( mediaIndex < 0 ) - { - FTRACE(FPrint( _L("CDunTransUtils::GetLocalId() (ERROR) complete (%d)" ), mediaIndex)); - return NULL; - } - if ( mediaIndex >= iChannelData.Count() ) - { - FTRACE(FPrint( _L("CDunTransUtils::GetLocalId() (not found) complete" ) )); - return NULL; - } - TDunChannelData& channelData = iChannelData[mediaIndex]; - if ( channelData.iComm ) - { - FTRACE(FPrint( _L("CDunTransUtils::GetLocalId() (iComm) complete" ))); - return channelData.iComm; - } - if ( channelData.iSocket ) - { - FTRACE(FPrint( _L("CDunTransUtils::GetLocalId() (iSocket) complete" ))); - return channelData.iSocket; - } - FTRACE(FPrint( _L("CDunTransUtils::GetLocalId() (ERROR) complete" ))); - return NULL; - } - -// --------------------------------------------------------------------------- -// From MDunTransporterUtilityAux. -// Notifies when serious read/write error is detected on a connection -// --------------------------------------------------------------------------- -// -TInt CDunTransUtils::DoNotifyConnectionNotOk( - RComm* aComm, - RSocket* aSocket, - TDunConnectionReason& aConnReason, - RPointerArray& aCallbacks ) - { - FTRACE(FPrint( _L("CDunTransUtils::DoNotifyConnectionNotOk()" ))); - TConnId localId = NULL; - if ( aComm ) - { - localId = aComm; - } - else if ( aSocket ) - { - localId = aSocket; - } - TInt i; - TInt count = aCallbacks.Count(); - for ( i=0; iNotifyProgressChangeL( localId, aConnReason ) ); - } - FTRACE(FPrint( _L("CDunTransUtils::DoNotifyConnectionNotOk() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunActivityManager. -// Notifies about activity on a channel -// --------------------------------------------------------------------------- -// -TInt CDunTransUtils::NotifyChannelActivity() - { - FTRACE(FPrint( _L("CDunTransUtils::NotifyChannelActivity()" ))); - iParent.iActiveChannels++; - if ( iParent.iActiveChannels == 1 ) - { - // Now set key and notify (only once) that DUN is active - TInt retTemp = RProperty::Set( KPSUidDialupConnStatus, - KDialupConnStatus, - EDialupActive ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunTransUtils::NotifyChannelActivity() (ERROR) complete" ))); - return retTemp; - } - } - FTRACE(FPrint( _L("CDunTransUtils::NotifyChannelActivity() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class MDunActivityManager. -// Notifies about inactivity on a channel -// --------------------------------------------------------------------------- -// -TInt CDunTransUtils::NotifyChannelInactivity() - { - FTRACE(FPrint( _L("CDunTransUtils::NotifyChannelInactivity()" ))); - if ( iParent.iActiveChannels <= 0 ) - { - FTRACE(FPrint( _L("CDunTransUtils::NotifyChannelInactivity() (wrong iActiveChannels!) complete" ))); - return KErrGeneral; - } - iParent.iActiveChannels--; - if ( iParent.iActiveChannels == 0 ) - { - // Now set key and notify (only once) that DUN is inactive - TInt retTemp = RProperty::Set( KPSUidDialupConnStatus, - KDialupConnStatus, - EDialupInactive ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunTransUtils::NotifyChannelInactivity() (ERROR) complete" ))); - return retTemp; - } - } - FTRACE(FPrint( _L("CDunTransUtils::NotifyChannelInactivity() complete" ))); - return KErrNone; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/src/DunTransporter.cpp --- a/localconnectivityservice/dun/utils/src/DunTransporter.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,891 +0,0 @@ -/* -* Copyright (c) 2006-2008 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: Managing abstracted "channels" of network side communication -* -*/ - - -#include "DunTransUtils.h" -#include "DunTransporter.h" -#include "DunDataWaiter.h" -#include "DunUpstream.h" -#include "DunDownstream.h" -#include "DunSignalCopy.h" -#include "DunNoteHandler.h" -#include "DunUtils.h" -#include "DunDebug.h" -#include "DunPlugin.h" - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -EXPORT_C CDunTransporter* CDunTransporter::NewL( - MDunPluginManager* aPluginManager, - TInt aNumOfMaxChannels ) - { - CDunTransporter* self = new (ELeave) CDunTransporter( aPluginManager, - aNumOfMaxChannels ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunTransporter::~CDunTransporter() - { - FTRACE(FPrint( _L("CDunTransporter::~CDunTransporter()" ))); - UnInitialize(); - FTRACE(FPrint( _L("CDunTransporter::~CDunTransporter() complete" ))); - } - -// --------------------------------------------------------------------------- -// Number of allocated channels, is the same number as allocated and active -// (non-waiting) channels -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CDunTransporter::NumberOfAllocatedChannels() - { - FTRACE(FPrint( _L("CDunTransporter::NumberOfAllocatedChannels()" ))); - TInt i; - TInt allocChannels = 0; - TInt count = iChannelData.Count(); - for ( i=0; iNumberOfWaiters(); - FTRACE(FPrint( _L("CDunTransporter::NumberWaitingChannels() complete" ))); - return waiters; - } - -// --------------------------------------------------------------------------- -// Gets the number of allocated channels by owner UID, is the same number as -// allocated and active (non-waiting) channels -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CDunTransporter::GetNumberOfAllocatedChannelsByUid( - TUid aOwnerUid ) - { - FTRACE(FPrint( _L("CDunTransporter::GetNumberOfAllocatedChannelsByUid()" ))); - TInt i; - TInt allocChannels = 0; - TInt count = iChannelData.Count(); - for ( i=0; iGetNumberOfWaitersByUid( aOwnerUid ); - FTRACE(FPrint( _L("CDunTransporter::GetNumberWaitingChannelsByUid() complete" ))); - return waiters; - } - -// --------------------------------------------------------------------------- -// Transporter's service advertisement status -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CDunTransporter::AdvertisementStatus() - { - FTRACE(FPrint( _L("CDunTransporter::AdvertisementStatus()" ))); - FTRACE(FPrint( _L("CDunTransporter::AdvertisementStatus() complete" ))); - return iAdvertise; - } - -// --------------------------------------------------------------------------- -// Creates a channel of communication between local media (aComm) and network -// Local media object pointer also works as a connection ID for the -// allocated channel -// --------------------------------------------------------------------------- -// -EXPORT_C void CDunTransporter::AllocateChannelL( - RComm* aComm, - TUid aOwnerUid, - const TDesC8& aName, - TBool aEnqueuedFail, - MDunBufferCorrection* aCorrection ) - { - FTRACE(FPrint( _L("CDunTransporter::AllocateChannel() (RComm)" ))); - - if ( !aComm ) - { - FTRACE(FPrint( _L("CDunTransporter::AllocateChannel() (aComm not initialized!) complete" ))); - User::Leave( KErrGeneral ); - } - - if ( !aComm->SubSessionHandle() ) - { - FTRACE(FPrint( _L("CDunTransporter::AllocateChannel() (RComm) (bad handle) complete" ) )); - User::Leave( KErrBadHandle ); - } - - TInt retTemp = InitializeOnDemand(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunTransporter::AllocateChannel() (RComm) (ERROR) complete" ) )); - User::Leave( retTemp ); - } - - iChanMan->AddConnWaiterL( aComm, - aOwnerUid, - aName, - aEnqueuedFail, - aCorrection ); - - FTRACE(FPrint( _L("CDunTransporter::AllocateChannel() (RComm) complete" ))); - } - -// --------------------------------------------------------------------------- -// Creates a channel of communication between local media (aSocket) and -// network -// Local media object pointer also works as a connection ID for the -// allocated channel -// --------------------------------------------------------------------------- -// -EXPORT_C void CDunTransporter::AllocateChannelL( - RSocket* aSocket, - TUid aOwnerUid, - const TDesC8& aName, - TBool aEnqueuedFail, - TBool& aNoFreeChans ) - { - FTRACE(FPrint( _L("CDunTransporter::AllocateChannel() (RSocket)" ))); - - aNoFreeChans = EFalse; // Initialize now if plugin didn't do it already - - if ( !aSocket ) - { - FTRACE(FPrint( _L("CDunTransporter::AllocateChannel() (aSocket not initialized!) complete" ))); - User::Leave( KErrGeneral ); - } - if ( !aSocket->SubSessionHandle() ) - { - FTRACE(FPrint( _L("CDunTransporter::AllocateChannel() (RSocket) (bad handle) complete" ) )); - User::Leave( KErrBadHandle ); - } - TInt retTemp = InitializeOnDemand(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunTransporter::AllocateChannel() (RSocket) (ERROR) complete" ))); - User::Leave( retTemp ); - } - TInt firstFree = iUtility->InitializeFirstFreeChannel( aSocket ); - if ( firstFree < 0 ) - { - FTRACE(FPrint( _L("CDunTransporter::AllocateChannel() (RSocket) (firstfree failed!) complete" ) )); - User::Leave( firstFree ); - } - if ( firstFree >= iChannelData.Count() ) - { - FTRACE(FPrint( _L("CDunTransporter::AllocateChannel() (RSocket) (firstfree failed!) complete" ) )); - User::Leave( KErrGeneral ); - } - TInt bufferLength = KErrNotFound; - // bufferLength will be omitted (not needed to set to RSocket) - TRAPD( retTrap, - iUtility->DoAllocateChannelL(NULL, bufferLength, firstFree, NULL) ); - if ( retTrap != KErrNone ) - { - FTRACE(FPrint( _L("CDunTransporter::AllocateChannel() (RSocket) trapped!" ) )); - UnInitializeOnDemand(); // remove unused initialized channel - if ( retTrap == KErrTooBig ) - { - if ( aEnqueuedFail ) - { - // Inform plugin enqueue request - iPluginManager->NotifyPluginEnqueueRequest( aOwnerUid ); - } - aNoFreeChans = ETrue; // Inform plugin about no free channels - FTRACE(FPrint( _L("CDunTransporter::AllocateChannel() (RSocket) complete" ))); - User::Leave( KErrTooBig ); - } - FTRACE(FPrint( _L("CDunTransporter::AllocateChannel() (RSocket) complete" ))); - User::Leave( retTrap ); - } - TDunChannelData& channelData = iChannelData[firstFree]; - channelData.iSocket = aSocket; - channelData.iChannelName = HBufC8::NewMaxL( aName.Length() ); - TPtr8 chanNamePtr = channelData.iChannelName->Des(); - chanNamePtr.Copy( aName ); - channelData.iUpstreamRW->SetMedia( aSocket, EDunMediaContextLocal ); - channelData.iDownstreamRW->SetMedia( aSocket, EDunMediaContextLocal ); - channelData.iOwnerUid = aOwnerUid; - // Channel now occupied - channelData.iChannelInUse = ETrue; - - // Clear the queue, just to be sure - iPluginManager->NotifyPluginDequeueRequest( aOwnerUid ); - - FTRACE(FPrint( _L("CDunTransporter::AllocateChannel() (RSocket) complete" ))); - } - -// --------------------------------------------------------------------------- -// Frees an allocated channel by local media (aComm) connection ID -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CDunTransporter::FreeChannel( RComm* aComm ) - { - FTRACE(FPrint( _L("CDunTransporter::FreeChannel() (RComm)" ))); - - TInt retTemp = CheckInitAndHandle( aComm ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunTransporter::FreeChannel() (RComm) (ERROR) complete" ) )); - return retTemp; - } - - retTemp = iChanMan->RemoveConnWaiter( aComm ); - if ( retTemp == KErrNone ) - { - FTRACE(FPrint( _L("CDunTransporter::FreeChannel() (RComm) complete" ))); - return KErrNone; - } - - // No waiter found, so try to find from channels - TInt mediaIndex = GetMediaIndex( aComm ); - if ( mediaIndex < 0 ) - { - FTRACE(FPrint( _L("CDunTransporter::FreeChannel() (RComm) (ERROR) complete" ) )); - return mediaIndex; - } - - retTemp = iUtility->DoFreeChannel( mediaIndex ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunTransporter::FreeChannel() (RComm) (ERROR) complete" ))); - return retTemp; - } - UnInitializeOnDemand(); - - FTRACE(FPrint( _L("CDunTransporter::FreeChannel() (RComm) complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Frees an allocated channel by local media (aSocket) connection ID -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CDunTransporter::FreeChannel( RSocket* aSocket ) - { - FTRACE(FPrint( _L("CDunTransporter::FreeChannel() (RSocket)" ))); - - TInt retTemp = CheckInitAndHandle( aSocket ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunTransporter::FreeChannel() (RSocket) (ERROR) complete" ) )); - return retTemp; - } - - TInt mediaIndex = GetMediaIndex( aSocket ); - if ( mediaIndex < 0 ) - { - return mediaIndex; - } - - retTemp = iUtility->DoFreeChannel( mediaIndex ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunTransporter::FreeChannel() (RSocket) (ERROR) complete" ) )); - return retTemp; - } - UnInitializeOnDemand(); - - FTRACE(FPrint( _L("CDunTransporter::FreeChannel() (RSocket) complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Issues transfer requests for all transfer objects by local media -// (aComm) connection ID -// This will cause the Transporter by be ready for transferring data -// --------------------------------------------------------------------------- -// -EXPORT_C void CDunTransporter::IssueTransferRequestsL( RComm* aComm ) - { - FTRACE(FPrint( _L("CDunTransporter::IssueTransferRequests() (RComm)" ))); - - User::LeaveIfError( CheckInitAndHandle( aComm ) ); - TInt retTemp = iChanMan->IssueConnWaiterRequest( aComm ); - if ( retTemp == KErrNone ) - { - FTRACE(FPrint( _L("CDunTransporter::IssueTransferRequests() (RComm) complete" ))); - return; - } - - // No waiter found, so try to find from channels - TInt mediaIndex = GetMediaIndexL( aComm ); - User::LeaveIfError( iUtility->DoIssueTransferRequests( mediaIndex ) ); - - FTRACE(FPrint( _L("CDunTransporter::IssueTransferRequests() (RComm) complete" ))); - } - -// --------------------------------------------------------------------------- -// Issues transfer requests for all transfer objects by local media -// (aSocket) connection ID -// This will cause the Transporter by be ready for transferring data -// --------------------------------------------------------------------------- -// -EXPORT_C void CDunTransporter::IssueTransferRequestsL( RSocket* aSocket ) - { - FTRACE(FPrint( _L("CDunTransporter::IssueTransferRequests() (RSocket)" ))); - - User::LeaveIfError( CheckInitAndHandle( aSocket ) ); - TInt mediaIndex = GetMediaIndexL( aSocket ); - User::LeaveIfError( iUtility->DoIssueTransferRequests(mediaIndex) ); - - FTRACE(FPrint( _L("CDunTransporter::IssueTransferRequests() (RSocket) complete" ))); - } - -// --------------------------------------------------------------------------- -// Stops transfers for all transfer objects by local media (aComm) -// connection ID -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CDunTransporter::StopTransfers( RComm* aComm ) - { - FTRACE(FPrint( _L("CDunTransporter::StopTransfers() (RComm)" ))); - - TInt retTemp = CheckInitAndHandle( aComm ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunTransporter::StopTransfers() (RComm) (ERROR) complete" ) )); - return retTemp; - } - - retTemp = iChanMan->StopConnWaiter( aComm ); - if ( retTemp == KErrNone ) - { - FTRACE(FPrint( _L("CDunTransporter::StopTransfers() (RComm) complete" ))); - return KErrNone; - } - - // No waiter found, so try to find from channels - TInt mediaIndex = GetMediaIndex( aComm ); - if ( mediaIndex < 0 ) - { - FTRACE(FPrint( _L("CDunTransporter::StopTransfers() (RComm) (ERROR) complete" ) )); - return mediaIndex; - } - - retTemp = iUtility->DoStopTransfers( mediaIndex ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunTransporter::StopTransfers() (RComm) (ERROR) complete" ))); - return retTemp; - } - - FTRACE(FPrint( _L("CDunTransporter::StopTransfers() (RComm) complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Stops transfers for all transfer objects by local media (aSocket) -// connection ID -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CDunTransporter::StopTransfers( RSocket* aSocket ) - { - FTRACE(FPrint( _L("CDunTransporter::StopTransfers() (RSocket)" ))); - - TInt retTemp = CheckInitAndHandle( aSocket ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunTransporter::StopTransfers() (RSocket) (ERROR) complete" ) )); - return retTemp; - } - - TInt mediaIndex = GetMediaIndex( aSocket ); - if ( mediaIndex < 0 ) - { - FTRACE(FPrint( _L("CDunTransporter::StopTransfers() (RSocket) (ERROR) complete" ) )); - return mediaIndex; - } - - retTemp = iUtility->DoStopTransfers( mediaIndex ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint( _L("CDunTransporter::StopTransfers() (RSocket) (ERROR) complete" ))); - return retTemp; - } - - FTRACE(FPrint( _L("CDunTransporter::StopTransfers() (RSocket) complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Adds connection monitor callback for either local media or network side -// by connection ID -// Callbacks will be called read/write error is detected during endpoint -// operation -// --------------------------------------------------------------------------- -// -EXPORT_C void CDunTransporter::AddConnMonCallbackL( RComm* aComm, - MDunConnMon* aCallback, - TDunDirection aDirection, - TBool /*aSignal*/ ) - { - FTRACE(FPrint( _L("CDunTransporter::AddConnMonCallbackL() (RComm)" ))); - - User::LeaveIfError( CheckInitAndHandle( aComm ) ); - TInt retTemp = iChanMan->SaveWaiterConnMonCallbackL( aComm, - aCallback, - aDirection ); - if ( retTemp == KErrNone ) - { - FTRACE(FPrint( _L("CDunTransporter::AddConnMonCallbackL() (RComm) complete" ))); - return; - } - - TInt mediaIndex = GetMediaIndexL( aComm ); - User::LeaveIfError( iUtility->DoAddConnMonCallback( mediaIndex, - aCallback, - aDirection, - NULL )); - - FTRACE(FPrint( _L("CDunTransporter::AddConnMonCallbackL() (RComm) complete" ))); - } - -// --------------------------------------------------------------------------- -// Adds connection monitor callback for either local media or network side -// by connection ID -// Callbacks will be called when line status switches to high or low -// --------------------------------------------------------------------------- -// -EXPORT_C void CDunTransporter::AddConnMonCallbackL( RSocket* aSocket, - MDunConnMon* aCallback, - TDunDirection aDirection, - TBool aSignal ) - { - FTRACE(FPrint( _L("CDunTransporter::AddConnMonCallbackL() (RSocket)" ))); - - User::LeaveIfError( CheckInitAndHandle( aSocket ) ); - TInt mediaIndex = GetMediaIndexL( aSocket ); - User::LeaveIfError( iUtility->DoAddConnMonCallback( mediaIndex, - aCallback, - aDirection, - aSignal )); - - FTRACE(FPrint( _L("CDunTransporter::AddConnMonCallbackL() (RSocket) complete" ))); - } - -// --------------------------------------------------------------------------- -// Adds error to consider as no error condition when doing any of the four -// endpoint's read/writer operation -// --------------------------------------------------------------------------- -// -EXPORT_C void CDunTransporter::AddSkippedErrorL( TInt aError, - RComm* aComm, - TDunDirection aDirection ) - { - FTRACE(FPrint( _L("CDunTransporter::AddSkippedErrorL() (RComm)" ))); - - User::LeaveIfError( CheckInitAndHandle( aComm ) ); - TInt retTemp = iChanMan->SaveWaiterSkippedErrorL( aError, - aComm, - aDirection ); - if ( retTemp == KErrNone ) - { - FTRACE(FPrint( _L("CDunTransporter::AddSkippedErrorL() (RComm) complete" ))); - return; - } - - TInt mediaIndex = GetMediaIndexL( aComm ); - User::LeaveIfError( iUtility->DoAddSkippedError( mediaIndex, - aError, - aDirection )); - - FTRACE(FPrint( _L("CDunTransporter::AddSkippedErrorL() (RComm) complete" ))); - } - -// --------------------------------------------------------------------------- -// Adds error to consider as no error condition when doing any of the four -// endpoint's read/writer operation -// --------------------------------------------------------------------------- -// -EXPORT_C void CDunTransporter::AddSkippedErrorL( TInt aError, - RSocket* aSocket, - TDunDirection aDirection ) - { - FTRACE(FPrint( _L("CDunTransporter::AddSkippedErrorL() (RSocket)" ))); - - User::LeaveIfError( CheckInitAndHandle( aSocket ) ); - TInt mediaIndex = GetMediaIndexL( aSocket ); - User::LeaveIfError( iUtility->DoAddSkippedError( mediaIndex, - aError, - aDirection )); - - FTRACE(FPrint( _L("CDunTransporter::AddSkippedErrorL() (RSocket) complete" ))); - } - -// --------------------------------------------------------------------------- -// Sets service advertisement monitor callback by owner UID -// Callbacks will be called when advertisement status changes. -// The callbacks are updated with every successfully completed -// channel allocation/free (and allocation failure) so it is recommended -// to call this method after AllocateChannelL(). -// --------------------------------------------------------------------------- -// -EXPORT_C void CDunTransporter::SetAdvertisementMonitorL( - TUid aOwnerUid, - MDunServAdvMon* aCallback ) - { - FTRACE(FPrint( _L("CDunTransporter::SetAdvertisementMonitorL()" ))); - TInt i; - TInt count; - if ( !aCallback ) - { - FTRACE(FPrint( _L("CDunTransporter::SetAdvertisementMonitorL() (aCallback) not initialized!" ))); - User::Leave( KErrGeneral ); - } - count = iServAdvData.Count(); - for ( i=0; i( utility ); - MDunTransporterUtilityAux* utilityAux = static_cast( utility ); - iChanMan = CDunChanMan::NewL( *this, iUtility, utilityAux, iPluginManager ); - iNetwork = CDunNetDataport::NewL( iNumOfMaxChannels ); - iNetwork->InitializeL(); - iNoteHandler = CDunNoteHandler::NewL(); - iInitialized = ETrue; - - FTRACE(FPrint( _L("CDunTransporter::InitializeL() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// UnInitializes the transporter, can be called as the last operation -// --------------------------------------------------------------------------- -// -EXPORT_C void CDunTransporter::UnInitialize() - { - FTRACE(FPrint( _L("CDunTransporter::UnInitialize()" ))); - // first stop channel waiters before deletion - if ( iChanMan ) - { - iChanMan->ResetData(); - } - // now ready to remove channel data as no existing waiters - TInt i; - TInt count = iChannelData.Count(); - for ( i=0; iDoFreeChannel( i ); - } - } - iChannelData.Close(); - iServAdvData.Close(); - DeleteTransporter(); - iInitialized = EFalse; - FTRACE(FPrint( _L("CDunTransporter::UnInitialize() complete" ))); - } - -// --------------------------------------------------------------------------- -// Initialize the transporter -// --------------------------------------------------------------------------- -// -TInt CDunTransporter::InitializeOnDemand() - { - FTRACE(FPrint( _L("CDunTransporter::InitializeOnDemand()" ) )); - if ( !iInitialized ) - { - TRAPD( retTrap, InitializeL() ); - if ( retTrap != KErrNone ) - { - FTRACE(FPrint( _L("CDunTransporter::InitializeOnDemand() initialize failed!" ) )); - return retTrap; - } - } - FTRACE(FPrint( _L("CDunTransporter::InitializeOnDemand() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// UnInitialize the transporter -// --------------------------------------------------------------------------- -// -TInt CDunTransporter::UnInitializeOnDemand() - { - FTRACE(FPrint( _L("CDunTransporter::UnInitializeOnDemand()" ) )); - if ( !iInitialized ) - { - FTRACE(FPrint( _L("CDunTransporter::UnInitializeOnDemand() (not ready) complete" ) )); - return KErrNotReady; - } - // Check if non-free channel exists, also remove empty channel(s) - TInt i; - TBool allFree = ETrue; - for ( i=iChannelData.Count()-1; i>=0; i-- ) - { - TDunChannelData& channelData = iChannelData[i]; - if ( !channelData.iChannelInUse ) - { - if ( !channelData.iNetwork ) - { - // iChannelData must not contain data here - iChannelData.Remove( i ); - } - } - else // channel not free - { - allFree = EFalse; - FTRACE(FPrint( _L("CDunTransporter::UnInitializeOnDemand() channel found" ) )); - } - } - if ( iChanMan->NumberOfWaiters() > 0 ) - { - allFree = EFalse; - FTRACE(FPrint( _L("CDunTransporter::UnInitializeOnDemand() waiter found" ) )); - } - if ( allFree ) - { - // All channels were free -> uninitialize - UnInitialize(); - FTRACE(FPrint( _L("CDunTransporter::UnInitializeOnDemand() complete" ) )); - return KErrNone; - } - FTRACE(FPrint( _L("CDunTransporter::UnInitializeOnDemand() (not ready) complete" ) )); - return KErrNotReady; - } - -// --------------------------------------------------------------------------- -// Returns index of media for connection ID -// --------------------------------------------------------------------------- -// -TInt CDunTransporter::GetMediaIndex( TConnId aConnId, - TDunMediaContext aMediaContext ) - { - FTRACE(FPrint( _L("CDunTransporter::GetMediaIndex()" ))); - if ( aMediaContext != EDunMediaContextNetwork && - aMediaContext != EDunMediaContextLocal ) - { - FTRACE(FPrint( _L("CDunTransporter::GetMediaIndex() (not supported) complete" ))); - return KErrNotSupported; - } - TInt i; - TInt count = iChannelData.Count(); - for ( i=0; i( aConnId ); - if ( !subBase->SubSessionHandle() ) - { - FTRACE(FPrint( _L("CDunTransporter::CheckInitAndHandle() (bad handle) complete" ))); - return KErrBadHandle; - } - FTRACE(FPrint( _L("CDunTransporter::CheckInitAndHandle() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Deletes own internal data -// --------------------------------------------------------------------------- -// -void CDunTransporter::DeleteTransporter() - { - FTRACE(FPrint( _L("CDunTransporter::DeleteTransporter()" ))); - // first, delete channel manager with waiters - delete iChanMan; - iChanMan = NULL; - // second, delete the network object - delete iNetwork; - iNetwork = NULL; - // as last step delete utility class - CDunTransUtils* utility = static_cast( iUtility ); - delete utility; - iUtility = NULL; - // delete note class - delete iNoteHandler; - iNoteHandler = NULL; - FTRACE(FPrint( _L("CDunTransporter::DeleteTransporter() complete" ))); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/src/DunUpstream.cpp --- a/localconnectivityservice/dun/utils/src/DunUpstream.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,576 +0,0 @@ -/* -* Copyright (c) 2008-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: Definitions needed for one "stream" of CDunTransporter -* -*/ - -/* - * TODO: When local media is of type RComm, listening on it is started with - * RComm::NotifyDataAvailable() call. Check that USB ACM port and Irda RCOMM - * (and any other new media in the future) behaves correctly so that when - * RComm::ReadOneOrMore() is issued, the read is issued immediately without - * checking for new data. If waiting for new data happens in this - * NotifyDataAvailable/ReadOneOrMore combination, raise a defect to Symbian. - */ - -#include "DunTransporter.h" -#include "DunUpstream.h" -#include "DunDebug.h" - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CDunUpstream* CDunUpstream::NewL( MDunTransporterUtilityAux* aUtility ) - { - CDunUpstream* self = new (ELeave) CDunUpstream( aUtility ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CDunUpstream::~CDunUpstream() - { - FTRACE(FPrint( _L("CDunUpstream::~CDunUpstream()" ))); - ResetData(); - FTRACE(FPrint( _L("CDunUpstream::~CDunUpstream() complete" ))); - } - -// --------------------------------------------------------------------------- -// Resets data to initial values -// --------------------------------------------------------------------------- -// -void CDunUpstream::ResetData() - { - // APIs affecting this: - // IssueRequest() - Stop(); - // InitializeForAtParsing() - delete iParseData.iAtCmdHandler; - iParseData.iAtCmdHandler = NULL; - // AddConnMonCallbackL() - iCallbacksR.Close(); - iCallbacksW.Close(); - // AddSkippedErrorL() - iOkErrorsR.Close(); - iOkErrorsW.Close(); - // Internal - Initialize(); - } - -// --------------------------------------------------------------------------- -// Sets activity callback for this stream -// --------------------------------------------------------------------------- -// -TInt CDunUpstream::SetActivityCallback( - MDunActivityManager* aActivityCallback ) - { - if ( !aActivityCallback ) - { - FTRACE(FPrint( _L("CDunUpstream::SetActivityCallback() (aActivityCallback) not initialized!" ) )); - return KErrGeneral; - } - if ( iActivityData.iActivityCallback ) - { - FTRACE(FPrint( _L("CDunUpstream::SetActivityCallback() (already exists) complete" ) )); - return KErrAlreadyExists; - } - iActivityData.iActivityCallback = aActivityCallback; - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Initializes this stream for AT command notifications -// --------------------------------------------------------------------------- -// -TInt CDunUpstream::InitializeForAtParsing( - MDunStreamManipulator* aStreamCallback, - const TDesC8* aConnectionName, - MDunCmdModeMonitor* aCallbackUp, - MDunCmdModeMonitor* aCallbackDown ) - { - FTRACE(FPrint( _L("CDunUpstream::InitializeForAtParsing()" ) )); - if ( iParseData.iAtCmdHandler ) - { - FTRACE(FPrint( _L("CDunUpstream::InitializeForAtParsing() (already exists) complete" ) )); - return KErrAlreadyExists; - } - TInt retTrap = KErrNone; - CDunAtCmdHandler* atCmdHandler = NULL; - TRAP( retTrap, atCmdHandler = CDunAtCmdHandler::NewL(this, - aStreamCallback, - aConnectionName) ); - if ( retTrap != KErrNone ) - { - FTRACE(FPrint( _L("CDunUpstream::InitializeForAtParsing() (trapped!) complete" ) )); - return retTrap; - } - atCmdHandler->AddCmdModeCallback( aCallbackUp ); - atCmdHandler->AddCmdModeCallback( aCallbackDown ); - iParseData.iDataMode = EFalse; - iParseData.iAtCmdHandler = atCmdHandler; - FTRACE(FPrint( _L("CDunUpstream::InitializeForAtParsing() complete" ) )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Starts upstream by issuing read request -// --------------------------------------------------------------------------- -// -TInt CDunUpstream::StartStream() - { - FTRACE(FPrint( _L("CDunUpstream::StartStream()" ) )); - if ( !iNetwork ) - { - FTRACE(FPrint( _L("CDunUpstream::StartStream() (iNetwork) not initialized!" ) )); - return KErrGeneral; - } - if ( !iComm && !iSocket ) - { - FTRACE(FPrint( _L("CDunUpstream::StartStream() (iComm&iSocket) not initialized!" ) )); - return KErrGeneral; - } - iOperationType = EDunOperationTypeRead; - TInt retVal = IssueRequest(); - FTRACE(FPrint( _L("CDunUpstream::StartStream() complete" ) )); - return retVal; - } - -// --------------------------------------------------------------------------- -// Stops transfer for read or write endpoints -// --------------------------------------------------------------------------- -// -TInt CDunUpstream::Stop() - { - FTRACE(FPrint( _L("CDunUpstream::Stop() (Dir=%d)" ), iDirection)); - // Don't stop CDunAtCmdHandler here as it is downstream related! - if ( iTransferState != EDunStateTransferring ) - { - FTRACE(FPrint( _L("CDunUpstream::Stop() (not ready) complete" ))); - return KErrNotReady; - } - // Stop only current operation - if ( iOperationType == EDunOperationTypeRead ) - { - if ( iComm ) - { - iComm->ReadCancel(); - FTRACE(FPrint( _L("CDunUpstream::Stop() (RComm) cancelled" ))); - } - else if ( iSocket ) - { - iSocket->CancelRecv(); - FTRACE(FPrint( _L("CDunUpstream::Stop() (RSocket) cancelled" ))); - } - } - else if ( iOperationType == EDunOperationTypeWrite ) - { - if ( iNetwork ) - { - iNetwork->WriteCancel(); - FTRACE(FPrint( _L("CDunUpstream::Stop() (Network) cancelled" ))); - } - } - Cancel(); - iTransferState = EDunStateIdle; - // Notify parent about inactivity - if ( iActivityData.iActivityCallback && iActivityData.iNotified ) - { - iActivityData.iActivityCallback->NotifyChannelInactivity(); - iActivityData.iNotified = EFalse; - } - FTRACE(FPrint( _L("CDunUpstream::Stop() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Data transmission state (if read completed) -// --------------------------------------------------------------------------- -// -TBool CDunUpstream::DataReadStatus() - { - return iActivityData.iDataRead; - } - -// --------------------------------------------------------------------------- -// CDunUpstream::CDunUpstream -// --------------------------------------------------------------------------- -// -CDunUpstream::CDunUpstream( MDunTransporterUtilityAux* aUtility ) : - iUtility( aUtility ) - { - Initialize(); - } - -// --------------------------------------------------------------------------- -// CDunUpstream::ConstructL -// --------------------------------------------------------------------------- -// -void CDunUpstream::ConstructL() - { - FTRACE(FPrint( _L("CDunUpstream::ConstructL()" ) )); - if ( !iUtility ) - { - User::Leave( KErrGeneral ); - } - FTRACE(FPrint( _L("CDunUpstream::ConstructL() complete" ) )); - } - -// --------------------------------------------------------------------------- -// Initializes this class -// --------------------------------------------------------------------------- -// -void CDunUpstream::Initialize() - { - // Don't initialize iUtility here (it is set through NewL) - iActivityData.iActivityCallback = NULL; - iActivityData.iDataRead = EFalse; - iActivityData.iNotified = EFalse; - iParseData.iDataMode = EFalse; - iParseData.iAtCmdHandler = NULL; - } - -// --------------------------------------------------------------------------- -// Issues transfer request for this stream -// --------------------------------------------------------------------------- -// -TInt CDunUpstream::IssueRequest() - { - // Set direction - iDirection = static_cast( EDunStreamTypeUpstream | iOperationType ); - - FTRACE(FPrint( _L("CDunUpstream::IssueRequest() (Dir=%d)" ), iDirection)); - - if ( iTransferState != EDunStateIdle ) - { - FTRACE(FPrint( _L("CDunUpstream::IssueRequest() (not ready) complete" ) )); - return KErrNotReady; - } - - if ( iOperationType == EDunOperationTypeRead ) - { - iBufferPtr->SetLength( iBufferPtr->MaxLength() ); - FTRACE(FPrint( _L("CDunUpstream::IssueRequest() trying to read %d bytes... (Dir=%d)" ), iBufferPtr->Length(), iDirection)); - } - else // iOperationType == EDunOperationTypeWrite - { - FTRACE(FPrint( _L("CDunUpstream::IssueRequest() writing %d bytes... (Dir=%d)" ), iBufferPtr->Length(), iDirection)); - } - - switch ( iDirection ) - { - case EDunReaderUpstream: - if ( iComm ) - { - iStatus = KRequestPending; - iComm->ReadOneOrMore( iStatus, *iBufferPtr ); - FTRACE(FPrint( _L("CDunUpstream::IssueRequest() RComm ReadOneOrMore() requested" ) )); - } - else if ( iSocket ) - { - iStatus = KRequestPending; - iSocket->RecvOneOrMore( *iBufferPtr, 0, iStatus, iReadLengthSocket ); - FTRACE(FPrint( _L("CDunUpstream::IssueRequest() RSocket RecvOneOrMore() requested" ) )); - } - else - { - FTRACE(FPrint( _L("CDunUpstream::IssueRequest() (ERROR) complete" ) )); - return KErrGeneral; - } - break; - case EDunWriterUpstream: - iStatus = KRequestPending; - iNetwork->Write( iStatus, *iBufferPtr ); - FTRACE(FPrint( _L("CDunUpstream::IssueRequest() RComm Write() requested" ) )); - break; - default: - FTRACE(FPrint( _L("CDunUpstream::IssueRequest() (ERROR) complete" ) )); - return KErrGeneral; - } - - SetActive(); - iTransferState = EDunStateTransferring; - - FTRACE(FPrint( _L("CDunUpstream::IssueRequest() (Dir=%d) complete" ), iDirection)); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Processes data that was read -// --------------------------------------------------------------------------- -// -TBool CDunUpstream::ProcessReadData() - { - FTRACE(FPrint( _L("CDunUpstream::ProcessReadData()" ))); - // The following will be transferred to Dataport - if ( iParseData.iDataMode ) - { - iOperationType = EDunOperationTypeWrite; - FTRACE(FPrint( _L("CDunUpstream::ProcessReadData() (next write) complete" ))); - return ETrue; - } - if ( !iParseData.iAtCmdHandler ) // optional - { - FTRACE(FPrint( _L("CDunUpstream::ProcessReadData() (no handler) complete" ))); - return ETrue; - } - // The following will be transferred to parser - TInt retTemp = KErrNone; - TBool moreNeeded = EFalse; - retTemp = iParseData.iAtCmdHandler->AddDataForParsing( *iBufferPtr, - moreNeeded ); - if ( retTemp!=KErrNone || !moreNeeded ) - { - // If error or no error but no more data needed, don't reissue - FTRACE(FPrint( _L("CDunUpstream::ProcessReadData() (no reissue) complete" ))); - return EFalse; - } - // If no error and more data needed, reissue - FTRACE(FPrint( _L("CDunUpstream::ProcessReadData() (reissue) complete" ))); - return ETrue; - } - -// --------------------------------------------------------------------------- -// Manages activity in a channel -// --------------------------------------------------------------------------- -// -TInt CDunUpstream::ManageChannelActivity() - { - FTRACE(FPrint( _L("CDunUpstream::ManageChannelActivity()" ))); - if ( iActivityData.iDataRead ) - { - FTRACE(FPrint( _L("CDunUpstream::ManageChannelActivity() (not ready) complete" ))); - return KErrNotReady; - } - iActivityData.iDataRead = ETrue; - if ( iActivityData.iActivityCallback && !iActivityData.iNotified ) - { - iActivityData.iActivityCallback->NotifyChannelActivity(); - iActivityData.iNotified = ETrue; - } - FTRACE(FPrint( _L("CDunUpstream::ManageChannelActivity() complete" ))); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called when endpoint data read/write complete -// --------------------------------------------------------------------------- -// -void CDunUpstream::RunL() - { - FTRACE(FPrint( _L("CDunUpstream::RunL() (Dir=%d)" ), iDirection)); - iTransferState = EDunStateIdle; - - TBool isError; - TInt retTemp = iStatus.Int(); - TInt stop = ProcessErrorCondition( retTemp, isError ); - - if ( !stop ) // no real error detected -> continue - { - TBool reIssue = ETrue; - if ( !isError ) - { - if ( iOperationType == EDunOperationTypeRead ) - { - ManageChannelActivity(); - reIssue = ProcessReadData(); - } // if ( iOperationType == EDunOperationTypeRead ) - else // iOperationType == EDunOperationTypeWrite - { - iOperationType = EDunOperationTypeRead; - } - } // if ( !isError ) - - if ( reIssue ) - { - IssueRequest(); - } - - } // if ( !stop ) - else // stop -> tear down connection - { - FTRACE(FPrint( _L("CDunUpstream::RunL() stop" ))); - TDunConnectionReason connReason; - connReason.iReasonType = EDunReasonTypeRW; - connReason.iContext = GetMediaContext( EDunStreamTypeUpstream ); - connReason.iSignalType = 0; - connReason.iSignalHigh = EFalse; - connReason.iDirection = iDirection; - connReason.iErrorCode = retTemp; - if ( iOperationType == EDunOperationTypeRead ) - { - iUtility->DoNotifyConnectionNotOk( iComm, - iSocket, - connReason, - iCallbacksR ); - } - else // iOperationType == EDunOperationTypeWrite - { - iUtility->DoNotifyConnectionNotOk( iComm, - iSocket, - connReason, - iCallbacksW ); - } - } // else - - FTRACE(FPrint( _L("CDunUpstream::RunL() complete" ))); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Gets called on cancel -// --------------------------------------------------------------------------- -// -void CDunUpstream::DoCancel() - { - } - -// --------------------------------------------------------------------------- -// From class MDunAtCmdStatusReporter -// Notifies about parser's need to get more data -// --------------------------------------------------------------------------- -// -void CDunUpstream::NotifyParserNeedsMoreData() - { - FTRACE(FPrint( _L("CDunUpstream::NotifyParserNeedsMoreData()" ))); - IssueRequest(); // iOperationType must be read here (don't set) - FTRACE(FPrint( _L("CDunUpstream::NotifyParserNeedsMoreData() complete" ))); - } - -// --------------------------------------------------------------------------- -// From class MDunAtCmdStatusReporter -// Notifies about editor mode reply -// --------------------------------------------------------------------------- -// -void CDunUpstream::NotifyEditorModeReply( TBool aStart ) - { - FTRACE(FPrint( _L("CDunUpstream::NotifyEditorModeReply()" ))); - if ( iParseData.iDataMode ) - { - FTRACE(FPrint( _L("CDunUpstream::NotifyEditorModeReply() (not ready) complete" ))); - return; - } - // If start of editor mode then just reissue the read request - // If continuation then echo and reissue the read request - if ( aStart ) - { - IssueRequest(); - FTRACE(FPrint( _L("CDunUpstream::NotifyEditorModeReply() (start) complete" ))); - return; - } - iParseData.iAtCmdHandler->SendEchoCharacter( iBufferPtr, this ); - FTRACE(FPrint( _L("CDunUpstream::NotifyEditorModeReply() complete" ))); - } - -// --------------------------------------------------------------------------- -// From class MDunAtCmdHandler -// Starts URC message handling -// --------------------------------------------------------------------------- -// -TInt CDunUpstream::StartUrc() - { - FTRACE(FPrint( _L("CDunUpstream::StartUrc()" ))); - TInt retVal = KErrNone; - if ( iParseData.iAtCmdHandler ) // optional - { - retVal = iParseData.iAtCmdHandler->StartUrc(); - } - FTRACE(FPrint( _L("CDunUpstream::StartUrc() complete" ))); - return retVal; - } - -// --------------------------------------------------------------------------- -// From class MDunAtCmdHandler -// Stops AT command handling downstream related activity (also URC) -// --------------------------------------------------------------------------- -// -TInt CDunUpstream::StopAtCmdHandling() - { - FTRACE(FPrint( _L("CDunUpstream::StopAtCmdHandling()" ))); - TInt retVal = KErrNone; - if ( iParseData.iAtCmdHandler ) // optional - { - retVal = iParseData.iAtCmdHandler->StopUrc(); - if ( retVal != KErrNone ) - { - iParseData.iAtCmdHandler->Stop(); - FTRACE(FPrint( _L("CDunUpstream::StopAtCmdHandling() (iAtCmdHandler) complete" ))); - return retVal; - } - retVal = iParseData.iAtCmdHandler->Stop(); - } - FTRACE(FPrint( _L("CDunUpstream::StopAtCmdHandling() complete" ))); - return retVal; - } - -// --------------------------------------------------------------------------- -// From class MDunCmdModeMonitor. -// Notifies about command mode start -// --------------------------------------------------------------------------- -// -void CDunUpstream::NotifyCommandModeStart() - { - FTRACE(FPrint( _L("CDunUpstream::NotifyCommandModeStart()" ))); - iParseData.iDataMode = EFalse; - // Stop processing (just to be sure). - // This will stop any possibly pending operations of - // CDunAtCmdHandler and CDunAtUrcHandler. CDunDownstream will take care of - // clearing (and stopping) non-callback write queues. - StopAtCmdHandling(); - // Also restart the URC handling after the data mode - StartUrc(); - FTRACE(FPrint( _L("CDunUpstream::NotifyCommandModeStart() complete" ))); - } - -// --------------------------------------------------------------------------- -// From class MDunCmdModeMonitor. -// Notifies about command mode end -// --------------------------------------------------------------------------- -// -void CDunUpstream::NotifyCommandModeEnd() - { - FTRACE(FPrint( _L("CDunUpstream::NotifyCommandModeEnd()" ))); - iParseData.iDataMode = ETrue; - // Stop processing (mandatory). - // This will stop any possibly pending operations of - // CDunAtCmdHandler and CDunAtUrcHandler. CDunDownstream will take care of - // clearing (and stopping) non-callback write queues. - StopAtCmdHandling(); - // The follow is needed because stopping the AT command handling here - // prevents the subsequent AT command handling notification to reach the - // NotifyAtCmdHandlingEnd() in this class (the notification starts from - // CDunAtCmdPusher's SetToIdleAndNotifyEnd()). - // So here we have to do the block "if ( aStartIndex < 0 )" in function - // NotifyAtCmdHandlingEnd(). - IssueRequest(); - FTRACE(FPrint( _L("CDunUpstream::NotifyCommandModeEnd() complete" ))); - } - -// --------------------------------------------------------------------------- -// From class MDunAtCmdEchoer. -// Notifies about command mode end -// --------------------------------------------------------------------------- -// -void CDunUpstream::NotifyEchoComplete() - { - FTRACE(FPrint( _L("CDunUpstream::NotifyEchoComplete()" ))); - IssueRequest(); - FTRACE(FPrint( _L("CDunUpstream::NotifyEchoComplete() complete" ))); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/dun/utils/src/DunUtils.cpp --- a/localconnectivityservice/dun/utils/src/DunUtils.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Common utility methods for DUN -* -*/ - - -#include -#include "DunUtils.h" -#include "DunDebug.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Connects to comms server -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CDunUtils::ConnectCommsServer( RCommServ& aCommServer ) - { - FTRACE(FPrint(_L( "CDunUtils::ConnectCommsServer()") )); - TInt retTemp; -#ifndef PRJ_USE_NETWORK_STUBS - retTemp = StartC32(); - if ( retTemp!=KErrNone && retTemp!=KErrAlreadyExists ) - { - FTRACE(FPrint(_L( "CDunUtils::ConnectCommsServer() StartC32 %d" ), retTemp)); - return retTemp; - } -#endif - retTemp = aCommServer.Connect(); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L( "CDunUtils::ConnectCommsServer() aCommServer.Connect %d" ), retTemp)); - return retTemp; - } - FTRACE(FPrint(_L( "CDunUtils::ConnectCommsServer() complete") )); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Sets RComm buffer length -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CDunUtils::SetRCommBufferLength( RComm& aComm, TInt aLength ) - { - FTRACE(FPrint(_L( "CDunUtils::SetRCommBufferLength()") )); - TInt retTemp = aComm.SetReceiveBufferLength( aLength ); - if ( retTemp != KErrNone ) - { - FTRACE(FPrint(_L( "CDunUtils::SetRCommBufferLength() (set failed) complete (%d)"), retTemp)); - return retTemp; - } - TInt setLength = aComm.ReceiveBufferLength(); - if ( setLength != aLength ) - { - FTRACE(FPrint(_L( "CDunUtils::SetRCommBufferLength() (get failed) complete") )); - return KErrGeneral; - } - FTRACE(FPrint(_L( "CDunUtils::SetRCommBufferLength() complete") )); - return KErrNone; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/bwins/generichidu.def --- a/localconnectivityservice/generichid/bwins/generichidu.def Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -EXPORTS - ?Unit@CField@@QBEHXZ @ 1 NONAME ; int CField::Unit(void) const - ?IsInReport@CField@@QBEHH@Z @ 2 NONAME ; int CField::IsInReport(int) const - ?NewLC@CGenericHid@@SAPAV1@PAVMTransportLayer@@@Z @ 3 NONAME ; class CGenericHid * CGenericHid::NewLC(class MTransportLayer *) - ?UsageMax@CField@@QBEHXZ @ 4 NONAME ; int CField::UsageMax(void) const - ?UnitExponent@CField@@QBEHXZ @ 5 NONAME ; int CField::UnitExponent(void) const - ?StringMin@CField@@QBEHXZ @ 6 NONAME ; int CField::StringMin(void) const - ?NewL@CHidDriver@@SAPAV1@VTUid@@PAVMDriverAccess@@@Z @ 7 NONAME ; class CHidDriver * CHidDriver::NewL(class TUid, class MDriverAccess *) - ?SetOffset@CField@@QAEXH@Z @ 8 NONAME ; void CField::SetOffset(int) - ?NewLC@CParser@@SAPAV1@XZ @ 9 NONAME ; class CParser * CParser::NewLC(void) - ?SetStringRange@CField@@QAEXHH@Z @ 10 NONAME ; void CField::SetStringRange(int, int) - ?ReportSizeBytes@CReportRoot@@QBEHHW4TType@CField@@@Z @ 11 NONAME ; int CReportRoot::ReportSizeBytes(int, enum CField::TType) const - ?ClearUsageList@CField@@QAEXXZ @ 12 NONAME ; void CField::ClearUsageList(void) - ?IsNamedArray@CCollection@@QBEHXZ @ 13 NONAME ; int CCollection::IsNamedArray(void) const - ?SetUnitExponent@CField@@QAEXH@Z @ 14 NONAME ; void CField::SetUnitExponent(int) - ?SetAttributes@CField@@QAEXK@Z @ 15 NONAME ; void CField::SetAttributes(unsigned long) - ?SetPhysicalMin@CField@@QAEXH@Z @ 16 NONAME ; void CField::SetPhysicalMin(int) - ?SetUsagePage@CField@@QAEXH@Z @ 17 NONAME ; void CField::SetUsagePage(int) - ?SetStringMin@CField@@QAEXH@Z @ 18 NONAME ; void CField::SetStringMin(int) - ?CollectionByIndex@CCollection@@QBEPBV1@H@Z @ 19 NONAME ; class CCollection const * CCollection::CollectionByIndex(int) const - ?FieldByIndex@CCollection@@QBEPBVCField@@H@Z @ 20 NONAME ; class CField const * CCollection::FieldByIndex(int) const - ?SetPhysicalRange@CField@@QAEXHH@Z @ 21 NONAME ; void CField::SetPhysicalRange(int, int) - ?SetDesignatorRange@CField@@QAEXHH@Z @ 22 NONAME ; void CField::SetDesignatorRange(int, int) - ?CollectionCount@CCollection@@QBEHXZ @ 23 NONAME ; int CCollection::CollectionCount(void) const - ?NewLC@CReportGenerator@@SAPAV1@PBVCReportRoot@@HW4TType@CField@@@Z @ 24 NONAME ; class CReportGenerator * CReportGenerator::NewLC(class CReportRoot const *, int, enum CField::TType) - ?IsInput@CField@@QBEHXZ @ 25 NONAME ; int CField::IsInput(void) const - ?StringMax@CField@@QBEHXZ @ 26 NONAME ; int CField::StringMax(void) const - ?SetLogicalMin@CField@@QAEXH@Z @ 27 NONAME ; void CField::SetLogicalMin(int) - ?GetUsageId@TReportTranslator@@QBEHAAHH@Z @ 28 NONAME ; int TReportTranslator::GetUsageId(int &, int) const - ?SearchL@THidFieldSearch@@QAEXPBVCReportRoot@@PAVMHidFieldFinder@@@Z @ 29 NONAME ; void THidFieldSearch::SearchL(class CReportRoot const *, class MHidFieldFinder *) - ?IsConstant@CField@@QBEHXZ @ 30 NONAME ; int CField::IsConstant(void) const - ?PhysicalMin@CField@@QBEHXZ @ 31 NONAME ; int CField::PhysicalMin(void) const - ?ParseL@CParser@@QAEPAVCReportRoot@@ABVTDesC8@@@Z @ 32 NONAME ; class CReportRoot * CParser::ParseL(class TDesC8 const &) - ?AddUsageL@CField@@QAEXH@Z @ 33 NONAME ; void CField::AddUsageL(int) - ?Count@CField@@QBEHXZ @ 34 NONAME ; int CField::Count(void) const - ?SetSize@CField@@QAEXH@Z @ 35 NONAME ; void CField::SetSize(int) - ??0TReportTranslator@@QAE@ABVTDesC8@@PBVCField@@@Z @ 36 NONAME ; TReportTranslator::TReportTranslator(class TDesC8 const &, class CField const *) - ?ReportId@CField@@QBEHXZ @ 37 NONAME ; int CField::ReportId(void) const - ?IsArray@CField@@QBEHXZ @ 38 NONAME ; int CField::IsArray(void) const - ?SetPhysicalMax@CField@@QAEXH@Z @ 39 NONAME ; void CField::SetPhysicalMax(int) - ?NewL@CGenericHid@@SAPAV1@PAVMTransportLayer@@@Z @ 40 NONAME ; class CGenericHid * CGenericHid::NewL(class MTransportLayer *) - ?HasUsage@CField@@QBEHH@Z @ 41 NONAME ; int CField::HasUsage(int) const - ?SetStringMax@CField@@QAEXH@Z @ 42 NONAME ; void CField::SetStringMax(int) - ?IsFeature@CField@@QBEHXZ @ 43 NONAME ; int CField::IsFeature(void) const - ?StringIndex@CField@@QBEHXZ @ 44 NONAME ; int CField::StringIndex(void) const - ?Report@CReportGenerator@@QAE?AVTPtr8@@XZ @ 45 NONAME ; class TPtr8 CReportGenerator::Report(void) - ??0CHidDriver@@IAE@XZ @ 46 NONAME ; CHidDriver::CHidDriver(void) - ?AllowedToHandleEvent@CHidInputDataHandlingReg@@QAEHHH@Z @ 47 NONAME ; int CHidInputDataHandlingReg::AllowedToHandleEvent(int, int) - ?UsageIdL@TReportTranslator@@QBEHH@Z @ 48 NONAME ; int TReportTranslator::UsageIdL(int) const - ?SetLogicalMax@CField@@QAEXH@Z @ 49 NONAME ; void CField::SetLogicalMax(int) - ?IsOutput@CField@@QBEHXZ @ 50 NONAME ; int CField::IsOutput(void) const - ?Usage@CCollection@@QBEHXZ @ 51 NONAME ; int CCollection::Usage(void) const - ?SetUnit@CField@@QAEXH@Z @ 52 NONAME ; void CField::SetUnit(int) - ?PhysicalMax@CField@@QBEHXZ @ 53 NONAME ; int CField::PhysicalMax(void) const - ?IsData@CField@@QBEHXZ @ 54 NONAME ; int CField::IsData(void) const - ?SetUsageRange@CField@@QAEXHH@Z @ 55 NONAME ; void CField::SetUsageRange(int, int) - ?DesignatorIndex@CField@@QBEHXZ @ 56 NONAME ; int CField::DesignatorIndex(void) const - ?IsApplication@CCollection@@QBEHXZ @ 57 NONAME ; int CCollection::IsApplication(void) const - ?LogicalMin@CField@@QBEHXZ @ 58 NONAME ; int CField::LogicalMin(void) const - ?DesignatorMin@CField@@QBEHXZ @ 59 NONAME ; int CField::DesignatorMin(void) const - ?RawValueL@TReportTranslator@@QBEHH@Z @ 60 NONAME ; int TReportTranslator::RawValueL(int) const - ?SetDesignatorIndex@CField@@QAEXH@Z @ 61 NONAME ; void CField::SetDesignatorIndex(int) - ?AddHandledEvent@CHidInputDataHandlingReg@@QAEXHH@Z @ 62 NONAME ; void CHidInputDataHandlingReg::AddHandledEvent(int, int) - ?Type@CField@@QBE?AW4TType@1@XZ @ 63 NONAME ; enum CField::TType CField::Type(void) const - ?Attributes@CField@@QBEKXZ @ 64 NONAME ; unsigned long CField::Attributes(void) const - ?IsReport@CCollection@@QBEHXZ @ 65 NONAME ; int CCollection::IsReport(void) const - ?IsUsageModifier@CCollection@@QBEHXZ @ 66 NONAME ; int CCollection::IsUsageModifier(void) const - ?LastUsage@CField@@QBEHXZ @ 67 NONAME ; int CField::LastUsage(void) const - ?SetUsageMin@CField@@QAEXH@Z @ 68 NONAME ; void CField::SetUsageMin(int) - ?IsUsageSwitch@CCollection@@QBEHXZ @ 69 NONAME ; int CCollection::IsUsageSwitch(void) const - ?Size@CField@@QBEHXZ @ 70 NONAME ; int CField::Size(void) const - ?IsLogical@CCollection@@QBEHXZ @ 71 NONAME ; int CCollection::IsLogical(void) const - ?FieldCount@CCollection@@QBEHXZ @ 72 NONAME ; int CCollection::FieldCount(void) const - ?SetField@CReportGenerator@@QAEHPBVCField@@HHH@Z @ 73 NONAME ; int CReportGenerator::SetField(class CField const *, int, int, int) - ?IsPhysical@CCollection@@QBEHXZ @ 74 NONAME ; int CCollection::IsPhysical(void) const - ?LogicalMax@CField@@QBEHXZ @ 75 NONAME ; int CField::LogicalMax(void) const - ?SetDesignatorMin@CField@@QAEXH@Z @ 76 NONAME ; void CField::SetDesignatorMin(int) - ?DesignatorMax@CField@@QBEHXZ @ 77 NONAME ; int CField::DesignatorMax(void) const - ?Type@CCollection@@QBEKXZ @ 78 NONAME ; unsigned long CCollection::Type(void) const - ?Count@TReportTranslator@@QBEHXZ @ 79 NONAME ; int TReportTranslator::Count(void) const - ?GetValue@TReportTranslator@@QBEHAAHHH@Z @ 80 NONAME ; int TReportTranslator::GetValue(int &, int, int) const - ?IsVariable@CField@@QBEHXZ @ 81 NONAME ; int CField::IsVariable(void) const - ?ValueL@TReportTranslator@@QBEHHH@Z @ 82 NONAME ; int TReportTranslator::ValueL(int, int) const - ?SetUsageMax@CField@@QAEXH@Z @ 83 NONAME ; void CField::SetUsageMax(int) - ?SetType@CField@@QAEXABW4TType@1@@Z @ 84 NONAME ; void CField::SetType(enum CField::TType const &) - ?Usage@CField@@QBEHH@Z @ 85 NONAME ; int CField::Usage(int) const - ?NewL@CReportGenerator@@SAPAV1@PBVCReportRoot@@HW4TType@CField@@@Z @ 86 NONAME ; class CReportGenerator * CReportGenerator::NewL(class CReportRoot const *, int, enum CField::TType) - ?UsagePage@CField@@QBEHXZ @ 87 NONAME ; int CField::UsagePage(void) const - ?SetStringIndex@CField@@QAEXH@Z @ 88 NONAME ; void CField::SetStringIndex(int) - ?UsageMin@CField@@QBEHXZ @ 89 NONAME ; int CField::UsageMin(void) const - ?UsageArray@CField@@QBE?AV?$TArray@H@@XZ @ 90 NONAME ; class TArray CField::UsageArray(void) const - ?SetCount@CField@@QAEXH@Z @ 91 NONAME ; void CField::SetCount(int) - ?UsagePage@CCollection@@QBEHXZ @ 92 NONAME ; int CCollection::UsagePage(void) const - ??1CHidDriver@@UAE@XZ @ 93 NONAME ; CHidDriver::~CHidDriver(void) - ?Offset@CField@@QBEHXZ @ 94 NONAME ; int CField::Offset(void) const - ?SetDesignatorMax@CField@@QAEXH@Z @ 95 NONAME ; void CField::SetDesignatorMax(int) - ?SetReportId@CField@@QAEXH@Z @ 96 NONAME ; void CField::SetReportId(int) - ?NewL@CParser@@SAPAV1@XZ @ 97 NONAME ; class CParser * CParser::NewL(void) - ?UsageCount@CField@@QBEHXZ @ 98 NONAME ; int CField::UsageCount(void) const - ?SetLogicalRange@CField@@QAEXHH@Z @ 99 NONAME ; void CField::SetLogicalRange(int, int) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/eabi/generichidu.def --- a/localconnectivityservice/generichid/eabi/generichidu.def Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -EXPORTS - _ZN10CHidDriver4NewLE4TUidP13MDriverAccess @ 1 NONAME - _ZN10CHidDriverC2Ev @ 2 NONAME - _ZN10CHidDriverD0Ev @ 3 NONAME - _ZN10CHidDriverD1Ev @ 4 NONAME - _ZN10CHidDriverD2Ev @ 5 NONAME - _ZN11CGenericHid4NewLEP15MTransportLayer @ 6 NONAME - _ZN11CGenericHid5NewLCEP15MTransportLayer @ 7 NONAME - _ZN15THidFieldSearch7SearchLEPK11CReportRootP15MHidFieldFinder @ 8 NONAME - _ZN16CReportGenerator4NewLEPK11CReportRootiN6CField5TTypeE @ 9 NONAME - _ZN16CReportGenerator5NewLCEPK11CReportRootiN6CField5TTypeE @ 10 NONAME - _ZN16CReportGenerator6ReportEv @ 11 NONAME - _ZN16CReportGenerator8SetFieldEPK6CFieldiii @ 12 NONAME - _ZN17TReportTranslatorC1ERK6TDesC8PK6CField @ 13 NONAME - _ZN17TReportTranslatorC2ERK6TDesC8PK6CField @ 14 NONAME - _ZN24CHidInputDataHandlingReg15AddHandledEventEii @ 15 NONAME - _ZN24CHidInputDataHandlingReg20AllowedToHandleEventEii @ 16 NONAME - _ZN6CField11SetReportIdEi @ 17 NONAME - _ZN6CField11SetUsageMaxEi @ 18 NONAME - _ZN6CField11SetUsageMinEi @ 19 NONAME - _ZN6CField12SetStringMaxEi @ 20 NONAME - _ZN6CField12SetStringMinEi @ 21 NONAME - _ZN6CField12SetUsagePageEi @ 22 NONAME - _ZN6CField13SetAttributesEm @ 23 NONAME - _ZN6CField13SetLogicalMaxEi @ 24 NONAME - _ZN6CField13SetLogicalMinEi @ 25 NONAME - _ZN6CField13SetUsageRangeEii @ 26 NONAME - _ZN6CField14ClearUsageListEv @ 27 NONAME - _ZN6CField14SetPhysicalMaxEi @ 28 NONAME - _ZN6CField14SetPhysicalMinEi @ 29 NONAME - _ZN6CField14SetStringIndexEi @ 30 NONAME - _ZN6CField14SetStringRangeEii @ 31 NONAME - _ZN6CField15SetLogicalRangeEii @ 32 NONAME - _ZN6CField15SetUnitExponentEi @ 33 NONAME - _ZN6CField16SetDesignatorMaxEi @ 34 NONAME - _ZN6CField16SetDesignatorMinEi @ 35 NONAME - _ZN6CField16SetPhysicalRangeEii @ 36 NONAME - _ZN6CField18SetDesignatorIndexEi @ 37 NONAME - _ZN6CField18SetDesignatorRangeEii @ 38 NONAME - _ZN6CField7SetSizeEi @ 39 NONAME - _ZN6CField7SetTypeERKNS_5TTypeE @ 40 NONAME - _ZN6CField7SetUnitEi @ 41 NONAME - _ZN6CField8SetCountEi @ 42 NONAME - _ZN6CField9AddUsageLEi @ 43 NONAME - _ZN6CField9SetOffsetEi @ 44 NONAME - _ZN7CParser4NewLEv @ 45 NONAME - _ZN7CParser5NewLCEv @ 46 NONAME - _ZN7CParser6ParseLERK6TDesC8 @ 47 NONAME - _ZNK11CCollection10FieldCountEv @ 48 NONAME - _ZNK11CCollection10IsPhysicalEv @ 49 NONAME - _ZNK11CCollection12FieldByIndexEi @ 50 NONAME - _ZNK11CCollection12IsNamedArrayEv @ 51 NONAME - _ZNK11CCollection13IsApplicationEv @ 52 NONAME - _ZNK11CCollection13IsUsageSwitchEv @ 53 NONAME - _ZNK11CCollection15CollectionCountEv @ 54 NONAME - _ZNK11CCollection15IsUsageModifierEv @ 55 NONAME - _ZNK11CCollection17CollectionByIndexEi @ 56 NONAME - _ZNK11CCollection4TypeEv @ 57 NONAME - _ZNK11CCollection5UsageEv @ 58 NONAME - _ZNK11CCollection8IsReportEv @ 59 NONAME - _ZNK11CCollection9IsLogicalEv @ 60 NONAME - _ZNK11CCollection9UsagePageEv @ 61 NONAME - _ZNK11CReportRoot15ReportSizeBytesEiN6CField5TTypeE @ 62 NONAME - _ZNK17TReportTranslator10GetUsageIdERii @ 63 NONAME - _ZNK17TReportTranslator5CountEv @ 64 NONAME - _ZNK17TReportTranslator6ValueLEii @ 65 NONAME - _ZNK17TReportTranslator8GetValueERiii @ 66 NONAME - _ZNK17TReportTranslator8UsageIdLEi @ 67 NONAME - _ZNK17TReportTranslator9RawValueLEi @ 68 NONAME - _ZNK6CField10AttributesEv @ 69 NONAME - _ZNK6CField10IsConstantEv @ 70 NONAME - _ZNK6CField10IsInReportEi @ 71 NONAME - _ZNK6CField10IsVariableEv @ 72 NONAME - _ZNK6CField10LogicalMaxEv @ 73 NONAME - _ZNK6CField10LogicalMinEv @ 74 NONAME - _ZNK6CField10UsageArrayEv @ 75 NONAME - _ZNK6CField10UsageCountEv @ 76 NONAME - _ZNK6CField11PhysicalMaxEv @ 77 NONAME - _ZNK6CField11PhysicalMinEv @ 78 NONAME - _ZNK6CField11StringIndexEv @ 79 NONAME - _ZNK6CField12UnitExponentEv @ 80 NONAME - _ZNK6CField13DesignatorMaxEv @ 81 NONAME - _ZNK6CField13DesignatorMinEv @ 82 NONAME - _ZNK6CField15DesignatorIndexEv @ 83 NONAME - _ZNK6CField4SizeEv @ 84 NONAME - _ZNK6CField4TypeEv @ 85 NONAME - _ZNK6CField4UnitEv @ 86 NONAME - _ZNK6CField5CountEv @ 87 NONAME - _ZNK6CField5UsageEi @ 88 NONAME - _ZNK6CField6IsDataEv @ 89 NONAME - _ZNK6CField6OffsetEv @ 90 NONAME - _ZNK6CField7IsArrayEv @ 91 NONAME - _ZNK6CField7IsInputEv @ 92 NONAME - _ZNK6CField8HasUsageEi @ 93 NONAME - _ZNK6CField8IsOutputEv @ 94 NONAME - _ZNK6CField8ReportIdEv @ 95 NONAME - _ZNK6CField8UsageMaxEv @ 96 NONAME - _ZNK6CField8UsageMinEv @ 97 NONAME - _ZNK6CField9IsFeatureEv @ 98 NONAME - _ZNK6CField9LastUsageEv @ 99 NONAME - _ZNK6CField9StringMaxEv @ 100 NONAME - _ZNK6CField9StringMinEv @ 101 NONAME - _ZNK6CField9UsagePageEv @ 102 NONAME - _ZTI10CHidDriver @ 103 NONAME ; ## - _ZTI11CCollection @ 104 NONAME ; ## - _ZTI11CGenericHid @ 105 NONAME ; ## - _ZTI11CReportRoot @ 106 NONAME ; ## - _ZTI15CDriverListItem @ 107 NONAME ; ## - _ZTI16CReportGenerator @ 108 NONAME ; ## - _ZTI24CHidInputDataHandlingReg @ 109 NONAME ; ## - _ZTI6CField @ 110 NONAME ; ## - _ZTI7CParser @ 111 NONAME ; ## - _ZTV10CHidDriver @ 112 NONAME ; ## - _ZTV11CCollection @ 113 NONAME ; ## - _ZTV11CGenericHid @ 114 NONAME ; ## - _ZTV11CReportRoot @ 115 NONAME ; ## - _ZTV15CDriverListItem @ 116 NONAME ; ## - _ZTV16CReportGenerator @ 117 NONAME ; ## - _ZTV24CHidInputDataHandlingReg @ 118 NONAME ; ## - _ZTV6CField @ 119 NONAME ; ## - _ZTV7CParser @ 120 NONAME ; ## - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/group/bld.inf --- a/localconnectivityservice/generichid/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2005-2007 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 project generichid -* -*/ - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -../rom/generichid.iby CORE_MW_LAYER_IBY_EXPORT_PATH(generichid.iby) - -PRJ_MMPFILES -generichid.mmp diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/group/generichid.mmp --- a/localconnectivityservice/generichid/group/generichid.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: Project definition file for project generichid -* -*/ - - -#include -#include - -TARGET generichid.dll -TARGETTYPE DLL -UID 0x1000008d 0x10281cfe - -CAPABILITY CAP_APPLICATION CommDD ProtServ // two latter needed by USB -VENDORID VID_DEFAULT - -SOURCEPATH ../src -SOURCE hidgeneric.cpp -SOURCE hiddriveritem.cpp -SOURCE hidfield.cpp -SOURCE hidparser.cpp -SOURCE hiditem.cpp -SOURCE hidcollection.cpp -SOURCE hidsearch.cpp -SOURCE hidreporttranslator.cpp -SOURCE hidreportroot.cpp -SOURCE hidreportbase.cpp -SOURCE hidreportgenerator.cpp -SOURCE hidinterfaces.cpp -SOURCE hidconnectioninfo.cpp - -USERINCLUDE ../inc - -MW_LAYER_SYSTEMINCLUDE -SYSTEMINCLUDE ../../../inc -SYSTEMINCLUDE /epoc32/include/ecom - -LIBRARY euser.lib -LIBRARY ecom.lib - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/inc/debug.h --- a/localconnectivityservice/generichid/inc/debug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,175 +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: Logging definition -* -*/ - - -#ifndef PRJ_LOGGING_H -#define PRJ_LOGGING_H - -#include "debugconfig.h" - -#ifdef PRJ_ENABLE_TRACE - -#ifdef PRJ_FILE_TRACE -#include -#else -#include -#endif - -const TInt KMaxLogLineLength = 512; - -#define KPRINTERROR 0x00000001 // Tracing level: error -#define KPRINTINFO 0x00000002 // Tracing level: function trace -#define KPRINTSTATE 0x00000004 // Tracing level: state machine info -#define KPRINTWARNING 0x00000008 // Tracing level: warning - -const TInt KTraceMask = KPRINTERROR | KPRINTINFO | KPRINTSTATE | KPRINTWARNING; - -NONSHARABLE_CLASS(TOverflowTruncate16) : public TDes16Overflow - { -public: - void Overflow(TDes16& /*aDes*/) {} - }; - -NONSHARABLE_CLASS(TOverflowTruncate8) : public TDes8Overflow - { -public: - void Overflow(TDes8& /*aDes*/) {} - }; - -inline void Trace(TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); -#ifdef PRJ_FILE_TRACE - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); -#else - TBuf16 theFinalString; - theFinalString.Append(KTracePrefix16); - TOverflowTruncate16 overflow; - theFinalString.AppendFormatList(aFmt,list,&overflow); - RDebug::Print(theFinalString); -#endif - } - -inline void Trace(TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list, aFmt); -#ifdef PRJ_FILE_TRACE - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); -#else - TOverflowTruncate8 overflow; - TBuf8 buf8; - buf8.Append(KTracePrefix8); - buf8.AppendFormatList(aFmt, list, &overflow); - TBuf16 buf16(buf8.Length()); - buf16.Copy(buf8); - TRefByValue tmpFmt(_L("%S")); - RDebug::Print(tmpFmt, &buf16); -#endif - } - -inline void TracePanic( - char* aFile, - TInt aLine, - TInt aPanicCode, - const TDesC& aPanicCategory) - { - TPtrC8 fullFileName((const TUint8*)aFile); - TPtrC8 fileName(fullFileName.Ptr()+fullFileName.LocateReverse('\\')+1); - TBuf8 buf; - buf.Append(KPanicPrefix8); - buf.AppendFormat(_L8("%d at line %d in file %S"), aPanicCode, aLine, &fileName); - Trace(buf); - User::Panic(aPanicCategory, aPanicCode); - } - -inline void TraceLeave(char* aFile, TInt aLine, TInt aReason) - { - TPtrC8 fullFileName((const TUint8*)aFile); - TPtrC8 fileName(fullFileName.Ptr()+fullFileName.LocateReverse('\\')+1); - TBuf8 buf; - buf.Append(KLeavePrefix8); - buf.AppendFormat(_L8("%d at line %d in file %S"), aReason, aLine, &fileName); - Trace(buf); - User::LeaveIfError(aReason); - } - -#define TRACE_INFO(p) {if(KTraceMask & KPRINTINFO) Trace p;} - -#define TRACE_ERROR(p) {if(KTraceMask & KPRINTERROR) Trace p;} - -#define TRACE_STATE(p) {if(KTraceMask & KPRINTSTATE) Trace p;} - -#define TRACE_WARNING(p) {if(KTraceMask & KPRINTWARNING) Trace p;} - -#define TRACE_INFO_SEG(p) {if(KTraceMask & KPRINTINFO) p;} - -#define TRACE_ASSERT(GUARD, CODE) {if (!(GUARD)) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory);} - -#define PANIC(CODE) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory) - -#define LEAVE_IF_ERROR(REASON) {if (REASON) TraceLeave(__FILE__, __LINE__, REASON);} - -#define LEAVE(REASON) {TraceLeave(__FILE__, __LINE__, REASON);} - -#define TRACE_FUNC_ENTRY {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryFormat8, &ptr8);}} - -#define TRACE_FUNC_ENTRY_THIS {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryThisFormat8, &ptr8, this);}} - -#define TRACE_FUNC_EXIT {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncExitFormat8, &ptr8);}} - -#define TRACE_FUNC {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncFormat8, &ptr8);}} - -#define TRACE_FUNC_THIS {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncThisFormat8, &ptr8, this);}} - -#define RETURN_IF_ERR(ERR) {if(ERR) {TPtrC8 ptr8((TUint8*)__FILE__); Trace(_L8(" RETURN %d at file %S line %d"), ERR, &ptr8, __LINE__); return ERR;}} - -#else // PRJ_ENABLE_TRACE not defined - -#define TRACE_INFO(p) - -#define TRACE_ERROR(p) - -#define TRACE_STATE(p) - -#define TRACE_WARNING(p) - -#define TRACE_INFO_SEG(p) - -#define TRACE_ASSERT(GUARD, CODE) - -#define PANIC(CODE) {User::Panic(KPanicCategory, CODE);} - -#define LEAVE_IF_ERROR(REASON) {static_cast(User::LeaveIfError(REASON));} - -#define LEAVE(REASON) {static_cast(User::Leave(REASON));} - -#define TRACE_FUNC_ENTRY - -#define TRACE_FUNC_ENTRY_THIS - -#define TRACE_FUNC_EXIT - -#define TRACE_FUNC - -#define TRACE_FUNC_THIS - -#define RETURN_IF_ERR(ERR) {if(ERR) return ERR;} -#endif // PRJ_ENABLE_TRACE - -#endif // PRJ_LOGGING_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/inc/debugconfig.h --- a/localconnectivityservice/generichid/inc/debugconfig.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +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: Project configure file. -* -*/ - - -#ifndef GENERICHID_DEBUGCONFIG_H -#define GENERICHID_DEBUGCONFIG_H - -#include "prjconfig.h" - - -/** - * Custom logging variations. - */ -#ifdef PRJ_FILE_TRACE -_LIT(KLogFile,"generichid.txt"); -_LIT(KLogDir,"generichid"); -#endif - -#ifdef PRJ_ENABLE_TRACE -_LIT(KTracePrefix16, "[generichid] "); -_LIT8(KTracePrefix8, "[generichid] "); -_LIT8(KFuncFormat8, "><%S"); -_LIT8(KFuncThisFormat8, "><%S, [0x%08X]"); -_LIT8(KFuncEntryFormat8, ">%S"); -_LIT8(KFuncEntryThisFormat8, ">%S, [0x%08X]"); -_LIT8(KFuncExitFormat8, "<%S"); - -_LIT(KPanicCategory, "generichid"); -_LIT8(KPanicPrefix8, "PANIC code "); -_LIT8(KLeavePrefix8, "LEAVE code "); -#endif - -#endif // OBEXSM_DEBUGCONFIG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/inc/hidconnectioninfo.h --- a/localconnectivityservice/generichid/inc/hidconnectioninfo.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/* -* Copyright (c) 2008-2008 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: ?Description -* -*/ - - -#ifndef C_CONNECTIONINFO_H_ -#define C_CONNECTIONINFO_H_ - - -#include - -class CReportRoot; -class CHidDriver; - -/** - * CConnectionInfo - * Connection information - * - * - * @lib generichid.lib - * @since S60 v5.0 - */ -NONSHARABLE_CLASS ( CConnectionInfo ) : public CBase - { - -public: - /** - * Two-phased constructor. - * @param aConnectionID Connection identifier - * @param aReportRoot Connection ReportRoot - */ - static CConnectionInfo* NewL(TInt aConnectionID, CReportRoot* aReportRoot); - static CConnectionInfo* NewLC(TInt aConnectionID, CReportRoot* aReportRoot); - - /** - * Destructor. - */ - virtual ~CConnectionInfo(); - -public: - /** - * Get Connection id - * - * @since S60 v5.0 - * @return connection id - */ - TInt ConnectionID(); - - /** - * Get report id - * - * @since S60 v5.0 - * @return report id - */ - CReportRoot* ReportRoot(); - - /** - * Set last command handler - * - * @since S60 v5.0 - * @param aHidDriverItem hiddriver item - * @return None - */ - void SetLastCommandHandler(CHidDriver* aHidDriverItem); - - /** - * Set last command handler - * - * @since S60 v5.0 - * @param aHidDriverItem hiddriver item - * @return None - */ - CHidDriver* ReturnLastCommandHandler(); - -private: - CConnectionInfo(TInt aConnectionID, CReportRoot* aReportRoot); - -private: - - /** - * Connection id - */ - TInt iConnectionID; - - /** - * Connection id - * Own. - */ - CReportRoot* iReportRoot; - - /** - * Pointer to last driver which handled last command - * Not own. - */ - CHidDriver* iLastCmdDriver; - }; - -#endif /* C_CONNECTIONINFO_H_ */ diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/inc/hiddriveritem.h --- a/localconnectivityservice/generichid/inc/hiddriveritem.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: Declares driver list itemapplication class. -* -*/ - - - -#ifndef C_DRIVERLISTITEM_H -#define C_DRIVERLISTITEM_H - -#include "hidreportroot.h" -#include "hidinterfaces.h" - -/** - * Container class so we can maintain a list of driver instances - * - * @lib generichid.lib - * @since S60 v5.0 - */ -class CDriverListItem : public CBase - { - // Give access to the TSglQueLink offset: - friend class CGenericHid; - -public : - - explicit CDriverListItem(TInt aConnectionId); - - /** - * Destructor. - */ - virtual ~CDriverListItem(); - - - /** - * Set driver instance - * - * @since S60 v5.0 - * @param aDriver Driver instance - * @return None - */ - void SetDriver(CHidDriver* aDriver); - - /** - * Return connection ID - * - * @since S60 v5.0 - * @return Connection id - */ - TInt ConnectionId() const; - - /** - * Return driver instance - * - * @since S60 v5.0 - * @return driver instance - */ - CHidDriver* Driver() const; - - -private : - - /** - * Queue link - */ - TSglQueLink iSlink; - - /** - * The transport-layer ID for the connection - */ - TInt iConnectionId; - - /** - * The device driver - * Own. - */ - CHidDriver* iDriver; - - }; -#endif - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/inc/hiditem.h --- a/localconnectivityservice/generichid/inc/hiditem.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,198 +0,0 @@ -/* -* Copyright (c) 2005-2007 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: BTHid item -* -*/ - - -#ifndef T_ITEM_H -#define T_ITEM_H - -#include - -/** - * HID item class - * A HID report descriptor is comprised of a sequence of "items" - * that provide information about the device. Items consist of a - * header and zero or more bytes of data. The header contains the item - * type (main/global/local), an item "tag" (subtype) and the item size. - * Items can be "short" (containing a maximum of 4 bytes of data) or - * "long" (a maximum of 255 bytes of data). - - * A TItem represents a single HID report descriptor item. It is - * constructed from an eight bit non-modifiable (Symbian-) descriptor, - * which is assumed to contain report (HID-) descriptor data. - * - * @lib generichid.lib - * @since S60 v5.0 - */ -class TItem - { -public: - /** - * The possible item types: main, global or local. Item type is - * a two-bit field -- the 11b value is reserved for "long items", which - * are only used for vendor-specific commands. - */ - enum TItemType - { - EMain = 0, //!< Input, output, feature and begin or end collection - EGlobal = 1, //!< Global item items affect all subsequent fields - ELocal = 2, //!< Local items only persist until the next main item - EReserved = 3 //!< No defined use in the current HID standard (v1.11) - }; - -public: - - /** - * The constructor takes a an eight bit non-modifiable (Symbian-) - * descriptor containing report (HID-) descriptor data. - * The item tag, type, data size and offset are calculated here. - * - * @since S60 v5.0 - * @param aRawData The raw item data, represented as a Symbian - * descriptor. The item data is assumed to be at the beginning of the - * descriptor. The size of the TDesC8 may be greater than the size - * of the item, as the item size will be calculated from the raw HID - * descriptor data. Of course, the TDesC8 should be at least as - * long as the raw item data. - */ - TItem(const TDesC8& aRawData); - - /** - * DataSize() returns the size of the item data in bytes. This - * is the total item size minus the size of any header information. - * (A short item header is a single byte, a long item header is - * three bytes long.) - * - * @since S60 v5.0 - * @return The size, in bytes, of the item data. Range 0-255. - */ - TInt DataSize() const; - - /** - * Tag() returns the tag (subtype) value for this item. - * - * @since S60 v5.0 - * @return The item tag. - */ - TInt Tag() const; - - /** - * Data() returns the data associated with the item, represented as a - * 32-bit unsigned integer. This is only meaningful if the data length - * is less than 4 bytes. - * - * @since S60 v5.0 - * @return The item data as a 32-bit unsigned integer. - */ - TUint32 Data() const; - - /** - * SignedData() returns the data associated with the item, - * represented as a 32-bit signed integer. This is only - * meaningful if the data length is less than 4 bytes. - * - * @since S60 v5.0 - * @return The item data as a 32-bit signed integer. - */ - TInt32 SignedData() const; - - /** - * Returns the byte at the given offset within the item data block. - * - * @since S60 v5.0 - * @param aIndex The index within the data block for the current tag. - * @return The data at the specified index. - */ - TUint8 operator[](TInt aIndex) const; - - /** - * Type() returns the item type (e.g. "global"). - * - * @since S60 v5.0 - * @return The item type. - */ - TItemType Type() const; - - /** - * Check if item is main - * - * @since S60 v5.0 - * @return ETrue if item type is "main" - */ - TBool IsMain() const; - - /** - * Check if item is local - * - * @since S60 v5.0 - * @return ETrue if item type is "local" - */ - TBool IsLocal() const; - - /** - * Check if item is global - * - * @since S60 v5.0 - * @return ETrue if item type is "global" - */ - TBool IsGlobal() const; - - /** - * Check if item is global - * - * @since S60 v5.0 - * @return ETrue if this is a long item - */ - TBool IsLong() const; - - /** - * ItemSize() returns the total size of this item, including the - * header data. - * - * @since S60 v5.0 - * @return The total size of this item, in bytes. - */ - TInt ItemSize() const; - -private: - /** - * Pointer to the raw report descriptor data - */ - TPtrC8 iRawData; - - /** - * Item data size - */ - - TInt iSize; - /** - * Item tag value - */ - TInt iTag; - - /** - * Offset in bytes of the data block - */ - TInt iDataOffset; - - /** - * Item type - */ - TItemType iType; - }; - -#endif - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/inc/hidparser.h --- a/localconnectivityservice/generichid/inc/hidparser.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1041 +0,0 @@ -/* -* Copyright (c) 2005-2007 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: BTHid item -* -*/ - -#ifndef C_PARSER_H -#define C_PARSER_H - -#include "hidreportroot.h" - -class TItem; - -/** - * HID Parser error codes. For a description of the error code - * format, see "HID Parser Error Codes", Revision 1.2, USB - * Implementers' Forum, February 2000. - */ -enum THidParserError - { - // General: - // - EUnknownItem = 0xbf00, - ELongItemDefined = 0x3e00, - // - // Global: - // - EZeroUsagePage = 0x8004, - EUsagePageOutOfRange = 0x8104, - ELogicalMinInvalidForArray = 0x8214, - ELogicalMaxInvalidForArray = 0x8224, - ELonelyPhysicalMin = 0x8034, - ELonelyPhysicalMax = 0x8044, - EZeroReportId = 0x8084, - EReportIdTooBig = 0x8184, - ELateReportId = 0x8284, - EReportIdOutsideTopLevel = 0x8484, - EZeroReportCount = 0x8094, - EPushWithoutPop = 0x80a4, - EPushHasData = 0x81a4, - EPopWithoutPush = 0x80b4, - EPopHasData = 0x81b4, - ERedundantGlobalItem = 0x80f4, - EReservedUsagePage = 0x0004, - ELogicalMinExceedsMax = 0x0014, - EPhysicalMinExceedsMax = 0x0034, - EExponentReservedBitsNonZero = 0x0054, - EUnitReservedBitsNonZero = 0x0064, - // - // Local: - // - ELonelyUsageMin = 0x8018, - EUsageMinExceedsMax = 0x8118, - EUsagePageMismatchMin = 0x8318, - ELonelyUsageMax = 0x8028, - EUsagePageMismatchMax = 0x8228, - ELonelyDesignatorMin = 0x8048, - EDesignatorMinExceedsMax = 0x8148, - ELonelyDesignatorMax = 0x8058, - ELonelyStringMin = 0x8088, - EStringMinExceedsMax = 0x8188, - ELonelyStringMax = 0x8098, - EUnknownDelimiter = 0x80a8, - ENestedDelimiter = 0x81a8, - ELonelyDelimiter = 0x82a8, - EInvalidItemWithinDelimiter = 0x83a8, - EDelimiterAtTopLevel = 0x84a8, - EZeroUsage = 0x0008, - // - // Main: - // - EInputMissingItems = 0x8080, - EInputItemWithinDelimiter = 0x8180, - EInputReportSize = 0x8280, - EInputMinExceedsMax = 0x8380, - EOutputMissingItems = 0x8090, - EOutputItemWithinDelimiter = 0x8190, - EOutputReportSize = 0x8290, - EOutputMinExceedsMax = 0x8390, - EFeatureMissingItems = 0x80b0, - EFeatureItemWithinDelimiter = 0x81b0, - EFeatureReportSize = 0x82b0, - EFeatureMinExceedsMax = 0x83b0, - ENoMatchingBeginCollection = 0x80c0, - EEndCollectionWithinDelimiter = 0x81c0, - EReportMustBeEightBitMultiple = 0x82c0, - ENoMatchingEndCollection = 0x80a0, - EBeginCollectionWithinDelimiter = 0x81a0, - EApplicationCollectionLevel = 0x82a0, - EInputReservedBitsNonZero = 0x0080, - EInputLocalMultipleUse = 0x0280, - EOutputReservedBitsNonZero = 0x0090, - EOutputLocalMultipleUse = 0x0290, - EFeatureReservedBitsNonZero = 0x00b0, - EFeatureLocalMultipleUse = 0x02b0, - ECollectionLocalUnused = 0x00a0, - ECollectionTypeUnknownReserved = 0x01a0, - EEndCollectionLocalUnused = 0x00c0, - EEndCollectionHasData = 0x01c0, - // - // Our ("vendor specific") codes: - // - EInvalidItemLength = 0xC000, - EApplicationHasDelimiter = 0x40a0, - EDelimiterWithinNamedArray = 0x40a8, - ECollectionHasNoUsage = 0x40c0, - ECollectionHasNoUsagePage = 0x41c0 - }; - -/** - * HID parser panics - */ -enum THidParsingError - { - // ASSERT_ALWAYS: - // - EZeroLengthItem = 1, //!< Zero descriptor length in TItem constructor - ENoReportRoot = 2, //!< iReportRoot is 0 in CreateFieldL() - ENoCurrentCollection = 3, //!< No current collection in Collection() - // - // ASSERT_DEBUG: - // - ENoCollectionToCheck = 10, //!< No collection in CheckForCollectionErrors() - EPopFailed = 11, //!< Empty collection stack in PopCollection() - EIndexOutOfRange = 12, //!< Index out of range in TItem::operator[] - EItemTooLong = 13 //!< Data() called for item with size > 4 - }; - - -/** - * Parser global states - * - * CParser uses TParserGlobalState objects to store the global item - * state during parsing. The global state can be saved and restored - * using the HID descriptor POP and PUSH tags, therefore CParser - * incorporates a stack of TParserGlobalState objects. - * - * - * @lib generichid.lib - * @since S60 v5.0 - */ -class TParserGlobalState - { - friend class CParser; - -public: - - TParserGlobalState(); - - /** - * Copies all data members into a CField object. The other - * members of the CField object (those corresponding to local - * HID descriptor tags) are unaffected. - * - * @since S60 v5.0 - * @param aField Pointer to the field object to populate. - * @return None. - */ - void Populate(CField *aField) const; - -private: - /** - * Usage page - */ - TInt iUsagePage; - - /** - * Logical minimum - */ - TInt iLogicalMin; - - /** - * Logical maximum - */ - TInt iLogicalMax; - - /** - * Physical minimum - */ - TInt iPhysicalMin; - - /** - * Physical maximum - */ - TInt iPhysicalMax; - - /** - * Unit type - */ - TInt iUnit; - - /** - * Unit exponent - */ - TInt iUnitExponent; - - /** - * Associated report ID - */ - TInt iReportId; - - /** - * Report size - */ - TInt iSize; - - /** - * Report count - */ - TInt iCount; - }; - - -/** - * - * HID parser - * CParser parses a HID report descriptor. It outputs a CReportRoot - * containing a tree of CCollection and CField objects representing - * the descriptor information. A HID device driver can then use this, - * in conjunction with TReportTranslator and CReportGenerator objects, - * to facilitate communication with a HID device. - * - * The parsing process conforms to the HID class specification - * document: "USB Device Class Definition for Human Interface Devices - * (HID)", Firmware Specification, Version 1.11, USB Implementers' Forum, - * June 2001. - * - * - * @lib generichid.lib - * @since S60 v5.0 - */ -class CParser : public CBase - { -public: - IMPORT_C static CParser* NewL(); - IMPORT_C static CParser* NewLC(); - - virtual ~CParser(); - - /** - * ParseL() parses a string of bytes representing a HID report - * descriptor. It returns a tree of collection and field objects (a - * CReportRoot). Ownership of the CReportRoot is transferred to the - * caller. - * - * Warning messages produced during the parse process are added to - * a list which the driver can retrieve using the Warnings() - * function. Note that the list will be overwritten by the next - * ParseL() operation. - * - * Errors and warnings are represented using the format described - * in "HID Parser Error Codes", Revision 1.2, USB Implementers' - * Forum, February 2000. - * - * @since S60 v5.0 - * @param aRawData The report descriptor data to be processed - * @return The root collection, a tree of CCollection and CField objects - */ - IMPORT_C CReportRoot* ParseL(const TDesC8& aRawData); - - /** - * Return field count - * - * @since S60 v5.0 - * @return field count - */ - TInt FieldCount(); - - - - - -private: - CParser(); - void ConstructL(); - - /** - * Handle a HID descriptor main item. This includes the creation - * of new field objects in the current collection and management of - * the global item state stack. - * - * @since S60 v5.0 - * @param aItem The current report descriptor tag and its associated data - * @return KErrNone (0) on success, otherwise a critical error code in - * the standard HID format. - */ - TInt MainItemL(const TItem& aItem); - - /** - * Handle a HID descriptor local item. Stores the data in the - * appropriate member of the local state object, *iLocal. - * - * @since S60 v5.0 - * @param aItem The current report descriptor tag and its associated data - * @return KErrNone (0) on success, otherwise a critical error code in - * the standard HID format. - */ - TInt LocalItemL(const TItem& aItem); - - /** - * Handle a HID descriptor global item. Stores the data in the - * appropriate member of the current global state object, iGlobal. - * - * @since S60 v5.0 - * @param aItem The current report descriptor tag and its associated data - * @return KErrNone (0) on success, otherwise a critical error code in - * the standard HID format. - */ - TInt GlobalItemL(const TItem& aItem); - - /** - * Used to access the current collection object, i.e. the object - * at the top of the collection stack (iCollectionStack). - * - * - * @since S60 v5.0 - * @return A pointer to the current collection object. - * - */ - CCollection* Collection(); - - /** - * Pushes a pointer to the current collection object on to the - * collection stack. - * - * Note that the collection stack is used to create the tree of - * collections. It should not be confused with the global state - * stack, iGlobalStack. - * - * @since S60 v5.0 - * @param aCollection The collection to be pushed onto the stack - * @return None. - * - */ - void PushCollectionL(const CCollection* aCollection); - - /** - * Pushes a pointer to the current collection object on to the - * collection stack. - * - * Note that the collection stack is used to create the tree of - * collections. It should not be confused with the global state - * stack, iGlobalStack. - * - * @since S60 v5.0 - * @return None. - * - */ - void PopCollection(); - - /** - * CreateFieldL() is called to instantiate a new CField object - * when an input, output or feature item is encountered in the - * report descriptor. - * - * The current local and global states extracted from the report - * descriptor are copied to the CField, which is placed into the - * current CCollection. - * - * @since S60 v5.0 - * @param aType The type of field: input, output or feature - * @param aAttributes The attributes for the field (e.g. Data, Array, - * Absolute.) - * @return KErrNone (0) on success, otherwise a critical error code - * in the standard HID format. - * - */ - TInt CreateFieldL(CField::TType aType, TUint32 aAttributes); - - /** - * ClearLocalState() clears the appropriate fields in the CField - * object that represents the current local item state. - * - * @since S60 v5.0 - * @return None - * - */ - void ClearLocalState(); - - /** - * DumpStateTableL() copies the current local and global item state - * into a CField object. - * - * @since S60 v5.0 - * @param aField The field object to receive the data - * @return None - * - */ - void DumpStateTableL(CField *aField) const; - - /** - * CreateCollectionL() is called to instantiate a new CCollection - * object when a "begin collection" item is encountered in the - * report descriptor. - * - * @since S60 v5.0 - * @param aType The type of the collection. This can be one of the - * seven standard types defined in CCollection::TType, - * or a vendor defined value. - * @return KErrNone (0) on success, otherwise a critical error code in - * the standard HID format. - */ - TInt CreateCollectionL(TUint32 aType); - - /** - * CheckForCollectionErrors() validates the current collection - * object. It adds non-critical errors to the warnings list. It - * returns an error code if a critical error is encountered. - * - * @since S60 v5.0 - * @param aType The type of the collection (one of the CCollection::TType - * values, or vendor defined). - * @return KErrNone (0) if there was no error, otherwise a critical - * error code in the standard HID format. - */ - TInt CheckForCollectionErrors(TUint32 aType); - - /** - * CheckForFieldErrors() validates the current global and local - * item state in preparation for creating a CField object. It adds - * non-critical errors to the warnings list. It returns an error - * code if a critical error is encountered. - * - * @since S60 v5.0 - * @param @param aType The type of the field (input, output or feature). - * @param aAttributes The attributes for the field (e.g. Data, Array, - * Absolute.) - * @return KErrNone (0) if there was no error, otherwise a critical - * error code in the standard HID format. - */ - TInt CheckForFieldErrors(CField::TType aType, TUint32 aAttributes); - - /** - * CheckForMainErrors() performs error checking common to - * CheckForCollectionErrors() and CheckForFieldErrors(). It adds - * non-critical errors to the warnings list. It returns an error - * code if a critical error is encountered. - * - * @since S60 v5.0 - * @return KErrNone (0) if there was no error, otherwise a critical - * error code in the standard HID format. - */ - TInt CheckForMainErrors(); - - /** - * CheckAllReportSizes() checks if all report sizes are integral - * multiples of 8 bits. - * - * @since S60 v5.0 - * @return ETrue if all report sizes are integral multiples of - * 8 bits. - */ - TBool CheckAllReportSizes() const; - - /** - * BitsToRepresentRange() returns the number of bits required to - * represent all values in a given range. It is used to check - * that the report field size is appropriate for the given - * logical minimum and maximum. - * - * If the range is all positive then it is assumed that there is no - * sign bit, otherwise twos complement format is assumed, as per - * the HID class specification, v1.11, Section 6.2.2.7. - * - * @since S60 v5.0 - * @param aMin Logical minimum - * @param aMax Logical maximum - * @return The number of bits required to represent the range aMin - * to aMax (inclusive). - */ - static TInt BitsToRepresentRange(TInt aMin, TInt aMax); - - /** - * NumberOfLeadingZeros() is used by BitsToRepresentRange(). It - * returns the number of leading zeros in the binary representation - * of a number, effectively performing a log_2 operation. - * - * @since S60 v5.0 - * @param aValue Unsigned 32-bit value - * @return Number of leading zeros in the binary representation of aValue - */ - static TInt NumberOfLeadingZeros(TUint32 aValue); - - /** - * IssueWarning() adds a TParserWarning to the warning list. - * - * @since S60 v5.0 - * @param aHidWarningCode The error or warning code, which should - * be in the standard HID format. - * @return None - */ - void IssueWarning(TInt aHidWarningCode); - - /** - * IsReservedUsagePage() checks if the given HID usage page is - * listed as reserved according to the HID clas specification, - * v1.11. - * - * @since S60 v5.0 - * @param aUsagePage The usage page to check. - * @result ETrue if the usage page is listed as reserved. - */ - static TBool IsReservedUsagePage(TInt aUsagePage); - - - /** - * HandleMainInputTagL - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleMainInputTagL(const TItem& aItem); - - - /** - * HandleMainOutputTag - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleMainOutputTagL(const TItem& aItem); - - /** - * HandleMainFeature - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleMainFeatureL( const TItem& aItem ); - - /** - * HandleMainCollection - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleMainCollectionL( const TItem& aItem ); - - - /** - * MainEndCollection - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleMainEndCollection( const TItem& aItem); - - /** - * HandleGlobalReportId - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleGlobalReportId( const TItem& aItem ); - - /** - * HandleGlobalUsagePage - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleGlobalUsagePage( const TItem& aItem ); - - /** - * HandleGlobalLogicalMinimum - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleGlobalLogicalMinimum( const TItem& aItem ); - - /** - * HandleGlobalLogicalMaximum - * - * @since S60 ?S60_version *** for example, S60 v3.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleGlobalLogicalMaximum( const TItem& aItem ); - - /** - * HandleGlobalPhysicalMinimum - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleGlobalPhysicalMinimum( const TItem& aItem ); - - /** - * HandleGlobalPhysicalMinimum - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleGlobalPhysicalMaximum( const TItem& aItem ); - - /** - * HandleGlobalUnit - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleGlobalUnit( const TItem& aItem ); - - /** - * HandleGlobalUnitExponent - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleGlobalUnitExponent( const TItem& aItem ); - - /** - * HandleGlobalReportSize - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleGlobalReportSize( const TItem& aItem ); - - /** - * HandleGlobalReportSize - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleGlobalReportCount( const TItem& aItem ); - - /** - * HandleGlobalPush - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleGlobalPushL( const TItem& aItem ); - - /** - * HandleGlobalPop - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleGlobalPop( const TItem& aItem ); - - /** - * HandleLocalUsage - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleLocalUsageL( const TItem& aItem ); - - /** - * HandleLocalUsageMinimum - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleLocalUsageMinimum( const TItem& aItem ); - - /** - * HandleLocalUsageMinimum - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleLocalUsageMaximum( const TItem& aItem ); - - /** - * HandleLocalDesignatorIndex - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleLocalDesignatorIndex( const TItem& aItem ); - - /** - * HandleLocalDesignatorMinimum - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleLocalDesignatorMinimum( const TItem& aItem ); - - /** - * HandleLocalDesignatorMaximum - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleLocalDesignatorMaximum( const TItem& aItem ); - - /** - * HandleLocalStringIndex - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleLocalStringIndex( const TItem& aItem ); - - /** - * HandleLocalStringMinimum - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleLocalStringMinimum( const TItem& aItem ); - - /** - * HandleLocalStringMaximum - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleLocalStringMaximum( const TItem& aItem ); - - /** - * HandleLocalDelimiter - * - * @since S60 v5.0 - * @param aItem a Hid field item - * @result error code - */ - TInt HandleLocalDelimiter( const TItem& aItem ); - - /** - * CheckMandatoryFieldError - * - * @since S60 v5.0 - * @param aType a field type - * @param aAttributes attributes - * @result error code - */ - TInt CheckMandatoryFieldExistence( CField::TType aType, TUint32 aAttributes ); - - /** - * CheckUsageMinAndMaxErrors - * - * @since S60 v5.0 - * @result error code - */ - TInt CheckUsageMinAndMaxErrors(); - - /** - * CheckDesignatorMinAndMaxErrors - * - * @since S60 v5.0 - * @result error code - */ - TInt CheckDesignatorMinAndMaxErrors(); - - /** - * CheckStringMinAndMaxErrors - * - * @since S60 v5.0 - * @result error code - */ - TInt CheckStringMinAndMaxErrors(); - - /** - * CheckMandatoryFieldError - * - * @since S60 v5.0 - * @param aType a field type - * @param aAttributes attributes - * @result error code - */ - TInt CheckMandatoryFieldErrors( CField::TType aType, TUint32 aAttributes ); - - /** - * CheckLogicalMinAndMax - * Check if logical minimum and maximum must match the number of usage - * values - * - * @since S60 v5.0 - * @param aAttributes attributes - * @result error code - */ - void CheckLogicalMinAndMax( TUint32 aAttributes ); - - /** - * CheckMandatoryFieldError - * - * @since S60 v5.0 - * @param aType a field type - * @param aAttributes attributes - * @result error code - */ - void CheckFieldBitNeeded( CField::TType aType, TUint32 aAttributes ); - - /** - * HandleItem - * - * @since S60 v5.0 - * @result error code - */ - void HandleItemL(TItem& aItem); - - /** - * CheckParseErrors - * - * @since S60 v5.0 - * @result error code - */ - void CheckParseErrors(); - - /** - * ResetParser - * - * @since S60 v5.0 - * @result error code - */ - void ResetParserL(); - -private: - /** - * A bitmask containing the THidItem flags which represent local - * (as opposed to main or global) items. - */ - static const TUint32 KLocalItemMask; - - /** - * A bitmask containing the THidItem flags which represent local - * unused items. - */ - static const TUint32 KUnusedLocalItemsMask; - - /** - * A bitmask containing the THidItem flags which represent mandatory - * items. - */ - static const TUint32 KMandatoryItemMask; - - /** - * A bitmask containing the THidItem flags which represent report - * items. - */ - static const TUint32 KReportItemMask; - -private: - - /** - * THidItem defineds a set of flags used for keeping track of - * which items have been encountered in the report descriptor for - * the current report field. The flags are used with the - * iItemsDefined and iGlobalItemsDefined data members. - */ - enum THidItem - { - EUsagePage = 1<<0, - ELogicalMin = 1<<1, - ELogicalMax = 1<<2, - EReportSize = 1<<3, - EReportCount = 1<<4, - EReportId = 1<<5, - EUsageMin = 1<<6, - EUsageMax = 1<<7, - EPhysicalMin = 1<<8, - EPhysicalMax = 1<<9, - EUnit = 1<<10, - EUnitExponent = 1<<11, - EDesignatorIndex = 1<<12, - EDesignatorMin = 1<<13, - EDesignatorMax = 1<<14, - EStringIndex = 1<<15, - EStringMin = 1<<16, - EStringMax = 1<<17, - EInputReport = 1<<18, - EOutputReport = 1<<19, - EFeatureReport = 1<<20, - EDelimiter = 1<<21, - EUsageId = 1<<22 - }; - - /** - * HID local tags - */ - enum THidLocalTags - { - ELocalUsage = 0x00, - ELocalUsageMinimum = 0x01, - ELocalUsageMaximum = 0x02, - ELocalDesignatorIndex = 0x03, - ELocalDesignatorMinimum = 0x04, - ELocalDesignatorMaximum = 0x05, - ELocalStringIndex = 0x07, - ELocalStringMinimum = 0x08, - ELocalStringMaximum = 0x09, - ELocalDelimiter = 0x0a - }; - - /** - * HID global tags - */ - enum THidGlobalTags - { - EGlobalUsagePage = 0x00, - EGlobalLogicalMinimum = 0x01, - EGlobalLogicalMaximum = 0x02, - EGlobalPhysicalMinimum = 0x03, - EGlobalPhysicalMaximum = 0x04, - EGlobalUnitExponent = 0x05, - EGlobalUnit = 0x06, - EGlobalReportSize = 0x07, - EGlobalReportId = 0x08, - EGlobalReportCount = 0x09, - EGlobalPush = 0x0a, - EGlobalPop = 0x0b - }; - - /** - * HID main tags - */ - enum THidMainTags - { - EMainInput = 0x08, - EMainOutput = 0x09, - EMainFeature = 0x0b, - EMainCollection = 0x0a, - EMainEndCollection = 0x0c - }; - - /** - * The local state, cleared after each "Main" item - * Own. - */ - CField* iLocal; - - /** - * Current global state - */ - TParserGlobalState iGlobal; - - /** - * Global state stack, to allow HID descriptor PUSH and POP commands - */ - RArray iGlobalStack; - - // For delimiter handling: - // - /** - * ETrue if currently within a delimiter pair - */ - TBool iWithinDelimiter; - - /** - * Count of alternate USAGE declarations so far - */ - TInt iAliasCount; - - /** - * Count of alternate USAGE_MIN declarations - */ - TInt iAliasCountMin; - - /** - * Count of alternate USAGE_MAX declarations - */ - TInt iAliasCountMax; - - /** - * The root node of the collection tree - * Own. - */ - CReportRoot* iReportRoot; - - /** - * Stack used to create the collection tree - */ - RPointerArray iCollectionStack; - - // Keep track of which items have been seen in the descriptor: - // - /** - * All items forming the current item state - */ - TUint32 iItemsDefined; - - /** - * Global items seen since the last main tag - */ - TUint32 iGlobalItemsDefined; - - /** - * ETrue if a redundant local item is seen - */ - TBool iLocalMultipleUse; - - /** - * Number of the item we're currently processing - */ - TInt iItemNumber; - - /** - * Record of any critical error encountered - */ - TInt iErrorCode; - - /** - * Field count - */ - TInt iFieldCount; - }; - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/inc/hidreportgenerator.h --- a/localconnectivityservice/generichid/inc/hidreportgenerator.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/* -* Copyright (c) 2005-2007 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: Report generator -* -*/ - -#ifndef C_REPORT_GENERATOR_H -#define C_REPORT_GENERATOR_H - -#include "hidreportroot.h" -#include "hidtranslate.h" - -/** - * HID report generator - * - * Class used for generating output or feature reports to send to the device. - * - * @lib generichid.lib - * @since S60 v5.0 - */ -class CReportGenerator : public CBase - { -public: - /** - * Constructs a CReportGenerator. - * - * @since S60 v5.0 - * @param aReportRoot Tree generated by CParser from the report - * descriptor. - * @param aReportId Report ID of the report to generate. - * @param aType Type of report to generate (output or feature). - */ - IMPORT_C static CReportGenerator* NewLC(const CReportRoot* aReportRoot, - TInt aReportId, CField::TType aType); - - /** - * Constructs a CReportGenerator. - * - * @since S60 v5.0 - * @param aReportRoot Tree generated by CParser from the report - * descriptor. - * @param aReportId Report ID of the report to generate. - * @param aType Type of report to generate (output or feature). - */ - IMPORT_C static CReportGenerator* NewL(const CReportRoot* aReportRoot, - TInt aReportId, CField::TType aType); - - virtual ~CReportGenerator(); - - /** - * Sets the value of a single field in the report. Stores the requested - * control value in a field in the report buffer. For array fields, adds - * the requested usage ID to the array. - * - * @since S60 v5.0 - * @param aField Pointer to the field in which to set a value. - * @param aUsageId Usage ID of the control to set. - * @param aValue Value to write to the field, used for variable - * fields only. - * @param aControlOffset Which control to set when more than one - * have the same usage ID. - * @return Error code indicating success or reason for failure. - */ - IMPORT_C TInt SetField(const CField* aField, TInt aUsageId, TInt aValue, - TInt aControlOffset = 0); - - /** - * Get the buffer holding the generated report - * - * @since S60 v5.0 - * @return pointer to buffer - */ - IMPORT_C TPtr8 Report(); - -private: - /** - * Constructor for CReportGenerator. - * - * @since S60 v5.0 - * @param aReportId Report ID of the report to generate. - * @param aType Type of report to generate (output or feature). - */ - CReportGenerator(TInt aReportId, CField::TType aType); - - /** - * 2nd phase constructor for CReportGenerator. Allocates the - * report buffer iBuf. - * - * @since S60 v5.0 - * @param aReportRoot Tree generated by CParser from the report - * descriptor. - */ - void ConstructL(const CReportRoot* aReportRoot); - - /** - * Report ID of the report to generate - */ - TInt iReportId; - - /** - * Type of report to generate - */ - CField::TType iType; - - /** - * Tree of fields from the report descriptor - * Not own. - */ - const CReportRoot* iReportRoot; - - /** - * Buffer to hold the generated report - * Own. - */ - HBufC8* iBuf; - }; - -#endif // __REPORT_GENERATOR_H__ diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/inc/hiduids.h --- a/localconnectivityservice/generichid/inc/hiduids.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* Copyright (c) 2007 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: UID definitions. -* -*/ - - -#ifndef HIDUIDS_H -#define HIDUIDS_H - -#define ECOM_UID 0x10009d8d -#define REMCON_PLUGIN_IF 0x10204546 -//----- original HID uids, reserved from Symbian -#define LAYOUT_PLUGIN_UID 0x10201d25 -#define DRIVER_PLUGIN_IF 0x10201d26 -#define LAYOUT_PLUGIN_IF 0x10201d27 -#define BTHID_SRV_UID 0x10201d28 -#define LAYOUTMGR_UID 0x10201d29 -#define BTKEYBOARD_APP_UID 0x10201d2a -#define STARTER_UID 0x10201d2b -#define BTHID_PLUGIN_UID 0x10201d2c -//----- reserved from NSS list -#define MOUSE_UID 0x10281cfc -#define BTHID_CLIENT_UID 0x10281cfd -#define GENERICHID_UID 0x10281cfe -#define GSPLUGIN_IMP 0x10281cff -#define BTHID_MAIN_IMP 0x10281d00 -#define BTHID_SETTINGS_IMP 0x10281d01 -#define BTHID_PLUGIN_IF 0x10281d02 -#define INSTALLER_UID 0x10281d03 -#define KEYBOARD_UID 0x10281d04 -#define KEYBOARD_DRIVER_IMP 0x10282bfd -#define MOUSE_DRIVER_IMP 0x10282bfe -#define BELGIAN_LAYOUT_IMP 0x10282bff -#define DANISH_LAYOUT_IMP 0x10282c00 -#define DUTCH_LAYOUT_IMP 0x10282c01 -#define FINSWE_LAYOUT_IMP 0x10282c02 -#define FRENCH_LAYOUT_IMP 0x10282c03 -#define GERMAN_LAYOUT_IMP 0x10282c04 -#define ITALIAN_LAYOUT_IMP 0x10282c05 -#define NORWEGIAN_LAYOUT_IMP 0x10282c06 -#define PORTUGUESE_LAYOUT_IMP 0x10282c07 -#define SPANISH_LAYOUT_IMP 0x10282c08 -#define SU8GERMAN_LAYOUT_IMP 0x10282c09 -#define SU8RUSSIAN_LAYOUT_IMP 0x10282c0a -#define SU8RUSSIANINT_LAYOUT_IMP 0x10282c0b -#define SU8FINSWE_LAYOUT_IMP 0x10282c0c -#define SU8DANNOR_LAYOUT_IMP 0x10282c0d -#define SU8USENGLISH_LAYOUT_IMP 0x10282c0e -#define SU8INTUSENGLISH_LAYOUT_IMP 0x10282c0f -#define UK_LAYOUT_IMP 0x10282c10 -#define US_LAYOUT_IMP 0x10282c11 -#define USDVORAK_LAYOUT_IMP 0x10282c12 -#define USINT_LAYOUT_IMP 0x10282c13 -#define KBDCLIENT_UID 0x10282c14 -#define HEADSET_UID 0x10282c15 -#define HEADSET_DRIVER_IMP 0x10282c16 -#define HIDREMCON_UID 0x10282c17 -#define HIDREMCON_IMP 0x10282c18 -#define HIDEVENTPUBLISHER_UID 0x10282c19 -// Last reserved UID 0x10282c3c - -#endif // __HIDUIDS_H__ diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/inc/prjconfig.h --- a/localconnectivityservice/generichid/inc/prjconfig.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +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: Project configure file. -* -*/ - - -#ifndef GENERICHID_PRJCONFIG_H -#define GENERICHID_PRJCONFIG_H - -/** - * Traces are enabled via RDebug::Print() in UDEB build, by default. - */ -#ifdef _DEBUG -#define PRJ_ENABLE_TRACE -#endif - -/** - * Traces will be written to file if this is defined. - */ -//#define PRJ_FILE_TRACE - - -/** - * build the project for module test purpose if this is defined - */ -//#define PRJ_MODULETEST_BUILD - -/** - * build the project using stubs to replace the dependencies if this is defined - */ -//#define PRJ_USE_STUB - -#endif // OBEXSM_PRJCONFIG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/rom/generichid.iby --- a/localconnectivityservice/generichid/rom/generichid.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2008-2008 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: Image description file for project generichid -* -*/ - - -#ifndef __GENERICHID_IBY__ -#define __GENERICHID_IBY__ - -file=ABI_DIR\BUILD_DIR\generichid.dll SHARED_LIB_DIR\generichid.dll - - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/src/hidcollection.cpp --- a/localconnectivityservice/generichid/src/hidcollection.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,284 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: HID collection implementation -* -*/ - - -#include -#include -#include -#include - -#include "hidreportroot.h" -#include "debug.h" - -// ======== MEMBER FUNCTIONS ======== - -// ----------------------------------------------------------------------------- -// NewLC() -// ----------------------------------------------------------------------------- -// -CCollection* CCollection::NewLC() - { - CCollection* self = new (ELeave) CCollection(); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } -// ----------------------------------------------------------------------------- -// NewL() -// ----------------------------------------------------------------------------- -// -CCollection* CCollection::NewL() - { - CCollection* self=NewLC(); - CleanupStack::Pop(); - return self; - } - -// ----------------------------------------------------------------------------- -// ConstructL() -// ----------------------------------------------------------------------------- -// -void CCollection::ConstructL() - { - // Nothing to do here - } - -// ----------------------------------------------------------------------------- -// CCollection() -// ----------------------------------------------------------------------------- -// -CCollection::CCollection() - { - // Nothing to do here - } - -// ----------------------------------------------------------------------------- -// ~CCollection() -// ----------------------------------------------------------------------------- -// -CCollection::~CCollection() - { - iCollections.ResetAndDestroy(); - iFields.ResetAndDestroy(); - } - -// ----------------------------------------------------------------------------- -// Type() -// ----------------------------------------------------------------------------- -// -EXPORT_C TUint32 CCollection::Type() const - { - return iType; - } - -// ----------------------------------------------------------------------------- -// UsagePage() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CCollection::UsagePage() const - { - return iUsagePage; - } - -// ----------------------------------------------------------------------------- -// Usage() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CCollection::Usage() const - { - return iUsage; - } - -// ----------------------------------------------------------------------------- -// CollectionCount() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CCollection::CollectionCount() const - { - return iCollections.Count(); - } - -// ----------------------------------------------------------------------------- -// FieldCount() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CCollection::FieldCount() const - { - return iFields.Count(); - } - -// ----------------------------------------------------------------------------- -// CollectionByIndex -// ----------------------------------------------------------------------------- -// -EXPORT_C const CCollection* CCollection::CollectionByIndex(TInt aIndex) const - { - return (0 <= aIndex && aIndex < iCollections.Count()) ? - iCollections[aIndex] : NULL; - } - -// ----------------------------------------------------------------------------- -// FieldByIndex -// ----------------------------------------------------------------------------- -// -EXPORT_C const CField* CCollection::FieldByIndex(TInt aIndex) const - { - return (0 <= aIndex && aIndex < iFields.Count()) ? - iFields[aIndex] : NULL; - } - -// ----------------------------------------------------------------------------- -// IsPhysical() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CCollection::IsPhysical() const - { - return iType == EPhysical; - } - -// ----------------------------------------------------------------------------- -// IsApplication() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CCollection::IsApplication() const - { - return iType == EApplication; - } - -// ----------------------------------------------------------------------------- -// IsLogical() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CCollection::IsLogical() const - { - return iType == ELogical; - } - -// ----------------------------------------------------------------------------- -// IsReport() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CCollection::IsReport() const - { - return iType == EReport; - } - -// ----------------------------------------------------------------------------- -// IsNamedArray() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CCollection::IsNamedArray() const - { - return iType == ENamedArray; - } - -// ----------------------------------------------------------------------------- -// IsUsageSwitch() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CCollection::IsUsageSwitch() const - { - return iType == EUsageSwitch; - } - -// ----------------------------------------------------------------------------- -// IsUsageModifier() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CCollection::IsUsageModifier() const - { - return iType == EUsageModifier; - } - -// ----------------------------------------------------------------------------- -// SetType() -// ----------------------------------------------------------------------------- -// -void CCollection::SetType(TUint32 aType) - { - iType = aType; - } - -// ----------------------------------------------------------------------------- -// SetUsagePage() -// ----------------------------------------------------------------------------- -// -void CCollection::SetUsagePage(TInt aUsagePage) - { - iUsagePage = aUsagePage; - } - -// ----------------------------------------------------------------------------- -// SetUsage() -// ----------------------------------------------------------------------------- -// -void CCollection::SetUsage(TInt aUsage) - { - iUsage = aUsage; - } -// ----------------------------------------------------------------------------- -// AddFieldL() -// ----------------------------------------------------------------------------- -// -CField* CCollection::AddFieldL() - { - CField* field = CField::NewL(); - CleanupStack::PushL(field); - User::LeaveIfError(iFields.Append(field)); - CleanupStack::Pop(field); - return field; - } - -// ----------------------------------------------------------------------------- -// AddCollectionL() -// ----------------------------------------------------------------------------- -// -CCollection* CCollection::AddCollectionL() - { - CCollection* collection = CCollection::NewL(); - CleanupStack::PushL(collection); - User::LeaveIfError(iCollections.Append(collection)); - CleanupStack::Pop(collection); - return collection; - } - - - - - -// ----------------------------------------------------------------------------- -// Match() -// ----------------------------------------------------------------------------- -// -TBool TReportSize::Match(const TReportSize& aFirst, - const TReportSize& aSecond) - { - return (aFirst.iReportId == aSecond.iReportId) && - (aFirst.iType == aSecond.iType); - } - - -// ----------------------------------------------------------------------------- -// TReportSize() -// ----------------------------------------------------------------------------- -// -TReportSize::TReportSize(TInt aReportId, CField::TType aType) - : iReportId(aReportId), iType(aType), iSize(0) - { - // Nothing else to do - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/src/hidconnectioninfo.cpp --- a/localconnectivityservice/generichid/src/hidconnectioninfo.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* Copyright (c) 2008-2008 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: -* -*/ - - - -#include "hidconnectioninfo.h" -#include "hidreportroot.h" -#include "debug.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// -CConnectionInfo::CConnectionInfo(TInt aConnectionID, CReportRoot* aReportRoot): -iConnectionID(aConnectionID), -iReportRoot(aReportRoot) - { - TRACE_FUNC - } - -// --------------------------------------------------------------------------- -// NewL -// --------------------------------------------------------------------------- -// -CConnectionInfo* CConnectionInfo::NewL(TInt aConnectionID, CReportRoot* aReportRoot) - { - CConnectionInfo* self = CConnectionInfo::NewLC(aConnectionID, aReportRoot); - CleanupStack::Pop( self ); - return self; - } - - -// --------------------------------------------------------------------------- -// NewLC -// --------------------------------------------------------------------------- -// -CConnectionInfo* CConnectionInfo::NewLC(TInt aConnectionID, CReportRoot* aReportRoot) - { - CConnectionInfo* self = new( ELeave ) CConnectionInfo( aConnectionID, aReportRoot); - CleanupStack::PushL( self ); - return self; - } - - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CConnectionInfo::~CConnectionInfo() - { - TRACE_FUNC_ENTRY - delete iReportRoot; - iReportRoot = NULL; - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// ConnectionID -// --------------------------------------------------------------------------- -// -TInt CConnectionInfo::ConnectionID() - { - return iConnectionID; - } - -// --------------------------------------------------------------------------- -// ReportRoot -// --------------------------------------------------------------------------- -// -CReportRoot* CConnectionInfo::ReportRoot() - { - return iReportRoot; - } - -// --------------------------------------------------------------------------- -// SetLastCommandHandler -// --------------------------------------------------------------------------- -// -void CConnectionInfo::SetLastCommandHandler(CHidDriver* aHidDriverItem) - { - iLastCmdDriver = aHidDriverItem; - } -// --------------------------------------------------------------------------- -// ReturnLastCommandHandler -// --------------------------------------------------------------------------- -// -CHidDriver* CConnectionInfo::ReturnLastCommandHandler() - { - return iLastCmdDriver; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/src/hiddriveritem.cpp --- a/localconnectivityservice/generichid/src/hiddriveritem.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* Copyright (c) 2009 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: Driver list item implementation -* -*/ - - -#include -#include -#include - -#include "hiddriveritem.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// -CDriverListItem::CDriverListItem(TInt aConnectionId) - : iConnectionId(aConnectionId) - { - } -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CDriverListItem::~CDriverListItem() - { - delete iDriver; - } - -// --------------------------------------------------------------------------- -// ConnectionId() -// --------------------------------------------------------------------------- -// -TInt CDriverListItem::ConnectionId() const - { - return iConnectionId; - } - -// --------------------------------------------------------------------------- -// Driver() -// --------------------------------------------------------------------------- -// -CHidDriver* CDriverListItem::Driver() const - { - return iDriver; - } - -// --------------------------------------------------------------------------- -// SetDriver() -// --------------------------------------------------------------------------- -// -void CDriverListItem::SetDriver(CHidDriver* aDriver) - { - delete iDriver; - iDriver = aDriver; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/src/hidfield.cpp --- a/localconnectivityservice/generichid/src/hidfield.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,638 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: Hid field implementation -* -*/ - - -#include -#include -#include -#include - -#include "hidreportroot.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// NewL() -// --------------------------------------------------------------------------- -// -CField* CField::NewL() - { - CField* self = NewLC(); - CleanupStack::Pop(); - return self; - } - -// --------------------------------------------------------------------------- -// NewLC() -// --------------------------------------------------------------------------- -// -CField* CField::NewLC() - { - // Two-phase construction isn't necessary at present: - CField* self = new (ELeave) CField; - CleanupStack::PushL(self); - return self; - } - -// --------------------------------------------------------------------------- -// CField() -// --------------------------------------------------------------------------- -// -CField::CField() - { - // nothing else to do - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CField::~CField() - { - iUsageList.Close(); - } - -// --------------------------------------------------------------------------- -// UsagePage() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::UsagePage() const - { - return iUsagePage; - } - -// --------------------------------------------------------------------------- -// ReportId() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::ReportId() const - { - return iReportId; - } - -// --------------------------------------------------------------------------- -// Offset() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::Offset() const - { - return (iReportId == 0) ? iPos : (iPos+KSizeOfByte); - } - -// --------------------------------------------------------------------------- -// Size() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::Size() const - { - return iSize; - } - -// --------------------------------------------------------------------------- -// Count() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::Count() const - { - return iCount; - } - -// --------------------------------------------------------------------------- -// LogicalMin() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::LogicalMin() const - { - return iLogicalMin; - } - -// --------------------------------------------------------------------------- -// LogicalMax() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::LogicalMax() const - { - return iLogicalMax; - } - -// --------------------------------------------------------------------------- -// UsageMin() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::UsageMin() const - { - return iUsageMin; - } - -// --------------------------------------------------------------------------- -// UsageMax() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::UsageMax() const - { - return iUsageMax; - } - -// --------------------------------------------------------------------------- -// PhysicalMin() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::PhysicalMin() const - { - return iPhysicalMin; - } - -// --------------------------------------------------------------------------- -// PhysicalMax() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::PhysicalMax() const - { - return iPhysicalMax; - } - -// --------------------------------------------------------------------------- -// Unit() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::Unit() const - { - return iUnit; - } - -// --------------------------------------------------------------------------- -// UnitExponent() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::UnitExponent() const - { - return iUnitExponent; - } - -// --------------------------------------------------------------------------- -// DesignatorIndex() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::DesignatorIndex() const - { - return iDesignatorIndex; - } - -// --------------------------------------------------------------------------- -// DesignatorMin() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::DesignatorMin() const - { - return iDesignatorMin; - } - -// --------------------------------------------------------------------------- -// DesignatorMax() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::DesignatorMax() const - { - return iDesignatorMax; - } - -// --------------------------------------------------------------------------- -// StringMin() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::StringMin() const - { - return iStringMin; - } - -// --------------------------------------------------------------------------- -// StringMax() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::StringMax() const - { - return iStringMax; - } - -// --------------------------------------------------------------------------- -// StringIndex() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::StringIndex() const - { - return iStringIndex; - } - -// --------------------------------------------------------------------------- -// UsageArray() -// --------------------------------------------------------------------------- -// -EXPORT_C TArray CField::UsageArray() const - { - return iUsageList.Array(); - } - -// --------------------------------------------------------------------------- -// HasUsage() -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CField::HasUsage(const TInt aUsage) const - { - return iUsageList.Find(aUsage) != KErrNotFound; - } - -// --------------------------------------------------------------------------- -// AddUsageL -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::AddUsageL(const TInt aUsage) - { - User::LeaveIfError(iUsageList.Append(aUsage)); - } - -// --------------------------------------------------------------------------- -// ClearUsageList() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::ClearUsageList() - { - iUsageList.Reset(); - } - -// --------------------------------------------------------------------------- -// LastUsage() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::LastUsage() const - { - TInt usage = 0; - if (iUsageList.Count() > 0) - { - usage = iUsageList[iUsageList.Count()-1]; - } - return usage; - } - -// --------------------------------------------------------------------------- -// Attributes() -// --------------------------------------------------------------------------- -// -EXPORT_C TUint32 CField::Attributes() const - { - return iAttributes; - } - -// --------------------------------------------------------------------------- -// Type() -// --------------------------------------------------------------------------- -// -EXPORT_C CField::TType CField::Type() const - { - return iType; - } - -// --------------------------------------------------------------------------- -// IsVariable() -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CField::IsVariable() const - { - return (( iAttributes & KFieldAttributeVariable ) != 0); - } - -// --------------------------------------------------------------------------- -// IsArray() -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CField::IsArray() const - { - return ( ( iAttributes & KFieldAttributeVariable ) == 0); - } - -// --------------------------------------------------------------------------- -// IsConstant() -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CField::IsConstant() const - { - return (( iAttributes & KFieldAttributeConstant ) != 0 ); - } - -// --------------------------------------------------------------------------- -// IsData() -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CField::IsData() const - { - // Field atribute first bit present if data is constat or is it data. - // If first bit is zero field attibute data is set. - return ( ( iAttributes & KFieldAttributeConstant ) == 0 ); - } - -// --------------------------------------------------------------------------- -// SetType() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetType(const TType& aType) - { - iType = aType; - } - -// --------------------------------------------------------------------------- -// SetUsagePage() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetUsagePage(const TInt aUsagePage) - { - iUsagePage = aUsagePage; - } - -// --------------------------------------------------------------------------- -// Destructor() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetReportId(const TInt aId) - { - iReportId = aId; - } - -// --------------------------------------------------------------------------- -// SetOffset() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetOffset(const TInt aOffset) - { - iPos = aOffset; - } - -// --------------------------------------------------------------------------- -// SetSize() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetSize(const TInt aSize) - { - iSize = aSize; - } - -// --------------------------------------------------------------------------- -// SetCount() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetCount(const TInt aCount) - { - iCount = aCount; - } - -// --------------------------------------------------------------------------- -// SetLogicalMin() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetLogicalMin(const TInt aMin) - { - iLogicalMin = aMin; - } - -// --------------------------------------------------------------------------- -// SetLogicalMax() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetLogicalMax(const TInt aMax) - { - iLogicalMax = aMax; - } - -// --------------------------------------------------------------------------- -// SetUsageMin() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetUsageMin(const TInt aMin) - { - iUsageMin = aMin; - } - -// --------------------------------------------------------------------------- -// SetUsageMax() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetUsageMax(const TInt aMax) - { - iUsageMax = aMax; - } - -// --------------------------------------------------------------------------- -// SetAttributes() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetAttributes(const TUint32 aAttributes) - { - iAttributes = aAttributes; - } - -// --------------------------------------------------------------------------- -// SetPhysicalMin() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetPhysicalMin(TInt aValue) - { - iPhysicalMin = aValue; - } - -// --------------------------------------------------------------------------- -// SetPhysicalMax() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetPhysicalMax(TInt aValue) - { - iPhysicalMax = aValue; - } - -// --------------------------------------------------------------------------- -// SetUnit() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetUnit(TInt aValue) - { - iUnit = aValue; - } - -// --------------------------------------------------------------------------- -// SetUnitExponent() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetUnitExponent(TInt aValue) - { - iUnitExponent = aValue; - } - -// --------------------------------------------------------------------------- -// SetDesignatorIndex() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetDesignatorIndex(TInt aValue) - { - iDesignatorIndex = aValue; - } - -// --------------------------------------------------------------------------- -// SetDesignatorMin() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetDesignatorMin(TInt aValue) - { - iDesignatorMin = aValue; - } - -// --------------------------------------------------------------------------- -// SetDesignatorMax() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetDesignatorMax(TInt aValue) - { - iDesignatorMax = aValue; - } - -// --------------------------------------------------------------------------- -// SetStringMin() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetStringMin(TInt aValue) - { - iStringMin = aValue; - } - -// --------------------------------------------------------------------------- -// SetStringMax() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetStringMax(TInt aValue) - { - iStringMax = aValue; - } - -// --------------------------------------------------------------------------- -// SetStringIndex() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetStringIndex(TInt aValue) - { - iStringIndex = aValue; - } - -// --------------------------------------------------------------------------- -// SetLogicalRange() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetLogicalRange(TInt aMin, TInt aMax) - { - iLogicalMin = aMin; - iLogicalMax = aMax; - } - -// --------------------------------------------------------------------------- -// SetUsageRange() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetUsageRange(TInt aMin, TInt aMax) - { - iUsageMin = aMin; - iUsageMax = aMax; - } - -// --------------------------------------------------------------------------- -// SetPhysicalRange -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetPhysicalRange(TInt aMin, TInt aMax) - { - iPhysicalMin = aMin; - iPhysicalMax = aMax; - } - -// --------------------------------------------------------------------------- -// SetStringRange() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetStringRange(TInt aMin, TInt aMax) - { - iStringMin = aMin; - iStringMax = aMax; - } - -// --------------------------------------------------------------------------- -// SetDesignatorRange() -// --------------------------------------------------------------------------- -// -EXPORT_C void CField::SetDesignatorRange(TInt aMin, TInt aMax) - { - iDesignatorMin = aMin; - iDesignatorMax = aMax; - } - -// --------------------------------------------------------------------------- -// IsInput() -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CField::IsInput() const - { - return iType == EInput; - } - -// --------------------------------------------------------------------------- -// IsOutput() -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CField::IsOutput() const - { - return iType == EOutput; - } - -// --------------------------------------------------------------------------- -// IsFeature() -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CField::IsFeature() const - { - return iType == EFeature; - } - -// --------------------------------------------------------------------------- -// UsageCount() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::UsageCount() const - { - return iUsageList.Count(); - } - -// --------------------------------------------------------------------------- -// Usage() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CField::Usage(TInt aIndex) const - { - return iUsageList[aIndex]; - } - -// --------------------------------------------------------------------------- -// IsInReport() -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CField::IsInReport(TInt aReportId) const - { - return ( 0 == iReportId || aReportId == iReportId ); - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/src/hidgeneric.cpp --- a/localconnectivityservice/generichid/src/hidgeneric.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,533 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: Generic hid implementation -* -*/ - -#include - -#include "debug.h" -#include "hidgeneric.h" -#include "hidreportroot.h" -#include "hidparser.h" -#include "hiddriveritem.h" -#include "hidconnectioninfo.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// NewLC -// --------------------------------------------------------------------------- -// -EXPORT_C CGenericHid* CGenericHid::NewLC(MTransportLayer* aTransportLayer) - { - TRACE_INFO((_L("[HID]\tCGenericHid::NewLC(0x%08x)"), aTransportLayer)); - CGenericHid* self = new (ELeave) CGenericHid(aTransportLayer); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// NewL -// --------------------------------------------------------------------------- -// -EXPORT_C CGenericHid* CGenericHid::NewL(MTransportLayer* aTransportLayer) - { - TRACE_INFO((_L("[HID]\tCGenericHid::NewL(0x%08x)"), aTransportLayer)); - CGenericHid* self = NewLC(aTransportLayer); - CleanupStack::Pop(); - return self; - } - -// --------------------------------------------------------------------------- -// ConstructL() -// --------------------------------------------------------------------------- -// -void CGenericHid::ConstructL() - { - TRACE_INFO(_L("[HID]\tCGenericHid::ConstructL()")); - TRACE_INFO(_L("[HID]\tCGenericHid::ConstructL(): Creating Parser...")); - iParser = CParser::NewL(); - iInputHandlingReg = CHidInputDataHandlingReg::NewL(); - } - -// --------------------------------------------------------------------------- -// CGenericHid() -// --------------------------------------------------------------------------- -// -CGenericHid::CGenericHid(MTransportLayer* aTransportLayer) : - iDriverList(_FOFF(CDriverListItem, iSlink)), - iTransportLayer(aTransportLayer) - { - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CGenericHid::~CGenericHid() - { - TRACE_FUNC_ENTRY - RemoveDrivers(); - iConnectionInfo.ResetAndDestroy(); - iConnectionInfo.Close(); - delete iInputHandlingReg; - delete iParser; - REComSession::FinalClose(); - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// From MDriverAccess -// CountryCodeL -// --------------------------------------------------------------------------- -// -TUint CGenericHid::CountryCodeL(TInt aConnID) - { - // Pass the request through to the transport layer. - return (iTransportLayer->CountryCodeL(aConnID)); - } - -// --------------------------------------------------------------------------- -// From MDriverAccess -// VendorIdL -// --------------------------------------------------------------------------- -// -TUint CGenericHid::VendorIdL(TInt aConnID) - { - // Pass the request through to the transport layer. - return (iTransportLayer->VendorIdL(aConnID)); - } - -// --------------------------------------------------------------------------- -// From MDriverAccess -// ProductIdL() -// --------------------------------------------------------------------------- -// -TUint CGenericHid::ProductIdL(TInt aConnID) - { - // Pass the request through to the transport layer. - return iTransportLayer->ProductIdL(aConnID); - } - -// --------------------------------------------------------------------------- -// From MDriverAccess -// SetProtocol -// --------------------------------------------------------------------------- -// -void CGenericHid::SetProtocolL(TInt aConnectionId, TUint16 aInterface, - MDriverAccess::TProtocols aProtocol, - CHidDriver* aDriver) - { - iTransportLayer->SetProtocolL(aConnectionId, static_cast(aProtocol), - aInterface); - CConnectionInfo* conninfo = SeekConnectionInfo( aConnectionId ); - if ( conninfo ) - { - conninfo->SetLastCommandHandler(aDriver); - } - } - -// --------------------------------------------------------------------------- -// From MDriverAccess -// GetProtocol -// --------------------------------------------------------------------------- -// -void CGenericHid::GetProtocolL(TInt aConnectionId,TUint16 aInterface) - { - iTransportLayer->GetProtocolL(aConnectionId, aInterface); - } - -// --------------------------------------------------------------------------- -// From MDriverAccess -// GetReport -// --------------------------------------------------------------------------- -// -void CGenericHid::GetReportL(TInt aConnectionId, - TUint8 aReportId, TUint16 aInterface, TUint16 aLength) - { - iTransportLayer->GetReportL(aConnectionId, MDriverAccess::EInput, aReportId, - aInterface, aLength); - } - -// --------------------------------------------------------------------------- -// From MDriverAccess -// SetReport() -// --------------------------------------------------------------------------- -// -void CGenericHid::SetReportL(TInt aConnectionId, TUint8 aReportId, - MDriverAccess::TReportType aReportType, const TDesC8& aPayload, - TUint16 aInterface, CHidDriver* aDriver) - { - iTransportLayer->SetReportL(aConnectionId, static_cast(aReportType), - aReportId, aInterface, aPayload); - CConnectionInfo* conninfo = SeekConnectionInfo( aConnectionId ); - if ( conninfo ) - { - conninfo->SetLastCommandHandler(aDriver); - } - } - -// --------------------------------------------------------------------------- -// From MDriverAccess -// DataOut() -// --------------------------------------------------------------------------- -// -void CGenericHid::DataOutL(TInt aConnectionId, TUint8 aReportId, - const TDesC8& aPayload, - TUint16 aInterface) - { - iTransportLayer->DataOutL(aConnectionId, aReportId, aInterface, aPayload); - } - - -// --------------------------------------------------------------------------- -// From MDriverAccess -// GetIdle() -// --------------------------------------------------------------------------- -// -void CGenericHid::GetIdleL(TInt aConnectionId, TUint8 aReportId, - TUint16 aInterface ) - { - iTransportLayer->GetIdleL(aConnectionId, aReportId, aInterface); - } - -// --------------------------------------------------------------------------- -// From MDriverAccess -// SetIdle() -// --------------------------------------------------------------------------- -// -void CGenericHid::SetIdleL(TInt aConnectionId, TUint8 aDuration, - TUint8 aReportId, TUint16 aInterface, CHidDriver* aDriver) - { - iTransportLayer->SetIdleL(aConnectionId, aDuration, aReportId, aInterface); - CConnectionInfo* conninfo = SeekConnectionInfo( aConnectionId ); - if ( conninfo ) - { - conninfo->SetLastCommandHandler(aDriver); - } - - } - -// --------------------------------------------------------------------------- -// RemoveDrivers() -// --------------------------------------------------------------------------- -// -void CGenericHid::RemoveDrivers() - { - TRACE_FUNC - // Driver instances - CDriverListItem* driverItem; - while ( !iDriverList.IsEmpty() ) - { - driverItem = iDriverList.Last(); - iDriverList.Remove( *driverItem ); - delete driverItem; - } - } - -// --------------------------------------------------------------------------- -// From CHidTransport -// Disconnected() -// --------------------------------------------------------------------------- -// -TInt CGenericHid::Disconnected( TInt aConnectionId ) - { - TRACE_FUNC_ENTRY - TInt retVal = KErrNone; - - TSglQueIter driverIter( iDriverList ); - driverIter.SetToFirst(); - - CDriverListItem* driverItem = driverIter; - while ( driverItem ) - { - driverIter++; - if ( driverItem->ConnectionId() == aConnectionId ) - { - TRACE_INFO(_L("[HID]\tCGenericHid::Disconnected driver")); - if (driverItem->Driver()) - { - driverItem->Driver()->Disconnected(0); - } - // Remove it from the list of driver instances - - iDriverList.Remove(*driverItem); - delete driverItem; - driverItem = NULL; - retVal = KErrNone; - } - driverItem = driverIter; - - TRACE_INFO(_L("[HID]\tCGenericHid::Disconnected next driver")); - } - TRACE_INFO(_L("[HID]\tCGenericHid::Disconnected remove connection info")); - TInt count = iConnectionInfo.Count(); - for (TInt i = count-1 ; i>=0; i--) - { - TRACE_INFO((_L("[HID]\tCGenericHid::Disconnected remove connection info %d"),i)); - CConnectionInfo* conninfo = iConnectionInfo[i]; - TRACE_INFO((_L("[HID]\tCGenericHid::Disconnected remove connection info %d"),i)); - if ( conninfo->ConnectionID() == aConnectionId ) - { - iConnectionInfo.Remove(i); - delete conninfo; - TRACE_INFO((_L("[HID]\tCGenericHid::Disconnected remove connection info %d removed"),i)); - } - } - TRACE_FUNC_EXIT - return retVal; - } - -// --------------------------------------------------------------------------- -// From CHidTransport -// ConnectedL -// HID device has been connected. Attempt to find a driver that can -// handle reports in the format specified by the report descriptor. -// --------------------------------------------------------------------------- -// -TInt CGenericHid::ConnectedL( TInt aConnectionId, const TDesC8& aDescriptor ) - { - TRACE_INFO((_L("[HID]\tCGenericHid::ConnectedL(%d, ...)"), aConnectionId)) - - // Place the parsed report descriptor in the driver list item: - - TBool found = EFalse; - CConnectionInfo* conninfo = SeekConnectionInfo( aConnectionId ); - if ( conninfo ) - { - return KErrInUse; - } - - CReportRoot* reportRoot = iParser->ParseL( aDescriptor ); - CleanupStack::PushL(reportRoot); - - TRACE_INFO(_L("[HID]\tCGenericHid::ConnectedL: evaluate driver array")); - // Implementation info array - RImplInfoPtrArray implInfoArray; - REComSession::ListImplementationsL( KHidDriverPluginInterfaceUid, implInfoArray ); - CleanupClosePushL(implInfoArray); - - TRACE_INFO((_L("[HID]\tCGenericHid::ConnectedL: %d implementations found"), implInfoArray.Count())); - TInt index = 0; - TInt retVal = KErrHidNoDriver; - TInt supportedfields = 0; - CHidDriver* driver = NULL; - for ( index = 0; index < implInfoArray.Count(); index++ ) - { - // parse implementation UID - CImplementationInformation* info = implInfoArray[ index ]; - TUid implUid = info->ImplementationUid(); - TRACE_INFO((_L("[HID]\tCGenericHid::ConnectedL: load plugin 0x%08x"),implUid )); - // load driver - // Trap so other drivers will be enumerated even if - // this fails: - - TRAPD(retTrap, driver = CHidDriver::NewL( implUid, this )); - if ( retTrap != KErrNone) - { - continue; - } - CleanupStack::PushL(driver); - TRACE_INFO((_L("[HID]\tCGenericHid::ConnectedL: init plugin 0x%08x"),implUid )); - driver->InitialiseL( aConnectionId ); - TInt ret = driver->CanHandleReportL( reportRoot ); - if (ret == KErrNone) - { - TRACE_INFO(_L("[HID]\tCGenericHid::ConnectedL(): found driver")); - - // Make a new driver list item: - CDriverListItem* driverItem = new ( ELeave ) CDriverListItem( aConnectionId ); - CleanupStack::PushL( driverItem ); - driver->SetInputHandlingReg( iInputHandlingReg ); - supportedfields += driver->SupportedFieldCount(); - iDriverList.AddLast( *driverItem ); - CleanupStack::Pop( driverItem ); - driverItem->SetDriver( driver ); - CleanupStack::Pop( driver ); - retVal = KErrNone; - found = ETrue; - } - else - { - CleanupStack::PopAndDestroy( driver ); - } - } - TRACE_INFO((_L("[HID]\tCGenericHid::ConnectedL Partial supported hid device supported %d in report %d&"),supportedfields,iParser->FieldCount())); - if (supportedfields < iParser->FieldCount() && found ) - { - TRACE_INFO(_L("[HID]\tCGenericHid::ConnectedL Partial supported hid device")); - } - implInfoArray.ResetAndDestroy(); - CleanupStack::PopAndDestroy(); // info - if ( found ) - { - TRACE_INFO(_L("[HID]\tCGenericHid::ConnectedL append connection info")); - conninfo = CConnectionInfo::NewL(aConnectionId, reportRoot); - CleanupStack::Pop(reportRoot); // ownership transfered to conninfo - CleanupStack::PushL(conninfo); - iConnectionInfo.AppendL(conninfo); - CleanupStack::Pop(conninfo); - } - else - { - CleanupStack::PopAndDestroy(reportRoot); - } - - return retVal; - } - -// --------------------------------------------------------------------------- -// From CHidTransport -// DataIn -// Determine which driver is handling this connection ID and pass the payload -// reference to it -// --------------------------------------------------------------------------- -// -TInt CGenericHid::DataIn(TInt aConnectionId, - CHidTransport::THidChannelType aChannel, const TDesC8& aPayload) - { - TRACE_FUNC_ENTRY - TInt retVal = KErrHidNoDriver; - TInt ret = KErrNone; - - TSglQueIter driverIter( iDriverList ); - driverIter.SetToFirst(); - - CDriverListItem* item = driverIter; - TBool found = EFalse; - while ( item ) - { - if ( item->ConnectionId() == aConnectionId ) - { - ret = item->Driver()->DataIn( aChannel, aPayload ); - if (ret == KErrNone) - { - TRACE_INFO(_L("[HID]\tCGenericHid::DataIn command handled")); - found = ETrue; - retVal = KErrNone; - } - } - TRACE_INFO(_L("[HID]\tCGenericHid::DataIn next driver")); - driverIter++; - item = driverIter; - } - if ( !found && aChannel == CHidTransport::EHidChannelCtrl ) - { - retVal = KErrNone; - } - iInputHandlingReg->Reset(); - TRACE_FUNC_EXIT - return retVal; - } - - -// --------------------------------------------------------------------------- -// ReportDescriptor -// Provides access to the parsed results to the factory -// --------------------------------------------------------------------------- -// -CReportRoot* CGenericHid::ReportDescriptor(TInt aConnectionId) - { - CConnectionInfo* conninfo = SeekConnectionInfo( aConnectionId ); - if ( conninfo ) - { - return conninfo->ReportRoot(); - } - return NULL; - } - -// --------------------------------------------------------------------------- -// From CHidTransport -// DriverActive() -// --------------------------------------------------------------------------- -// -TInt CGenericHid::DriverActive(TInt aConnectionId, - CHidTransport::TDriverState aActive) - { - TRACE_FUNC_ENTRY - TInt retVal = KErrHidNoDriver; - // Find the driver handling the connection and stop it - TSglQueIter driverIter( iDriverList ); - driverIter.SetToFirst(); - CDriverListItem* item = driverIter; - - while ( item ) - { - TRACE_INFO(_L("[HID]\tCGenericHid::DriverActive")); - if ( item->ConnectionId() == aConnectionId && item->Driver() ) - { - TRACE_INFO(_L("[HID]\tCGenericHid::DriverActive driver found")); - if ( aActive == CHidTransport::EActive ) - { - TRAP(retVal, item->Driver()->StartL( aConnectionId )); - if (retVal != KErrNone) - { - break; - } - } - else if ( aActive == CHidTransport::ESuspend) - { - item->Driver()->Stop(); - retVal = KErrNone; - } - } - driverIter++; - item = driverIter; - } - TRACE_FUNC_EXIT - return retVal; - } - -// --------------------------------------------------------------------------- -// CommandResult() -// --------------------------------------------------------------------------- -// -void CGenericHid::CommandResult(TInt aConnectionId, TInt aCmdAck) - { - // Get the driver handling this connection - CConnectionInfo* conninfo = SeekConnectionInfo( aConnectionId ); - if ( conninfo ) - { - CHidDriver* hiddriver = conninfo->ReturnLastCommandHandler(); - if (hiddriver) - { - hiddriver->CommandResult(aCmdAck); - } - } - } - -// --------------------------------------------------------------------------- -// SeekConnectionInfo() -// --------------------------------------------------------------------------- -// -CConnectionInfo* CGenericHid::SeekConnectionInfo(TInt aConnectionId) - { - TRACE_FUNC - CConnectionInfo* conninfo = NULL; - TInt count = iConnectionInfo.Count(); - TRACE_INFO((_L("[HID]\tCGenericHid::SeekConnectionInfo count %d"), count)); - for (TInt i = 0 ; i < count; i++) - { - conninfo = iConnectionInfo[i]; - TRACE_INFO((_L("[HID]\tCGenericHid::SeekConnectionInfo connection info check %d %d"),aConnectionId, conninfo->ConnectionID())); - if ( conninfo->ConnectionID() == aConnectionId) - { - TRACE_INFO(_L("[HID]\tCGenericHid::SeekConnectionInfo connection info found")); - return conninfo; - } - } - return NULL; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/src/hidinterfaces.cpp --- a/localconnectivityservice/generichid/src/hidinterfaces.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/* -* Copyright (c) 2007-2007 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: Hid interface implementation -* -*/ - - -#include - -// ----------------------------------------------------------------------------- -// Constructor -// ----------------------------------------------------------------------------- -// -EXPORT_C CHidDriver::CHidDriver() - { - } - -// ----------------------------------------------------------------------------- -// Desturctor -// ----------------------------------------------------------------------------- -// -EXPORT_C CHidDriver::~CHidDriver() - { - REComSession::DestroyedImplementation( iDtor_ID_Key ); - } - -// ----------------------------------------------------------------------------- -// NewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHidDriver* CHidDriver::NewL( - TUid aImplementationUid, - MDriverAccess* aHid ) - { - TAny* ptr; - TInt32 keyOffset = _FOFF( CHidDriver, iDtor_ID_Key ); - ptr = REComSession::CreateImplementationL( - aImplementationUid, - keyOffset, - aHid - ); - return reinterpret_cast (ptr); - } - - -// ----------------------------------------------------------------------------- -// NewL() -// ----------------------------------------------------------------------------- -// -CHidInputDataHandlingReg* CHidInputDataHandlingReg::NewL() - { - CHidInputDataHandlingReg* self = new (ELeave) CHidInputDataHandlingReg(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - - } - -// ----------------------------------------------------------------------------- -// Constructor -// ----------------------------------------------------------------------------- -// -CHidInputDataHandlingReg::CHidInputDataHandlingReg() - { - } - -// ----------------------------------------------------------------------------- -// Constructor -// ----------------------------------------------------------------------------- -// -void CHidInputDataHandlingReg::ConstructL() - { - iEventArray = new ( ELeave ) CArrayFixFlat( 2 ); - } -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -CHidInputDataHandlingReg::~CHidInputDataHandlingReg() - { - Reset(); - delete iEventArray; - } - -// ----------------------------------------------------------------------------- -// AddHandledEvent -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHidInputDataHandlingReg::AddHandledEvent( TInt aUsagePage, TInt aUsage ) - { - THidEvent event; - event.iUsagePage = aUsagePage; - event.iKeyCode = aUsage; - TRAP_IGNORE(iEventArray->AppendL( event )); - } - -// ----------------------------------------------------------------------------- -// AllowedToHandleEvent -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CHidInputDataHandlingReg::AllowedToHandleEvent(TInt aUsagePage, TInt aUsage) - { - TInt i; - for (i = 0; i< iEventArray->Count() ;i++) - { - if ( iEventArray->At(i).iUsagePage == aUsagePage && iEventArray->At(i).iKeyCode == aUsage ) - { - return EFalse; - } - } - return ETrue; - } - -// ----------------------------------------------------------------------------- -// Reset -// ----------------------------------------------------------------------------- -// -void CHidInputDataHandlingReg::Reset() - { - iEventArray->Reset(); - } - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/src/hiditem.cpp --- a/localconnectivityservice/generichid/src/hiditem.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,263 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: Item implementation -* -*/ - - -// References: -// -// [1] USB Device Class Definition for Human Interface Devices (HID), -// Firmware Specification, Version 1.11, USB Implementers' Forum, -// June 2001 -// -// ---------------------------------------------------------------------- - -#include - -#include "hiditem.h" -#include "hidparser.h" - -const TInt KSizeMask = 0x03; -const TInt KTypeMask = 0x03; -const TInt KTypePosn = 2; -const TInt KTagMask = 0x0F; -const TInt KTagPosn = 4; -const TInt KLongItemId = 0xfe; -const TInt KMaxItemlength = 4; -const TInt KSizeThree = 3; -const TInt KSizeFour = 4; -const TInt KLongItemMin = 3; - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// -TItem::TItem(const TDesC8& aRawData) - : iRawData(aRawData) - { - if (aRawData.Length() < 1) - { - return; - } - TBool isShortItem = (aRawData[0] != KLongItemId); - - if (isShortItem) - { - // +----+----+----+----+----+----+----+----+ - // | Tag | Type | Size | [data...] - // | . . . | . | . | - // +----+----+----+----+----+----+----+----+ - // 7 6 5 4 3 2 1 0 - // - // A short item is followed by 0, 1, 2 or 4 bytes of data, as - // specified in the size field. See [1], Section 6.2.2.2. - iSize = aRawData[0] & KSizeMask; - if (iSize == KSizeThree) - { - iSize = KSizeFour; - } - iType = static_cast((aRawData[0] >> KTypePosn) & KTypeMask); - iTag = (aRawData[0] >> KTagPosn) & KTagMask; - iDataOffset = 1; - } - else - { - // Byte 0 Byte 1 Byte 2 - // +------+------+------+ +-----------+ +-----------+ - // | Tag | Type | Size | | Data size | | Long item | [data...] - // | 1111 | 11 | 10 | | (0-255) | | tag | - // +------+------+------+ +-----------+ +-----------+ - // 7654 32 10 - // - // A long item is followed by 0-255 bytes of data, as specified - // in the data size byte. See [1], Section 6.2.2.3. - - iType = EReserved; - - if (aRawData.Length() > KLongItemMin) - { - iSize = aRawData[1]; - iTag = aRawData[2]; - iDataOffset = KLongItemMin; - } - else - { - iSize = 0; - iTag = 0; - iDataOffset = 0; - } - } - -#ifdef DBG_ACTIVE - for (TInt i=0; (i KMaxItemlength) - { - size = KMaxItemlength; - } - - // Ensure we don't overrun the source buffer: - // - if (size > (iRawData.Length() - 1)) - { - size = iRawData.Length() - 1; - } - - // Concatenate each byte into a TUint32. Note that this function must - // return zero if the data size is zero (see Parser.cpp, MainItemL()). - // - TUint32 tagData = 0; - for (TInt i=0; i(data); - } - -// --------------------------------------------------------------------------- -// Operator [] -// --------------------------------------------------------------------------- -// -TUint8 TItem::operator[](TInt aIndex) const - { - - TUint8 value = 0; - if ((aIndex >= 0) && (aIndex < iSize)) - { - value = iRawData[iDataOffset + aIndex]; - } - return value; - } - -// --------------------------------------------------------------------------- -// Type() -// --------------------------------------------------------------------------- -// -TItem::TItemType TItem::Type() const - { - return iType; - } - -// --------------------------------------------------------------------------- -// IsMain() -// --------------------------------------------------------------------------- -// -TBool TItem::IsMain() const - { - return iType == TItem::EMain; - } - -// --------------------------------------------------------------------------- -// IsLocal() -// --------------------------------------------------------------------------- -// -TBool TItem::IsLocal() const - { - return iType == TItem::ELocal; - } - -// --------------------------------------------------------------------------- -// IsGlobal() -// --------------------------------------------------------------------------- -// -TBool TItem::IsGlobal() const - { - return iType == TItem::EGlobal; - } - -// --------------------------------------------------------------------------- -// IsLong() -// --------------------------------------------------------------------------- -// -TBool TItem::IsLong() const - { - return iType == TItem::EReserved; - } - -// --------------------------------------------------------------------------- -// ItemSize() -// --------------------------------------------------------------------------- -// -TInt TItem::ItemSize() const - { - return iSize + iDataOffset; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/src/hidparser.cpp --- a/localconnectivityservice/generichid/src/hidparser.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1941 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: HID parser implementation -* -*/ - - -// ---------------------------------------------------------------------- - -// References: -// -// [1] USB Device Class Definition for Human Interface Devices (HID), -// Firmware Specification, Version 1.11, USB Implementers' Forum, -// June 2001 -// -// [2] HID Parser Error Codes (HID Parser Error Checking), Revision -// 1.2, USB Implementers' Forum, February 2000 -// -// [3] USB HID Usage Tables, Version 1.11, USB Implementers' Forum, -// June 2001 -// -// ---------------------------------------------------------------------- - -#include -#include -#include -#include - -#include "hidreportroot.h" -#include "hiditem.h" -#include "hidparser.h" -#include "debug.h" - - - - -// ---------------------------------------------------------------------- -/* -// Define PARSER_DEBUG to activate trace output for WINS debug builds: -#undef PARSER_DEBUG - -#if defined(PARSER_DEBUG) && defined(_DEBUG) && defined(__WINS__) -#define PDBG(a) a; -#define PDBG_ACTIVE -#else -#define PDBG(a) -#endif -*/ -#define PDBG_ACTIVE - -const TUint32 CParser::KLocalItemMask = - EUsageMin | EUsageMax | EUsageId | - EDesignatorIndex | EDesignatorMin | EDesignatorMax | - EStringIndex | EStringMin | EStringMax; - - -const TUint32 KMaxStandardType = 0x06; -const TUint32 KMinVendorType = 0x80; -const TUint32 KMaxVendorType = 0xFF; -const TUint32 KMaxUsagePage = 0xffff; -const TUint32 KUnitData = 0x0f; - -const TUint32 CParser::KUnusedLocalItemsMask = KLocalItemMask & ~EUsageId; - -const TUint32 KInputReservedBitsMask = 0xffffff00; -const TUint32 KOutputReservedBitsMask = 0xffffff00; -const TUint32 KFeatureReservedBitsMask = 0xffffff00; -const TUint32 KUnitReservedBitsMask = 0xf0000000; - -const TInt KConstantFlag = 1<<0; // Constant (1) or Data (0) -const TInt KVariableFlag = 1<<1; // Array (0) or Variable (1) -const TInt KNullStateFlag = 1<<6; - -const TInt KExtendedDataSize = 4; // 32-bit extended data size -const TInt KExtendedDataShift = 16; // 16 bit shift if extended usage page is used -const TInt KMaxReportIDMax = 255; -const TInt K32Bit = 32; - -const TUint K32BitFirstBitOn = 1u<<31; -const TInt KUnitSystemMin = 5; -const TInt KUnitSystem15 = 15; - -const TUint32 CParser::KMandatoryItemMask = EUsagePage | - ELogicalMin | ELogicalMax | EReportSize | EReportCount; - -const TUint32 CParser::KReportItemMask = EInputReport | - EOutputReport | EFeatureReport; - - -// Reserved values as per the HUT document 1.11, [3]: -// This ranges are reserverd in future use. - -const TInt KReservedUsage = 0x0e; -const TInt KReservedUsageRange1Min = 0x11; -const TInt KReservedUsageRange1Max = 0x13; -const TInt KReservedUsageRange2Min = 0x15; -const TInt KReservedUsageRange2Max = 0x3f; -const TInt KReservedUsageRange3Min = 0x41; -const TInt KReservedUsageRange3Max = 0x7f; -const TInt KReservedUsageRange4Min = 0x88; -const TInt KReservedUsageRange4Max = 0x8b; -const TInt KReservedUsageRange5Min = 0x92; -const TInt KReservedUsageRange5Max = 0xfeff; - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// NewLC() -// --------------------------------------------------------------------------- -// -EXPORT_C CParser* CParser::NewLC() - { - CParser* self = new (ELeave) CParser; - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// NewL() -// --------------------------------------------------------------------------- -// -EXPORT_C CParser* CParser::NewL() - { - CParser* self = NewLC(); - CleanupStack::Pop(); - return self; - } - -// --------------------------------------------------------------------------- -// ConstructL() -// --------------------------------------------------------------------------- -// -void CParser::ConstructL() - { - TRACE_FUNC_THIS - iLocal = CField::NewL(); - } - -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// -CParser::CParser(): - iFieldCount(0) - { - TRACE_FUNC_THIS - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CParser:: ~CParser() - { - TRACE_FUNC_THIS - - // Free all RArray storage: - iGlobalStack.Reset(); - - - // Although iCollectionStack is an RPointerArray, we aren't doing - // a ResetAndDestroy() here, as all the collections are owned by - // the report root object, iReportRoot: - iCollectionStack.Reset(); - - delete iReportRoot; - delete iLocal; - } - -// --------------------------------------------------------------------------- -// CreateCollectionL -// --------------------------------------------------------------------------- -// -TInt CParser::CreateCollectionL(TUint32 aType) - { - TInt err = CheckForCollectionErrors(aType); - - if (err == KErrNone) - { - CCollection* collection = Collection()->AddCollectionL(); // Created collection added - // Collection's collection array - collection->SetType(aType); - collection->SetUsagePage(iGlobal.iUsagePage); - collection->SetUsage(iLocal->LastUsage()); - PushCollectionL(collection); - } - return err; - } - -// --------------------------------------------------------------------------- -// CheckForMainErrors() -// --------------------------------------------------------------------------- -// -TInt CParser::CheckForMainErrors() - { - if ( ( iItemsDefined & ELogicalMin ) && ( iItemsDefined & ELogicalMax ) ) - { - if ( iGlobal.iLogicalMin > iGlobal.iLogicalMax ) - { - IssueWarning( ELogicalMinExceedsMax ); - } - } - if ( iItemsDefined & (EPhysicalMin | EPhysicalMax ) ) - { - if ( !( iItemsDefined & EPhysicalMax ) ) - { - return ELonelyPhysicalMin; - } - if (!( iItemsDefined & EPhysicalMin )) - { - return ELonelyPhysicalMax; - } - - if ( iGlobal.iPhysicalMin > iGlobal.iPhysicalMax ) - { - IssueWarning(EPhysicalMinExceedsMax); - } - } - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CheckForCollectionErrors() -// --------------------------------------------------------------------------- -// -TInt CParser::CheckForCollectionErrors(TUint32 aType) - { - if (iCollectionStack.Count() == 0 ) - { - return ENoCollectionToCheck; - } - - if (aType > KMaxStandardType) - { - if ((aType < KMinVendorType) || (aType > KMaxVendorType)) - { - IssueWarning( ECollectionTypeUnknownReserved ); - } - } - - if ( iItemsDefined & KUnusedLocalItemsMask ) - { - IssueWarning( ECollectionLocalUnused ); - } - - TInt numUsages = iLocal->UsageCount(); - - if ( numUsages > 1 ) - { - // Only a single usage value can be associated with a collection: - IssueWarning( ECollectionLocalUnused ); - } - - if ( numUsages == 0 ) - { - // A usage tag must be associated with a collection (see [1], - // Section 6.2.2.6): - IssueWarning( ECollectionHasNoUsage ); - } - - if ( !( iItemsDefined & EUsagePage ) ) - { - // A usage page must be associated with a collection (see [1], - // Section 6.2.2.6): - IssueWarning( ECollectionHasNoUsagePage ); - } - - if (( aType == CCollection::EApplication ) && ( iItemsDefined & EDelimiter )) - { - // Delimiters can't be used when defining usages that apply to - // Application Collections ([1], Section 6.2.2.8): - IssueWarning(EApplicationHasDelimiter); - - // It is an error to declare a delimiter for a top-level - // application collection, [2]: - if (iCollectionStack.Count() == 1) - { - return EDelimiterAtTopLevel; - } - } - return CheckForMainErrors(); - } - - -// --------------------------------------------------------------------------- -// CheckForFieldErrors() -// --------------------------------------------------------------------------- -// -TInt CParser::CheckForFieldErrors(CField::TType aType, TUint32 aAttributes) - { - TInt ret = KErrNone; - ret = CheckMandatoryFieldErrors(aType, aAttributes); - if ( ret != KErrNone ) - { - return ret; - } - - const TInt KLimitsError[] = - { EInputMinExceedsMax, EOutputMinExceedsMax, EFeatureMinExceedsMax }; - - if ( iGlobal.iLogicalMin > iGlobal.iLogicalMax ) - { - return KLimitsError[aType]; - } - - if ( ( iItemsDefined & ( EPhysicalMin | EPhysicalMax ) ) - && ( iGlobal.iPhysicalMin > iGlobal.iPhysicalMax )) - { - return KLimitsError[aType]; - } - CheckLogicalMinAndMax( aAttributes ); - CheckFieldBitNeeded( aType, aAttributes ); - return CheckForMainErrors(); - } - - -// --------------------------------------------------------------------------- -// BitsToRepresentRange() -// --------------------------------------------------------------------------- -// -TInt CParser::BitsToRepresentRange(TInt aMin, TInt aMax) - { - // The number of bits required to represent all values in the - // range aMin to aMax inclusive. If the range is all positive - // then there is no sign bit, otherwise twos complement format is - // assumed. ([1], Section 6.2.2.7.) - - TInt bitsNeeded = 0; - - if (aMin != aMax) - { - TUint absVal = static_cast(Max(Abs(aMin), Abs(aMax))); - - bitsNeeded = K32Bit - NumberOfLeadingZeros(absVal); - - // If either are negative, we'll need space for the sign bit: - // - if ((aMax < 0) || (aMin < 0)) - { - bitsNeeded++; - - // However, 2s complement allows us to represent one extra - // negative number than positive, and so our calculation - // may be one bit over. Catch this with a special case: - // - if (bitsNeeded > 1) - { - TInt n = 1 << (bitsNeeded - 2); - if ((aMin == -n) && (aMax < n)) - { - bitsNeeded--; - } - } - } - } - - return bitsNeeded; - } - -// --------------------------------------------------------------------------- -// NumberOfLeadingZeros() -// --------------------------------------------------------------------------- -// -TInt CParser::NumberOfLeadingZeros(TUint32 aValue) - { - TInt count = 0; - - TUint32 pos = K32BitFirstBitOn; - while ((pos != 0) && ((aValue & pos) == 0)) - { - count++; - pos >>= 1; - } - - return count; - } - - -// --------------------------------------------------------------------------- -// CheckAllReportSizes() -// --------------------------------------------------------------------------- -// -TBool CParser::CheckAllReportSizes() const - { - // Final report sizes must be an integral number of bytes, [2]: - - TBool sizesOk = ETrue; - - for (TInt i=0; sizesOk && (iNumberOfReports()); ++i) - { - TInt bits = iReportRoot->ReportSize(i); - - if ((bits == 0) || ((bits % 8) != 0)) - { - sizesOk = EFalse; - } - } - return sizesOk; - } - - -// --------------------------------------------------------------------------- -// CreateFieldL() -// --------------------------------------------------------------------------- -// -TInt CParser::CreateFieldL(CField::TType aType, TUint32 aAttributes) - { - TInt err = CheckForFieldErrors( aType, aAttributes ); - //Microsoft Elite 2 keyboard HID bug fix - if ( err == EInputMissingItems && iGlobal.iUsagePage == 0x07 ) - if ( iLocal->UsageMin( ) == 0xe0 && iLocal->UsageMax( ) == 0xe7 ) - { - iGlobal.iLogicalMin = 0x0; - iGlobal.iLogicalMax = 0x1; - err = KErrNone; - } - else - { - iGlobal.iLogicalMin = 0x0; - err = KErrNone; - } - - if (err == KErrNone) - { - // Create a new field object: - CField* field = Collection()->AddFieldL( ); // Created field added - // to collection's field array - DumpStateTableL( field ); - field->SetType( aType ); - field->SetAttributes( aAttributes ); - - // Set the field offset to the current report size, and - // increase the report size by the size of this field: - if ( !iReportRoot ) - { - User::Leave(ENoReportRoot); - } - field->SetOffset( iReportRoot->ReportSize( field->ReportId( ), aType) ); - iReportRoot->IncrementReportSizeL( field->ReportId(), - aType, field->Count() * field->Size() ); - TRACE_INFO(_L("CParser::CreateFieldL Field added")); - if ( field->UsageCount() ) - { - iFieldCount++; - } - } - return err; - } - -// --------------------------------------------------------------------------- -// DumpStateTableL() -// --------------------------------------------------------------------------- -// -void CParser::DumpStateTableL(CField *aField) const - { - TRACE_INFO((_L("DumpStateTableL(0x%08x)\n"), aField)); - - // Copy global state: - // - iGlobal.Populate(aField); - - // Copy local state: - // - aField->SetUsageRange( iLocal->UsageMin(), iLocal->UsageMax() ); - aField->SetDesignatorIndex( iLocal->DesignatorIndex() ); - aField->SetDesignatorRange( iLocal->DesignatorMin(), - iLocal->DesignatorMax() ); - aField->SetStringIndex( iLocal->StringIndex() ); - aField->SetStringRange( iLocal->StringMin(), iLocal->StringMax() ); - - // Copy usage list (local state) and calculate the usage range, if - // it hasn't already been explicitly specified: - // - if ( iLocal->UsageCount() > 0 ) - { - TInt minUsage, maxUsage; - minUsage = maxUsage = iLocal->Usage( 0 ); - - for (TInt i=0; iUsageCount(); ++i) - { - TInt value = iLocal->Usage( i ); - aField->AddUsageL( value ); - if ( value < minUsage ) - { - minUsage = value; - } - if ( value > maxUsage ) - { - maxUsage = value; - } - } - if ( (iItemsDefined & (EUsageMin | EUsageMax) ) == 0) - { - aField->SetUsageRange( minUsage, maxUsage ); - } - } - } - - -// --------------------------------------------------------------------------- -// Collection() -// --------------------------------------------------------------------------- -// -CCollection* CParser::Collection() - { - CCollection* lastcollection = NULL; - if ( iCollectionStack.Count( ) > 0 ) - { - lastcollection = iCollectionStack[ iCollectionStack.Count() - 1 ]; - } - return lastcollection; - } - -// --------------------------------------------------------------------------- -// PushCollectionL() -// --------------------------------------------------------------------------- -// -void CParser::PushCollectionL(const CCollection* aCollection) - { - User::LeaveIfError( iCollectionStack.Append( aCollection ) ); - } - -// --------------------------------------------------------------------------- -// PopCollection() -// --------------------------------------------------------------------------- -// -void CParser::PopCollection() - { - - if ( iCollectionStack.Count() > 0 ) - { - iCollectionStack.Remove( iCollectionStack.Count() - 1 ); - } - } - - -// --------------------------------------------------------------------------- -// IssueWarning() -// --------------------------------------------------------------------------- -// -void CParser::IssueWarning(TInt aHidWarningCode) - { - TRACE_ERROR((_L("Item %3d: Warning 0x%04x\n"), iItemNumber, aHidWarningCode)); - (void)aHidWarningCode; - } - -// --------------------------------------------------------------------------- -// ParseL() -// --------------------------------------------------------------------------- -// -EXPORT_C CReportRoot* CParser::ParseL(const TDesC8& aRawData) - { - ResetParserL(); - // Now we can parse the descriptor data: - const TInt length = aRawData.Length(); - TInt posn = 0; - TRACE_INFO((_L("CParser::ParseL() Start parsing length %d"), length)); - while ((posn < length) && (iErrorCode == 0)) - { - iItemNumber++; - TRACE_INFO((_L("posn is %d"), posn)); - - TItem item(aRawData.Right(length-posn)); - -#ifdef PDBG_ACTIVE - TRACE_INFO((_L("Item: size %d, tag %d, type %d\n"), - item.DataSize(), item.Tag(), item.Type())); - for (TInt i=0; i length) - { - iErrorCode = EInvalidItemLength; - } - } - - PopCollection(); - - // PUSH without POP: - CheckParseErrors(); - - iGlobalStack.Reset(); - iCollectionStack.Reset(); - - TRACE_INFO((_L("CParser::ParseL() error code is %d"), iErrorCode)); - // Finished, transfer ownership to caller: - CReportRoot* reportRoot = iReportRoot; - iReportRoot = 0; - return reportRoot; - } - -// --------------------------------------------------------------------------- -// CParser::FieldCount() -// --------------------------------------------------------------------------- -// -TInt CParser::FieldCount() - { - return iFieldCount; - } - -// --------------------------------------------------------------------------- -// CParser::MainItemL() -// --------------------------------------------------------------------------- -// -TInt CParser::MainItemL(const TItem& aItem) - { - TInt retVal = 0; - - switch (aItem.Tag()) - { - case EMainInput: - retVal = HandleMainInputTagL( aItem ); - break; - - case EMainOutput: - retVal = HandleMainOutputTagL( aItem ); - break; - - case EMainFeature: - retVal = HandleMainFeatureL( aItem ); - break; - - case EMainCollection: - retVal = HandleMainCollectionL( aItem ); - break; - - case EMainEndCollection: - retVal = HandleMainEndCollection( aItem ); - break; - default: - TRACE_ERROR(_L("Error: unknown main item\n")); - retVal = EUnknownItem; - break; - } - - // All main items cause local state to be cleared: - ClearLocalState(); - - // For checking if global items declared more than once between - // main items: - iGlobalItemsDefined = 0; - - return retVal; - } -// --------------------------------------------------------------------------- -// ClearLocalState() -// --------------------------------------------------------------------------- -// -void CParser::ClearLocalState() - { - iLocal->ClearUsageList(); - iLocal->SetUsageRange(0, 0); - iLocal->SetStringIndex(0); - iLocal->SetStringRange(0, 0); - iLocal->SetDesignatorIndex(0); - iLocal->SetDesignatorRange(0, 0); - - iItemsDefined &= ~(KLocalItemMask | EDelimiter); - iLocalMultipleUse = EFalse; - } - -// --------------------------------------------------------------------------- -// GlobalItemL() -// --------------------------------------------------------------------------- -// -TInt CParser::GlobalItemL(const TItem& aItem) - { - TInt retVal = 0; - switch (aItem.Tag()) - { - case EGlobalReportId: - retVal = HandleGlobalReportId( aItem ); - break; - case EGlobalUsagePage: - retVal = HandleGlobalUsagePage( aItem ); - break; - case EGlobalLogicalMinimum: - retVal = HandleGlobalLogicalMinimum( aItem ); - break; - case EGlobalLogicalMaximum: - retVal = HandleGlobalLogicalMaximum( aItem ); - break; - case EGlobalPhysicalMinimum: - retVal = HandleGlobalPhysicalMinimum( aItem ); - break; - case EGlobalPhysicalMaximum: - retVal = HandleGlobalPhysicalMaximum( aItem ); - break; - case EGlobalUnit: - retVal = HandleGlobalUnit( aItem ); - break; - case EGlobalUnitExponent: - retVal = HandleGlobalUnitExponent( aItem ); - break; - case EGlobalReportSize: - retVal = HandleGlobalReportSize( aItem ); - break; - case EGlobalReportCount: - retVal = HandleGlobalReportCount(aItem ); - break; - case EGlobalPush: - retVal = HandleGlobalPushL( aItem ); - break; - case EGlobalPop: - retVal = HandleGlobalPop( aItem ); - break; - default: - TRACE_ERROR(_L("Error: unknown global item\n")); - retVal = EUnknownItem; - break; - } - - return retVal; - } - -// --------------------------------------------------------------------------- -// LocalItemL() -// --------------------------------------------------------------------------- -// -TInt CParser::LocalItemL(const TItem& aItem) - { - TInt retVal = 0; - switch (aItem.Tag()) - { - case ELocalUsage: - retVal = HandleLocalUsageL( aItem ); - break; - case ELocalUsageMinimum: - retVal = HandleLocalUsageMinimum( aItem ); - break; - case ELocalUsageMaximum: - retVal = HandleLocalUsageMaximum( aItem ); - break; - case ELocalDesignatorIndex: - retVal = HandleLocalDesignatorIndex( aItem ); - break; - case ELocalDesignatorMinimum: - retVal = HandleLocalDesignatorMinimum( aItem ); - break; - case ELocalDesignatorMaximum: - retVal = HandleLocalDesignatorMaximum( aItem ); - break; - case ELocalStringIndex: - retVal = HandleLocalStringIndex( aItem ); - break; - case ELocalStringMinimum: - retVal = HandleLocalStringMinimum( aItem ); - break; - case ELocalStringMaximum: - retVal = HandleLocalStringMaximum( aItem ); - break; - // "HID parsers must handle Delimiters however, the support - // for the alternative usages that they define is optional. - // Usages other than the first (most preferred) usage defined - // may not be made accessible by system software.", [1], - // Section 6.2.2.8. - // - // This parser only supports the first usage in a delimiter list. - case ELocalDelimiter: - retVal = HandleLocalDelimiter( aItem ); - break; - default: - TRACE_ERROR(_L("Error: unknown local item\n")); - retVal = EUnknownItem; - break; - } - return retVal; - } - -// --------------------------------------------------------------------------- -// IsReservedUsagePage() -// --------------------------------------------------------------------------- -// -TBool CParser::IsReservedUsagePage(TInt aId) - { - return (aId == KReservedUsage) || - ((aId >= KReservedUsageRange1Min ) && (aId <= KReservedUsageRange1Max)) || - ((aId >= KReservedUsageRange2Min ) && (aId <= KReservedUsageRange2Max)) || - ((aId >= KReservedUsageRange3Min) && (aId <= KReservedUsageRange3Max)) || - ((aId >= KReservedUsageRange4Min ) && (aId <= KReservedUsageRange4Max)) || - ((aId >= KReservedUsageRange5Min) && (aId <= KReservedUsageRange5Max)); - } - -// --------------------------------------------------------------------------- -// Populate() -// --------------------------------------------------------------------------- -// -void TParserGlobalState::Populate(CField *aField) const - { - aField->SetUsagePage(iUsagePage); - aField->SetReportId(iReportId); - aField->SetLogicalRange(iLogicalMin, iLogicalMax); - aField->SetSize(iSize); - aField->SetCount(iCount); - aField->SetUnit(iUnit); - aField->SetUnitExponent(iUnitExponent); - - // If the physical min and max are both zero, then the HID class - // document specifies that they should be assumed to be equal to - // the corresponding logical values ([1], Section 6.2.2.7): - // - if ((iPhysicalMin == 0) && (iPhysicalMax == 0)) - { - aField->SetPhysicalRange(iLogicalMin, iLogicalMax); - } - else - { - aField->SetPhysicalRange(iPhysicalMin, iPhysicalMax); - } - } - - -// --------------------------------------------------------------------------- -// TParserGlobalState() -// --------------------------------------------------------------------------- -// -TParserGlobalState::TParserGlobalState() - : iUsagePage(0), iLogicalMin(0), iLogicalMax(0), - iPhysicalMin(0), iPhysicalMax(0), iUnit(0), - iUnitExponent(0), iReportId(0), iSize(0), iCount(0) - { - // Nothing else to do - } - -// --------------------------------------------------------------------------- -// HandleMainInputTagL -// --------------------------------------------------------------------------- -// -TInt CParser::HandleMainInputTagL(const TItem& aItem) - { - // Section 6.2.2.4 of the HID class specification, [1], - // states that an Input item may have a data size of zero - // bytes: - // - // "In this case the value of each data bit for the item - // can be assumed to be zero. This is functionally - // identical to using a item tag that specifies a 4-byte - // data item followed by four zero bytes." - // - // For a data size of zero, TItem::Data() will return zero - // and so we will get the required behaviour. - TRACE_INFO((_L("Input %d\n"), aItem.Data())); - TInt retVal=0; - - iItemsDefined |= EInputReport; - - if ( aItem.Data() & KInputReservedBitsMask ) - { - IssueWarning( EInputReservedBitsNonZero ); - } - if ( iLocalMultipleUse ) - { - IssueWarning( EInputLocalMultipleUse ); - } - if ( iWithinDelimiter ) - { - retVal = EInputItemWithinDelimiter; - } - else - { - retVal = CreateFieldL( CField::EInput, aItem.Data() ); - } - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleMainOutputTagL -// --------------------------------------------------------------------------- -// -TInt CParser::HandleMainOutputTagL(const TItem& aItem) - { - TRACE_INFO((_L("Output %d\n"), aItem.Data())); - TInt retVal=0; - iItemsDefined |= EOutputReport; - - if ( aItem.Data() & KOutputReservedBitsMask ) - { - IssueWarning( EOutputReservedBitsNonZero ); - } - - if ( iLocalMultipleUse ) - { - IssueWarning( EOutputLocalMultipleUse ); - } - - if ( iWithinDelimiter ) - { - retVal = EOutputItemWithinDelimiter; - } - else - { - retVal = CreateFieldL( CField::EOutput, aItem.Data() ); - } - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleMainFeatureL -// --------------------------------------------------------------------------- -// -TInt CParser::HandleMainFeatureL( const TItem& aItem ) - { - TRACE_INFO((_L("Feature %d\n"), aItem.Data())); - TInt retVal=0; - iItemsDefined |= EFeatureReport; - - if ( aItem.Data() & KFeatureReservedBitsMask ) - { - IssueWarning(EFeatureReservedBitsNonZero ); - } - - if ( iLocalMultipleUse ) - { - IssueWarning( EFeatureLocalMultipleUse ); - } - - if ( iWithinDelimiter ) - { - retVal = EFeatureItemWithinDelimiter; - } - else - { - retVal = CreateFieldL( CField::EFeature, aItem.Data() ); - } - - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleMainCollectionL -// --------------------------------------------------------------------------- -// -TInt CParser::HandleMainCollectionL( const TItem& aItem ) - { - TRACE_INFO((_L("Start collection %d\n"), aItem.Data())); - TInt retVal = 0; - - if ( iWithinDelimiter ) - { - retVal = EBeginCollectionWithinDelimiter; - } - else - { - // Application collections can only be declared at - // top-level: - if ((aItem.Data() == CCollection::EApplication) && - (iCollectionStack.Count() != 1)) - { - retVal = EApplicationCollectionLevel; - } - else - { - retVal = CreateCollectionL(aItem.Data()); - } - } - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleMainEndCollection -// --------------------------------------------------------------------------- -// -TInt CParser::HandleMainEndCollection( const TItem& aItem ) - { - TRACE_INFO((_L("Start collection %d\n"), aItem.Data())); - TInt retVal = 0; - - if (aItem.DataSize() != 0) - { - IssueWarning(EEndCollectionHasData); - } - - if (iItemsDefined & KLocalItemMask) - { - IssueWarning(EEndCollectionLocalUnused); - } - - if (iCollectionStack.Count() > 1) - { - PopCollection(); - } - else - { - retVal = ENoMatchingBeginCollection; - } - - if (iWithinDelimiter) - { - retVal = EEndCollectionWithinDelimiter; - } - - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleGlobalReportId -// --------------------------------------------------------------------------- -// -TInt CParser::HandleGlobalReportId( const TItem& aItem ) - { - TRACE_INFO((_L("Global report ID %d\n"), aItem.Data())); - TInt retVal = 0; - TUint reportId = aItem.Data(); - - if (reportId == 0) - { - retVal = EZeroReportId; - } - if (reportId > KMaxReportIDMax) - { - retVal = EReportIdTooBig; - } - - // If there are to be any report IDs specified at all, - // then a report ID must be defined before the first - // input, output or feature report: - // - if ((iGlobal.iReportId == 0) && (iItemsDefined & KReportItemMask)) - { - retVal = ELateReportId; - } - - // Report ID defined outside a top level collection (Microsoft - // restriction) - // - if (iCollectionStack.Count() == 1) - { - retVal = EReportIdOutsideTopLevel; - } - - // Same item shouldn't have been declared since last main item: - // - if (iGlobalItemsDefined & EReportId) - { - // This is an error according to [2], but as it isn't - // a critical problem, and as some real-world devices - // fail this check, we issue a warning instead: - IssueWarning(ERedundantGlobalItem); - } - iGlobalItemsDefined |= EReportId; - - iItemsDefined |= EReportId; - iGlobal.iReportId = reportId; - - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleGlobalUsagePage -// --------------------------------------------------------------------------- -// -TInt CParser::HandleGlobalUsagePage( const TItem& aItem ) - { - TRACE_INFO((_L("Global usage page %d\n"), aItem.Data())); - TInt retVal = 0; - - iGlobal.iUsagePage = aItem.Data(); - - if (aItem.Data() == 0) - { - retVal = EZeroUsagePage; - } - - if (aItem.Data() > KMaxUsagePage) - { - retVal = EUsagePageOutOfRange; - } - - if (IsReservedUsagePage(aItem.Data())) - { - IssueWarning(EReservedUsagePage); - } - - iItemsDefined |= EUsagePage; - - if (iGlobalItemsDefined & EUsagePage) - { - retVal = ERedundantGlobalItem; - } - iGlobalItemsDefined |= EUsagePage; - - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleGlobalLogicalMinimum -// --------------------------------------------------------------------------- -// -TInt CParser::HandleGlobalLogicalMinimum( const TItem& aItem ) - { - TRACE_INFO((_L("Global logical min %d\n"), aItem.SignedData())); - TInt retVal = 0; - iGlobal.iLogicalMin = aItem.SignedData(); - iItemsDefined |= ELogicalMin; - - if (iGlobalItemsDefined & ELogicalMin) - { - retVal = ERedundantGlobalItem; - } - iGlobalItemsDefined |= ELogicalMin; - - // "Until Physical Minimum and Physical Maximum are - // declared in a report descriptor they are assumed by the - // HID parser to be equal to Logical Minimum and Logical - // Maximum, respectively.", [1], Section 6.2.2.7. - // - if (!(iItemsDefined & EPhysicalMin)) - { - iGlobal.iPhysicalMin = aItem.SignedData(); - } - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleGlobalLogicalMaximum -// --------------------------------------------------------------------------- -// -TInt CParser::HandleGlobalLogicalMaximum( const TItem& aItem ) - { - TRACE_INFO((_L("Global logical max %d\n"), aItem.SignedData())); - TInt retVal = 0; - - iGlobal.iLogicalMax = aItem.SignedData(); - if ( !(iItemsDefined & EPhysicalMax) ) - { - iGlobal.iPhysicalMax = aItem.SignedData(); - } - iItemsDefined |= ELogicalMax; - - if (iGlobalItemsDefined & ELogicalMax) - { - retVal = ERedundantGlobalItem; - } - iGlobalItemsDefined |= ELogicalMax; - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleGlobalPhysicalMinimum -// --------------------------------------------------------------------------- -// -TInt CParser::HandleGlobalPhysicalMinimum( const TItem& aItem ) - { - TRACE_INFO((_L("Global physical min %d\n"), aItem.SignedData())); - TInt retVal = 0; - iGlobal.iPhysicalMin = aItem.SignedData(); - iItemsDefined |= EPhysicalMin; - - if (iGlobalItemsDefined & EPhysicalMin) - { - retVal = ERedundantGlobalItem; - } - iGlobalItemsDefined |= EPhysicalMin; - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleGlobalPhysicalMaximum -// --------------------------------------------------------------------------- -// -TInt CParser::HandleGlobalPhysicalMaximum( const TItem& aItem ) - { - TRACE_INFO((_L("Global physical max %d\n"), aItem.SignedData())); - - TInt retVal = 0; - iGlobal.iPhysicalMax = aItem.SignedData(); - iItemsDefined |= EPhysicalMax; - - if ( iGlobalItemsDefined & EPhysicalMax ) - { - retVal = ERedundantGlobalItem; - } - iGlobalItemsDefined |= EPhysicalMax; - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleGlobalUnit -// --------------------------------------------------------------------------- -// -TInt CParser::HandleGlobalUnit( const TItem& aItem ) - { - TRACE_INFO((_L("Global unit %d\n"), aItem.Data())); - TInt retVal = 0; - iGlobal.iUnit = aItem.Data(); - iItemsDefined |= EUnit; - - if (iGlobalItemsDefined & EUnit) - { - retVal = ERedundantGlobalItem; - } - iGlobalItemsDefined |= EUnit; - - TInt unitSystem = aItem.Data() & KUnitData; - if (((unitSystem >= KUnitSystemMin ) && (unitSystem != KUnitSystem15)) || - (aItem.Data() & KUnitReservedBitsMask )) - { - IssueWarning(EUnitReservedBitsNonZero); - } - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleGlobalUnitExponent -// --------------------------------------------------------------------------- -// -TInt CParser::HandleGlobalUnitExponent( const TItem& aItem ) - { - TRACE_INFO((_L("Global unit exponent %d\n"), aItem.Data())); - TInt retVal = 0; - iGlobal.iUnitExponent = aItem.Data(); - iItemsDefined |= EUnitExponent; - - if (iGlobalItemsDefined & EUnitExponent) - { - retVal = ERedundantGlobalItem; - } - iGlobalItemsDefined |= EUnitExponent; - const TUint32 KReservedBits = ~0x0fUL; - if (aItem.Data() & KReservedBits) - { - IssueWarning( EExponentReservedBitsNonZero ); - } - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleGlobalReportSize -// --------------------------------------------------------------------------- -// -TInt CParser::HandleGlobalReportSize( const TItem& aItem ) - { - TRACE_INFO((_L("Global report size %d\n"), aItem.Data())); - TInt retVal = 0; - iGlobal.iSize = aItem.Data(); - iItemsDefined |= EReportSize; - - if (iGlobalItemsDefined & EReportSize) - { - retVal = ERedundantGlobalItem; - } - iGlobalItemsDefined |= EReportSize; - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleGlobalReportCount -// --------------------------------------------------------------------------- -// -TInt CParser::HandleGlobalReportCount( const TItem& aItem ) - { - TRACE_INFO((_L("Global report count %d\n"), aItem.Data())); - TInt retVal = 0; - iGlobal.iCount = aItem.Data(); - if (aItem.Data() == 0) - { - retVal = EZeroReportCount; - } - iItemsDefined |= EReportCount; - - if (iGlobalItemsDefined & EReportCount) - { - retVal = ERedundantGlobalItem; - } - iGlobalItemsDefined |= EReportCount; - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleGlobalPushL -// --------------------------------------------------------------------------- -// -TInt CParser::HandleGlobalPushL( const TItem& aItem ) - { - TRACE_INFO(_L("Global push\n")); - TInt retVal = 0; - if (aItem.DataSize() != 0) - { - retVal = EPushHasData; - } - User::LeaveIfError(iGlobalStack.Append(iGlobal)); - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleGlobalPop -// --------------------------------------------------------------------------- -// -TInt CParser::HandleGlobalPop( const TItem& aItem ) - { - TRACE_INFO(_L("Global pop\n")); - TInt retVal = 0; - if (aItem.DataSize() != 0) - { - retVal = EPopHasData; - } - - if (iGlobalStack.Count() > 0) - { - iGlobal = iGlobalStack[iGlobalStack.Count()-1]; - iGlobalStack.Remove(iGlobalStack.Count()-1); - } - else - { - retVal = EPopWithoutPush; - } - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleLocalUsageL -// --------------------------------------------------------------------------- -// -TInt CParser::HandleLocalUsageL( const TItem& aItem ) - { - TRACE_INFO((_L("Local usage %d\n"), aItem.Data())); - TInt retVal = 0; - - if (aItem.DataSize() == KExtendedDataSize ) - { - // Extended (32-bit) usage: - TInt usagePage = (aItem.Data() >> KExtendedDataShift); - if (IsReservedUsagePage(usagePage)) - { - IssueWarning(EReservedUsagePage); - } - } - - if ((aItem.Data() & 0xffff) == 0) - { - IssueWarning(EZeroUsage); - } - - if (!iWithinDelimiter || (iAliasCount++ == 0)) - { - iLocal->AddUsageL(aItem.Data()); - iItemsDefined |= EUsageId; - } - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleLocalUsageMinimum -// --------------------------------------------------------------------------- -// -TInt CParser::HandleLocalUsageMinimum( const TItem& aItem ) - { - TRACE_INFO((_L("Local usage min %d\n"), aItem.Data())); - TInt retVal = 0; - if (!iWithinDelimiter || (iAliasCountMin++ == 0)) - { - TInt usagePage = iGlobal.iUsagePage; - - if (aItem.DataSize() == KExtendedDataSize ) - { - // Extended usage specified. - usagePage = aItem.Data() >> KExtendedDataShift; - } - - if (iItemsDefined & EUsageMax) - { - TInt maxPage = - static_cast(iLocal->UsageMax()) >> KExtendedDataShift; - if (maxPage == 0) - { - maxPage = iGlobal.iUsagePage; - } - if (usagePage != maxPage) - { - retVal = EUsagePageMismatchMin; - } - } - iLocal->SetUsageMin(aItem.Data()); - } - if (iItemsDefined & EUsageMin) - { - iLocalMultipleUse = ETrue; - } - iItemsDefined |= EUsageMin; - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleLocalUsageMaximum -// --------------------------------------------------------------------------- -// -TInt CParser::HandleLocalUsageMaximum( const TItem& aItem ) - { - TRACE_INFO((_L("Local usage max %d\n"), aItem.Data())); - - TInt retVal = 0; - - if (!iWithinDelimiter || (iAliasCountMax++ == 0)) - { - TInt usagePage = iGlobal.iUsagePage; - - if (aItem.DataSize() == KExtendedDataSize ) - { - // Extended usage specified. - usagePage = aItem.Data() >> KExtendedDataShift; - } - if (iItemsDefined & EUsageMin) - { - TInt minPage = - static_cast(iLocal->UsageMin()) >> KExtendedDataShift; - if (minPage == 0) - { - minPage = iGlobal.iUsagePage; - } - if (usagePage != minPage) - { - retVal = EUsagePageMismatchMax; - } - } - iLocal->SetUsageMax(aItem.Data()); - } - if (iItemsDefined & EUsageMax) - { - iLocalMultipleUse = ETrue; - } - iItemsDefined |= EUsageMax; - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleLocalDesignatorIndex -// --------------------------------------------------------------------------- -// -TInt CParser::HandleLocalDesignatorIndex( const TItem& aItem ) - { - TRACE_INFO((_L("Local designator index %d\n"), - aItem.Data())); - TInt retVal = 0; - iLocal->SetDesignatorIndex(aItem.Data()); - if (iWithinDelimiter) - { - retVal = EInvalidItemWithinDelimiter; - } - if (iItemsDefined & EDesignatorIndex) - { - iLocalMultipleUse = ETrue; - } - iItemsDefined |= EDesignatorIndex; - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleLocalDesignatorMinimum -// --------------------------------------------------------------------------- -// -TInt CParser::HandleLocalDesignatorMinimum( const TItem& aItem ) - { - TRACE_INFO((_L("Local designator min %d\n"), aItem.Data())); - TInt retVal = 0; - iLocal->SetDesignatorMin(aItem.Data()); - if ( iWithinDelimiter ) - { - retVal = EInvalidItemWithinDelimiter; - } - if (iItemsDefined & EDesignatorMin) - { - iLocalMultipleUse = ETrue; - } - iItemsDefined |= EDesignatorMin; - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleLocalDesignatorMaximum -// --------------------------------------------------------------------------- -// -TInt CParser::HandleLocalDesignatorMaximum( const TItem& aItem ) - { - TRACE_INFO((_L("Local designator max %d\n"), aItem.Data())); - TInt retVal = 0; - iLocal->SetDesignatorMax(aItem.Data()); - if ( iWithinDelimiter ) - { - retVal = EInvalidItemWithinDelimiter; - } - if ( iItemsDefined & EDesignatorMax ) - { - iLocalMultipleUse = ETrue; - } - iItemsDefined |= EDesignatorMax; - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleLocalStringIndex -// --------------------------------------------------------------------------- -// -TInt CParser::HandleLocalStringIndex( const TItem& aItem ) - { - TRACE_INFO((_L("Local string index %d\n"), aItem.Data())); - TInt retVal = 0; - iLocal->SetStringIndex(aItem.Data()); - if ( iItemsDefined & EStringIndex ) - { - iLocalMultipleUse = ETrue; - } - iItemsDefined |= EStringIndex; - if ( iWithinDelimiter ) - { - retVal = EInvalidItemWithinDelimiter; - } - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleLocalStringMinimum -// --------------------------------------------------------------------------- -// -TInt CParser::HandleLocalStringMinimum( const TItem& aItem ) - { - TRACE_INFO((_L("Local string min %d\n"), - aItem.Data())); - TInt retVal = 0; - iLocal->SetStringMin(aItem.Data()); - if ( iItemsDefined & EStringMin) - { - iLocalMultipleUse = ETrue; - } - iItemsDefined |= EStringMin; - if (iWithinDelimiter) - { - retVal = EInvalidItemWithinDelimiter; - } - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleLocalStringMaximum -// --------------------------------------------------------------------------- -// -TInt CParser::HandleLocalStringMaximum( const TItem& aItem ) - { - TRACE_INFO((_L("Local string max %d\n"), - aItem.Data())); - TInt retVal = 0; - iLocal->SetStringMax(aItem.Data()); - if ( iItemsDefined & EStringMax ) - { - iLocalMultipleUse = ETrue; - } - iItemsDefined |= EStringMax; - if ( iWithinDelimiter ) - { - retVal = EInvalidItemWithinDelimiter; - } - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleLocalDelimiter -// --------------------------------------------------------------------------- -// -TInt CParser::HandleLocalDelimiter( const TItem& aItem ) - { - const TInt KBeginDelimiter = 1; - const TInt KEndDelimiter = 0; - TInt retVal = 0; - - switch ( aItem.Data() ) - { - case KBeginDelimiter: - if ( iWithinDelimiter ) - { - retVal = ENestedDelimiter; - } - // Delimiters can't be used when defining usages - // that apply to array items ([1], Section 6.2.2.8): - // - if ( Collection()->Type() == CCollection::ENamedArray ) - { - IssueWarning( EDelimiterWithinNamedArray ); - } - iWithinDelimiter = ETrue; - iAliasCount = 0; - iAliasCountMin = 0; - iAliasCountMax = 0; - break; - - case KEndDelimiter: - if ( !iWithinDelimiter ) - { - retVal = ELonelyDelimiter; - } - iWithinDelimiter = EFalse; - break; - - default: - retVal = EUnknownDelimiter; - TRACE_ERROR((_L("Error: Unknown delimiter type %d\n"), - aItem.Data())); - break; - } - return retVal; - } - -// --------------------------------------------------------------------------- -// CheckMandatoryFieldExistence -// --------------------------------------------------------------------------- -// -TInt CParser::CheckMandatoryFieldExistence( CField::TType aType, TUint32 aAttributes ) - { - TInt retVal = KErrNone; - - if ( ( ( iItemsDefined & KMandatoryItemMask ) != KMandatoryItemMask ) - && (!(aAttributes & KConstantFlag))) - { - if ( aType == CField::EInput ) - { - retVal = EInputMissingItems; - } - if ( aType == CField::EOutput ) - { - retVal = EOutputMissingItems; - } - if ( aType == CField::EFeature ) - { - retVal = EFeatureMissingItems; - } - } - return retVal; - } - -// --------------------------------------------------------------------------- -// CheckUsageMinAndMaxErrors -// --------------------------------------------------------------------------- -// -TInt CParser::CheckUsageMinAndMaxErrors() - { - TInt retVal = KErrNone; - - if ( iItemsDefined & ( EUsageMin | EUsageMax )) - { - if (!( iItemsDefined & EUsageMax )) - { - retVal = ELonelyUsageMin; - } - if (!( iItemsDefined & EUsageMin )) - { - retVal = ELonelyUsageMax; - } - if ( iLocal->UsageMin() > iLocal->UsageMax() ) - { - retVal = EUsageMinExceedsMax; - } - } - return retVal; - } - -// --------------------------------------------------------------------------- -// CheckDesignatorMinAndMaxErrors -// --------------------------------------------------------------------------- -// -TInt CParser::CheckDesignatorMinAndMaxErrors() - { - TInt retVal = KErrNone; - - if ( iItemsDefined & ( EDesignatorMin | EDesignatorMax )) - { - if ( !( iItemsDefined & EDesignatorMax ) ) - { - retVal = ELonelyDesignatorMin; - } - if ( !( iItemsDefined & EDesignatorMin ) ) - { - retVal = ELonelyDesignatorMax; - } - if ( iLocal->DesignatorMin( ) > iLocal->DesignatorMax( ) ) - { - retVal = EDesignatorMinExceedsMax; - } - } - return retVal; - } - -// --------------------------------------------------------------------------- -// CheckStringMinAndMaxErrors -// --------------------------------------------------------------------------- -// -TInt CParser::CheckStringMinAndMaxErrors() - { - TInt retVal = KErrNone; - - if (iItemsDefined & (EStringMin | EStringMax)) - { - if ( !( iItemsDefined & EStringMax ) ) - { - retVal = ELonelyStringMin; - } - if ( !( iItemsDefined & EStringMin ) ) - { - retVal = ELonelyStringMax; - } - if ( iLocal->StringMin( ) > iLocal->StringMax( ) ) - { - retVal = EStringMinExceedsMax; - } - } - return retVal; - } - - -// --------------------------------------------------------------------------- -// CheckStringMinAndMaxErrors -// --------------------------------------------------------------------------- -// -TInt CParser::CheckMandatoryFieldErrors( CField::TType aType, TUint32 aAttributes ) - { - TInt ret = KErrNone; - // Check for mandatory items: - ret = CheckMandatoryFieldExistence( aType, aAttributes ); - if ( ret != KErrNone ) - { - return ret; - } - ret = CheckUsageMinAndMaxErrors(); - if ( ret != KErrNone ) - { - return ret; - } - ret = CheckDesignatorMinAndMaxErrors(); - if ( ret != KErrNone ) - { - return ret; - } - ret = CheckStringMinAndMaxErrors(); - if ( ret != KErrNone ) - { - return ret; - } - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CheckLogicalMinAndMax -// --------------------------------------------------------------------------- -// -void CParser::CheckLogicalMinAndMax( TUint32 aAttributes ) - { - // Logical minimum and maximum must match the number of usage - // values defined if the Array flag is set (Var=0). (Ignore this - // check for constant fields) - // - if ( !( aAttributes & KVariableFlag ) && ( ! ( aAttributes & KConstantFlag ) ) ) - { - // Logical minimum must equal 1: - // - if ( iGlobal.iLogicalMin != 1 ) - { - // This is an error according to [2], but we issue a - // warning instead, as many devices (including the - // Logitech diNovo keyboard) fail this check: - IssueWarning( ELogicalMinInvalidForArray ); - } - - // Logical maximum must equal the number of defined usages: - // - TInt numUsages = iLocal->UsageCount(); - if ( numUsages == 0 ) - { - numUsages = iLocal->UsageMax( ) - iLocal->UsageMin( ) + 1; - } - if ( iGlobal.iLogicalMax != numUsages ) - { - // Again, we issue a warning rather than an error: - IssueWarning( ELogicalMaxInvalidForArray ); - } - } - - } - -// --------------------------------------------------------------------------- -// CheckFieldBitNeeded -// --------------------------------------------------------------------------- -// -void CParser::CheckFieldBitNeeded( CField::TType aType, TUint32 aAttributes ) - { - // "The bit field declared by Report Size must be large enough to - // hold all values declared by Logical Minimum and Logical - // Maximum. This includes a sign bit if either are less than - // 0. Also if the Null flag is set then the field must be capable - // of reporting all values declared by Logical Minimum and Logical - // Maximum, and a null value.", [2] (footnote 5). - - TInt bitsNeeded = 0; - - if ( !( aAttributes & KConstantFlag ) ) - { - if ( aAttributes & KNullStateFlag ) - { - // The null state flag is set, so there needs to be at - // least one extra "out of range" value. This could be - // below the lowest value or above the highest, whichever - // will fit better: - bitsNeeded = Min( - BitsToRepresentRange(iGlobal.iLogicalMin - 1, - iGlobal.iLogicalMax), - BitsToRepresentRange(iGlobal.iLogicalMin, - iGlobal.iLogicalMax + 1)); - } - else - { - // No null state declared: - bitsNeeded = BitsToRepresentRange(iGlobal.iLogicalMin, - iGlobal.iLogicalMax); - } - } - - if ( iGlobal.iSize < bitsNeeded ) - { - // The Logitech diNovo is missing a Logical Min and Logical - // Max pair and so will trigger a range error here. As a - // workaround, we will treat this as a warning rather than - // a critical error: - const TInt KRangeError[] = - { EInputReportSize, EOutputReportSize, EFeatureReportSize }; - IssueWarning(KRangeError[aType]); - } - } - -// --------------------------------------------------------------------------- -// HandleItem -// --------------------------------------------------------------------------- -// -void CParser::HandleItemL( TItem& aItem ) - { - iErrorCode = EUnknownItem; - if (aItem.IsLocal()) - { - iErrorCode = LocalItemL(aItem); - } - else - { - // Not allowed non-local items within a delimiter pair: - // - if ( iWithinDelimiter ) - { - iErrorCode = EInvalidItemWithinDelimiter; - } - else - { - if ( aItem.IsMain() ) - { - iErrorCode = MainItemL(aItem); - } - - if ( aItem.IsGlobal() ) - { - iErrorCode = GlobalItemL(aItem); - } - if ( aItem.IsLong() ) - { - IssueWarning(ELongItemDefined); - iErrorCode = 0; - } - } - } - } - -// --------------------------------------------------------------------------- -// CheckParseErrors() -// --------------------------------------------------------------------------- -// -void CParser::CheckParseErrors() - { - if ( !iErrorCode && ( iGlobalStack.Count() > 0) ) - { - iErrorCode = EPushWithoutPop; - } - - // COLLECTION without END_COLLECTION: - if ( !iErrorCode && ( iCollectionStack.Count() != 0 ) ) - { - iErrorCode = ENoMatchingEndCollection; - } - - // DELIMITER(Open) without DELIMITER(Close): - if ( !iErrorCode && iWithinDelimiter ) - { - iErrorCode = ELonelyDelimiter; - } - - // Final size of all reports must be a multiple of eight bits: - if ( !CheckAllReportSizes() ) - { - IssueWarning( EReportMustBeEightBitMultiple ); - } - } - -// --------------------------------------------------------------------------- -// ResetParser -// --------------------------------------------------------------------------- -// -void CParser::ResetParserL() - { - // Create the root collection, which is the container for all - // other collections and fields: - // - delete iReportRoot; // may exist if there has been a Leave() - iReportRoot = 0; - iReportRoot = CReportRoot::NewL(); - iCollectionStack.Reset(); - PushCollectionL(iReportRoot); - - // Clear the error code and the warnings list: - // - iErrorCode = 0; - - // Reset the parser internal state: - // - iGlobal = TParserGlobalState(); - iGlobalStack.Reset(); - iWithinDelimiter = EFalse; - iItemsDefined = 0; - iGlobalItemsDefined = 0; - iItemNumber = 0; - ClearLocalState(); - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/src/hidreportbase.cpp --- a/localconnectivityservice/generichid/src/hidreportbase.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: Report base class implementation -* -*/ - - -#include "hidfield.h" -#include "hidtranslate.h" -#include "hidinterfaces.h" - -const TUint KValueMask = 0xFFFFFFFF; -const TUint KSignBitMask = 0x80000000; -const TInt KThreeLSB = 7; -const TInt KThreeLSBShift = 3; -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// GetIndexOfUsage() -// --------------------------------------------------------------------------- -// -TBool TReportUtils::GetIndexOfUsage(const CField* aField, - TInt aUsageId, TInt& aUsageIndex) - { - TArray usages(aField->UsageArray()); - - if ( usages.Count() > 0 ) - { - // Find the usage in the array - for ( TInt i = 0; i < usages.Count(); i++ ) - { - if ( usages[i] == aUsageId ) - { - aUsageIndex = i; - return ETrue; - } - } - } - else - { - // The field includes all usages between the min and max - if ( aField->UsageMin() <= aUsageId && aUsageId <= aField->UsageMax() ) - { - aUsageIndex = aUsageId - aField->UsageMin(); - return ETrue; - } - } - - return EFalse; - } - -// --------------------------------------------------------------------------- -// UsageAtIndex() -// --------------------------------------------------------------------------- -// -TInt TReportUtils::UsageAtIndex(const CField* aField, TInt aUsageIndex) - { - TInt usageId = 0; - TArray usages(aField->UsageArray()); - - if ( usages.Count() > 0 ) - { - if ( aUsageIndex < 0 ) - { - // Null state for array control - } - else if ( aUsageIndex < usages.Count() ) - { - // Get the usage ID from the set of possible usages - usageId = usages[aUsageIndex]; - } - else - { - // If there aren't enough usages in the set, the last one repeats - usageId = usages[usages.Count() - 1]; - } - } - else - { - // Get the usage ID from the range - if ( 0 <= aUsageIndex - && aUsageIndex <= (aField->UsageMax() - aField->UsageMin()) ) - { - usageId = aField->UsageMin() + aUsageIndex; - } - } - - return usageId; - } - -// --------------------------------------------------------------------------- -// WriteData() -// --------------------------------------------------------------------------- -// -TInt TReportUtils::WriteData(HBufC8& aData, const CField* aField, - TInt aIndex, TInt aValue) - { - if ( 0 <= aIndex && aIndex < aField->Count() ) - { - // The offset in bits from the start of the report to the value - TInt offset = aField->Offset() + aIndex * aField->Size(); - - // How many bits in the least significant byte are not part of the value - TInt bitsToShift = offset & KThreeLSB; - - TUint mask = KValueMask >> ((KSizeOfByte * sizeof(TInt)) - aField->Size()); - mask <<= bitsToShift; - aValue <<= bitsToShift; - - TPtr8 data = aData.Des(); - - // Write out the bytes, least significant first - for ( TInt i = offset >> KThreeLSBShift; mask && i < aData.Length(); i++ ) - { - TUint8 maskByte = static_cast(mask); - - // The extra cast is because MSVC6 thinks that or-ing 2 - // TUint8s together gives an int. - data[i] = static_cast( - (static_cast(aValue) & maskByte) - | (aData[i] & ~maskByte)); - mask >>= KSizeOfByte; - aValue >>= KSizeOfByte; - } - - return KErrNone; - } - - return KErrBadControlIndex; - } - -// --------------------------------------------------------------------------- -// ReadData() -// --------------------------------------------------------------------------- -// -TInt TReportUtils::ReadData(const TDesC8& aData, const CField* aField, - TInt aIndex, TInt& aValue) - { - if ( 0 <= aIndex && aIndex < aField->Count() ) - { - // The offset in bits from the start of the report to the value - TInt offset = aField->Offset() + aIndex * aField->Size(); - - // How many bits in the least significant byte are not part of - // the value - TInt bitsToShift = offset & KThreeLSB; - - // How many consecutive bytes we need to read to get the whole - // value. According to the HID spec, a value cannot span more - // than 4 bytes in a report - TInt bytesToRead = (bitsToShift + aField->Size() + KThreeLSB) / KSizeOfByte; - - // Make sure we don't read past the end of the data - if ( (offset >> KThreeLSBShift) + bytesToRead > aData.Length() ) - { - bytesToRead = aData.Length() - (offset >> KThreeLSBShift); - } - - TInt value = 0; - - // Read in the bytes, most significant first - for ( TInt i = bytesToRead - 1; i >= 0; i-- ) - { - value = (value << KSizeOfByte) | aData[(offset >> KThreeLSBShift) + i]; - } - - value >>= bitsToShift; - - // Make masks for the whole value and just the sign bit - TUint valueMask = KValueMask >> ((KSizeOfByte * sizeof(TInt)) - aField->Size()); - TUint signMask = KSignBitMask >> ((KSizeOfByte * sizeof(TInt)) - aField->Size()); - - if ( aField->LogicalMin() < 0 && (value & signMask) ) - { - // The value is negative, so the leading bits should be 1s - aValue = value | ~valueMask; - } - else - { - // The value is positive, so the leading bits should be 0s - aValue = value & valueMask; - } - - return KErrNone; - } - - return KErrBadControlIndex; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/src/hidreportgenerator.cpp --- a/localconnectivityservice/generichid/src/hidreportgenerator.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,164 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: HID retport generator -* -*/ - - - -#include "hidreportgenerator.h" -#include "hidreportroot.h" -#include "hidinterfaces.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// NewLC() -// --------------------------------------------------------------------------- -// -EXPORT_C CReportGenerator* CReportGenerator::NewLC(const CReportRoot* - aReportRoot, TInt aReportId, CField::TType aType) - { - CReportGenerator* self = new (ELeave) CReportGenerator(aReportId, aType); - CleanupStack::PushL(self); - self->ConstructL(aReportRoot); - return self; - } - -// --------------------------------------------------------------------------- -// NewL() -// --------------------------------------------------------------------------- -// -EXPORT_C CReportGenerator* CReportGenerator::NewL(const CReportRoot* - aReportRoot, TInt aReportId, CField::TType aType) - { - CReportGenerator* self = - CReportGenerator::NewLC(aReportRoot, aReportId, aType); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// -CReportGenerator::CReportGenerator(TInt aReportId, CField::TType aType) - : iReportId(aReportId), iType(aType) - { - // Nothing else to do - } - -// --------------------------------------------------------------------------- -// ConstructL() -// --------------------------------------------------------------------------- -// -void CReportGenerator::ConstructL(const CReportRoot* aReportRoot) - { - User::LeaveIfNull(const_cast(aReportRoot)); - iReportRoot = aReportRoot; - - // Allocate the buffer, initialise to all zeros, and fill in the - // report ID if used. Zero should be a null value for all array fields - // according to the HID parser error checking spec. - iBuf = HBufC8::NewMaxL(aReportRoot->ReportSizeBytes(iReportId, iType)); - TPtr8 bufptr = iBuf->Des(); - bufptr.FillZ(); - if ( 0 != iReportId ) - { - bufptr[0] = static_cast(iReportId); - } - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CReportGenerator::~CReportGenerator() - { - delete iBuf; - } - -// --------------------------------------------------------------------------- -// SetField() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CReportGenerator::SetField(const CField* aField, - TInt aUsageId, TInt aValue, TInt aControlOffset /*= 0*/) - { - TInt usageIndex; - - if ( aField && TReportUtils::GetIndexOfUsage(aField, aUsageId, usageIndex) ) - { - if ( aField->IsArray() ) - { - // Convert usage ID to logical value - TInt logicalValue = usageIndex + aField->LogicalMin(); - - // Find unused position in the array and write the logical - // value to it - for ( TInt i = 0; i < aField->Count(); i++ ) - { - TInt value; - TInt error = TReportUtils::ReadData(*iBuf, aField, i, value); - - if ( KErrNone != error ) - { - return error; - } - - if ( value == logicalValue ) - { - // The array already contains this usage - return KErrNone; - } - else if ( 0 == value || value < aField->LogicalMin() || - aField->LogicalMax() < value ) - { - // This is an unused position - // - // NOTE: The comparison with zero is because the buffer is - // initialised to all zeros, and some reports erroneously - // include zero in the logical range. - // - return TReportUtils::WriteData(*iBuf, aField, i, logicalValue); - } - } - - return KErrNoSpaceInArray; - } - else - { - // Check the value to set is valid - if ( aValue < aField->LogicalMin() || - aField->LogicalMax() < aValue ) - { - return KErrValueOutOfRange; - } - - return TReportUtils::WriteData(*iBuf, aField, - usageIndex + aControlOffset, aValue); - } - } - - return KErrUsageNotFound; - } - -// --------------------------------------------------------------------------- -// SetField() -// --------------------------------------------------------------------------- -// -EXPORT_C TPtr8 CReportGenerator::Report() - { - return iBuf->Des(); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/src/hidreportroot.cpp --- a/localconnectivityservice/generichid/src/hidreportroot.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: Reportroot implementation -* -*/ - - -#include - -#include "hidreportroot.h" -#include "debug.h" - -const TInt KSevenBits = 7; - -// ======== MEMBER FUNCTIONS ======== - -// ----------------------------------------------------------------------------- -// NewLC() -// ----------------------------------------------------------------------------- -// -CReportRoot* CReportRoot::NewLC() - { - CReportRoot* self = new (ELeave) CReportRoot(); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } -// ----------------------------------------------------------------------------- -// NewL() -// ----------------------------------------------------------------------------- -// -CReportRoot* CReportRoot::NewL() - { - CReportRoot* self = NewLC(); - CleanupStack::Pop(self); - return self; - } -// ----------------------------------------------------------------------------- -// ~CReportRoot() -// ----------------------------------------------------------------------------- -// -CReportRoot::~CReportRoot() - { - iSizes.Reset(); - iSizes.Close(); - } -// ----------------------------------------------------------------------------- -// CReportRoot() -// ----------------------------------------------------------------------------- -// -CReportRoot::CReportRoot() - { - // Nothing to do here - } - - - -// ----------------------------------------------------------------------------- -// IncrementReportSizeL() -// Manage the report ID <-> size "map": -// ----------------------------------------------------------------------------- -// -void CReportRoot::IncrementReportSizeL(TInt aReportId, - CField::TType aType, TInt aIncrement) - { - TInt index = FindReportSizeIndex(aReportId, aType); - - if ( index == KErrNotFound ) - { - // Add a new entry for this report ID to the "map": - User::LeaveIfError(iSizes.Append(TReportSize(aReportId, aType))); - index = iSizes.Count() - 1; - - TRACE_INFO((_L("Adding size record for report %d:%d (%d)\n"), - aReportId, aType, iSizes[index].iSize)); - } - TRACE_INFO((_L("Size for report %d:%d changes %d + %d\n"), - aReportId, aType, iSizes[index].iSize, aIncrement)); - iSizes[index].iSize += aIncrement; - } - -// ----------------------------------------------------------------------------- -// NumberOfReports() -// ----------------------------------------------------------------------------- -// -TInt CReportRoot::NumberOfReports() const - { - return iSizes.Count(); - } -// ----------------------------------------------------------------------------- -// ReportSize() -// ----------------------------------------------------------------------------- -// -TInt CReportRoot::ReportSize(TInt aIndex) const - { - TInt size = 0; - - if (aIndex < iSizes.Count()) - { - size = iSizes[aIndex].iSize; - } - - return size; - } -// ----------------------------------------------------------------------------- -// ReportSize() -// ----------------------------------------------------------------------------- -// -TInt CReportRoot::ReportSize(TInt aReportId, CField::TType aType) const - { - TInt offset = 0; - - TInt index = FindReportSizeIndex(aReportId, aType); - if (index != KErrNotFound && index < iSizes.Count() ) - { - offset = iSizes[index].iSize; - } - return offset; - } - -// ----------------------------------------------------------------------------- -// ReportSizeBytes() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CReportRoot::ReportSizeBytes(TInt aReportId, - CField::TType aType) const - { - TInt reportBytes = (ReportSize(aReportId, aType) + KSevenBits) / KSizeOfByte; - - // Add an extra byte if the report ID is used - return ( aReportId ) ? reportBytes + 1 : reportBytes; - } - -// ----------------------------------------------------------------------------- -// FindReportSizeIndex() -// ----------------------------------------------------------------------------- -// -TInt CReportRoot::FindReportSizeIndex(TInt aReportId, CField::TType aType) const - { - TIdentityRelation matcher(TReportSize::Match); - TInt index = iSizes.Find(TReportSize(aReportId, aType), matcher); - - TRACE_INFO((_L("FindReportSizeIndex(%d, %d) = %d\n"), - aReportId, aType, index)); - return index; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/src/hidreporttranslator.cpp --- a/localconnectivityservice/generichid/src/hidreporttranslator.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,170 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: Report base class implementation -* -*/ - - -#include - -#include "hidtranslate.h" -#include "hidreportroot.h" -#include "hidinterfaces.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// -EXPORT_C TReportTranslator::TReportTranslator( - const TDesC8& aData, - const CField *aField) - : iData(aData), iField(aField) - { - } - -// --------------------------------------------------------------------------- -// GetValue() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt TReportTranslator::GetValue(TInt& aValue, TInt aUsageId, - TInt aControlOffset /*= 0*/) const - { - TInt usageIndex = 0; - - if ( iField && TReportUtils::GetIndexOfUsage(iField, aUsageId, usageIndex) ) - { - if ( iField->IsArray() ) - { - // Convert usage ID to logical value - TInt logicalValue = usageIndex + iField->LogicalMin(); - - // Find logical value in the array - for ( TInt i = 0; i < iField->Count(); i++ ) - { - TInt value = 0; - TInt error = TReportUtils::ReadData(iData, iField, i, value); - - if ( KErrNone != error ) - { - return error; - } - - if ( value == logicalValue ) - { - aValue = ETrue; - return KErrNone; - } - } - - aValue = EFalse; - return KErrNone; - } - else - { - return TReportUtils::ReadData(iData, iField, usageIndex + aControlOffset, aValue); - } - } - - return KErrUsageNotFound; - } - -// --------------------------------------------------------------------------- -// ValueL() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt TReportTranslator::ValueL(TInt aUsageId, - TInt aControlOffset /*= 0*/) const - { - TInt value = 0; - - User::LeaveIfError(GetValue(value, aUsageId, aControlOffset)); - - return value; - } - -// --------------------------------------------------------------------------- -// GetUsageId() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt TReportTranslator::GetUsageId(TInt& aUsageId, TInt aIndex) const - { - TInt logicalValue = 0; - TInt error = KErrNoMemory; - - if ( iField ) - { - error = TReportUtils::ReadData(iData, iField, aIndex, logicalValue); - - if ( KErrNone == error ) - { - if ( iField->IsArray() ) - { - // The logical value is a usage index - aUsageId = TReportUtils::UsageAtIndex(iField, logicalValue - - iField->LogicalMin()); - } - else - { - // Treat the logical value as an on/off control for the usage - aUsageId = ( logicalValue ) ? TReportUtils::UsageAtIndex(iField, - aIndex) : 0; - } - } - } - - return error; - } - -// --------------------------------------------------------------------------- -// GetUsageId() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt TReportTranslator::UsageIdL(TInt aIndex) const - { - TInt usageId = 0; - - User::LeaveIfError(GetUsageId(usageId, aIndex)); - - return usageId; - } - -// --------------------------------------------------------------------------- -// RawValueL() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt TReportTranslator::RawValueL(TInt aIndex) const - { - TInt value = 0; - User::LeaveIfNull(const_cast(iField)); - User::LeaveIfError(TReportUtils::ReadData(iData, iField, aIndex, value)); - return value; - } - -// --------------------------------------------------------------------------- -// Count() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt TReportTranslator::Count() const - { - TInt count = 0; - - if (iField) - { - count = iField->Count(); - } - - return count; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/src/hidsearch.cpp --- a/localconnectivityservice/generichid/src/hidsearch.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: HID field search -* -*/ - -#include -#include - -#include "hidreportroot.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// SearchL() -// --------------------------------------------------------------------------- -// -EXPORT_C void THidFieldSearch::SearchL(const CReportRoot* aReportRoot, - MHidFieldFinder* aFinder) - { - iFinder = aFinder; - - if (aReportRoot) - { - TBool done = EFalse; - for (TInt i=0; (i < aReportRoot->CollectionCount()) && !done; ++i) - { - done = !DoSearchL(aReportRoot->CollectionByIndex(i)); - } - } - } - -// --------------------------------------------------------------------------- -// DoSearchL() -// --------------------------------------------------------------------------- -// -TBool THidFieldSearch::DoSearchL(const CCollection* aCollection) - { - if (iFinder->BeginCollection(aCollection)) - { - TInt i; - - for (i=0; i < aCollection->FieldCount(); ++i) - { - iFinder->Field(aCollection->FieldByIndex(i)); - } - - for (i=0; i < aCollection->CollectionCount(); ++i) - { - if (!DoSearchL(aCollection->CollectionByIndex(i))) - { - return EFalse; - } - } - } - - return iFinder->EndCollection(aCollection); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/Bmarm/GenericHidTestU.DEF --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/Bmarm/GenericHidTestU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/Bwins/GenericHidTestU.DEF --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/Bwins/GenericHidTestU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/conf/GenericHidTest.cfg --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/conf/GenericHidTest.cfg Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1749 +0,0 @@ -/* -* Copyright (c) 2008-2009 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: Test script config file -* -*/ - -[StifSettings] -CapsModifier= GenericHidTest.exe -[EndStifSettings] - -// GenericHidTest Module - total ... tc - -// GenericHidTest Api Tests (... tc) -/* - [Test] - title Example Api Test - create GenericHidTest tester - tester ExecuteApiTestBlock ExampleTestL API option 1 a - delete tester - [Endtest] -*/ -// Add new api tests here -// ... - - -// GenericHidTest Module Tests (... tc) -/* - [Test] - title Example Module Test - create GenericHidTest tester - tester ExecuteModuleTestBlock ExampleTestL MODULE option 2 b - delete tester - [Endtest] -*/ -// Add new module tests here -// ... - - -// GenericHidTest Branch Tests (... tc) - -[Test] -title Connect/Disconnect -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetconnect.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Connect Unsupported -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\dummyconnect.hid -delete tester -[Endtest] - -[Test] -title Multiple Connect wiht same id -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetconnect.hid -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetconnect.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Headset Data In -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetconnect.hid -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\headsetvolumeup.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Usage PoC Data In -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetconnect.hid -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\UsagePoC.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Multipage Connect/Disconnect -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\multipagec.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Multipage Data In -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\multipagec.hid -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\headsetvolumeupm.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Next track -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetcon2.hid -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\play.hid -tester ExecuteBranchTestBlock Wait BRANCH 20 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\hook.hid -tester ExecuteBranchTestBlock Wait BRANCH 1 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\empty.hid -tester ExecuteBranchTestBlock Wait BRANCH 20 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\stop.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Next after next track -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetcon2.hid -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\play.hid -tester ExecuteBranchTestBlock Wait BRANCH 20 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\hook.hid -tester ExecuteBranchTestBlock Wait BRANCH 1 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\empty.hid -tester ExecuteBranchTestBlock Wait BRANCH 1 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\hook.hid -tester ExecuteBranchTestBlock Wait BRANCH 1 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\empty.hid -tester ExecuteBranchTestBlock Wait BRANCH 20 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\stop.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -tester ExecuteBranchTestBlock Wait BRANCH 2 -delete tester -[Endtest] - -[Test] -title Stop Alarm when playing music -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetcon2.hid -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\play.hid -tester ExecuteBranchTestBlock Wait BRANCH 20 -tester ExecuteBranchTestBlock AddAlarm BRANCH 1000 -tester ExecuteBranchTestBlock Wait BRANCH 70 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\hook.hid -tester ExecuteBranchTestBlock Wait BRANCH 20 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\stop.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -tester ExecuteBranchTestBlock DeleteAlarm BRANCH -delete tester -[Endtest] - -[Test] -title Volume up -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetcon2.hid -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\volup.hid -tester ExecuteBranchTestBlock Wait BRANCH 6 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\empty.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Volume down -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetcon2.hid -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\voldown.hid -tester ExecuteBranchTestBlock Wait BRANCH 6 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\empty.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Mute -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetcon2.hid -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\mute.hid -tester ExecuteBranchTestBlock Wait BRANCH 1 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\empty.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Short next -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetcon2.hid -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\play.hid -tester ExecuteBranchTestBlock Wait BRANCH 10 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\next.hid -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\empty.hid -tester ExecuteBranchTestBlock Wait BRANCH 20 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\stop.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Long press next -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetcon2.hid -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\play.hid -tester ExecuteBranchTestBlock Wait BRANCH 10 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\next.hid -tester ExecuteBranchTestBlock Wait BRANCH 3 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\empty.hid -tester ExecuteBranchTestBlock Wait BRANCH 20 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\stop.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Long press back -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetcon2.hid -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\play.hid -tester ExecuteBranchTestBlock Wait BRANCH 10 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\prev.hid -tester ExecuteBranchTestBlock Wait BRANCH 3 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\empty.hid -tester ExecuteBranchTestBlock Wait BRANCH 20 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\stop.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Short press back -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetcon2.hid -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\play.hid -tester ExecuteBranchTestBlock Wait BRANCH 10 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\prev.hid -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\empty.hid -tester ExecuteBranchTestBlock Wait BRANCH 20 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\stop.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - -[Test] -title Connect/Disconnect ad83 -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock Wait BRANCH 10 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\multipagein.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Contry code -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CountryCode BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Vendor id -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock VendorId BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Product ID -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock ProductId BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Set Protocol -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock SetProtocol BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Get Protocol -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock GetProtocol BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Get Report -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock GetReport BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Set Report -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock SetReport BRANCH c:\data\others\hook.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Data out -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock DataOut BRANCH c:\data\others\hook.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - -[Test] -title Get idle -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock GetIdle BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Set idle -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock SetIdle BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Command Result -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\multipagein.hid -tester ExecuteBranchTestBlock CommandResult BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - -[Test] -title Report Descriptor -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock ReportDescriptor BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - -[Test] -title Translator GetValue -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportTranslator BRANCH c:\data\others\multipagein.hid -tester ExecuteBranchTestBlock ReportTranslatorGetValue BRANCH Ok -tester ExecuteBranchTestBlock DeleteReportTranslator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - -[Test] -title Translator GetValue Field Null -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportTranslator_FieldNull BRANCH c:\data\others\multipagein.hid -tester ExecuteBranchTestBlock ReportTranslatorGetValue BRANCH NotFound -tester ExecuteBranchTestBlock DeleteReportTranslator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Translator GetValue NotArray -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportTranslator_NotArray BRANCH c:\data\others\multipagein.hid -tester ExecuteBranchTestBlock ReportTranslatorGetValue BRANCH Ok -tester ExecuteBranchTestBlock DeleteReportTranslator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Translator GetValue FieldCountZero -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportTranslator_FieldCountZero BRANCH c:\data\others\multipagein.hid -tester ExecuteBranchTestBlock ReportTranslatorGetValue BRANCH Ok -tester ExecuteBranchTestBlock DeleteReportTranslator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - -[Test] -title Translator Value -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportTranslator BRANCH c:\data\others\multipagein.hid -tester ExecuteBranchTestBlock ReportTranslatorValue BRANCH -tester ExecuteBranchTestBlock DeleteReportTranslator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - -[Test] -title Translator GetUsageId -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportTranslator BRANCH c:\data\others\multipagein.hid -tester ExecuteBranchTestBlock ReportTranslatorGetUsageId BRANCH Ok -tester ExecuteBranchTestBlock DeleteReportTranslator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Translator GetUsageId BadIndex -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportTranslator BRANCH c:\data\others\multipagein.hid -tester ExecuteBranchTestBlock ReportTranslatorGetUsageId BRANCH BadIndex -tester ExecuteBranchTestBlock DeleteReportTranslator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Translator GetUsageId Field Null -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportTranslator_FieldNull BRANCH c:\data\others\multipagein.hid -tester ExecuteBranchTestBlock ReportTranslatorGetUsageId BRANCH Error -tester ExecuteBranchTestBlock DeleteReportTranslator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Translator GetUsageId NotArray -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportTranslator_NotArray BRANCH c:\data\others\multipagein.hid -tester ExecuteBranchTestBlock ReportTranslatorGetUsageId BRANCH Ok -tester ExecuteBranchTestBlock DeleteReportTranslator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Translator UsageId -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportTranslator BRANCH c:\data\others\multipagein.hid -tester ExecuteBranchTestBlock ReportTranslatorUsageId BRANCH -tester ExecuteBranchTestBlock DeleteReportTranslator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Translator Raw value -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportTranslator BRANCH c:\data\others\multipagein.hid -tester ExecuteBranchTestBlock ReportTranslatorRawValue BRANCH -tester ExecuteBranchTestBlock DeleteReportTranslator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Translator Count -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportTranslator BRANCH c:\data\others\multipagein.hid -tester ExecuteBranchTestBlock ReportTranslatorCount BRANCH NotZero -tester ExecuteBranchTestBlock DeleteReportTranslator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Translator Count Field Null -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportTranslator_FieldNull BRANCH c:\data\others\multipagein.hid -tester ExecuteBranchTestBlock ReportTranslatorCount BRANCH Zero -tester ExecuteBranchTestBlock DeleteReportTranslator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - -[Test] -title Collection type -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock Collectiontype BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Collection IsPhysical -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CollectionIsPhysical BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Collection IsLogical -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CollectionIsLogical BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Collection IsReport -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CollectionIsReport BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Collection IsNamedArray -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CollectionIsNamedArray BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Collection IsUsageSwitch -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CollectionIsUsageSwitch BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Collection IsUsageModifier -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CollectionIsUsageModifier BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Collection IsApplication -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CollectionIsApplication BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Collection UsagePage -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CollectionUsagePage BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Collection Usage -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CollectionUsage BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Collection CollectionCount -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CollectionCollectionCount BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Collection FieldCount -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CollectionFieldCount BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Collection CollectionByIndex Present -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CollectionCollectionByIndex BRANCH Present -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Collection CollectionByIndex NotPresent -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CollectionCollectionByIndex BRANCH NotPresent -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Collection FieldByIndex -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CollectionFieldByIndex BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title ReportSizeBytes -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock ReportrootReportSizeBytes BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Logical Max -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldLogicalMax BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Physical min -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldPhysicalMin BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Physical max -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldPhysicalMax BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Unit -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldUnit BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Unit Exponent -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldUnitExponent BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Count -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldCount BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Size -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldSize BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Offset SetReport -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldOffset BRANCH SetReport -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Offset NotSetReport -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldOffset BRANCH NotSetReport -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Report Id -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldReportId BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Is In Report -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldIsInReport BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Designator Index -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldDesignatorIndex BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field String Index -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldStringIndex BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Usage Page -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldUsagePage BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field HasUsage -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldHasUsage BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Usage Array -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldUsageArray BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Usage -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldUsage BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Usage Count -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldUsageCount BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Clear Usage List -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldClearUsageList BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Last Usage Empty -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldLastUsage BRANCH Empty -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Last Usage NotEmpty -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldLastUsage BRANCH NotEmpty -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Attributes -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldAttributes BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field Type -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldType BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field IsVariable -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldIsVariable BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - -[Test] -title Field IsArray -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldIsArray BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - - -[Test] -title Field IsConstant -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldIsConstant BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - -[Test] -title Field IsData -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldIsData BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - -[Test] -title Field SetLogicalMin -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldSetLogicalMin BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field SetLogicalMax -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldSetLogicalMax BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field SetPhysicalMin -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldSetPhysicalMin BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field SetPhysicalMax -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldSetPhysicalMax BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field SetDesignatorMin -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldSetDesignatorMin BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field SetDesignatorMax -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldSetDesignatorMax BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field SetUsageMin -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldSetUsageMin BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field SetUsageMax -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldSetUsageMax BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field SetStringMin -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldSetStringMin BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field SetStringMax -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldSetStringMax BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field SetLogicalRange -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldSetLogicalRange BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field SetUsageRange -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldSetUsageRange BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field SetPhysicalRange -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldSetPhysicalRange BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field SetStringRange -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldSetStringRange BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field SetDesignatorRange -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldSetDesignatorRange BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field IsInput -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldIsInput BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - -[Test] -title Field IsOutput -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldIsOutput BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Field IsFeature -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock FieldIsFeature BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - -[Test] -title ReportGeneratorReport -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportGenerator BRANCH -tester ExecuteBranchTestBlock ReportGeneratorReport BRANCH -tester ExecuteBranchTestBlock DeleteReportGenerator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title ReportGeneratorReport SetField Array -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportGenerator BRANCH -tester ExecuteBranchTestBlock ReportGeneratorSetField BRANCH Array -tester ExecuteBranchTestBlock DeleteReportGenerator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title ReportGeneratorReport SetField NotArray -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportGenerator BRANCH -tester ExecuteBranchTestBlock ReportGeneratorSetField BRANCH NotArray -tester ExecuteBranchTestBlock DeleteReportGenerator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title ReportGeneratorReport SetField NotArrayOutOfRange -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportGenerator BRANCH -tester ExecuteBranchTestBlock ReportGeneratorSetField BRANCH NotArrayOutOfRange -tester ExecuteBranchTestBlock DeleteReportGenerator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - -[Test] -title ReportGeneratorReport SetField FieldNull -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportGenerator BRANCH -tester ExecuteBranchTestBlock ReportGeneratorSetField BRANCH FieldNull -tester ExecuteBranchTestBlock DeleteReportGenerator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title ReportGeneratorReport SetField FieldCountZero -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportGenerator BRANCH -tester ExecuteBranchTestBlock ReportGeneratorSetField BRANCH FieldCountZero -tester ExecuteBranchTestBlock DeleteReportGenerator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title ReportGeneratorReport SetField NotExistingUsage -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportGenerator BRANCH -tester ExecuteBranchTestBlock ReportGeneratorSetField BRANCH NotExistingUsage -tester ExecuteBranchTestBlock DeleteReportGenerator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title ReportGeneratorReport SetField NotExistingUsage2 -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportGenerator BRANCH -tester ExecuteBranchTestBlock ReportGeneratorSetField BRANCH NotExistingUsage2 -tester ExecuteBranchTestBlock DeleteReportGenerator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - -[Test] -title ReportGeneratorReport SetField BadIndex -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\connectad83.hid -tester ExecuteBranchTestBlock CreateReportGenerator BRANCH -tester ExecuteBranchTestBlock ReportGeneratorSetField BRANCH BadIndex -tester ExecuteBranchTestBlock DeleteReportGenerator BRANCH -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - -[Test] -title OutputReport -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\output.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title FeautureReport -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\feature.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Global physical -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\physicalmax.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Unit -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\unit.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Unit exponent -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\unitexponent.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Designator limit test -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\designator.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Delimiter test -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\delimiter.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title String limit test -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\string.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Push whitout pop -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\push.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Pop whitout push -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\pop.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title String index -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\stringindex.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Designator index -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\designatorindex.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Local Designator index -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\localdesignatorindex.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Local Designator minimum -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\localdesignatorminimum.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Local Designator maximum -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\localdesignatormaximum.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Local String index -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\localstringindex.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Local String minimum -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\localstringminimum.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Local String maximum -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\localstringmaximum.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - - -[Test] -title Local Delimiter - unknown delimiter -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\localdelimiter.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Local Delimiter - lonely delimiter -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\localdelimiter_lonelydelimiter.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Local Delimiter - nested delimiter -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\localdelimiter_nesteddelimiter.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Local Usage -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\localusage.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Local Usage minimum -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\localusageminimum.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Local Usage maximum -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\localusagemaximum.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Local item - unknown -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\localitem_unknown.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Global Physical minimum -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\globalphysicalmin.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Global Physical maximum -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\globalphysicalmax.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Global Unit -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\globalunit.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Global Unit small value -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\globalunit_smallvalue.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Global Unit exponent -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\globalunitexponent.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Global Unit exponent2 -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\globalunitexponent2.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Global push -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\globalpush.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Global pop -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\globalpop.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Global pop without push -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\globalpop_withoutpush.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Global item - unknown -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\globaitem_unknown.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Main Output Tag -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\mainoutputtag.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Main Feature -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\mainfeature.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Long Item -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\longitem.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Handle Item - within delimiter -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\handleitem_withindelimiter.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Main Item - unknown -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\mainitem_unknown.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check usage min and max - LonelyUsageMin -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkusageminandmax.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check usage min and max - LonelyUsageMax -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkusageminandmax2.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check usage min and max - UsageMinExceedsMax -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkusageminandmax3.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check designator min and max - LonelyDesignatorMin -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkdesignatorminandmax.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check designator min and max - LonelyDesignatorMax -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkdesignatorminandmax2.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check designator min and max - DesignatorMinExceedsMax -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkdesignatorminandmax3.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check string min and max - LonelyStringMin -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkstringminandmax.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check string min and max - LonelyStringMax -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkstringminandmax2.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check string min and max - StringMinExceedsMax -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkstringminandmax3.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check mandatory field existence -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkmandatoryfieldexistence.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check mandatory field existence2 -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkmandatoryfieldexistence2.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check mandatory field existence3 -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkmandatoryfieldexistence3.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check for field errors -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkforfielderrors.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check for field errors2 -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkforfielderrors2.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check logical min and max -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checklogicalminandmax.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check field bit needed -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkfieldbitneeded.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check for main errors -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkformainerrors.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check for main errors2 -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkformainerrors2.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check for main errors3 -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkformainerrors3.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check for main errors3 -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkformainerrors3.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check parse errors -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkparseerrors.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check parse errors2 -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkparseerrors2.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check parse errors3 -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkparseerrors3.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title check for collection errors -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\checkforcollectionerrors.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -///////////////////////////////// -[Test] -title Hangup -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetconnect.hid -tester ExecuteBranchTestBlock Wait BRANCH 2 -tester ExecuteBranchTestBlock CreateCall BRANCH +48607939016 //+358405695587 -tester ExecuteBranchTestBlock Wait BRANCH 5 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\hook.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Redial -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetconnect.hid -tester ExecuteBranchTestBlock Wait BRANCH 2 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\hook.hid -tester ExecuteBranchTestBlock Wait BRANCH 1 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\hook.hid -tester ExecuteBranchTestBlock Wait BRANCH 2 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\hook.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -delete tester -[Endtest] - -[Test] -title Snooze Alarm -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetconnect.hid -tester ExecuteBranchTestBlock AddAlarm BRANCH 1 -tester ExecuteBranchTestBlock Wait BRANCH 80 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\hook.hid -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\hook.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -tester ExecuteBranchTestBlock DeleteAlarm BRANCH -delete tester -[Endtest] - -[Test] -title Stop Alarm -create GenericHidTest tester -tester ExecuteBranchTestBlock Connect BRANCH c:\data\others\headsetconnect.hid -tester ExecuteBranchTestBlock AddAlarm BRANCH 1 -tester ExecuteBranchTestBlock Wait BRANCH 80 -tester ExecuteBranchTestBlock DataIn BRANCH c:\data\others\hook.hid -tester ExecuteBranchTestBlock Disconnect BRANCH -tester ExecuteBranchTestBlock DeleteAlarm BRANCH -delete tester -[Endtest] -// -// Add new branch tests here -// ... - -//Field SetLogicalRange \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/E000B181.rss --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/E000B181.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2002 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: -* -*/ - - -#include - -// Declares info for two implementations -RESOURCE REGISTRY_INFO theInfo - { - // UID for the DLL - dll_uid = 0xE000B181; - // Declare array of interface info - interfaces = - { - INTERFACE_INFO - { - // UID of interface that is implemented - interface_uid = 0x10201d26; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = 0xE000B187; - version_no = 1; - display_name = "CHidDriverPlugin"; - default_data = ""; - opaque_data = ""; - } - }; - } - }; - } - -// -// End of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/UsagePoC.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/UsagePoC.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ - 0x33, 0x01 - \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkdesignatorminandmax.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkdesignatorminandmax.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -0x49, 0x00, //define designator minimum -0x91, 0x01 // main output tag - create field \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkdesignatorminandmax2.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkdesignatorminandmax2.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -0x59, 0x00, //define designator maximum -0x91, 0x01 // main output tag - create field \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkdesignatorminandmax3.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkdesignatorminandmax3.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -0x49, 0x10, //define designator minimum -0x59, 0x00, //define designator maximum -0x91, 0x01 // main output tag - create field \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkfieldbitneeded.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkfieldbitneeded.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -//0x91, 0x00, // main output tag - create field -0x91, 0x41, // main output tag - create field KNullStateFlag - - -//tests for BitsToRepresentRange -0x15, 0x10, //define logical minimum -0x25, 0x10, //define logical maximum -0x91, 0x01, // main output tag - create field - -0x15, 0x05, //define logical minimum -0x25, 0x10, //define logical maximum -0x91, 0x01, // main output tag - create field - - -0x17, 0xFF, 0xFF, 0xFF, 0xFF, //define logical minimum - negative minimum -0x25, 0x10, //define logical maximum -0x91, 0x01, // main output tag - create field - -0x15, 0x05, //define logical minimum -0x25, 0x10, //define logical maximum - -//0x75, 0x00, // set iGlobal.iSize to 0 -0x77, 0xFF, 0xFF, 0xFF, 0xFF, // set iGlobal.iSize to -1 - -0x91, 0x01, // main output tag - create field - -0x75, 0x00, // set iGlobal.iSize to 0 -0x91, 0x01 // main output tag - create field \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkforcollectionerrors.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkforcollectionerrors.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -0xA1, 0x81, //main collection -0xC0, //end collection - -0xA1, 0x07, //main collection -0xC0, //end collection - -0x09, 0xc8, // add local usage -0x05, 0xc8, // add local usage page - -0xA1, 0x01, //main collection -0xC0, //end collection - -0x79, 0xc8, //local string index - KUnusedLocalItemsMask - -0xA1, 0x01, //main collection -0xC0, //end collection \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkforfielderrors.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkforfielderrors.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -0x15, 0x10, //define logical minimum -0x25, 0x00, //define logical maximum -0x91, 0x01 // main output tag - create field \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkforfielderrors2.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkforfielderrors2.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -0x35, 0x10, //define physical minimum -0x45, 0x00, //define physical maximum -0x91, 0x01 // main output tag - create field \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkformainerrors.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkformainerrors.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -0x35, 0x10, //define physical minimum -0x45, 0x00, //define physical maximum - -0xA1, 0x01, //main collection -0xC0 //end collection - -0x15, 0x10, //define logical minimum -0x25, 0x00, //define logical maximum -0xA1, 0x01, //main collection -0xC0 //end collection - -0x15, 0x00, //define logical minimum -0x25, 0x10, //define logical maximum -0xA1, 0x01, //main collection -0xC0 //end collection \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkformainerrors2.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkformainerrors2.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -0x35, 0x00, //define physical minimum - -0x91, 0x01 // main output tag - create field \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkformainerrors3.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkformainerrors3.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -0x45, 0x00, //define physical maximum - -0x91, 0x01 // main output tag - create field \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checklogicalminandmax.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checklogicalminandmax.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -//0x91, 0x01, // main output tag - create field -//0x91, 0xf0, // main output tag - create field - -0x25, 0x20, //define logical maximum -0x15, 0x10, //define logical minimum - wrong for array -0x91, 0x03, // main output tag - create field ELogicalMinInvalidForArray - -0x09, 0xc8, // add local usage -0x91, 0x03 // main output tag - create field ELogicalMinInvalidForArray \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkmandatoryfieldexistence.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkmandatoryfieldexistence.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x91, 0x00 // main output tag - create field \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkmandatoryfieldexistence2.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkmandatoryfieldexistence2.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0xB1, 0x00 // main feature - create field \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkmandatoryfieldexistence3.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkmandatoryfieldexistence3.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x81, 0x00 // main input tag - create field \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkparseerrors.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkparseerrors.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0xa9, 0x01 // begin delimiter \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkparseerrors2.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkparseerrors2.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0xA1, 0x01 //main collection \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkparseerrors3.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkparseerrors3.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0xA4 //global push - no data \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkstringminandmax.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkstringminandmax.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -0x89, 0x00, // define string minimum -0x91, 0x01 // main output tag - create field \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkstringminandmax2.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkstringminandmax2.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -0x99, 0x00, // define string maximum -0x91, 0x01 // main output tag - create field \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkstringminandmax3.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkstringminandmax3.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -0x89, 0x10, // define string minimum -0x99, 0x00, // define string maximum -0x91, 0x01 // main output tag - create field \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkusageminandmax.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkusageminandmax.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -0x19, 0x00, //define usage min to 0 -0x91, 0x01 // main output tag - create field \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkusageminandmax2.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkusageminandmax2.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -0x29, 0x00, //define usage max to 0 -0x91, 0x01 // main output tag - create field diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkusageminandmax3.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/checkusageminandmax3.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -0x19, 0x10, //define usage min to 0 -0x29, 0x00, //define usage max to 0 -0x91, 0x01 // main output tag - create field diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/connectad83.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/connectad83.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -0x05, 0x0C, -0x09, 0x01, -0xA1, 0x01, -0x15, 0x00, -0x25, 0x01, -0x75, 0x01, -0x09, 0xE9, -0x09, 0xEA, -0x95, 0x02, -0x81, 0x02, -0x05, 0x0B, -0x09, 0x2F, -0x95, 0x01, -0x81, 0x06, -0x09, 0x20, -0x81, 0x02, -0x06, 0x00, 0xFF, -0x09, 0x01, -0x09, 0x02, -0x95, 0x02, -0x81, 0x02, -0x95, 0x02, -0x81, 0x01, -0x05, 0x0C, -0x09, 0xB0, -0x09, 0xB3, -0x09, 0xB4, -0x09, 0xB7, -0x09, 0xB5, -0x09, 0xB6, -0x09, 0xB9, -0x95, 0x07, -0x81, 0x06, -0x95, 0x01, -0x81, 0x01, -0xC0 diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/delimiter.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/delimiter.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -// Filename: delimiter1.hid.txt -// A valid delimiter Open and Close - - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x01, // REPORT_ID (1) - 0x05, 0x08, // USAGE_PAGE (LEDs) - 0xA9, 0x01, // DELIMITER (OPEN) - 0x19, 0x01, // USAGE_MINIMUM (Num Lock) - 0x29, 0x03, // USAGE_MAXIMUM (Scroll Lock) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x03, // REPORT_COUNT (3) - 0xA9, 0x00, // DELIMITER (CLOSE) - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x09, 0x4B, // USAGE (Generic indicator) - 0x95, 0x01, // REPORT_COUNT (1) - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x95, 0x04, // REPORT_COUNT (4) - 0x91, 0x01, // OUTPUT (Cnst,Ary,Abs) - 0x05, 0x07, // USAGE_PAGE (Keyboard) - 0x19, 0xE0, // USAGE_MINIMUM (Keyboard LeftControl) - 0x29, 0xE7, // USAGE_MAXIMUM (Keyboard Right GUI) - 0x95, 0x08, // REPORT_COUNT (8) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x08, // REPORT_SIZE (8) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0x19, 0x00, // USAGE_MINIMUM (No event) - 0x29, 0x91, // USAGE_MAXIMUM (Keyboard LANG2) - 0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255) - 0x95, 0x06, // REPORT_COUNT (6) - 0x81, 0x00, // INPUT (Data,Ary,Abs) - 0xC0, // END_COLLECTION diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/designator.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/designator.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -// File: DesignatorMin1.hid.txt -// Designator Min defined, but no Designator Max - - - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x01, // REPORT_ID (1) - 0x05, 0x08, // USAGE_PAGE (LEDs) - 0x19, 0x01, // USAGE_MINIMUM (Num Lock) - 0x29, 0x03, // USAGE_MAXIMUM (Scroll Lock) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) -// Designator Min defined, but no Designator Max - 0x49, 0x01, // DESIGNATOR_MINIMUM (1) - 0x59, 0x20 // DESIGNATOR_MAXIMUM (32) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x03, // REPORT_COUNT (3) - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x09, 0x4B, // USAGE (Generic indicator) - 0x95, 0x01, // REPORT_COUNT (1) - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x95, 0x04, // REPORT_COUNT (4) - 0x91, 0x01, // OUTPUT (Cnst,Ary,Abs) - 0x05, 0x07, // USAGE_PAGE (Keyboard) - 0x19, 0xE0, // USAGE_MINIMUM (Keyboard LeftControl) - 0x29, 0xE7, // USAGE_MAXIMUM (Keyboard Right GUI) - 0x95, 0x08, // REPORT_COUNT (8) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x08, // REPORT_SIZE (8) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0x19, 0x00, // USAGE_MINIMUM (No event) - 0x29, 0x91, // USAGE_MAXIMUM (Keyboard LANG2) - 0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255) - 0x95, 0x06, // REPORT_COUNT (6) - 0x81, 0x00, // INPUT (Data,Ary,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x02, // REPORT_ID (2) - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x1C, // REPORT_COUNT (28) - 0x09, 0xE2, // USAGE (Mute) - 0x09, 0xB7, // USAGE (Stop) - 0x09, 0xCD, // USAGE (Play/pause) - 0x09, 0xEA, // USAGE (Volume Down) - 0x09, 0xE9, // USAGE (Volume Up) - 0x09, 0xB6, // USAGE (Scan Previous Track) - 0x09, 0xB5, // USAGE (Scan Next Track) - 0x0A, 0x83, 0x01, // USAGE (Control config) - 0x0A, 0x1A, 0x02, // USAGE (Undo) - 0x0A, 0x79, 0x02, // USAGE (Redo) - 0x0A, 0xAB, 0x01, // USAGE (Spell check) - 0x0A, 0x08, 0x02, // USAGE (Print) - 0x0A, 0x02, 0x02, // USAGE (Open) - 0x0A, 0x03, 0x02, // USAGE (Close) - 0x0A, 0x07, 0x02, // USAGE (Save) - 0x0A, 0x01, 0x02, // USAGE (New) - 0x0A, 0x92, 0x01, // USAGE (Calculator) - 0x0A, 0x9C, 0x01, // USAGE (Logoff) - 0x09, 0x95, // USAGE (Help) - 0x0A, 0x23, 0x02, // USAGE (Home) - 0x0A, 0x89, 0x02, // USAGE (Reply) - 0x0A, 0x8B, 0x02, // USAGE (Sendto - 0x0A, 0x8C, 0x02, // USAGE (Send) - 0x0A, 0x8A, 0x01, // USAGE (Email - 0x0A, 0x99, 0x01, // USAGE (Chat) - 0x0A, 0xA7, 0x01, // USAGE (Documents) - 0x0A, 0xB6, 0x01, // USAGE (Unknown 0x01b6) - 0x0A, 0xB7, 0x01, // USAGE (Unknown 0x01b7) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x04, // REPORT_COUNT (4) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x0A, 0x02, 0xFF, // USAGE (Unknown 0xff02) - 0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x08, // REPORT_SIZE (8) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x80, // USAGE (System Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x03, // REPORT_ID (3) - 0x19, 0x81, // USAGE_MINIMUM (System Power Down) - 0x29, 0x83, // USAGE_MAXIMUM (System Wake Up) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x95, 0x03, // REPORT_COUNT (3) - 0x75, 0x01, // REPORT_SIZE (1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x95, 0x05, // REPORT_COUNT (5) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x04, // REPORT_ID (4) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x02, // COLLECTION (Logical) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x03, // LOGICAL_MAXIMUM (3) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x02, // REPORT_SIZE (2) - 0x0A, 0x01, 0xFE, // USAGE (Unknown 1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x06, // REPORT_SIZE (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x05, // REPORT_ID (5) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x02, // COLLECTION (Logical) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x02, // REPORT_COUNT (2) - 0x0A, 0x03, 0xFE, // USAGE (Unknown 0xfe03) - 0x0A, 0x04, 0xFE, // USAGE (Unknown 0xfe04) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x95, 0x06, // REPORT_COUNT (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0xFF, // REPORT_ID (255) - 0x05, 0x06, // USAGE_PAGE (Generic Device Controls) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x02, // REPORT_SIZE (2) - 0x19, 0x24, // USAGE_MINIMUM (Unknown 0x24) - 0x29, 0x26, // USAGE_MAXIMUM (Unknown 0x26) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x06, // REPORT_SIZE (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0 // END_COLLECTION -// }; diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/designatorindex.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/designatorindex.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -// File: DesignatorMin1.hid.txt -// Designator Min defined, but no Designator Max - - - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x01, // REPORT_ID (1) - 0x05, 0x08, // USAGE_PAGE (LEDs) - 0x19, 0x01, // USAGE_MINIMUM (Num Lock) - 0x29, 0x03, // USAGE_MAXIMUM (Scroll Lock) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) -// Designator Min defined, but no Designator Max - 0x49, 0x01, // DESIGNATOR_MINIMUM (1) - 0x59, 0x20 // DESIGNATOR_MAXIMUM (32) - 0x39, 0x14 // DESIGNATOR_INDEX - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x03, // REPORT_COUNT (3) - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x09, 0x4B, // USAGE (Generic indicator) - 0x95, 0x01, // REPORT_COUNT (1) - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x95, 0x04, // REPORT_COUNT (4) - 0x91, 0x01, // OUTPUT (Cnst,Ary,Abs) - 0x05, 0x07, // USAGE_PAGE (Keyboard) - 0x19, 0xE0, // USAGE_MINIMUM (Keyboard LeftControl) - 0x29, 0xE7, // USAGE_MAXIMUM (Keyboard Right GUI) - 0x95, 0x08, // REPORT_COUNT (8) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x08, // REPORT_SIZE (8) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0x19, 0x00, // USAGE_MINIMUM (No event) - 0x29, 0x91, // USAGE_MAXIMUM (Keyboard LANG2) - 0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255) - 0x95, 0x06, // REPORT_COUNT (6) - 0x81, 0x00, // INPUT (Data,Ary,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x02, // REPORT_ID (2) - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x1C, // REPORT_COUNT (28) - 0x09, 0xE2, // USAGE (Mute) - 0x09, 0xB7, // USAGE (Stop) - 0x09, 0xCD, // USAGE (Play/pause) - 0x09, 0xEA, // USAGE (Volume Down) - 0x09, 0xE9, // USAGE (Volume Up) - 0x09, 0xB6, // USAGE (Scan Previous Track) - 0x09, 0xB5, // USAGE (Scan Next Track) - 0x0A, 0x83, 0x01, // USAGE (Control config) - 0x0A, 0x1A, 0x02, // USAGE (Undo) - 0x0A, 0x79, 0x02, // USAGE (Redo) - 0x0A, 0xAB, 0x01, // USAGE (Spell check) - 0x0A, 0x08, 0x02, // USAGE (Print) - 0x0A, 0x02, 0x02, // USAGE (Open) - 0x0A, 0x03, 0x02, // USAGE (Close) - 0x0A, 0x07, 0x02, // USAGE (Save) - 0x0A, 0x01, 0x02, // USAGE (New) - 0x0A, 0x92, 0x01, // USAGE (Calculator) - 0x0A, 0x9C, 0x01, // USAGE (Logoff) - 0x09, 0x95, // USAGE (Help) - 0x0A, 0x23, 0x02, // USAGE (Home) - 0x0A, 0x89, 0x02, // USAGE (Reply) - 0x0A, 0x8B, 0x02, // USAGE (Sendto - 0x0A, 0x8C, 0x02, // USAGE (Send) - 0x0A, 0x8A, 0x01, // USAGE (Email - 0x0A, 0x99, 0x01, // USAGE (Chat) - 0x0A, 0xA7, 0x01, // USAGE (Documents) - 0x0A, 0xB6, 0x01, // USAGE (Unknown 0x01b6) - 0x0A, 0xB7, 0x01, // USAGE (Unknown 0x01b7) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x04, // REPORT_COUNT (4) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x0A, 0x02, 0xFF, // USAGE (Unknown 0xff02) - 0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x08, // REPORT_SIZE (8) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x80, // USAGE (System Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x03, // REPORT_ID (3) - 0x19, 0x81, // USAGE_MINIMUM (System Power Down) - 0x29, 0x83, // USAGE_MAXIMUM (System Wake Up) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x95, 0x03, // REPORT_COUNT (3) - 0x75, 0x01, // REPORT_SIZE (1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x95, 0x05, // REPORT_COUNT (5) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x04, // REPORT_ID (4) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x02, // COLLECTION (Logical) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x03, // LOGICAL_MAXIMUM (3) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x02, // REPORT_SIZE (2) - 0x0A, 0x01, 0xFE, // USAGE (Unknown 1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x06, // REPORT_SIZE (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x05, // REPORT_ID (5) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x02, // COLLECTION (Logical) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x02, // REPORT_COUNT (2) - 0x0A, 0x03, 0xFE, // USAGE (Unknown 0xfe03) - 0x0A, 0x04, 0xFE, // USAGE (Unknown 0xfe04) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x95, 0x06, // REPORT_COUNT (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0xFF, // REPORT_ID (255) - 0x05, 0x06, // USAGE_PAGE (Generic Device Controls) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x02, // REPORT_SIZE (2) - 0x19, 0x24, // USAGE_MINIMUM (Unknown 0x24) - 0x29, 0x26, // USAGE_MAXIMUM (Unknown 0x26) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x06, // REPORT_SIZE (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0 // END_COLLECTION -// }; diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/dummyconnect.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/dummyconnect.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -0x05, 0x02, //Global usage page 12 -0x09, 0x01, //Local usage page 1 -0xa1, 0x01, //Collection Application -0x15, 0x00, //Global Locgical minimium -0x25, 0x01, //Global Logical maxim -0x75, 0x01, //Global Report size 1 -0x09, 0xE9, //Local usage Volume up -0x09, 0xEA, //Local usage Volume down -0x95, 0x02, //Global Report Count 2 -0x81, 0x02, //Input 2 First field -0x05, 0x03, //Global usage page 11 -0x09, 0x2F, //Local usage mute -0x95, 0x01, //Global Report Count 1 -0x81, 0x06, //Input 6 2. field -0x09, 0x20, //Local usage hook -0x95, 0x01, //Global Report Count 1 -0x81, 0x02, //Input 2 3. field -0x05, 0x02, //Global usage page 12 (consumer) -0x09, 0xCD, //Local usage play/pause -0x09, 0xb5, //Local usage 0xb5 ScanNext -0x09, 0xb6, //Local usage 0xb6 ScanPrev -0x09, 0xb7, //Local usage 0xb7 Stop -0x95, 0x04, //Global Report Count 4 -0x81, 0x02, //Input 2 6. field -0xc0 \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/empty.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/empty.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x0 \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/feature.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/feature.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -// File: Feature1.hid.txt -// A Feature item defined with no Global or Local items defined - - 0xa1, 0x02, // COLLECTION (Logical) - 0xa1, 0x02, // COLLECTION (Logical) -// No global or Local items defined - 0xb1, 0x40, // FEATURE (Data,Ary,Abs,Null) - 0xc0, // END_COLLECTION - 0x09, 0x47, // USAGE (Usage Indicator Color) - 0xa1, 0x02, // COLLECTION (Logical) - 0x09, 0x48, // USAGE (Red) - 0x09, 0x49, // USAGE (Green) - 0x09, 0x4a, // USAGE (Amber) - 0xb1, 0x40, // FEATURE (Data,Ary,Abs,Null) - 0xc0, // END_COLLECTION - 0xc0, // END_COLLECTION - 0x05, 0x0c, // USAGE_PAGE (Consumer Devices) - 0x19, 0xb7, // USAGE_MINIMUM (Stop) - 0xa1, 0x02, // COLLECTION (Logical) - 0x05, 0x08, // USAGE_PAGE (LEDs) - 0x09, 0x3c, // USAGE (Usage Multi Mode Indicator) - 0xa1, 0x02, // COLLECTION (Logical) - 0x09, 0x3d, // USAGE (Indicator On) - 0x09, 0x3f, // USAGE (Indicator Slow Blink) - 0x09, 0x41, // USAGE (Indicator Off) - 0xb1, 0x40, // FEATURE (Data,Ary,Abs,Null) - 0xc0, // END_COLLECTION - 0x09, 0x47, // USAGE (Usage Indicator Color) - 0xa1, 0x02, // COLLECTION (Logical) - 0x09, 0x48, // USAGE (Red) - 0x09, 0x49, // USAGE (Green) - 0x09, 0x4a, // USAGE (Amber) - 0xb1, 0x40, // FEATURE (Data,Ary,Abs,Null) - 0xc0, // END_COLLECTION - 0xc0 // END_COLLECTION -//}; - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/feature1.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/feature1.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -// File: Feature1.hid.txt -// A Feature item defined with no Global or Local items defined - - 0xa1, 0x02, // COLLECTION (Logical) - 0xa1, 0x02, // COLLECTION (Logical) -// No global or Local items defined - 0xb1, 0x40, // FEATURE (Data,Ary,Abs,Null) - 0xc0, // END_COLLECTION - 0x09, 0x47, // USAGE (Usage Indicator Color) - 0xa1, 0x02, // COLLECTION (Logical) - 0x09, 0x48, // USAGE (Red) - 0x09, 0x49, // USAGE (Green) - 0x09, 0x4a, // USAGE (Amber) - 0xb1, 0x40, // FEATURE (Data,Ary,Abs,Null) - 0xc0, // END_COLLECTION - 0xc0, // END_COLLECTION - 0x05, 0x0c, // USAGE_PAGE (Consumer Devices) - 0x19, 0xb7, // USAGE_MINIMUM (Stop) - 0xa1, 0x02, // COLLECTION (Logical) - 0x05, 0x08, // USAGE_PAGE (LEDs) - 0x09, 0x3c, // USAGE (Usage Multi Mode Indicator) - 0xa1, 0x02, // COLLECTION (Logical) - 0x09, 0x3d, // USAGE (Indicator On) - 0x09, 0x3f, // USAGE (Indicator Slow Blink) - 0x09, 0x41, // USAGE (Indicator Off) - 0xb1, 0x40, // FEATURE (Data,Ary,Abs,Null) - 0xc0, // END_COLLECTION - 0x09, 0x47, // USAGE (Usage Indicator Color) - 0xa1, 0x02, // COLLECTION (Logical) - 0x09, 0x48, // USAGE (Red) - 0x09, 0x49, // USAGE (Green) - 0x09, 0x4a, // USAGE (Amber) - 0xb1, 0x40, // FEATURE (Data,Ary,Abs,Null) - 0xc0, // END_COLLECTION - 0xc0 // END_COLLECTION -//}; - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/globaitem_unknown.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/globaitem_unknown.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0xF5, 0x01 // global item - unknown \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalphysicalmax.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalphysicalmax.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -0x45, 0xc8, //global physical maximum (200) -0x45, 0xc8 //global physical maximum (200) \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalphysicalmin.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalphysicalmin.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -0x35, 0xc8, //global physical minimum (200) -0x35, 0xc8 //global physical minimum (200) \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalpop.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalpop.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -0xA4, //global push - no data -0xB4, // global pop -0xA4, //global push - no data -0xB5, 0x01 // global pop with data \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalpop_withoutpush.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalpop_withoutpush.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0xB4 // global pop \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalpush.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalpush.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -0xA4, //global push - no data -0xB4, // global pop -0xA5, 0x01 // global push with data \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalunit.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalunit.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -0x65, 0x06, //global unit -0x65, 0x06 //global unit \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalunit_smallvalue.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalunit_smallvalue.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x65, 0x02 //global unit \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalunitexponent.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalunitexponent.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -0x55, 0x00, //global unit exponent -0x55, 0x00 //global unit exponent \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalunitexponent2.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/globalunitexponent2.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x55, 0xff //global unit exponent \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/handleitem_withindelimiter.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/handleitem_withindelimiter.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -0xa9, 0x01, // begin delimiter - set iWithinDelimiter -0xB1, 0xff, // main feature -0xa9, 0x00 // end delimiter \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/headsetcon2.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/headsetcon2.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -0x05, 0x0c, //Global usage page 12 -0x09, 0x01, //Local usage page 1 -0xa1, 0x01, //Collection Application -0x15, 0x00, //Global Locgical minimium -0x25, 0x01, //Global Logical maxim -0x75, 0x01, //Global Report size 1 -0x09, 0xE9, //Local usage Volume up -0x09, 0xEA, //Local usage Volume down -0x95, 0x02, //Global Report Count 2 -0x81, 0x02, //Input 2 First field -0x05, 0x0B, //Global usage page 11 -0x09, 0x2F, //Local usage mute -0x95, 0x01, //Global Report Count 1 -0x81, 0x06, //Input 6 2. field -0x09, 0x20, //Local usage hook -0x95, 0x01, //Global Report Count 1 -0x81, 0x02, //Input 2 3. field -0x05, 0x0C, //Global usage page 12 (consumer) -0x09, 0xCD, //Local usage play/pause -0x09, 0xb5, //Local usage 0xb5 ScanNext -0x09, 0xb6, //Local usage 0xb6 ScanPrev -0x09, 0xb7, //Local usage 0xb7 Stop -0x95, 0x04, //Global Report Count 4 -0x81, 0x02, //Input 2 6. field -0xc0 \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/headsetconnect.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/headsetconnect.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - 0x95, 0x01, //Report count 1 - 0x05, 0x0c, //Usage page telephony - 0x09, 0x01, // Usage Phone - 0xa1, 0x01, // COLLECTION (Application) - 0x09, 0x01, // USAGE (Programmable Button) - 0xa1, 0x02, // COLLECTION (Logical) - 0x05, 0x0c, // USAGE_PAGE (Button) - 0x19, 0x00, // USAGE_MINIMUM (Button 1) - 0x29, 0x2f, // USAGE_MAXIMUM (Button 6) - 0x75, 0x08, // REPORT_SIZE (3) - 0x15, 0x00, // LOGICAL_MINIMUM (1) - 0x25, 0x06, // LOGICAL_MAXIMUM (6) - 0x81, 0x00, // INPUT (Data,Ary,Abs) - 0xc0, // END_COLLECTION - 0xa1, 0x02, // COLLECTION (Logical) - 0x05, 0x0b, // USAGE_PAGE (Button) - 0x19, 0x20, // USAGE_MINIMUM (Button 1) - 0x29, 0x2f, // USAGE_MAXIMUM (Button 6) - 0x75, 0x08, // REPORT_SIZE (3) - 0x15, 0x00, // LOGICAL_MINIMUM (1) - 0x25, 0x2f, // LOGICAL_MAXIMUM (6) - 0x81, 0x00, // INPUT (Data,Ary,Abs) - 0xc0, // END_COLLECTION - 0xc0 //End collection \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/headsetvolumeup.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/headsetvolumeup.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ - 0x2f \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/headsetvolumeupm.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/headsetvolumeupm.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ - 0x01, 0x2f \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/hook.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/hook.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ - 0x20, 0x01 - \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/hookconnect.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/hookconnect.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - 0x95, 0x01, //Report count 1 - 0x05, 0x0c, //Usage page telephony - 0x09, 0x01, // Usage Phone - 0xa1, 0x01, // COLLECTION (Application) - 0x09, 0x01, // USAGE (Programmable Button) - 0xa1, 0x02, // COLLECTION (Logical) - 0x05, 0x0c, // USAGE_PAGE (Button) - 0x19, 0x00, // USAGE_MINIMUM (Button 1) - 0x29, 0x2f, // USAGE_MAXIMUM (Button 6) - 0x75, 0x08, // REPORT_SIZE (3) - 0x15, 0x00, // LOGICAL_MINIMUM (1) - 0x25, 0x06, // LOGICAL_MAXIMUM (6) - 0x81, 0x00, // INPUT (Data,Ary,Abs) - 0xc0, // END_COLLECTION - 0xa1, 0x02, // COLLECTION (Logical) - 0x05, 0x0b, // USAGE_PAGE (Button) - 0x19, 0x20, // USAGE_MINIMUM (Button 1) - 0x29, 0x2f, // USAGE_MAXIMUM (Button 6) - 0x75, 0x08, // REPORT_SIZE (3) - 0x15, 0x00, // LOGICAL_MINIMUM (1) - 0x25, 0x2f, // LOGICAL_MAXIMUM (6) - 0x81, 0x00, // INPUT (Data,Ary,Abs) - 0xc0, // END_COLLECTION - 0xc0 //End collection \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/inputdata.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/inputdata.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -0x01,0x48, -0x00,0x00, -0x00,0x00, -0x01,0x02, -0x02,0x03 \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/localdelimiter.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/localdelimiter.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0xa9, 0x01, // begin delimiter0xa9, 0x00, // end delimiter0xa9, 0x02, // unknown delimiter \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/localdelimiter_lonelydelimiter.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/localdelimiter_lonelydelimiter.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0xa9, 0x00 // end delimiter - lonely delimiter \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/localdelimiter_nesteddelimiter.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/localdelimiter_nesteddelimiter.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0xa1, 0x04, // COLLECTION (CCollection::ENamedArray) - warning 0xa9, 0x01, // begin delimiter0xa9, 0x01 // begin delimiter - nested \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/localdesignatorindex.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/localdesignatorindex.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x39, 0xc8,0x39, 0xc8,0xa9, 0x01, // begin delimiter0x39, 0xc8, // ELocalDesignatorIndex (200)0xc0 // END_COLLECTION \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/localdesignatormaximum.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/localdesignatormaximum.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x59, 0xc8,0x59, 0xc8,0xa9, 0x01, // begin delimiter0x59, 0xc8, // (200)0xc0 // END_COLLECTION \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/localdesignatorminimum.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/localdesignatorminimum.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x49, 0xc8,0x49, 0xc8,0xa9, 0x01, // begin delimiter0x49, 0xc8, // (200)0xc0 // END_COLLECTION \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/localitem_unknown.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/localitem_unknown.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0xf9, 0x01 // unknow item \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/localstringindex.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/localstringindex.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x79, 0xc8,0x79, 0xc8,0xa9, 0x01, // begin delimiter0x79, 0xc8, // (200)0xc0 // END_COLLECTION \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/localstringmaximum.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/localstringmaximum.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x99, 0xc8,0x99, 0xc8,0xa9, 0x01, // begin delimiter0x99, 0xc8, // (200)0xc0 // END_COLLECTION \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/localstringminimum.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/localstringminimum.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x89, 0xc8,0x89, 0xc8,0xa9, 0x01, // begin delimiter0x89, 0xc8, // ELocalDesignatorIndex (200)0xc0 // END_COLLECTION \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/localusage.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/localusage.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x09, 0xc8,0x09, 0x00, // zero usage0xa9, 0x01, // begin delimiter0x09, 0xc8,0x09, 0xc8,0x0B, 0xc8, 0xc9, 0xca, 0xcb, //data size - 40x0B, 0x00, 0x00, 0x00, 0x00, //data size - 40xa9, 0x00 // end delimiter \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/localusagemaximum.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/localusagemaximum.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x29, 0x00,0x19, 0x00, //define usage min to 00x29, 0x00,0xa9, 0x01, // begin delimiter0x29, 0x00,0x29, 0x00,0xa9, 0x00, // end delimiter0x19, 0xc8, //set usage min to 0xc80x29, 0xca,0x2B, 0x00, 0x00, 0x00, 0x00, //data size - 4 \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/localusageminimum.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/localusageminimum.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x19, 0x00,0x29, 0x00, //define usage max to 00x19, 0x00,0xa9, 0x01, // begin delimiter0x19, 0x00,0x19, 0x00,0xa9, 0x00, // end delimiter0x29, 0xca, //set usage max to 0xca0x19, 0xc8,0x1B, 0xc8, 0xc9, 0xca, 0xcb, //data size - 4 \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/longitem.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/longitem.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x0C //long item \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/mainfeature.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/mainfeature.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -0xB1, 0x01, // main feature - -0x39, 0xc8, -0x39, 0xc8, //local designator index - set iLocalMultipleUse - -0xB1, 0x01, // main feature -0xB2, 0xff, 0xff, // main feature - EOutputReservedBitsNonZero - -//0xa9, 0x01, // begin delimiter - set iWithinDelimiter -//0xB2, 0xff, 0xff, // main feature EOutputReservedBitsNonZero -//0xa9, 0x00 // end delimiter \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/mainitem_unknown.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/mainitem_unknown.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0xF0 //main item - unknown \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/mainoutputtag.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/mainoutputtag.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -0x91, 0x01, // main output tag - -0x39, 0xc8, -0x39, 0xc8, //local designator index - set iLocalMultipleUse - -0x91, 0x01, // main output tag -0x92, 0xff, 0xff, // main output tag EOutputReservedBitsNonZero - -//0xa9, 0x01, // begin delimiter - set iWithinDelimiter -//0x91, 0x01, // main output tag -//0xa9, 0x00 // end delimiter \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/multipagec.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/multipagec.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ - - 0x95, 0x01, //Report count 1 - 0x05, 0x0c, //Usage page telephony - 0x09, 0x01, // Usage Phone - 0xa1, 0x01, // COLLECTION (Application) - 0x85, 0x01, // Report id 1 - 0x09, 0x01, // USAGE (Programmable Button) - 0xa1, 0x02, // COLLECTION (Logical) - 0x05, 0x0c, // USAGE_PAGE (Button) - 0x19, 0x00, // USAGE_MINIMUM (Button 1) - 0x29, 0x2f, // USAGE_MAXIMUM (Button 6) - 0x75, 0x08, // REPORT_SIZE (3) - 0x15, 0x00, // LOGICAL_MINIMUM (1) - 0x25, 0x06, // LOGICAL_MAXIMUM (6) - 0x81, 0x00, // INPUT (Data,Ary,Abs) - 0xc0, // END_COLLECTION - 0xa1, 0x02, // COLLECTION (Logical) - 0x05, 0x0b, // USAGE_PAGE (Button) - 0x19, 0x20, // USAGE_MINIMUM (Button 1) - 0x29, 0x2f, // USAGE_MAXIMUM (Button 6) - 0x75, 0x08, // REPORT_SIZE (3) - 0x15, 0x00, // LOGICAL_MINIMUM (1) - 0x25, 0x2f, // LOGICAL_MAXIMUM (6) - 0x81, 0x00, // INPUT (Data,Ary,Abs) - 0xc0, // END_COLLECTION - 0xc0, //End collection -0x05, 0x01, // USAGE_PAGE (Generic Desktop) -0x09, 0x02, // USAGE (Mouse) -0xa1, 0x01, // COLLECTION (Application) -0x85, 0x02, // Report id 2 -0x09, 0x01, // USAGE (Pointer) -0xa1, 0x00, // COLLECTION (Physical) -0x05, 0x09, // USAGE_PAGE (Button) -0x19, 0x01, // USAGE_MINIMUM (Button 1) -0x29, 0x03, // USAGE_MAXIMUM (Button 3) -0x15, 0x00, // LOGICAL_MINIMUM (0) -0x25, 0x01, // LOGICAL_MAXIMUM (1) -0x95, 0x03, // REPORT_COUNT (3) -0x75, 0x01, // REPORT_SIZE (1) -0x81, 0x02, // INPUT (Data,Var,Abs) -0x95, 0x01, // REPORT_COUNT (1) -0x75, 0x05, // REPORT_SIZE (5) -0x81, 0x03, // INPUT (Cnst,Var,Abs) -0x05, 0x01, // USAGE_PAGE (Generic Desktop) -0x09, 0x30, // USAGE (X) -0x09, 0x31, // USAGE (Y) -0x15, 0x81, // LOGICAL_MINIMUM (-127) -0x25, 0x7f, // LOGICAL_MAXIMUM (127) -0x75, 0x08, // REPORT_SIZE (8) -0x95, 0x02, // REPORT_COUNT (2) -0x81, 0x06, // INPUT (Data,Var,Rel) -0xc0, // END_COLLECTION -0xc0 // END_COLLECTION \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/multipagein.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/multipagein.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -0x01,0x48, -0x00 \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/multiple_usage_page_connect.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/multiple_usage_page_connect.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ - 0x05, 0x0c, // Global usage page 12 - 0x09, 0x01, // Local usage page 1 - 0xa1, 0x01, // Start Application collection - 0x15, 0x00, // Global Locgical minimium - 0x20, 0x01, // Global Locgical maximum - 0x75, 0x01, // Global Report size 1 - 0x09, 0xe9, // Local usage Volume up - 0x09, 0xea, // Local usage Volume down - 0x95, 0x02, // Global Report Count 2 - 0x81, 0x02, // Input 2 First field - 0x05, 0x0b, // Global usage page 11 - 0x09, 0x2f, // Local usage mute - 0x95, 0x01, // Global Report Count 1 - 0x81, 0x06m // Input 6 2. field - 0x81, 0x20, // Local usage hook - 0x95, 0x01, // Global Report Count 1 - 0x81, 0x02, // Input 2 3. field - 0xc0 // End collection \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/mute.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/mute.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x24, 0x01 \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/next.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/next.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0xE0, 0x04 diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/output.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/output.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -// File: Output1.hid.txt -// Output item with no Global or Local items defined - - 0xA1, 0x01, // COLLECTION (Application) -// Output item with no Global or Local items defined - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x09, 0x4B, // USAGE (Generic indicator) - 0x95, 0x01, // REPORT_COUNT (1) - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x95, 0x04, // REPORT_COUNT (4) - 0x91, 0x01, // OUTPUT (Cnst,Ary,Abs) - 0x05, 0x07, // USAGE_PAGE (Keyboard) - 0x19, 0xE0, // USAGE_MINIMUM (Keyboard LeftControl) - 0x29, 0xE7, // USAGE_MAXIMUM (Keyboard Right GUI) - 0x95, 0x08, // REPORT_COUNT (8) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x08, // REPORT_SIZE (8) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0x19, 0x00, // USAGE_MINIMUM (No event) - 0x29, 0x91, // USAGE_MAXIMUM (Keyboard LANG2) - 0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255) - 0x95, 0x06, // REPORT_COUNT (6) - 0x81, 0x00, // INPUT (Data,Ary,Abs) - 0xC0, // END_COLLECTION diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/output1.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/output1.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -// File: Output1.hid.txt -// Output item with no Global or Local items defined - - 0xA1, 0x01, // COLLECTION (Application) -// Output item with no Global or Local items defined - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x09, 0x4B, // USAGE (Generic indicator) - 0x95, 0x01, // REPORT_COUNT (1) - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x95, 0x04, // REPORT_COUNT (4) - 0x91, 0x01, // OUTPUT (Cnst,Ary,Abs) - 0x05, 0x07, // USAGE_PAGE (Keyboard) - 0x19, 0xE0, // USAGE_MINIMUM (Keyboard LeftControl) - 0x29, 0xE7, // USAGE_MAXIMUM (Keyboard Right GUI) - 0x95, 0x08, // REPORT_COUNT (8) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x08, // REPORT_SIZE (8) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0x19, 0x00, // USAGE_MINIMUM (No event) - 0x29, 0x91, // USAGE_MAXIMUM (Keyboard LANG2) - 0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255) - 0x95, 0x06, // REPORT_COUNT (6) - 0x81, 0x00, // INPUT (Data,Ary,Abs) - 0xC0, // END_COLLECTION diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/physicalmax.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/physicalmax.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -// File: PhysicalMax1.hid.txt -// Physical Max defined, but no Physical Min - - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x09, 0x04, // USAGE (Joystick) - 0xa1, 0x01, // COLLECTION (Application) - 0x05, 0x02, // USAGE_PAGE (Simulation Controls) - 0x09, 0xbb, // USAGE (Throttle) - 0x15, 0x81, // LOGICAL_MINIMUM (-127) - 0x25, 0x7f, // LOGICAL_MAXIMUM (127) - 0x75, 0x08, // REPORT_SIZE (8) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x01, // USAGE (Pointer) - 0xa1, 0x00, // COLLECTION (Physical) - 0x09, 0x30, // USAGE (X) - 0x09, 0x31, // USAGE (Y) - 0x95, 0x02, // REPORT_COUNT (2) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0xc0, // END_COLLECTION - 0x09, 0x39, // USAGE (Hat switch) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x03, // LOGICAL_MAXIMUM (3) -// Physical Max defined, but no Physical Min -// 0x35, 0x00, // PHYSICAL_MINIMUM (0) - 0x46, 0x0e, 0x01, // PHYSICAL_MAXIMUM (270) - 0x65, 0x14, // UNIT (Eng Rot:Angular Pos) - 0x75, 0x04, // REPORT_SIZE (4) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x05, 0x09, // USAGE_PAGE (Button) - 0x19, 0x01, // USAGE_MINIMUM (Button 1) - 0x29, 0x04, // USAGE_MAXIMUM (Button 4) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x04, // REPORT_COUNT (4) - 0x55, 0x00, // UNIT_EXPONENT (0) - 0x65, 0x00, // UNIT (None) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0xc0 // END_COLLECTION -//}; - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/play.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/play.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ - 0xB0, 0x01, - 0x81, 0x01 \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/pop.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/pop.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -// File: Pop1.hid.txt -// Pop defined with no corresponding Push - - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x01, // REPORT_ID (1) - 0x05, 0x08, // USAGE_PAGE (LEDs) - 0x19, 0x01, // USAGE_MINIMUM (Num Lock) - 0x29, 0x03, // USAGE_MAXIMUM (Scroll Lock) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x03, // REPORT_COUNT (3) - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x09, 0x4B, // USAGE (Generic indicator) - 0x95, 0x01, // REPORT_COUNT (1) -// Pop defined with no corresponding Push - 0xb4, // POP - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x95, 0x04, // REPORT_COUNT (4) - 0x91, 0x01, // OUTPUT (Cnst,Ary,Abs) - 0x05, 0x07, // USAGE_PAGE (Keyboard) - 0x19, 0xE0, // USAGE_MINIMUM (Keyboard LeftControl) - 0x29, 0xE7, // USAGE_MAXIMUM (Keyboard Right GUI) - 0x95, 0x08, // REPORT_COUNT (8) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x08, // REPORT_SIZE (8) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0x19, 0x00, // USAGE_MINIMUM (No event) - 0x29, 0x91, // USAGE_MAXIMUM (Keyboard LANG2) - 0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255) - 0x95, 0x06, // REPORT_COUNT (6) - 0x81, 0x00, // INPUT (Data,Ary,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x02, // REPORT_ID (2) - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x1C, // REPORT_COUNT (28) - 0x09, 0xE2, // USAGE (Mute) - 0x09, 0xB7, // USAGE (Stop) - 0x09, 0xCD, // USAGE (Play/pause) - 0x09, 0xEA, // USAGE (Volume Down) - 0x09, 0xE9, // USAGE (Volume Up) - 0x09, 0xB6, // USAGE (Scan Previous Track) - 0x09, 0xB5, // USAGE (Scan Next Track) - 0x0A, 0x83, 0x01, // USAGE (Control config) - 0x0A, 0x1A, 0x02, // USAGE (Undo) - 0x0A, 0x79, 0x02, // USAGE (Redo) - 0x0A, 0xAB, 0x01, // USAGE (Spell check) - 0x0A, 0x08, 0x02, // USAGE (Print) - 0x0A, 0x02, 0x02, // USAGE (Open) - 0x0A, 0x03, 0x02, // USAGE (Close) - 0x0A, 0x07, 0x02, // USAGE (Save) - 0x0A, 0x01, 0x02, // USAGE (New) - 0x0A, 0x92, 0x01, // USAGE (Calculator) - 0x0A, 0x9C, 0x01, // USAGE (Logoff) - 0x09, 0x95, // USAGE (Help) - 0x0A, 0x23, 0x02, // USAGE (Home) - 0x0A, 0x89, 0x02, // USAGE (Reply) - 0x0A, 0x8B, 0x02, // USAGE (Sendto - 0x0A, 0x8C, 0x02, // USAGE (Send) - 0x0A, 0x8A, 0x01, // USAGE (Email - 0x0A, 0x99, 0x01, // USAGE (Chat) - 0x0A, 0xA7, 0x01, // USAGE (Documents) - 0x0A, 0xB6, 0x01, // USAGE (Unknown 0x01b6) - 0x0A, 0xB7, 0x01, // USAGE (Unknown 0x01b7) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x04, // REPORT_COUNT (4) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x0A, 0x02, 0xFF, // USAGE (Unknown 0xff02) - 0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x08, // REPORT_SIZE (8) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x80, // USAGE (System Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x03, // REPORT_ID (3) - 0x19, 0x81, // USAGE_MINIMUM (System Power Down) - 0x29, 0x83, // USAGE_MAXIMUM (System Wake Up) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x95, 0x03, // REPORT_COUNT (3) - 0x75, 0x01, // REPORT_SIZE (1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x95, 0x05, // REPORT_COUNT (5) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x04, // REPORT_ID (4) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x02, // COLLECTION (Logical) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x03, // LOGICAL_MAXIMUM (3) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x02, // REPORT_SIZE (2) - 0x0A, 0x01, 0xFE, // USAGE (Unknown 1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x06, // REPORT_SIZE (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x05, // REPORT_ID (5) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x02, // COLLECTION (Logical) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x02, // REPORT_COUNT (2) - 0x0A, 0x03, 0xFE, // USAGE (Unknown 0xfe03) - 0x0A, 0x04, 0xFE, // USAGE (Unknown 0xfe04) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x95, 0x06, // REPORT_COUNT (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0xFF, // REPORT_ID (255) - 0x05, 0x06, // USAGE_PAGE (Generic Device Controls) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x02, // REPORT_SIZE (2) - 0x19, 0x24, // USAGE_MINIMUM (Unknown 0x24) - 0x29, 0x26, // USAGE_MAXIMUM (Unknown 0x26) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x06, // REPORT_SIZE (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0 // END_COLLECTION -// }; diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/prev.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/prev.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ - 0x40, 0x02 diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/push.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/push.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -// File: Push1.hid.txt -// Push defined with no corresponding Pop - - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x01, // REPORT_ID (1) - 0x05, 0x08, // USAGE_PAGE (LEDs) - 0x19, 0x01, // USAGE_MINIMUM (Num Lock) - 0x29, 0x03, // USAGE_MAXIMUM (Scroll Lock) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x03, // REPORT_COUNT (3) - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x09, 0x4B, // USAGE (Generic indicator) - 0x95, 0x01, // REPORT_COUNT (1) -// Push defined with no corresponding Pop - 0xa4, // PUSH - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x95, 0x04, // REPORT_COUNT (4) - 0x91, 0x01, // OUTPUT (Cnst,Ary,Abs) - 0x05, 0x07, // USAGE_PAGE (Keyboard) - 0x19, 0xE0, // USAGE_MINIMUM (Keyboard LeftControl) - 0x29, 0xE7, // USAGE_MAXIMUM (Keyboard Right GUI) - 0x95, 0x08, // REPORT_COUNT (8) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x08, // REPORT_SIZE (8) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0x19, 0x00, // USAGE_MINIMUM (No event) - 0x29, 0x91, // USAGE_MAXIMUM (Keyboard LANG2) - 0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255) - 0x95, 0x06, // REPORT_COUNT (6) - 0x81, 0x00, // INPUT (Data,Ary,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x02, // REPORT_ID (2) - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x1C, // REPORT_COUNT (28) - 0x09, 0xE2, // USAGE (Mute) - 0x09, 0xB7, // USAGE (Stop) - 0x09, 0xCD, // USAGE (Play/pause) - 0x09, 0xEA, // USAGE (Volume Down) - 0x09, 0xE9, // USAGE (Volume Up) - 0x09, 0xB6, // USAGE (Scan Previous Track) - 0x09, 0xB5, // USAGE (Scan Next Track) - 0x0A, 0x83, 0x01, // USAGE (Control config) - 0x0A, 0x1A, 0x02, // USAGE (Undo) - 0x0A, 0x79, 0x02, // USAGE (Redo) - 0x0A, 0xAB, 0x01, // USAGE (Spell check) - 0x0A, 0x08, 0x02, // USAGE (Print) - 0x0A, 0x02, 0x02, // USAGE (Open) - 0x0A, 0x03, 0x02, // USAGE (Close) - 0x0A, 0x07, 0x02, // USAGE (Save) - 0x0A, 0x01, 0x02, // USAGE (New) - 0x0A, 0x92, 0x01, // USAGE (Calculator) - 0x0A, 0x9C, 0x01, // USAGE (Logoff) - 0x09, 0x95, // USAGE (Help) - 0x0A, 0x23, 0x02, // USAGE (Home) - 0x0A, 0x89, 0x02, // USAGE (Reply) - 0x0A, 0x8B, 0x02, // USAGE (Sendto - 0x0A, 0x8C, 0x02, // USAGE (Send) - 0x0A, 0x8A, 0x01, // USAGE (Email - 0x0A, 0x99, 0x01, // USAGE (Chat) - 0x0A, 0xA7, 0x01, // USAGE (Documents) - 0x0A, 0xB6, 0x01, // USAGE (Unknown 0x01b6) - 0x0A, 0xB7, 0x01, // USAGE (Unknown 0x01b7) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x04, // REPORT_COUNT (4) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x0A, 0x02, 0xFF, // USAGE (Unknown 0xff02) - 0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x08, // REPORT_SIZE (8) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x80, // USAGE (System Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x03, // REPORT_ID (3) - 0x19, 0x81, // USAGE_MINIMUM (System Power Down) - 0x29, 0x83, // USAGE_MAXIMUM (System Wake Up) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x95, 0x03, // REPORT_COUNT (3) - 0x75, 0x01, // REPORT_SIZE (1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x95, 0x05, // REPORT_COUNT (5) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x04, // REPORT_ID (4) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x02, // COLLECTION (Logical) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x03, // LOGICAL_MAXIMUM (3) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x02, // REPORT_SIZE (2) - 0x0A, 0x01, 0xFE, // USAGE (Unknown 1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x06, // REPORT_SIZE (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x05, // REPORT_ID (5) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x02, // COLLECTION (Logical) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x02, // REPORT_COUNT (2) - 0x0A, 0x03, 0xFE, // USAGE (Unknown 0xfe03) - 0x0A, 0x04, 0xFE, // USAGE (Unknown 0xfe04) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x95, 0x06, // REPORT_COUNT (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0xFF, // REPORT_ID (255) - 0x05, 0x06, // USAGE_PAGE (Generic Device Controls) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x02, // REPORT_SIZE (2) - 0x19, 0x24, // USAGE_MINIMUM (Unknown 0x24) - 0x29, 0x26, // USAGE_MAXIMUM (Unknown 0x26) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x06, // REPORT_SIZE (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0 // END_COLLECTION -// }; diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/stop.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/stop.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ - 0xb7, 0x01 \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/string.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/string.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,153 +0,0 @@ -// File: StringMin1.hid.txt -// String Min defined, but no String Max - - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x01, // REPORT_ID (1) - 0x05, 0x08, // USAGE_PAGE (LEDs) - 0x19, 0x01, // USAGE_MINIMUM (Num Lock) - 0x29, 0x03, // USAGE_MAXIMUM (Scroll Lock) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x03, // REPORT_COUNT (3) -// String Min defined, but no String Max - 0x89, 0x01, // STRING_MINIMUM (1) - 0x99, 0x20, // STRING_MAXIMUM (32) - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x09, 0x4B, // USAGE (Generic indicator) - 0x95, 0x01, // REPORT_COUNT (1) - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x95, 0x04, // REPORT_COUNT (4) - 0x91, 0x01, // OUTPUT (Cnst,Ary,Abs) - 0x05, 0x07, // USAGE_PAGE (Keyboard) - 0x19, 0xE0, // USAGE_MINIMUM (Keyboard LeftControl) - 0x29, 0xE7, // USAGE_MAXIMUM (Keyboard Right GUI) - 0x95, 0x08, // REPORT_COUNT (8) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x08, // REPORT_SIZE (8) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0x19, 0x00, // USAGE_MINIMUM (No event) - 0x29, 0x91, // USAGE_MAXIMUM (Keyboard LANG2) - 0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255) - 0x95, 0x06, // REPORT_COUNT (6) - 0x81, 0x00, // INPUT (Data,Ary,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x02, // REPORT_ID (2) - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x1C, // REPORT_COUNT (28) - 0x09, 0xE2, // USAGE (Mute) - 0x09, 0xB7, // USAGE (Stop) - 0x09, 0xCD, // USAGE (Play/pause) - 0x09, 0xEA, // USAGE (Volume Down) - 0x09, 0xE9, // USAGE (Volume Up) - 0x09, 0xB6, // USAGE (Scan Previous Track) - 0x09, 0xB5, // USAGE (Scan Next Track) - 0x0A, 0x83, 0x01, // USAGE (Control config) - 0x0A, 0x1A, 0x02, // USAGE (Undo) - 0x0A, 0x79, 0x02, // USAGE (Redo) - 0x0A, 0xAB, 0x01, // USAGE (Spell check) - 0x0A, 0x08, 0x02, // USAGE (Print) - 0x0A, 0x02, 0x02, // USAGE (Open) - 0x0A, 0x03, 0x02, // USAGE (Close) - 0x0A, 0x07, 0x02, // USAGE (Save) - 0x0A, 0x01, 0x02, // USAGE (New) - 0x0A, 0x92, 0x01, // USAGE (Calculator) - 0x0A, 0x9C, 0x01, // USAGE (Logoff) - 0x09, 0x95, // USAGE (Help) - 0x0A, 0x23, 0x02, // USAGE (Home) - 0x0A, 0x89, 0x02, // USAGE (Reply) - 0x0A, 0x8B, 0x02, // USAGE (Sendto - 0x0A, 0x8C, 0x02, // USAGE (Send) - 0x0A, 0x8A, 0x01, // USAGE (Email - 0x0A, 0x99, 0x01, // USAGE (Chat) - 0x0A, 0xA7, 0x01, // USAGE (Documents) - 0x0A, 0xB6, 0x01, // USAGE (Unknown 0x01b6) - 0x0A, 0xB7, 0x01, // USAGE (Unknown 0x01b7) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x04, // REPORT_COUNT (4) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x0A, 0x02, 0xFF, // USAGE (Unknown 0xff02) - 0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x08, // REPORT_SIZE (8) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x80, // USAGE (System Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x03, // REPORT_ID (3) - 0x19, 0x81, // USAGE_MINIMUM (System Power Down) - 0x29, 0x83, // USAGE_MAXIMUM (System Wake Up) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x95, 0x03, // REPORT_COUNT (3) - 0x75, 0x01, // REPORT_SIZE (1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x95, 0x05, // REPORT_COUNT (5) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x04, // REPORT_ID (4) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x02, // COLLECTION (Logical) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x03, // LOGICAL_MAXIMUM (3) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x02, // REPORT_SIZE (2) - 0x0A, 0x01, 0xFE, // USAGE (Unknown 1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x06, // REPORT_SIZE (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x05, // REPORT_ID (5) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x02, // COLLECTION (Logical) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x02, // REPORT_COUNT (2) - 0x0A, 0x03, 0xFE, // USAGE (Unknown 0xfe03) - 0x0A, 0x04, 0xFE, // USAGE (Unknown 0xfe04) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x95, 0x06, // REPORT_COUNT (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0xFF, // REPORT_ID (255) - 0x05, 0x06, // USAGE_PAGE (Generic Device Controls) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x02, // REPORT_SIZE (2) - 0x19, 0x24, // USAGE_MINIMUM (Unknown 0x24) - 0x29, 0x26, // USAGE_MAXIMUM (Unknown 0x26) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x06, // REPORT_SIZE (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0 // END_COLLECTION -// }; diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/stringindex.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/stringindex.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -// File: StringMin1.hid.txt -// String Min defined, but no String Max - - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x01, // REPORT_ID (1) - 0x05, 0x08, // USAGE_PAGE (LEDs) - 0x19, 0x01, // USAGE_MINIMUM (Num Lock) - 0x29, 0x03, // USAGE_MAXIMUM (Scroll Lock) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x03, // REPORT_COUNT (3) -// String Min defined, but no String Max - 0x89, 0x01, // STRING_MINIMUM (1) - 0x99, 0x20, // STRING_MAXIMUM (32) - 0x79, 0x01, // STRING_MINIMUM (1) - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x09, 0x4B, // USAGE (Generic indicator) - 0x95, 0x01, // REPORT_COUNT (1) - 0x91, 0x02, // OUTPUT (Data,Var,Abs) - 0x95, 0x04, // REPORT_COUNT (4) - 0x91, 0x01, // OUTPUT (Cnst,Ary,Abs) - 0x05, 0x07, // USAGE_PAGE (Keyboard) - 0x19, 0xE0, // USAGE_MINIMUM (Keyboard LeftControl) - 0x29, 0xE7, // USAGE_MAXIMUM (Keyboard Right GUI) - 0x95, 0x08, // REPORT_COUNT (8) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x08, // REPORT_SIZE (8) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0x19, 0x00, // USAGE_MINIMUM (No event) - 0x29, 0x91, // USAGE_MAXIMUM (Keyboard LANG2) - 0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255) - 0x95, 0x06, // REPORT_COUNT (6) - 0x81, 0x00, // INPUT (Data,Ary,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x02, // REPORT_ID (2) - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x1C, // REPORT_COUNT (28) - 0x09, 0xE2, // USAGE (Mute) - 0x09, 0xB7, // USAGE (Stop) - 0x09, 0xCD, // USAGE (Play/pause) - 0x09, 0xEA, // USAGE (Volume Down) - 0x09, 0xE9, // USAGE (Volume Up) - 0x09, 0xB6, // USAGE (Scan Previous Track) - 0x09, 0xB5, // USAGE (Scan Next Track) - 0x0A, 0x83, 0x01, // USAGE (Control config) - 0x0A, 0x1A, 0x02, // USAGE (Undo) - 0x0A, 0x79, 0x02, // USAGE (Redo) - 0x0A, 0xAB, 0x01, // USAGE (Spell check) - 0x0A, 0x08, 0x02, // USAGE (Print) - 0x0A, 0x02, 0x02, // USAGE (Open) - 0x0A, 0x03, 0x02, // USAGE (Close) - 0x0A, 0x07, 0x02, // USAGE (Save) - 0x0A, 0x01, 0x02, // USAGE (New) - 0x0A, 0x92, 0x01, // USAGE (Calculator) - 0x0A, 0x9C, 0x01, // USAGE (Logoff) - 0x09, 0x95, // USAGE (Help) - 0x0A, 0x23, 0x02, // USAGE (Home) - 0x0A, 0x89, 0x02, // USAGE (Reply) - 0x0A, 0x8B, 0x02, // USAGE (Sendto - 0x0A, 0x8C, 0x02, // USAGE (Send) - 0x0A, 0x8A, 0x01, // USAGE (Email - 0x0A, 0x99, 0x01, // USAGE (Chat) - 0x0A, 0xA7, 0x01, // USAGE (Documents) - 0x0A, 0xB6, 0x01, // USAGE (Unknown 0x01b6) - 0x0A, 0xB7, 0x01, // USAGE (Unknown 0x01b7) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x04, // REPORT_COUNT (4) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x0A, 0x02, 0xFF, // USAGE (Unknown 0xff02) - 0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x08, // REPORT_SIZE (8) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x80, // USAGE (System Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x03, // REPORT_ID (3) - 0x19, 0x81, // USAGE_MINIMUM (System Power Down) - 0x29, 0x83, // USAGE_MAXIMUM (System Wake Up) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x95, 0x03, // REPORT_COUNT (3) - 0x75, 0x01, // REPORT_SIZE (1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x95, 0x05, // REPORT_COUNT (5) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x04, // REPORT_ID (4) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x02, // COLLECTION (Logical) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x03, // LOGICAL_MAXIMUM (3) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x02, // REPORT_SIZE (2) - 0x0A, 0x01, 0xFE, // USAGE (Unknown 1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x06, // REPORT_SIZE (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0x05, // REPORT_ID (5) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x06, // USAGE (Keyboard) - 0xA1, 0x02, // COLLECTION (Logical) - 0x06, 0x00, 0xFF, // USAGE_PAGE (Vendor Defined Page 1) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x02, // REPORT_COUNT (2) - 0x0A, 0x03, 0xFE, // USAGE (Unknown 0xfe03) - 0x0A, 0x04, 0xFE, // USAGE (Unknown 0xfe04) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x95, 0x06, // REPORT_COUNT (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0, // END_COLLECTION - 0xC0, // END_COLLECTION - //... // - 0x05, 0x0C, // USAGE_PAGE (Consumer Devices) - 0x09, 0x01, // USAGE (Consumer Control) - 0xA1, 0x01, // COLLECTION (Application) - 0x85, 0xFF, // REPORT_ID (255) - 0x05, 0x06, // USAGE_PAGE (Generic Device Controls) - 0x95, 0x01, // REPORT_COUNT (1) - 0x75, 0x02, // REPORT_SIZE (2) - 0x19, 0x24, // USAGE_MINIMUM (Unknown 0x24) - 0x29, 0x26, // USAGE_MAXIMUM (Unknown 0x26) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x75, 0x06, // REPORT_SIZE (6) - 0x81, 0x01, // INPUT (Cnst,Ary,Abs) - 0xC0 // END_COLLECTION -// }; diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/unit.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/unit.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -// File: UnitExponent1.hid.txt -// Unit Exponent with non-zero data in the reserved field - - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x09, 0x04, // USAGE (Joystick) - 0xa1, 0x01, // COLLECTION (Application) - 0x05, 0x02, // USAGE_PAGE (Simulation Controls) - 0x09, 0xbb, // USAGE (Throttle) - 0x15, 0x81, // LOGICAL_MINIMUM (-127) - 0x25, 0x7f, // LOGICAL_MAXIMUM (127) - 0x75, 0x08, // REPORT_SIZE (8) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x01, // USAGE (Pointer) - 0xa1, 0x00, // COLLECTION (Physical) - 0x09, 0x30, // USAGE (X) - 0x09, 0x31, // USAGE (Y) - 0x95, 0x02, // REPORT_COUNT (2) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0xc0, // END_COLLECTION - 0x09, 0x39, // USAGE (Hat switch) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x03, // LOGICAL_MAXIMUM (3) - 0x35, 0x00, // PHYSICAL_MINIMUM (0) - 0x46, 0x0e, 0x01, // PHYSICAL_MAXIMUM (270) - 0x65, 0x14, // UNIT (Eng Rot:Angular Pos) - 0x75, 0x04, // REPORT_SIZE (4) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x05, 0x09, // USAGE_PAGE (Button) - 0x19, 0x01, // USAGE_MINIMUM (Button 1) - 0x29, 0x04, // USAGE_MAXIMUM (Button 4) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x04, // REPORT_COUNT (4) - 0x55, 0x00, // UNIT_EXPONENT (16) -// Non-zero data in the Reserved field -// 0x65, 0x00, // UNIT (None) - 0x67, 0x00, 0x00, 0x00, 0x80, // UNIT (Non-zero value in reserverd) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0xc0 // END_COLLECTION diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/unitexponent.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/unitexponent.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -// File: UnitExponent1.hid.txt -// Unit Exponent with non-zero data in the reserved field - - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x09, 0x04, // USAGE (Joystick) - 0xa1, 0x01, // COLLECTION (Application) - 0x05, 0x02, // USAGE_PAGE (Simulation Controls) - 0x09, 0xbb, // USAGE (Throttle) - 0x15, 0x81, // LOGICAL_MINIMUM (-127) - 0x25, 0x7f, // LOGICAL_MAXIMUM (127) - 0x75, 0x08, // REPORT_SIZE (8) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x05, 0x01, // USAGE_PAGE (Generic Desktop) - 0x09, 0x01, // USAGE (Pointer) - 0xa1, 0x00, // COLLECTION (Physical) - 0x09, 0x30, // USAGE (X) - 0x09, 0x31, // USAGE (Y) - 0x95, 0x02, // REPORT_COUNT (2) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0xc0, // END_COLLECTION - 0x09, 0x39, // USAGE (Hat switch) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x03, // LOGICAL_MAXIMUM (3) - 0x35, 0x00, // PHYSICAL_MINIMUM (0) - 0x46, 0x0e, 0x01, // PHYSICAL_MAXIMUM (270) - 0x65, 0x14, // UNIT (Eng Rot:Angular Pos) - 0x75, 0x04, // REPORT_SIZE (4) - 0x95, 0x01, // REPORT_COUNT (1) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0x05, 0x09, // USAGE_PAGE (Button) - 0x19, 0x01, // USAGE_MINIMUM (Button 1) - 0x29, 0x04, // USAGE_MAXIMUM (Button 4) - 0x15, 0x00, // LOGICAL_MINIMUM (0) - 0x25, 0x01, // LOGICAL_MAXIMUM (1) - 0x75, 0x01, // REPORT_SIZE (1) - 0x95, 0x04, // REPORT_COUNT (4) -// Non-zero data in the Reserved field - 0x55, 0x10, // UNIT_EXPONENT (16) - 0x65, 0x00, // UNIT (None) - 0x81, 0x02, // INPUT (Data,Var,Abs) - 0xc0 // END_COLLECTION diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/voldown.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/voldown.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x22, 0x01 \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/data/volup.hid --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/data/volup.hid Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -0x21,0x01 \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/eabi/GenericHidTestU.def --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/eabi/GenericHidTestU.def Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z9LibEntryLR13CTestModuleIf @ 1 NONAME - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/group/CHidDriverPlugin.mmp --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/group/CHidDriverPlugin.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2007 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: -* -*/ - -#include - -//CAPABILITY CAP_ECOM_PLUGIN -CAPABILITY CAP_APPLICATION CommDD ProtServ - -VENDORID VID_DEFAULT - -TARGET chiddriverplugin.dll -TARGETTYPE PLUGIN -UID 0x10009D8D 0xE000B181 - -SOURCEPATH ../src -SOURCE CHidDriverPluginProxy.cpp -SOURCE CHidDriverPlugin.cpp - -USERINCLUDE ../inc -USERINCLUDE ../../../inc - -SYSTEMINCLUDE /epoc32/include/ecom -MW_LAYER_SYSTEMINCLUDE - - -START RESOURCE ../data/E000B181.RSS -TARGET chiddriverplugin.rsc -END - -LIBRARY ECom.lib -LIBRARY euser.lib -LIBRARY generichid.lib - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/group/GenericHidTest.mmp --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/group/GenericHidTest.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/*TYPE TESTCLASS*/ -/* -* Copyright (c) 2008-2009 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: -* -*/ - - -#if defined(__S60_) - // To get the OSEXT_LAYER_SYSTEMINCLUDE-definition - #include -#endif - -TARGET GenericHidTest.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E3 - -//CAPABILITY ALL -TCB -CAPABILITY CAP_APPLICATION CommDD ProtServ - -DEFFILE GenericHidTest.def - -MW_LAYER_SYSTEMINCLUDE - -USERINCLUDE ../inc -USERINCLUDE ../../../inc - -SYSTEMINCLUDE /epoc32/include/internal - -SOURCEPATH ../src -SOURCE GenericHidTest.cpp -SOURCE GenericHidTestBlocks.cpp -SOURCE tGenericHIDAPI.cpp -SOURCE tdialclient.cpp -SOURCE alarmcontrol.cpp -SOURCE timer.cpp -SOURCE CHidDriverPlugin.cpp - -LIBRARY euser.lib -LIBRARY stiftestinterface.lib -LIBRARY stiftestengine.lib - -LIBRARY sysutil.lib -LIBRARY efsrv.lib -LIBRARY generichid.lib -LIBRARY etel3rdparty.lib -LIBRARY alarmclient.lib -LIBRARY alarmshared.lib - - -LANG SC - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/group/GenericHidTest_ats.pkg --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/group/GenericHidTest_ats.pkg Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,171 +0,0 @@ -; -; Copyright (c) 2008-2009 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: -; -; - -; Languages -&EN - -; Provide value for uid -#{"STIF"},(0x00000000),1,1,0,TYPE=SA - -; Series60 product id for S60 5.1 -[0x10283160], 0, 0, 0, {"Series60ProductID"} - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -; Logo -; None - -; Package signature - Optional -; None - -; Start of Package body - -; Condition blocks -; None - -; Options list -; None - -; Install files -"\epoc32\release\armv5\udeb\GenericHidTest.dll"-"c:\Sys\Bin\GenericHidTest.dll" -"\epoc32\release\armv5\udeb\GenericHidTest.exe" - "C:\Sys\Bin\GenericHidTest.exe" - -"\epoc32\release\armv5\udeb\chiddriverplugin.dll"-"C:\Sys\Bin\chiddriverplugin.dll" -"\epoc32\data\Z\resource\plugins\chiddriverplugin.rsc"-"C:\resource\plugins\chiddriverplugin.rsc" - -"..\init\GenericHidTest_ats.ini"-"e:\testing\init\GenericHidTest.ini" -"..\conf\GenericHidTest.cfg"-"e:\testing\conf\GenericHidTest.cfg" - -"..\data\connectad83.hid"-"c:\data\others\connectad83.hid" -"..\data\delimiter.hid"-"c:\data\others\delimiter.hid" -"..\data\designator.hid"-"c:\data\others\designator.hid" -"..\data\designatorindex.hid"-"c:\data\others\designatorindex.hid" -"..\data\dummyconnect.hid"-"c:\data\others\dummyconnect.hid" -"..\data\empty.hid"-"c:\data\others\empty.hid" -"..\data\feature.hid"-"c:\data\others\feature.hid" -"..\data\feature1.hid"-"c:\data\others\feature1.hid" -"..\data\headsetcon2.hid"-"c:\data\others\headsetcon2.hid" -"..\data\headsetconnect.hid"-"c:\data\others\headsetconnect.hid" -"..\data\headsetvolumeup.hid"-"c:\data\others\headsetvolumeup.hid" -"..\data\headsetvolumeupm.hid"-"c:\data\others\headsetvolumeupm.hid" -"..\data\hook.hid"-"c:\data\others\hook.hid" -"..\data\hookconnect.hid"-"c:\data\others\hookconnect.hid" -"..\data\inputdata.hid"-"c:\data\others\inputdata.hid" -"..\data\multipagec.hid"-"c:\data\others\multipagec.hid" -"..\data\multipagein.hid"-"c:\data\others\multipagein.hid" -"..\data\multiple_usage_page_connect.hid"-"c:\data\others\multiple_usage_page_connect.hid" -"..\data\mute.hid"-"c:\data\others\mute.hid" -"..\data\next.hid"-"c:\data\others\next.hid" -"..\data\output.hid"-"c:\data\others\output.hid" -"..\data\output1.hid"-"c:\data\others\output1.hid" -"..\data\physicalmax.hid"-"c:\data\others\physicalmax.hid" -"..\data\play.hid"-"c:\data\others\play.hid" -"..\data\pop.hid"-"c:\data\others\pop.hid" -"..\data\prev.hid"-"c:\data\others\prev.hid" -"..\data\push.hid"-"c:\data\others\push.hid" -"..\data\stop.hid"-"c:\data\others\stop.hid" -"..\data\string.hid"-"c:\data\others\string.hid" -"..\data\stringindex.hid"-"c:\data\others\stringindex.hid" -"..\data\unit.hid"-"c:\data\others\unit.hid" -"..\data\unitexponent.hid"-"c:\data\others\unitexponent.hid" -"..\data\voldown.hid"-"c:\data\others\voldown.hid" -"..\data\volup.hid"-"c:\data\others\volup.hid" - -"..\data\localdesignatorindex.hid"-"c:\data\others\localdesignatorindex.hid" -"..\data\localdesignatorminimum.hid"-"c:\data\others\localdesignatorminimum.hid" -"..\data\localdesignatormaximum.hid"-"c:\data\others\localdesignatormaximum.hid" - -"..\data\localstringindex.hid"-"c:\data\others\localstringindex.hid" -"..\data\localstringminimum.hid"-"c:\data\others\localstringminimum.hid" -"..\data\localstringmaximum.hid"-"c:\data\others\localstringmaximum.hid" - -"..\data\localdelimiter.hid"-"c:\data\others\localdelimiter.hid" -"..\data\localdelimiter_lonelydelimiter.hid"-"c:\data\others\localdelimiter_lonelydelimiter.hid" -"..\data\localdelimiter_nesteddelimiter.hid"-"c:\data\others\localdelimiter_nesteddelimiter.hid" - -"..\data\localusage.hid"-"c:\data\others\localusage.hid" -"..\data\localusageminimum.hid"-"c:\data\others\localusageminimum.hid" -"..\data\localusagemaximum.hid"-"c:\data\others\localusagemaximum.hid" - -"..\data\localitem_unknown.hid"-"c:\data\others\localitem_unknown.hid" - -"..\data\globalphysicalmin.hid"-"c:\data\others\globalphysicalmin.hid" -"..\data\globalphysicalmax.hid"-"c:\data\others\globalphysicalmax.hid" -"..\data\globalunit.hid"-"c:\data\others\globalunit.hid" -"..\data\globalunit_smallvalue.hid"-"c:\data\others\globalunit_smallvalue.hid" -"..\data\globalunitexponent.hid"-"c:\data\others\globalunitexponent.hid" -"..\data\globalunitexponent2.hid"-"c:\data\others\globalunitexponent2.hid" -"..\data\globalpush.hid"-"c:\data\others\globalpush.hid" -"..\data\globalpop.hid"-"c:\data\others\globalpop.hid" -"..\data\globalpop_withoutpush.hid"-"c:\data\others\globalpop_withoutpush.hid" -"..\data\globaitem_unknown.hid"-"c:\data\others\globaitem_unknown.hid" - -"..\data\mainoutputtag.hid"-"c:\data\others\mainoutputtag.hid" -"..\data\mainfeature.hid"-"c:\data\others\mainfeature.hid" - -"..\data\longitem.hid"-"c:\data\others\longitem.hid" -"..\data\handleitem_withindelimiter.hid"-"c:\data\others\handleitem_withindelimiter.hid" - -"..\data\mainitem_unknown.hid"-"c:\data\others\mainitem_unknown.hid" - -"..\data\checkusageminandmax.hid"-"c:\data\others\checkusageminandmax.hid" -"..\data\checkusageminandmax2.hid"-"c:\data\others\checkusageminandmax2.hid" -"..\data\checkusageminandmax3.hid"-"c:\data\others\checkusageminandmax3.hid" - -"..\data\checkdesignatorminandmax.hid"-"c:\data\others\checkdesignatorminandmax.hid" -"..\data\checkdesignatorminandmax2.hid"-"c:\data\others\checkdesignatorminandmax2.hid" -"..\data\checkdesignatorminandmax3.hid"-"c:\data\others\checkdesignatorminandmax3.hid" - -"..\data\checkstringminandmax.hid"-"c:\data\others\checkstringminandmax.hid" -"..\data\checkstringminandmax2.hid"-"c:\data\others\checkstringminandmax2.hid" -"..\data\checkstringminandmax3.hid"-"c:\data\others\checkstringminandmax3.hid" - -"..\data\checkmandatoryfieldexistence.hid"-"c:\data\others\checkmandatoryfieldexistence.hid" -"..\data\checkmandatoryfieldexistence2.hid"-"c:\data\others\checkmandatoryfieldexistence2.hid" -"..\data\checkmandatoryfieldexistence3.hid"-"c:\data\others\checkmandatoryfieldexistence3.hid" - -"..\data\checkforfielderrors.hid"-"c:\data\others\checkforfielderrors.hid" -"..\data\checkforfielderrors2.hid"-"c:\data\others\checkforfielderrors2.hid" - -"..\data\checklogicalminandmax.hid"-"c:\data\others\checklogicalminandmax.hid" - -"..\data\checkfieldbitneeded.hid"-"c:\data\others\checkfieldbitneeded.hid" - -"..\data\checkformainerrors.hid"-"c:\data\others\checkformainerrors.hid" -"..\data\checkformainerrors2.hid"-"c:\data\others\checkformainerrors2.hid" -"..\data\checkformainerrors3.hid"-"c:\data\others\checkformainerrors3.hid" - -"..\data\checkparseerrors.hid"-"c:\data\others\checkparseerrors.hid" -"..\data\checkparseerrors2.hid"-"c:\data\others\checkparseerrors2.hid" -"..\data\checkparseerrors3.hid"-"c:\data\others\checkparseerrors3.hid" - -"..\data\checkforcollectionerrors.hid"-"c:\data\others\checkforcollectionerrors.hid" - -; Embedded SIS -; None - -; End of Package body - -; PKG dependencies -; None - -; PKG capabilities -; None diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/group/GenericHidTest_exe.mmp --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/group/GenericHidTest_exe.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/*TYPE TESTCLASS*/ -/* -* Copyright (c) 2008-2009 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: -* -*/ - - -#if defined(__S60_) - #include -#endif - -TARGET GenericHidTest.exe -TARGETTYPE exe -UID 0 0xEF4892C6 - -CAPABILITY LocalServices CommDD - - -MW_LAYER_SYSTEMINCLUDE - -SOURCEPATH ../src - -SOURCE GenericHidTest_exe.cpp - -LIBRARY euser.lib -LIBRARY stiftestinterface.lib - -EPOCSTACKSIZE 40960 - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/group/GenericHidTest_phone.pkg --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/group/GenericHidTest_phone.pkg Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,172 +0,0 @@ -; -; Copyright (c) 2008-2009 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: -; -; - -; Languages -&EN - -; Provide value for uid -#{"STIF"},(0x00000000),1,1,0,TYPE=SA - -; Series60 product id for S60 5.1 -[0x10283160], 0, 0, 0, {"Series60ProductID"} - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -; Logo -; None - -; Package signature - Optional -; None - -; Start of Package body - -; Condition blocks -; None - -; Options list -; None - -; Install files -"\epoc32\release\armv5\udeb\GenericHidTest.dll"-"c:\Sys\Bin\GenericHidTest.dll" -"\epoc32\release\armv5\udeb\GenericHidTest.exe" - "C:\Sys\Bin\GenericHidTest.exe" - -"\epoc32\release\armv5\udeb\chiddriverplugin.dll"-"C:\Sys\Bin\chiddriverplugin.dll" -"\epoc32\data\Z\resource\plugins\chiddriverplugin.rsc"-"C:\resource\plugins\chiddriverplugin.rsc" - -"..\init\GenericHidTest_phone.ini"-"c:\testframework\testframework.ini" -"..\conf\GenericHidTest.cfg"-"c:\testframework\GenericHidTest.cfg" - -"..\data\connectad83.hid"-"c:\data\others\connectad83.hid" -"..\data\delimiter.hid"-"c:\data\others\delimiter.hid" -"..\data\designator.hid"-"c:\data\others\designator.hid" -"..\data\designatorindex.hid"-"c:\data\others\designatorindex.hid" -"..\data\dummyconnect.hid"-"c:\data\others\dummyconnect.hid" -"..\data\empty.hid"-"c:\data\others\empty.hid" -"..\data\feature.hid"-"c:\data\others\feature.hid" -"..\data\feature1.hid"-"c:\data\others\feature1.hid" -"..\data\headsetcon2.hid"-"c:\data\others\headsetcon2.hid" -"..\data\headsetconnect.hid"-"c:\data\others\headsetconnect.hid" -"..\data\headsetvolumeup.hid"-"c:\data\others\headsetvolumeup.hid" -"..\data\headsetvolumeupm.hid"-"c:\data\others\headsetvolumeupm.hid" -"..\data\hook.hid"-"c:\data\others\hook.hid" -"..\data\hookconnect.hid"-"c:\data\others\hookconnect.hid" -"..\data\inputdata.hid"-"c:\data\others\inputdata.hid" -"..\data\multipagec.hid"-"c:\data\others\multipagec.hid" -"..\data\multipagein.hid"-"c:\data\others\multipagein.hid" -"..\data\multiple_usage_page_connect.hid"-"c:\data\others\multiple_usage_page_connect.hid" -"..\data\mute.hid"-"c:\data\others\mute.hid" -"..\data\next.hid"-"c:\data\others\next.hid" -"..\data\output.hid"-"c:\data\others\output.hid" -"..\data\output1.hid"-"c:\data\others\output1.hid" -"..\data\physicalmax.hid"-"c:\data\others\physicalmax.hid" -"..\data\play.hid"-"c:\data\others\play.hid" -"..\data\pop.hid"-"c:\data\others\pop.hid" -"..\data\prev.hid"-"c:\data\others\prev.hid" -"..\data\push.hid"-"c:\data\others\push.hid" -"..\data\stop.hid"-"c:\data\others\stop.hid" -"..\data\string.hid"-"c:\data\others\string.hid" -"..\data\stringindex.hid"-"c:\data\others\stringindex.hid" -"..\data\unit.hid"-"c:\data\others\unit.hid" -"..\data\unitexponent.hid"-"c:\data\others\unitexponent.hid" -"..\data\voldown.hid"-"c:\data\others\voldown.hid" -"..\data\volup.hid"-"c:\data\others\volup.hid" -"..\data\UsagePoC.hid"-"c:\data\others\UsagePoC.hid" - -"..\data\localdesignatorindex.hid"-"c:\data\others\localdesignatorindex.hid" -"..\data\localdesignatorminimum.hid"-"c:\data\others\localdesignatorminimum.hid" -"..\data\localdesignatormaximum.hid"-"c:\data\others\localdesignatormaximum.hid" - -"..\data\localstringindex.hid"-"c:\data\others\localstringindex.hid" -"..\data\localstringminimum.hid"-"c:\data\others\localstringminimum.hid" -"..\data\localstringmaximum.hid"-"c:\data\others\localstringmaximum.hid" - -"..\data\localdelimiter.hid"-"c:\data\others\localdelimiter.hid" -"..\data\localdelimiter_lonelydelimiter.hid"-"c:\data\others\localdelimiter_lonelydelimiter.hid" -"..\data\localdelimiter_nesteddelimiter.hid"-"c:\data\others\localdelimiter_nesteddelimiter.hid" - -"..\data\localusage.hid"-"c:\data\others\localusage.hid" -"..\data\localusageminimum.hid"-"c:\data\others\localusageminimum.hid" -"..\data\localusagemaximum.hid"-"c:\data\others\localusagemaximum.hid" - -"..\data\localitem_unknown.hid"-"c:\data\others\localitem_unknown.hid" - -"..\data\globalphysicalmin.hid"-"c:\data\others\globalphysicalmin.hid" -"..\data\globalphysicalmax.hid"-"c:\data\others\globalphysicalmax.hid" -"..\data\globalunit.hid"-"c:\data\others\globalunit.hid" -"..\data\globalunit_smallvalue.hid"-"c:\data\others\globalunit_smallvalue.hid" -"..\data\globalunitexponent.hid"-"c:\data\others\globalunitexponent.hid" -"..\data\globalunitexponent2.hid"-"c:\data\others\globalunitexponent2.hid" -"..\data\globalpush.hid"-"c:\data\others\globalpush.hid" -"..\data\globalpop.hid"-"c:\data\others\globalpop.hid" -"..\data\globalpop_withoutpush.hid"-"c:\data\others\globalpop_withoutpush.hid" -"..\data\globaitem_unknown.hid"-"c:\data\others\globaitem_unknown.hid" - -"..\data\mainoutputtag.hid"-"c:\data\others\mainoutputtag.hid" -"..\data\mainfeature.hid"-"c:\data\others\mainfeature.hid" - -"..\data\longitem.hid"-"c:\data\others\longitem.hid" -"..\data\handleitem_withindelimiter.hid"-"c:\data\others\handleitem_withindelimiter.hid" - -"..\data\mainitem_unknown.hid"-"c:\data\others\mainitem_unknown.hid" - -"..\data\checkusageminandmax.hid"-"c:\data\others\checkusageminandmax.hid" -"..\data\checkusageminandmax2.hid"-"c:\data\others\checkusageminandmax2.hid" -"..\data\checkusageminandmax3.hid"-"c:\data\others\checkusageminandmax3.hid" - -"..\data\checkdesignatorminandmax.hid"-"c:\data\others\checkdesignatorminandmax.hid" -"..\data\checkdesignatorminandmax2.hid"-"c:\data\others\checkdesignatorminandmax2.hid" -"..\data\checkdesignatorminandmax3.hid"-"c:\data\others\checkdesignatorminandmax3.hid" - -"..\data\checkstringminandmax.hid"-"c:\data\others\checkstringminandmax.hid" -"..\data\checkstringminandmax2.hid"-"c:\data\others\checkstringminandmax2.hid" -"..\data\checkstringminandmax3.hid"-"c:\data\others\checkstringminandmax3.hid" - -"..\data\checkmandatoryfieldexistence.hid"-"c:\data\others\checkmandatoryfieldexistence.hid" -"..\data\checkmandatoryfieldexistence2.hid"-"c:\data\others\checkmandatoryfieldexistence2.hid" -"..\data\checkmandatoryfieldexistence3.hid"-"c:\data\others\checkmandatoryfieldexistence3.hid" - -"..\data\checkforfielderrors.hid"-"c:\data\others\checkforfielderrors.hid" -"..\data\checkforfielderrors2.hid"-"c:\data\others\checkforfielderrors2.hid" - -"..\data\checklogicalminandmax.hid"-"c:\data\others\checklogicalminandmax.hid" - -"..\data\checkfieldbitneeded.hid"-"c:\data\others\checkfieldbitneeded.hid" - -"..\data\checkformainerrors.hid"-"c:\data\others\checkformainerrors.hid" -"..\data\checkformainerrors2.hid"-"c:\data\others\checkformainerrors2.hid" -"..\data\checkformainerrors3.hid"-"c:\data\others\checkformainerrors3.hid" - -"..\data\checkparseerrors.hid"-"c:\data\others\checkparseerrors.hid" -"..\data\checkparseerrors2.hid"-"c:\data\others\checkparseerrors2.hid" -"..\data\checkparseerrors3.hid"-"c:\data\others\checkparseerrors3.hid" - -"..\data\checkforcollectionerrors.hid"-"c:\data\others\checkforcollectionerrors.hid" - -; Embedded SIS -; None - -; End of Package body - -; PKG dependencies -; None - -; PKG capabilities -; None diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/group/bld.inf --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* -* Copyright (c) 2008-2009 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 file -* -*/ - - - -PRJ_PLATFORMS -DEFAULT - -PRJ_TESTEXPORTS - -PRJ_EXPORTS - -PRJ_TESTMMPFILES -GenericHidTest.mmp -GenericHidTest_exe.mmp -CHidDriverPlugin.mmp - - -PRJ_MMPFILES - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/group/build_sis_ats.bat --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/group/build_sis_ats.bat Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -@rem -@rem Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: Test script config file -@rem -@rem - - -call bldmake bldfiles -call abld test build armv5 -call makesis GenericHidTest_ats.pkg -call signsis GenericHidTest_ats.sis GenericHidTest_ats.sisx rd.cer rd-key.pem diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/group/build_sis_phone.bat --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/group/build_sis_phone.bat Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -@rem -@rem Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: Test script config file -@rem -@rem - -rd /q /s x:\epoc32\build -del GenericHidTest_phone.sisx - -call bldmake bldfiles -call abld test build armv5 udeb -call makesis GenericHidTest_phone.pkg -call signsis GenericHidTest_phone.sis GenericHidTest_phone.sisx rd.cer rd-key.pem - -del GenericHidTest_phone.sis -call pause \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/inc/CHidDriverPlugin.h --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/inc/CHidDriverPlugin.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2005 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: -* -*/ - - -#ifndef REFERENCE_HIDDRIVER_IMPL_H -#define REFERENCE_HIDDRIVER_IMPL_H - -#include - -NONSHARABLE_CLASS(CHidDriverPlugin) : public CHidDriver - { - public: - - /** - * Two-phased constructor. - */ - static CHidDriverPlugin* NewL(MDriverAccess* aHid); - - TInt CanHandleReportL(CReportRoot* aReportDescriptor); - - TInt DataIn(CHidTransport::THidChannelType aChannel, - const TDesC8& aPayload); - - void Disconnected(TInt aReason); - void InitialiseL(TInt aConnectionId); - void StartL(TInt aConnectionId); - void Stop(); - void CommandResult(TInt aCmdAck); - TInt SupportedFieldCount(); - void SetInputHandlingReg(CHidInputDataHandlingReg* aHandlingReg); - -private: - CHidDriverPlugin(); - -private: // Data - - }; - -#endif // REFERENCE_HIDDRIVER_IMPL_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/inc/GenericHidTest.h --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/inc/GenericHidTest.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,377 +0,0 @@ -/* -* Copyright (c) 2008-2009 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: -* -*/ - - - - -#ifndef GENERICHIDTEST_H -#define GENERICHIDTEST_H - -// INCLUDES -#include -#include -#include -#include - -#include "hidparser.h" - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def -#define TEST_CLASS_VERSION_MAJOR 0 -#define TEST_CLASS_VERSION_MINOR 0 -#define TEST_CLASS_VERSION_BUILD 0 - -#ifdef STIF_LOG -#undef STIF_LOG -#endif - -#define STIF_LOG( s )\ - {\ - TBuf traceBuf;\ - traceBuf.Append( _L( "[STIF_LOG] " ) );\ - traceBuf.Append( _L( s ) );\ - iLog->Log( _L( s ) );\ - RDebug::Print( traceBuf );\ - } - -#define STIF_LOG1( s, v ) \ - {\ - TBuf traceBuf;\ - traceBuf.Append( _L( "[STIF_LOG] " ) );\ - traceBuf.Append( _L( s ) );\ - iLog->Log( _L( s ), v );\ - RDebug::Print( traceBuf, v );\ - } - -#define STIF_LOG2( s, v1, v2 ) \ - {\ - TBuf traceBuf;\ - traceBuf.Append( _L( "[STIF_LOG] " ) );\ - traceBuf.Append( _L( s ) );\ - iLog->Log( _L( s ), v1, v2 );\ - RDebug::Print( traceBuf, v1, v2 );\ - } - -#define STIF_LOG3( s, v1, v2, v3 ) \ - {\ - TBuf traceBuf;\ - traceBuf.Append( _L( "[STIF_LOG] " ) );\ - traceBuf.Append( _L( s ) );\ - iLog->Log( _L( s ), v1, v2, v3 );\ - RDebug::Print( traceBuf, v1, v2, v3 );\ - } - -// Logging path -//_LIT( KGenericHidTestLogPath, "\\logs\\testframework\\GenericHidTest\\" ); - -// Logging path for ATS - for phone builds comment this line -_LIT( KGenericHidTestLogPath, "e:\\testing\\stiflogs\\" ); - -// Log file -_LIT( KGenericHidTestLogFile, "GenericHidTest.txt" ); -_LIT( KGenericHidTestLogFileWithTitle, "GenericHidTest_[%S].txt" ); - -// FUNCTION PROTOTYPES -//?type ?function_name(?arg_list); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; -class CGenericHidTest; - -class CHidTestLogger; -class CtGenericHIDAPI; -//class CMediaControl; -class CDialClient; -class CAlarmControl; - -// DATA TYPES -//enum ?declaration - -enum TGenericHidTestResult - { - ETestCasePassed, - ETestCaseFailed - }; - -//typedef ?declaration -//extern ?data_type; - -// CLASS DECLARATION - -NONSHARABLE_CLASS( TGenericHidTestBlockParams ) - { - public: - TPtrC iTestBlockName; - - TPtrC iTestOption1; - TPtrC iTestOption2; - TPtrC iTestOption3; - - TInt iTestIntOption1; - TInt iTestIntOption2; - - TChar iTestCharOption1; - TChar iTestCharOption2; - }; - -/** -* CGenericHidTest test class for STIF Test Framework TestScripter. -* ?other_description_lines -* -* @lib ?library -* @since ?Series60_version -*/ -NONSHARABLE_CLASS( CGenericHidTest ) : public CScriptBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CGenericHidTest* NewL( CTestModuleIf& aTestModuleIf ); - - /** - * Destructor. - */ - virtual ~CGenericHidTest(); - - public: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - public: // Functions from base classes - - /** - * From CScriptBase Runs a script line. - * @since ?Series60_version - * @param aItem Script line containing method name and parameters - * @return Symbian OS error code - */ - virtual TInt RunMethodL( CStifItemParser& aItem ); - - protected: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - protected: // Functions from base classes - - /** - * From ?base_class ?member_description - */ - //?type ?member_function(); - - private: - - /** - * C++ default constructor. - */ - CGenericHidTest( CTestModuleIf& aTestModuleIf ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - // Prohibit copy constructor if not deriving from CBase. - // ?classname( const ?classname& ); - // Prohibit assigment operator if not deriving from CBase. - // ?classname& operator=( const ?classname& ); - - /** - * Frees all resources allocated from test methods. - * @since ?Series60_version - */ - void Delete(); - - /** - * Test methods are listed below. - */ - - virtual TInt ExecuteApiTestBlock( CStifItemParser& aItem ); - virtual TInt ExecuteModuleTestBlock( CStifItemParser& aItem ); - virtual TInt ExecuteBranchTestBlock( CStifItemParser& aItem ); - - /** - * Method used to log version of test class - */ - void SendTestClassVersion(); - - //ADD NEW METHOD DEC HERE - //[TestMethods] - Do not remove - - void GetTestBlockParamsL( CStifItemParser& aItem ); - - void DoExecuteApiTestBlockL( CStifItemParser& aItem, TGenericHidTestResult& aTestResult ); - void DoExecuteModuleTestBlockL( CStifItemParser& aItem, TGenericHidTestResult& aTestResult ); - void DoExecuteBranchTestBlockL( CStifItemParser& aItem, TGenericHidTestResult& aTestResult ); - - void ExampleTestL( TPtrC aTestOption, TPtrC aTestSubOption, - TInt aTestIntOption, TInt aTestCharOption, TGenericHidTestResult& aTestResult ); - - virtual TInt ConnectL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ); - virtual TInt DisconnectL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt DataIn( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ); - virtual TInt WaitL( TPtrC aTestOption, TInt aTestIntOption, TGenericHidTestResult& aTestResult ); - virtual TInt CreateCallL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ); - virtual TInt AddAlarmL( TPtrC aTestOption, TInt aTestIntOption, TGenericHidTestResult& aTestResult ); - virtual TInt DeleteAlarm( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt CountryCodeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt VendorIdL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt ProductIdL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt SetProtocolL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt GetProtocoL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt GetReportL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt SetReportL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ); - virtual TInt DataOutL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult); - virtual TInt GetIdleL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt SetIdleL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - - virtual TInt CommandResultL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt ReportDescriptorL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt CreateReportGeneratorL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt DeleteReportGeneratorL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt ReportGeneratorReportL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt ReportGeneratorSetFieldL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ); - virtual TInt CreateReportTranslatorL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ); - virtual TInt CreateReportTranslator_FieldNullL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ); - virtual TInt CreateReportTranslator_NotArrayL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ); - virtual TInt CreateReportTranslator_FieldCountZeroL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ); - virtual TInt DeleteReportTranslatorL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt ReportTranslatorGetValueL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ); - virtual TInt ReportTranslatorValueL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt ReportTranslatorGetUsageIdL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ); - virtual TInt ReportTranslatorUsageIdL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt ReportTranslatorRawValueL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt ReportTranslatorCountL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ); - - virtual TInt CollectiontypeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt CollectionIsPhysicalL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt CollectionIsLogicalL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt CollectionIsReportL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt CollectionIsNamedArrayL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt CollectionIsUsageSwitchL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt CollectionIsUsageModifierL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - - virtual TInt CollectionIsApplicationL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt CollectionUsagePageL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt CollectionUsageL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt CollectionCollectionCountL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt CollectionFieldCountL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt CollectionCollectionByIndexL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ); - virtual TInt CollectionFieldByIndexL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - - virtual TInt ReportrootReportSizeBytes( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - - virtual TInt FieldLogicalMaxL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldPhysicalMinL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldPhysicalMaxL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldUnitL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldUnitExponentL( TPtrC aTestOption, TGenericHidTestResult& aTestResult); - - virtual TInt FieldCountL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldSizeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldOffsetL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldReportIdL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldIsInReportL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldDesignatorIndexL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldStringIndexL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldUsagePageL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - - virtual TInt FieldHasUsageL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - - virtual TInt FieldUsageArrayL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldUsageL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldUsageCountL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldClearUsageListL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldLastUsageL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ); - - virtual TInt FieldAttributesL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldTypeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldIsVariableL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldIsArrayL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldIsConstantL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldIsDataL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldSetLogicalMinL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldSetLogicalMaxL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldSetPhysicalMinL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldSetPhysicalMaxL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldSetDesignatorMinL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldSetDesignatorMaxL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldSetUsageMinL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldSetUsageMaxL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldSetStringMinL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldSetStringMaxL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - - virtual TInt FieldSetLogicalRangeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldSetUsageRangeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldSetPhysicalRangeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldSetStringRangeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldSetDesignatorRangeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldIsInputL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - - virtual TInt FieldIsOutputL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - virtual TInt FieldIsFeatureL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ); - - HBufC8* ConvertArray(const TPtrC& aFilename); - TUint ConvSingleItem(TBuf8<2>& singleItem); - - public: // Data - // ?one_line_short_description_of_data - //?data_declaration; - - protected: // Data - // ?one_line_short_description_of_data - //?data_declaration; - - private: // Data - TGenericHidTestBlockParams iTestBlockParams; - - CtGenericHIDAPI* iGenericHIDTest; - CDialClient* iDialClient; - CAlarmControl* iAlarmControl; - - CParser* iParser; - // Reserved pointer for future extension - //TAny* iReserved; - - public: // Friend classes - //?friend_class_declaration; - protected: // Friend classes - //?friend_class_declaration; - private: // Friend classes - //?friend_class_declaration; - - }; - -#endif // GENERICHIDTEST_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/inc/alarmcontrol.h --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/inc/alarmcontrol.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2009 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: Dialhandling class for hid test application -* -*/ - - -#ifndef C_ALARMCONTROL_H -#define C_ALARMCONTROL_H - -#include -#include -#include -#include -#include "GenericHidTest.h" - -// RDebug -#include - -NONSHARABLE_CLASS ( CAlarmControl ): public CBase -{ -public: - static CAlarmControl* NewL(CStifLogger* aLogger); - static CAlarmControl* NewLC(CStifLogger* aLogger); - - void CreateClockAlarm( TInt aTime ); - void DeleteAlarm(); -public: - - virtual ~CAlarmControl(); - -private: - CAlarmControl(CStifLogger* aLogger); - void ConstructL(); - - RASCliSession iAlarmServer; - TInt iAlarmID; - CStifLogger * iLog; -}; - -#endif /*ALARMCONTROL_H*/ diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/inc/hidreports.h --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/inc/hidreports.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: HID field descriptor definition -* -*/ - -#ifndef __HIDREPORTS_H -#define __HIDREPORTS_H - - -#include -#include - -const TUint headsetconnnection[]={ - 0x95, 0x01, //Report count 1 - 0x05, 0x0b, //Usage page telephony - 0x09, 0x01, // Usage Phone - 0xa1, 0x02, // Collection (logical) - 0x05, 0x09, //Usage button - 0xc0 //End collection -}; - -#endif - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/inc/tdialclient.h --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/inc/tdialclient.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2009 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: Dialhandling class for hid test application -* -*/ - - -#ifndef TDIALCLIENT_H_ -#define TDIALCLIENT_H_ - -#include -#include - -NONSHARABLE_CLASS ( CDialClient ): public CActive - { - -public: - - static CDialClient* NewL(); - static CDialClient* NewLC(); - - void ConstructL(); - ~CDialClient(); - - void CreateCall(const TDesC& aNumber); - void HangUp(); - - -private: - void RunL(); - void DoCancel(); - -private: - CDialClient(); - - private: - CTelephony* iTelephony; - CTelephony::TCallId iCallId; - CTelephony::TCallParamsV1 iCallParams; - CTelephony::TCallParamsV1Pckg iCallParamsPckg; - CActiveSchedulerWait iSyncWaiter; - TBool iCallStarted; - }; - -#endif /*TDIALCLIENT_H_*/ diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/inc/tgenerichidapi.h --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/inc/tgenerichidapi.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,340 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: HID generic api test class -* -*/ - -#ifndef __TESTGEHERICHIDAPI_H -#define __TESTGEHERICHIDAPI_H - - -#include -#include -#include -#include "hidreportgenerator.h" -#include "hidtranslate.h" - -#include "CHidDriverPlugin.h" -#include "hiduids.h" - - -/** - * HID generic api test class - * - * @lib - * @since S60 v.3.2 - */ -NONSHARABLE_CLASS(CtGenericHIDAPI): public CBase, public MTransportLayer - { - public: - static CtGenericHIDAPI* NewL(); - static CtGenericHIDAPI* NewLC(); - - /** - * Destructor. - */ - virtual ~CtGenericHIDAPI(); - - public: - - /** - * Connect - * - * @since S60 v.3.2 - * @param aConnectionId connection id - * @param aDescriptor report descriptor - * @return None - */ - void ConnectL(TInt aConnectionId, const TDesC8& aDescriptor); - - /** - * Disconnect - * - * @since S60 v.3.2 - * @param aConnectionId a connection id - * @return None - */ - void DisconnectL(TInt aConnectionId); - - /** - * DataIn - * - * @since S60 v.3.2 - * @param aConnectionId connection id - * @param aDescriptor report descriptor - * @return error code - */ - TInt DataInL(TInt aConnectionId, const TDesC8& aDescriptor); - - TInt RunCountryCodeL(); - - TInt RunVendorIdL(); - - TInt RunProductIdL( ); - - TInt RunSetProtocolL(); - - TInt RunGetProtocoL( ); - - TInt RunGetReportL( ); - - TInt RunSetReportL(const TDesC8& aDescriptor ); - - TInt RunDataOutL( const TDesC8& aDescriptor ); - - TInt GetGetIdleL( ); - - TInt RunSetIdleL( ); - - TInt GetCommandResultL( ); - - TInt GetReportDescriptorL(); - - TInt CreateReportGeneratorL(); - - TInt DeleteReportGeneratorL(); - - TInt ReportGeneratorReport(); - - TInt ReportGeneratorSetFieldL( TBool aIsArray, TBool aOutOfRange, TBool aFieldNull, TBool aFieldCountZero, TBool aExistingUsageId, TBool aBadIndex ); - - TInt CreateReportTranslatorL( const TDesC8& aDescriptor, TBool aIsArray, TBool aFieldNull, TBool aFieldCountZero); - - //TInt CreateReportTranslator_FieldNullL( const TDesC8& aDescriptor ); - - TInt DeleteReportTranslatorL( ); - - TInt ReportTranslatorGetValueL( ); - - TInt ReportTranslatorValueL( ); - - TInt ReportTranslatorGetUsageIdL( TBool aBadControlIndex ); - - TInt ReportTranslatorUsageIdL( ); - - TInt ReportTranslatorRawValueL( ); - - TInt ReportTranslatorCountL( ); - - TInt CollectiontypeL( ); - TInt CollectionIsPhysicalL( ); - TInt CollectionIsLogicalL( ); - TInt CollectionIsReportL( ); - TInt CollectionIsNamedArrayL( ); - TInt CollectionIsUsageSwitchL( ); - TInt CollectionIsUsageModifierL( ); - - TInt CollectionIsApplicationL( ); - TInt CollectionUsagePageL( ); - TInt CollectionUsageL( ); - TInt CollectionCollectionCountL( ); - TInt CollectionFieldCountL( ); - TInt CollectionCollectionByIndexL( TBool aPresent ); - TInt CollectionFieldByIndexL( ); - - TInt ReportrootReportSizeBytes( ); - - - TInt FieldLogicalMaxL( ); - TInt FieldPhysicalMinL( ); - TInt FieldPhysicalMaxL( ); - TInt FieldUnitL( ); - TInt FieldUnitExponentL( ); - TInt FieldCountL( ); - TInt FieldSizeL( ); - TInt FieldOffsetL( TBool setReport ); - TInt FieldReportIdL( ); - TInt FieldIsInReportL( ); - TInt FieldUsagePageL( ); - TInt FieldDesignatorIndexL( ); - TInt FieldStringIndexL( ); - TInt FieldHasUsageL( ); - TInt FieldUsageArrayL( ); - TInt FieldUsageL( ); - TInt FieldUsageCountL( ); - TInt FieldClearUsageListL( ); - TInt FieldLastUsageL( TBool empty ); - TInt FieldAttributesL( ); - TInt FieldTypeL( ); - TInt FieldIsArrayL( ); - TInt FieldIsVariableL( ); - TInt FieldIsConstantL( ); - TInt FieldIsDataL( ); - TInt FieldSetLogicalMinL(); - TInt FieldSetLogicalMaxL( ); - TInt FieldSetPhysicalMinL( ); - TInt FieldSetPhysicalMaxL( ); - TInt FieldSetDesignatorMinL( ); - TInt FieldSetDesignatorMaxL( ); - TInt FieldSetUsageMinL( ); - TInt FieldSetUsageMaxL( ); - TInt FieldSetStringMinL( ); - TInt FieldSetStringMaxL( ); - TInt FieldSetLogicalRangeL( ); - TInt FieldSetUsageRangeL( ); - TInt FieldSetPhysicalRangeL( ); - TInt FieldSetStringRangeL( ); - TInt FieldSetDesignatorRangeL( ); - TInt FieldIsInputL( ); - TInt FieldIsOutputL( ); - TInt FieldIsFeatureL( ); - - - -private: //from MTransportLayer - - /** - * Request for the country code of the given device. - * - * @since S60 v3.2 - * @param aConnID The device identifier - * @return country code. - */ - TUint CountryCodeL(TInt aConnID); - - /** - * Request for the vendor identifier for the given device. - * - * @since S60 v3.2 - * @param aConnID The device identifier - * @return vendor id. - */ - TUint VendorIdL(TInt aConnID); - - /** - * Request for the product identifier for the given device. - * - * @since S60 v3.2 - * @param aConnID The device identifier - * @return product id. - */ - TUint ProductIdL(TInt aConnID); - - /** - * Request for the current device report protocol. The protocol will be - * received as a control report via the CHidTransport::DataIn function - * - * @since S60 v3.2 - * @param aConnID The device identifier - * @param aInterface The interface we want to get the protocol from - * @return None. - */ - void GetProtocolL(TInt aConnID, TUint16 aInterface); - - /** - * Request to put the device in the specified protocol - * - * @since S60 v3.2 - * @param aConnID The device identifier - * @param aValue The requested protocol for the device (boot or report) - * @param aInterface The interface we want to set the protocol for - * @return None. - */ - void SetProtocolL(TInt aConnID, TUint16 aValue, - TUint16 aInterface); - - /** - * Request for a device report. The data will be received as a control report - * via the CHidTransport::DataIn function - * - * @since S60 v3.2 - * @param aConnID The device identifier - * @param aReportType The type of report (input/output/feature) requested - * @param aReportID The specific report required - * @param aInterface The interface we want the report from - * @param aLength The expected length of the report buffer - * @return None. - */ - void GetReportL(TInt aConnID, TUint8 aReportType,TUint8 aReportID, - TUint16 aInterface, TUint16 aLength); - - /** - * Request to send a report to a device. The response will be reported via the - * CHidTransport::CommandResult function - * - * @since S60 v3.2 - * @param aConnID The device identifier - * @param aReportType The type of report (input/output/feature) requested - * @param aReportID The specific report required to set - * @param aInterface The interface we want to send the report to - * @param aReport The report payload to be sent to the device - * @return None. - */ - void SetReportL(TInt aConnID, TUint8 aReportType,TUint8 aReportID, - TUint16 aInterface, const TDesC8& aReport); - - /** - * Request to send data to a device. There are no responses to this report from device. - * - * @since S60 v3.2 - * @param aConnID The device identifier - * @param @param aReportID The specific report required - * @param aInterface The interface we want to send the report to - * @param aReport The report payload to be sent to the device - * @return None. - */ - void DataOutL(TInt aConnID, TUint8 aReportID, - TUint16 aInterface, const TDesC8& aReport); - - /** - * Request for the current idle rate of a report from the device. The response - * will be recevied via the CHidTransport::DataIn function - * - * @since S60 v3.2 - * @param aConnID The device identifier - * @param aReportID The specific report to be queried - * @param aInterface The interface we want to query for idle rate - * @return None. - */ - void GetIdleL(TInt aConnID, TUint8 aReportID, - TUint16 aInterface); - - /** - * Request to set the current idle rate for a report on the device. - * The response will be received via the CHidTransport::CommandResult function - * - * @since S60 v3.2 - * @param aConnID The device identifier - * @param aReportID The specific report to be queried - * @param aDuration The time period between idle reports (4ms per bit. An - * interval of 0 disables idle reports so that Interrupt reports are only ever - * received when the reported data has changed - * @param aReportID The specific report to be queried - * @param aInterface The interface we want to query for idle rate - * @return None. - */ - void SetIdleL(TInt aConnID, TUint8 aDuration, TUint8 aReportID, - TUint16 aInterface); - - -private: - CtGenericHIDAPI(); - void ConstructL(); - - const CField* CreateConstCFieldL(); - CField* CreateCFieldL(); - -private: - CGenericHid* iGenHID; - MDriverAccess* iDriverAcces; - CReportGenerator* iReportGenerator; - TReportTranslator* iTranslator; - - CHidDriver* iHidDriver; - - RPointerArray iFieldList; - }; -#endif - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/inc/timer.h --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/inc/timer.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: Hid timeout timer -* -*/ - -#ifndef C_TIMER_H -#define C_TIMER_H - -#include - - -/** - * HID headset driver class - * - * This class will notify an object after a specified timeout. - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS ( CWaitTimer ) : public CTimer - { -public: - /** - * Two-phased constructor. - * @param aPriority priority to use for this timer - * @param aTimeOutNotify object to notify of timeout event - */ - static CWaitTimer* NewL( TTimeIntervalMicroSeconds32 aTimeOutTime ); - - /** - * Two-phased constructor. - * @param aPriority priority to use for this timer - * @param aTimeOutNotify object to notify of timeout event - */ - static CWaitTimer* NewLC(TTimeIntervalMicroSeconds32 aTimeOutTime ); - - /** - * Destructor - */ - ~CWaitTimer(); - -protected: - - /** - * From CTimer - * Invoked when a timeout occurs - * - * @since S60 v3.2 - * @return None. - */ - virtual void RunL(); - -private: - CWaitTimer(); - void ConstructL( TTimeIntervalMicroSeconds32 aTimeOutTime ); - -private: // Member variables - CActiveSchedulerWait iSyncWaiter; - - }; -#endif // C_TIMER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/init/GenericHidTest_ats.ini --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/init/GenericHidTest_ats.ini Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,235 +0,0 @@ -# -# Copyright (c) 2008-2009 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: -# -# - -# -# This is STIF initialization file -# Comment lines start with '#'-character. -# See STIF TestFramework users guide.doc for instructions - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Set following test engine settings: -# - Set Test Reporting mode. TestReportMode's possible values are: -# + 'Summary': Summary of the tested test cases. -# + 'Environment': Hardware and software info. -# + 'TestCases': Test case report. -# + 'FullReport': Set of all above ones. -# + Example 'TestReportMode= Summary TestCases' -# -# - CreateTestReport setting controls report creation mode -# + YES, Test report will created. -# + NO, No Test report. -# -# - File path indicates the base path of the test report. -# - File name indicates the name of the test report. -# -# - File format indicates the type of the test report. -# + TXT, Test report file will be txt type, for example 'TestReport.txt'. -# + HTML, Test report will be html type, for example 'TestReport.html'. -# + XML, Test report will be xml type, for example 'TestReport.xml'. -# Note, that xml format is available only when output is set to FILE. -# -# - File output indicates output source of the test report. -# + FILE, Test report logging to file. -# + RDEBUG, Test report logging to using rdebug. -# -# - File Creation Mode indicates test report overwriting if file exist. -# + OVERWRITE, Overwrites if the Test report file exist. -# + APPEND, Continue logging after the old Test report information if -# report exist. -# - Sets a device reset module's dll name(Reboot). -# + If Nokia specific reset module is not available or it is not correct one -# StifHWResetStub module may use as a template for user specific reset -# module. -# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation -# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02 -# - -[Engine_Defaults] - -TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', - 'TestCases' or 'FullReport' - -CreateTestReport= YES # Possible values: YES or NO - -TestReportFilePath= e:\testing\logs\ -TestReportFileName= GenericHidTest_TestReport - -TestReportFormat= TXT # Possible values: TXT, HTML or XML -TestReportOutput= FILE # Possible values: FILE or RDEBUG -TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND - -DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting - -DisableMeasurement= stifmeasurementdisablenone # Possible values are: - # 'stifmeasurementdisablenone', 'stifmeasurementdisableall' - # 'stifmeasurementplugin01', 'stifmeasurementplugin02', - # 'stifmeasurementplugin03', 'stifmeasurementplugin04', - # 'stifmeasurementplugin05' or 'stifbappeaprofiler' - -Timeout= 0 # Default timeout value for each test case. In milliseconds -UITestingSupport= YES # Possible values: YES or NO -#SeparateProcesses= YES # Possible values: YES or NO (default: NO) -[End_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Module configurations start -# Modules are added between module tags -# tags. Module name is specified after ModuleName= tag, like -# ModuleName= GenericHidTestGenericHidTestGenericHidTest -# Modules might have initialisation file, specified as -# IniFile= c:\testframework\YYYYYY -# Modules might have several configuration files, like -# TestCaseFile= c:\testframework\NormalCases.txt -# TestCaseFile= c:\testframework\SmokeCases.txt -# TestCaseFile= c:\testframework\ManualCases.txt - -# (TestCaseFile is synonym for old term ConfigFile) - -# Following case specifies demo module settings. Demo module -# does not read any settings from file, so tags -# IniFile and TestCaseFile are not used. -# In the simplest case it is enough to specify only the -# name of the test module when adding new test module - -[New_Module] -ModuleName= testscripter -TestCaseFile= e:\testing\conf\GenericHidTest.cfg -[End_Module] - - -# Load testmoduleGenericHidTest, optionally with initialization file and/or test case files -#[New_Module] -#ModuleName= testmodulexxx - -#TestModuleGenericHidTest used initialization file -#IniFile= c:\testframework\init.txt - -#TestModuleGenericHidTest used configuration file(s) -#TestCaseFile= c:\testframework\testcases1.cfg -#TestCaseFile= c:\testframework\testcases2.cfg -#TestCaseFile= c:\testframework\manualtestcases.cfg - -#[End_Module] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Set STIF logging overwrite parameters for Logger. -# Hardware and emulator environment logging path and styles can -# be configured from here to overwrite the Logger's implemented values. -# -# Settings description: -# - Indicates option for creation log directory/directories. If log directory/directories -# is/are not created by user they will make by software. -# + YES, Create log directory/directories if not allready exist. -# + NO, Log directory/directories not created. Only created one is used. -# -# - Overwrite emulator path setting. -# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined -# Logger's path 'D:\\LOGS\\Module\\' with those definition the path -# will be 'C:\LOGS\TestFramework\LOGS\Module\' -# -# - Overwrite emulator's logging format. -# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. -# + HTML, Log file(s) will be html type(s), for example 'Module.html'. -# -# - Overwrited emulator logging output source. -# + FILE, Logging to file(s). -# + RDEBUG, Logging to using rdebug(s). -# -# - Overwrite hardware path setting (Same description as above in emulator path). -# - Overwrite hardware's logging format(Same description as above in emulator format). -# - Overwrite hardware's logging output source(Same description as above in emulator output). -# -# - File Creation Mode indicates file overwriting if file exist. -# + OVERWRITE, Overwrites if file(s) exist. -# + APPEND, Continue logging after the old logging information if file(s) exist. -# -# - Will thread id include to the log filename. -# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. -# + NO, No thread id to log file(s), Example filename 'Module.txt'. -# -# - Will time stamps include the to log file. -# + YES, Time stamp added to each line in log file(s). Time stamp is -# for example'12.Nov.2003 115958 LOGGING INFO' -# + NO, No time stamp(s). -# -# - Will line breaks include to the log file. -# + YES, Each logging event includes line break and next log event is in own line. -# + NO, No line break(s). -# -# - Will event ranking include to the log file. -# + YES, Event ranking number added to each line in log file(s). Ranking number -# depends on environment's tics, for example(includes time stamp also) -# '012 12.Nov.2003 115958 LOGGING INFO' -# + NO, No event ranking. -# -# - Will write log file in unicode format. -# + YES, Log file will be written in unicode format -# + NO, Log will be written as normal, not unicode, file. -# - -[Logger_Defaults] - -#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' -#NOTE: TestEngine and TestServer logging settings cannot change here - -#CreateLogDirectories= YES # Possible values: YES or NO - -#EmulatorBasePath= C:\LOGS\TestFramework\ -#EmulatorFormat= HTML # Possible values: TXT or HTML -#EmulatorOutput= FILE # Possible values: FILE or RDEBUG - -#HardwareBasePath= D:\LOGS\TestFramework\ -#HardwareFormat= HTML # Possible values: TXT or HTML -#HardwareOutput= FILE # Possible values: FILE or RDEBUG - -#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND - -#ThreadIdToLogFile= YES # Possible values: YES or NO -#WithTimeStamp= YES # Possible values: YES or NO -#WithLineBreak= YES # Possible values: YES or NO -#WithEventRanking= YES # Possible values: YES or NO - -#FileUnicode= YES # Possible values: YES or NO -#AddTestCaseTitle= YES # Possible values: YES or NO -[End_Logger_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Set filters to be used by ConsoleUI. -# If you want to use filter with ConsoleUI, simply remove comments -# from section below and provide valid filter entries. -# Each filter line has to start with "filter= " keyword. -# Filter can contain special wildcard characters: -# * which stands for none or any literal; -# ? which stands for single character. -# Filters are not case-sensitive. - -#[Filters] -#filter= *math* -#filter= *radio* -#[End_Filters] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -# End of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/init/GenericHidTest_phone.ini --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/init/GenericHidTest_phone.ini Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,235 +0,0 @@ -# -# Copyright (c) 2008-2009 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: -# -# - -# -# This is STIF initialization file -# Comment lines start with '#'-character. -# See STIF TestFramework users guide.doc for instructions - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Set following test engine settings: -# - Set Test Reporting mode. TestReportMode's possible values are: -# + 'Summary': Summary of the tested test cases. -# + 'Environment': Hardware and software info. -# + 'TestCases': Test case report. -# + 'FullReport': Set of all above ones. -# + Example 'TestReportMode= Summary TestCases' -# -# - CreateTestReport setting controls report creation mode -# + YES, Test report will created. -# + NO, No Test report. -# -# - File path indicates the base path of the test report. -# - File name indicates the name of the test report. -# -# - File format indicates the type of the test report. -# + TXT, Test report file will be txt type, for example 'TestReport.txt'. -# + HTML, Test report will be html type, for example 'TestReport.html'. -# + XML, Test report will be xml type, for example 'TestReport.xml'. -# Note, that xml format is available only when output is set to FILE. -# -# - File output indicates output source of the test report. -# + FILE, Test report logging to file. -# + RDEBUG, Test report logging to using rdebug. -# -# - File Creation Mode indicates test report overwriting if file exist. -# + OVERWRITE, Overwrites if the Test report file exist. -# + APPEND, Continue logging after the old Test report information if -# report exist. -# - Sets a device reset module's dll name(Reboot). -# + If Nokia specific reset module is not available or it is not correct one -# StifHWResetStub module may use as a template for user specific reset -# module. -# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation -# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02 -# - -[Engine_Defaults] - -TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', - 'TestCases' or 'FullReport' - -CreateTestReport= YES # Possible values: YES or NO - -TestReportFilePath= c:\logs\testframework\GenericHidTest\ -TestReportFileName= testreport - -TestReportFormat= TXT # Possible values: TXT, HTML or XML -TestReportOutput= FILE # Possible values: FILE or RDEBUG -TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND - -DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting - -DisableMeasurement= stifmeasurementdisablenone # Possible values are: - # 'stifmeasurementdisablenone', 'stifmeasurementdisableall' - # 'stifmeasurementplugin01', 'stifmeasurementplugin02', - # 'stifmeasurementplugin03', 'stifmeasurementplugin04', - # 'stifmeasurementplugin05' or 'stifbappeaprofiler' - -Timeout= 0 # Default timeout value for each test case. In milliseconds -UITestingSupport= YES # Possible values: YES or NO -#SeparateProcesses= YES # Possible values: YES or NO (default: NO) -[End_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Module configurations start -# Modules are added between module tags -# tags. Module name is specified after ModuleName= tag, like -# ModuleName= GenericHidTestGenericHidTestGenericHidTest -# Modules might have initialisation file, specified as -# IniFile= c:\testframework\YYYYYY -# Modules might have several configuration files, like -# TestCaseFile= c:\testframework\NormalCases.txt -# TestCaseFile= c:\testframework\SmokeCases.txt -# TestCaseFile= c:\testframework\ManualCases.txt - -# (TestCaseFile is synonym for old term ConfigFile) - -# Following case specifies demo module settings. Demo module -# does not read any settings from file, so tags -# IniFile and TestCaseFile are not used. -# In the simplest case it is enough to specify only the -# name of the test module when adding new test module - -[New_Module] -ModuleName= testscripter -TestCaseFile= c:\testframework\GenericHidTest.cfg -[End_Module] - - -# Load testmoduleGenericHidTest, optionally with initialization file and/or test case files -#[New_Module] -#ModuleName= testmodulexxx - -#TestModuleGenericHidTest used initialization file -#IniFile= c:\testframework\init.txt - -#TestModuleGenericHidTest used configuration file(s) -#TestCaseFile= c:\testframework\testcases1.cfg -#TestCaseFile= c:\testframework\testcases2.cfg -#TestCaseFile= c:\testframework\manualtestcases.cfg - -#[End_Module] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Set STIF logging overwrite parameters for Logger. -# Hardware and emulator environment logging path and styles can -# be configured from here to overwrite the Logger's implemented values. -# -# Settings description: -# - Indicates option for creation log directory/directories. If log directory/directories -# is/are not created by user they will make by software. -# + YES, Create log directory/directories if not allready exist. -# + NO, Log directory/directories not created. Only created one is used. -# -# - Overwrite emulator path setting. -# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined -# Logger's path 'D:\\LOGS\\Module\\' with those definition the path -# will be 'C:\LOGS\TestFramework\LOGS\Module\' -# -# - Overwrite emulator's logging format. -# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. -# + HTML, Log file(s) will be html type(s), for example 'Module.html'. -# -# - Overwrited emulator logging output source. -# + FILE, Logging to file(s). -# + RDEBUG, Logging to using rdebug(s). -# -# - Overwrite hardware path setting (Same description as above in emulator path). -# - Overwrite hardware's logging format(Same description as above in emulator format). -# - Overwrite hardware's logging output source(Same description as above in emulator output). -# -# - File Creation Mode indicates file overwriting if file exist. -# + OVERWRITE, Overwrites if file(s) exist. -# + APPEND, Continue logging after the old logging information if file(s) exist. -# -# - Will thread id include to the log filename. -# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. -# + NO, No thread id to log file(s), Example filename 'Module.txt'. -# -# - Will time stamps include the to log file. -# + YES, Time stamp added to each line in log file(s). Time stamp is -# for example'12.Nov.2003 115958 LOGGING INFO' -# + NO, No time stamp(s). -# -# - Will line breaks include to the log file. -# + YES, Each logging event includes line break and next log event is in own line. -# + NO, No line break(s). -# -# - Will event ranking include to the log file. -# + YES, Event ranking number added to each line in log file(s). Ranking number -# depends on environment's tics, for example(includes time stamp also) -# '012 12.Nov.2003 115958 LOGGING INFO' -# + NO, No event ranking. -# -# - Will write log file in unicode format. -# + YES, Log file will be written in unicode format -# + NO, Log will be written as normal, not unicode, file. -# - -[Logger_Defaults] - -#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' -#NOTE: TestEngine and TestServer logging settings cannot change here - -#CreateLogDirectories= YES # Possible values: YES or NO - -#EmulatorBasePath= C:\LOGS\TestFramework\ -#EmulatorFormat= HTML # Possible values: TXT or HTML -#EmulatorOutput= FILE # Possible values: FILE or RDEBUG - -#HardwareBasePath= D:\LOGS\TestFramework\ -#HardwareFormat= HTML # Possible values: TXT or HTML -#HardwareOutput= FILE # Possible values: FILE or RDEBUG - -#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND - -#ThreadIdToLogFile= YES # Possible values: YES or NO -#WithTimeStamp= YES # Possible values: YES or NO -#WithLineBreak= YES # Possible values: YES or NO -#WithEventRanking= YES # Possible values: YES or NO - -#FileUnicode= YES # Possible values: YES or NO -#AddTestCaseTitle= YES # Possible values: YES or NO -[End_Logger_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Set filters to be used by ConsoleUI. -# If you want to use filter with ConsoleUI, simply remove comments -# from section below and provide valid filter entries. -# Each filter line has to start with "filter= " keyword. -# Filter can contain special wildcard characters: -# * which stands for none or any literal; -# ? which stands for single character. -# Filters are not case-sensitive. - -#[Filters] -#filter= *math* -#filter= *radio* -#[End_Filters] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -# End of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/src/CHidDriverPlugin.cpp --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/src/CHidDriverPlugin.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* Copyright (c) 2007 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: -* -*/ - - - -#include "CHidDriverPlugin.h" - -CHidDriverPlugin* CHidDriverPlugin::NewL(MDriverAccess* /*aHid*/) - { - CHidDriverPlugin* self = new (ELeave) CHidDriverPlugin(); - return self; - } - - -CHidDriverPlugin::CHidDriverPlugin() : CHidDriver() - { - } - -TInt CHidDriverPlugin::CanHandleReportL(CReportRoot* aReportDescriptor) - { - return KErrNone; - } - -TInt CHidDriverPlugin::DataIn(CHidTransport::THidChannelType aChannel, - const TDesC8& aPayload) - { - return KErrNone; - } - -void CHidDriverPlugin::Disconnected(TInt aReason) - { - - } -void CHidDriverPlugin::InitialiseL(TInt aConnectionId) - { - - } -void CHidDriverPlugin::StartL(TInt aConnectionId) - { - - } -void CHidDriverPlugin::Stop() - { - - } -void CHidDriverPlugin::CommandResult(TInt aCmdAck) - { - - } -TInt CHidDriverPlugin::SupportedFieldCount() - { - return KErrNone; - } -void CHidDriverPlugin::SetInputHandlingReg(CHidInputDataHandlingReg* aHandlingReg) - { - ///////todo!! - aHandlingReg->AddHandledEvent(1,1); - TBool allowed = aHandlingReg->AllowedToHandleEvent(1,1); - if(allowed == EFalse) - { - //User::Leave(1); - } - allowed = aHandlingReg->AllowedToHandleEvent(2,2); - if(allowed != EFalse) - { - //User::Leave(1); - } - - } - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/src/CHidDriverPluginProxy.cpp --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/src/CHidDriverPluginProxy.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2007 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: -* -*/ - - -#ifndef REFERENCE_HIDDRIVER_H -#define REFERENCE_HIDDRIVER_H - -#include -#include -#include "CHidDriverPlugin.h" - -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY(0xE000B187, CHidDriverPlugin::NewL), - }; - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - - return ImplementationTable; - } - -#endif //REFERENCE_HIDDRIVER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/src/GenericHidTest.cpp --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/src/GenericHidTest.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,210 +0,0 @@ -/* -* Copyright (c) 2008-2009 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: -* -*/ - - - - -// INCLUDE FILES -#include -#include "GenericHidTest.h" -#include - -//#include "testlogger.h" - -// EXTERNAL DATA STRUCTURES -//extern ?external_data; - -// EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def - -// LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def - -// MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration - -// LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CGenericHidTest::CGenericHidTest -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CGenericHidTest::CGenericHidTest( - CTestModuleIf& aTestModuleIf ): - CScriptBase( aTestModuleIf ) - { - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CGenericHidTest::ConstructL() - { - //iTestLogger = CHidTestLogger::NewL( &TestModuleIf() ); - - //Read logger settings to check whether test case name is to be - //appended to log file name. - RSettingServer settingServer; - TInt ret = settingServer.Connect(); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Struct to StifLogger settigs. - TLoggerSettings loggerSettings; - // Parse StifLogger defaults from STIF initialization file. - ret = settingServer.GetLoggerSettings(loggerSettings); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Close Setting server session - settingServer.Close(); - - TFileName logFileName; - - if(loggerSettings.iAddTestCaseTitle) - { - TName title; - TestModuleIf().GetTestCaseTitleL(title); - logFileName.Format(KGenericHidTestLogFileWithTitle, &title); - } - else - { - logFileName.Copy(KGenericHidTestLogFile); - } - - iLog = CStifLogger::NewL( KGenericHidTestLogPath, - logFileName, - CStifLogger::ETxt, - CStifLogger::EFile, - EFalse ); - - SendTestClassVersion(); - - iParser = CParser::NewL(); - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CGenericHidTest* CGenericHidTest::NewL( - CTestModuleIf& aTestModuleIf ) - { - CGenericHidTest* self = new (ELeave) CGenericHidTest( aTestModuleIf ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - - return self; - - } - -// Destructor -CGenericHidTest::~CGenericHidTest() - { - - // Delete resources allocated from test methods - Delete(); - - // Delete logger - delete iLog; - - delete iParser; - - } - -//----------------------------------------------------------------------------- -// CGenericHidTest::SendTestClassVersion -// Method used to send version of test class -//----------------------------------------------------------------------------- -// -void CGenericHidTest::SendTestClassVersion() - { - TVersion moduleVersion; - moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; - moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; - moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; - - TFileName moduleName; - moduleName = _L("GenericHidTest.dll"); - - TBool newVersionOfMethod = ETrue; - TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); - } - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// LibEntryL is a polymorphic Dll entry point. -// Returns: CScriptBase: New CScriptBase derived object -// ----------------------------------------------------------------------------- -// -EXPORT_C CScriptBase* LibEntryL( - CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework - { - - return ( CScriptBase* ) CGenericHidTest::NewL( aTestModuleIf ); - - } - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/src/GenericHidTestBlocks.cpp --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/src/GenericHidTestBlocks.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2839 +0,0 @@ -/* -* Copyright (c) 2008-2009 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: -* -*/ - - - - -// [INCLUDE FILES] - do not remove -#include -#include -#include -#include "GenericHidTest.h" - -#include "hidreports.h" -#include "tGenericHIDAPI.h" -#include "tdialclient.h" -#include "alarmcontrol.h" -#include "timer.h" - -// EXTERNAL DATA STRUCTURES -//extern ?external_data; - -// EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def - -// LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def - -// MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration - -// LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CGenericHidTest::Delete -// Delete here all resources allocated and opened from test methods. -// Called from destructor. -// ----------------------------------------------------------------------------- -// -void CGenericHidTest::Delete() - { - if ( iGenericHIDTest ) - { - delete iGenericHIDTest; - iGenericHIDTest = NULL; - } - - if ( iDialClient ) - { - delete iDialClient; - iDialClient = NULL; - } - - if ( iAlarmControl ) - { - delete iAlarmControl; - iAlarmControl = NULL; - } - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::RunMethodL -// Run specified method. Contains also table of test mothods and their names. -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::RunMethodL( - CStifItemParser& aItem ) - { - - static TStifFunctionInfo const KFunctions[] = - { - //ADD NEW ENTRY HERE - // [test cases entries] - Do not remove - ENTRY( "ExecuteApiTestBlock", CGenericHidTest::ExecuteApiTestBlock ), - ENTRY( "ExecuteModuleTestBlock", CGenericHidTest::ExecuteModuleTestBlock ), - ENTRY( "ExecuteBranchTestBlock", CGenericHidTest::ExecuteBranchTestBlock ), - }; - - const TInt count = sizeof( KFunctions ) / - sizeof( TStifFunctionInfo ); - - return RunInternalL( KFunctions, count, aItem ); - - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::GetTestBlockParamsL -// ----------------------------------------------------------------------------- - -void CGenericHidTest::GetTestBlockParamsL( CStifItemParser& aItem ) - { - STIF_LOG( ">>> GetTestBlockParamsL" ); - - // Add new test block branches below, get all required test parameters - if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ExampleTestL" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - User::LeaveIfError( aItem.GetNextInt( iTestBlockParams.iTestIntOption1 ) ); - User::LeaveIfError( aItem.GetNextChar( iTestBlockParams.iTestCharOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "Connect" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "Disconnect" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "DataIn" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "Wait" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextInt( iTestBlockParams.iTestIntOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CreateCall" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "AddAlarm" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextInt( iTestBlockParams.iTestIntOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "DeleteAlarm" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CountryCode" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "VendorId" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ProductId" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "SetProtocol" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "GetProtocol" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "GetReport" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "SetReport" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "DataOut" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "GetIdle" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "SetIdle" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CommandResult" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportDescriptor" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CreateReportGenerator" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "DeleteReportGenerator" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportGeneratorReport" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportGeneratorSetField" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CreateReportTranslator" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CreateReportTranslator_FieldNull" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CreateReportTranslator_NotArray" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CreateReportTranslator_FieldCountZero" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "DeleteReportTranslator" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportTranslatorGetValue" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportTranslatorValue" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportTranslatorGetUsageId" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportTranslatorUsageId" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportTranslatorRawValue" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportTranslatorCount" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "Collectiontype" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionIsPhysical" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionIsLogical" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionIsReport" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionIsNamedArray" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionIsUsageSwitch" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionIsUsageModifier" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionIsApplication" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionUsagePage" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionUsage" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionCollectionCount" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionFieldCount" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionCollectionByIndex" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionFieldByIndex" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportrootReportSizeBytes" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldLogicalMax" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldPhysicalMin" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldPhysicalMax" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldUnit" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldUnitExponent" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldCount" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSize" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldOffset" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldReportId" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldIsInReport" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldDesignatorIndex" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldStringIndex" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldUsagePage" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldHasUsage" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldUsageArray" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldUsage" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldUsageCount" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldClearUsageList" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldLastUsage" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldAttributes" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldType" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldIsVariable" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldIsArray" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldIsConstant" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldIsData" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetLogicalMin" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetLogicalMax" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetPhysicalMin" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetPhysicalMax" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetDesignatorMin" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetDesignatorMax" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetUsageMin" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetUsageMax" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetStringMin" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetStringMax" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetLogicalRange" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetUsageRange" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetPhysicalRange" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetStringRange" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetDesignatorRange" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldIsInput" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldIsOutput" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldIsFeature" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - } - else - { - STIF_LOG( "GetTestBlockParamsL, Test type: not found" ); - User::Leave( KErrNotFound ); - } - STIF_LOG( "<<< GetTestBlockParams" ); - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::ExecuteApiTestBlock -// ----------------------------------------------------------------------------- - -TInt CGenericHidTest::ExecuteApiTestBlock( CStifItemParser& aItem ) - { - STIF_LOG( ">>>ExecuteApiTestBlock" ); - - TInt res; - TGenericHidTestResult testResult; - - TRAP( res, DoExecuteApiTestBlockL( aItem, testResult ) ); - if ( res != KErrNone ) - { - STIF_LOG1( "DoExecuteApiTestBlockL error: %d", res ); - return res; - } - - STIF_ASSERT_EQUALS( ETestCasePassed, testResult ); - STIF_LOG( "Test case passed" ); - STIF_LOG( "<<>>DoExecuteApiTestBlock" ); - - User::LeaveIfError( aItem.GetString( _L( "ExecuteApiTestBlock" ), iTestBlockParams.iTestBlockName ) ); - STIF_LOG1( "Api test type: %S", &iTestBlockParams.iTestBlockName ); - - GetTestBlockParamsL( aItem ); - - // Add new API test block branches with optional test parameters here - if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ExampleTestL" ) ) ) - { - ExampleTestL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, - iTestBlockParams.iTestIntOption1, iTestBlockParams.iTestCharOption1, aTestResult ); - } - else - { - STIF_LOG( "Test type: not found" ); - User::Leave( KErrNotFound ); - } - - STIF_LOG( "<<>>ExecuteModuleTestBlock" ); - - TInt res; - TGenericHidTestResult testResult; - - TRAP( res, DoExecuteModuleTestBlockL( aItem, testResult ) ); - if ( res != KErrNone ) - { - STIF_LOG1( "DoExecuteModuleTestBlockL error: %d", res ); - return res; - } - - STIF_ASSERT_EQUALS( ETestCasePassed, testResult ); - STIF_LOG( "[STIF_LOG] Test case passed" ); - STIF_LOG( "[STIF_LOG] <<>>DoExecuteModuleTestBlockL" ); - - User::LeaveIfError( aItem.GetString( _L( "ExecuteModuleTestBlock" ), iTestBlockParams.iTestBlockName ) ); - STIF_LOG1( "Module test type: %S", &iTestBlockParams.iTestBlockName ); - - GetTestBlockParamsL( aItem ); - - // Add new module test block branches with optional test parameters here - if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ExampleTestL" ) ) ) - { - ExampleTestL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, - iTestBlockParams.iTestIntOption1, iTestBlockParams.iTestCharOption1, aTestResult ); - } - else - { - STIF_LOG( "Test type: not found" ); - User::Leave( KErrNotFound ); - } - - STIF_LOG( "[STIF_LOG] <<>>ExecuteBranchTestBlock" ); - - TInt res; - TGenericHidTestResult testResult = ETestCaseFailed; - - TRAP( res, DoExecuteBranchTestBlockL( aItem, testResult ) ); - if ( res != KErrNone ) - { - STIF_LOG1( "DoExecuteBranchTestBlockL error: %d", res ); - return res; - } - - STIF_ASSERT_EQUALS( ETestCasePassed, testResult ); - STIF_LOG( "[STIF_LOG] Test case passed" ); - STIF_LOG( "[STIF_LOG] <<>>DoExecuteBranchTestBlockL" ); - - User::LeaveIfError( aItem.GetString( _L( "ExecuteBranchTestBlock" ), iTestBlockParams.iTestBlockName ) ); - STIF_LOG1( "Branch test type: %S", &iTestBlockParams.iTestBlockName ); - - GetTestBlockParamsL( aItem ); - - // Add new branch test block branches with optional test parameters here - if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ExampleTestL" ) ) ) - { - ExampleTestL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, - iTestBlockParams.iTestIntOption1, iTestBlockParams.iTestCharOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "Connect" ) ) ) - { - ConnectL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "Disconnect" ) ) ) - { - DisconnectL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "DataIn" ) ) ) - { - DataIn( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "Wait" ) ) ) - { - WaitL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestIntOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CreateCall" ) ) ) - { - CreateCallL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "AddAlarm" ) ) ) - { - AddAlarmL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestIntOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "DeleteAlarm" ) ) ) - { - DeleteAlarm( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CountryCode" ) ) ) - { - CountryCodeL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "VendorId" ) ) ) - { - VendorIdL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ProductId" ) ) ) - { - ProductIdL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "SetProtocol" ) ) ) - { - SetProtocolL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "GetProtocol" ) ) ) - { - GetProtocoL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "GetReport" ) ) ) - { - GetReportL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "SetReport" ) ) ) - { - SetReportL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "DataOut" ) ) ) - { - DataOutL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "GetIdle" ) ) ) - { - GetIdleL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "SetIdle" ) ) ) - { - SetIdleL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CommandResult" ) ) ) - { - CommandResultL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportDescriptor" ) ) ) - { - ReportDescriptorL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CreateReportGenerator" ) ) ) - { - CreateReportGeneratorL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "DeleteReportGenerator" ) ) ) - { - DeleteReportGeneratorL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportGeneratorReport" ) ) ) - { - ReportGeneratorReportL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportGeneratorSetField" ) ) ) - { - ReportGeneratorSetFieldL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CreateReportTranslator" ) ) ) - { - CreateReportTranslatorL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CreateReportTranslator_FieldNull" ) ) ) - { - CreateReportTranslator_FieldNullL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CreateReportTranslator_NotArray" ) ) ) - { - CreateReportTranslator_NotArrayL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CreateReportTranslator_FieldCountZero" ) ) ) - { - CreateReportTranslator_FieldCountZeroL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "DeleteReportTranslator" ) ) ) - { - DeleteReportTranslatorL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportTranslatorGetValue" ) ) ) - { - ReportTranslatorGetValueL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportTranslatorValue" ) ) ) - { - ReportTranslatorValueL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportTranslatorGetUsageId" ) ) ) - { - ReportTranslatorGetUsageIdL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportTranslatorUsageId" ) ) ) - { - ReportTranslatorUsageIdL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportTranslatorRawValue" ) ) ) - { - ReportTranslatorRawValueL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportTranslatorCount" ) ) ) - { - ReportTranslatorCountL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "Collectiontype" ) ) ) - { - CollectiontypeL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionIsPhysical" ) ) ) - { - CollectionIsPhysicalL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionIsLogical" ) ) ) - { - CollectionIsLogicalL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionIsReport" ) ) ) - { - CollectionIsReportL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionIsNamedArray" ) ) ) - { - CollectionIsNamedArrayL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionIsUsageSwitch" ) ) ) - { - CollectionIsUsageSwitchL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionIsUsageModifier" ) ) ) - { - CollectionIsUsageModifierL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionIsApplication" ) ) ) - { - CollectionIsApplicationL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionUsagePage" ) ) ) - { - CollectionUsagePageL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionUsage" ) ) ) - { - CollectionUsageL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionCollectionCount" ) ) ) - { - CollectionFieldCountL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionFieldCount" ) ) ) - { - CollectionFieldCountL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionCollectionByIndex" ) ) ) - { - CollectionCollectionByIndexL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CollectionFieldByIndex" ) ) ) - { - CollectionFieldByIndexL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ReportrootReportSizeBytes" ) ) ) - { - ReportrootReportSizeBytes( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldLogicalMax" ) ) ) - { - FieldLogicalMaxL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldPhysicalMin" ) ) ) - { - FieldPhysicalMinL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldPhysicalMax" ) ) ) - { - FieldPhysicalMaxL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldUnit" ) ) ) - { - FieldUnitL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldUnitExponent" ) ) ) - { - FieldUnitExponentL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldCount" ) ) ) - { - FieldCountL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSize" ) ) ) - { - FieldSizeL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldOffset" ) ) ) - { - FieldOffsetL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldReportId" ) ) ) - { - FieldReportIdL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldIsInReport" ) ) ) - { - FieldIsInReportL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldDesignatorIndex" ) ) ) - { - FieldDesignatorIndexL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldStringIndex" ) ) ) - { - FieldStringIndexL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldUsagePage" ) ) ) - { - FieldUsagePageL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldHasUsage" ) ) ) - { - FieldHasUsageL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldUsageArray" ) ) ) - { - FieldUsageArrayL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldUsage" ) ) ) - { - FieldUsageL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldUsageCount" ) ) ) - { - FieldUsageCountL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldClearUsageList" ) ) ) - { - FieldClearUsageListL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldLastUsage" ) ) ) - { - FieldLastUsageL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldAttributes" ) ) ) - { - FieldAttributesL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldType" ) ) ) - { - FieldTypeL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldIsVariable" ) ) ) - { - FieldIsVariableL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldIsArray" ) ) ) - { - FieldIsArrayL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldIsConstant" ) ) ) - { - FieldIsConstantL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldIsData" ) ) ) - { - FieldIsDataL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetLogicalMin" ) ) ) - { - FieldSetLogicalMinL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetLogicalMax" ) ) ) - { - FieldSetPhysicalMinL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetPhysicalMin" ) ) ) - { - FieldSetPhysicalMinL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetPhysicalMax" ) ) ) - { - FieldSetPhysicalMaxL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetDesignatorMin" ) ) ) - { - FieldSetDesignatorMinL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetDesignatorMax" ) ) ) - { - FieldSetUsageMinL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetUsageMin" ) ) ) - { - FieldSetUsageMinL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetUsageMax" ) ) ) - { - FieldSetUsageMaxL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetStringMin" ) ) ) - { - FieldSetStringMinL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetStringMax" ) ) ) - { - FieldSetStringMaxL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetLogicalRange" ) ) ) - { - FieldSetLogicalRangeL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetUsageRange" ) ) ) - { - FieldSetUsageRangeL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetPhysicalRange" ) ) ) - { - FieldSetPhysicalRangeL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetStringRange" ) ) ) - { - FieldSetStringRangeL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldSetDesignatorRange" ) ) ) - { - FieldSetDesignatorRangeL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldIsInput" ) ) ) - { - FieldIsInputL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldIsOutput" ) ) ) - { - FieldIsOutputL( iTestBlockParams.iTestOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FieldIsFeature" ) ) ) - { - FieldIsFeatureL( iTestBlockParams.iTestOption1, aTestResult ); - } - else - { - STIF_LOG( "DoExecuteBranchTestBlockL; Test type: not found" ); - User::Leave( KErrNotFound ); - } - - STIF_LOG( "[STIF_LOG] <<>>ExampleTest" ); - - if ( !aTestOption.Compare( _L( "API" ) ) ) - { - STIF_LOG1( "Api test option: %S", &aTestOption ); - STIF_LOG1( "Api test sub-option: %S", &aTestSubOption ); - STIF_LOG1( "Api test int option: %d", aTestIntOption ); - STIF_LOG1( "Api test char option: %c", aTestCharOption ); - } - else if ( !aTestOption.Compare( _L( "MODULE" ) ) ) - { - STIF_LOG1( "Module test option: %S", &aTestOption ); - STIF_LOG1( "Module test sub-option: %S", &aTestSubOption ); - STIF_LOG1( "Module test int option: %d", aTestIntOption ); - STIF_LOG1( "Module test char option: %c", aTestCharOption ); - } - else if ( !aTestOption.Compare( _L( "BRANCH" ) ) ) - { - STIF_LOG1( "Branch test option: %S", &aTestOption ); - STIF_LOG1( "Branch test sub-option: %S", &aTestSubOption ); - STIF_LOG1( "Branch test int option: %d", aTestIntOption ); - STIF_LOG1( "Branch test char option: %c", aTestCharOption ); - } - else - { - STIF_LOG( "Invalid test parameter" ); - User::Leave( KErrNotFound ); - } - - aTestResult = ETestCasePassed; - - STIF_LOG( "<<ConnectL(0,*report); - CleanupStack::PopAndDestroy(); - - STIF_LOG( "Connect passed" ); - - aTestResult = ETestCasePassed; - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::DisconnectL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::DisconnectL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->DisconnectL(0); - delete iGenericHIDTest; - iGenericHIDTest = NULL; - - STIF_LOG( "Disconnect passed" ); - - aTestResult = ETestCasePassed; - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::DataIn -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::DataIn( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ) - { - TInt retVal = KErrNone; - HBufC8* report = ConvertArray(aTestSubOption); - TInt firstByte = (*report)[0]; - STIF_LOG1("aTestSubOption >> report: %d", firstByte); - - retVal = iGenericHIDTest->DataInL(0,*report); - STIF_LOG1( "DataInL return value: %d" , retVal); - - delete report; - report = NULL; - - STIF_LOG( "Test case passed" ); - - aTestResult = ETestCasePassed; - - return retVal; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::Wait -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::WaitL( TPtrC aTestOption, TInt aTestIntOption, TGenericHidTestResult& aTestResult ) - { - CWaitTimer* timer = CWaitTimer::NewLC(aTestIntOption * 1000000); - CleanupStack::PopAndDestroy(timer); - - STIF_LOG( "Test case passed" ); - - aTestResult = ETestCasePassed; - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::CreateCallL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::CreateCallL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ) - { - TInt err = KErrNone; - - if ( iDialClient ) - { - delete iDialClient; - iDialClient = NULL; - } - iDialClient = CDialClient::NewL(); - - iDialClient->CreateCall( aTestSubOption ); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return err; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::AddAlarm -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::AddAlarmL( TPtrC aTestOption, TInt aTestIntOption, TGenericHidTestResult& aTestResult ) - { - STIF_LOG( ">>AddAlarmL" ); - - if ( !iAlarmControl ) - { - iAlarmControl = CAlarmControl::NewL( iLog ); - } - - STIF_LOG( "Create alarm" ); - - iAlarmControl->CreateClockAlarm( aTestIntOption ); - - STIF_LOG( "Test case passed" ); - - aTestResult = ETestCasePassed; - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::DeleteAlarm -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::DeleteAlarm( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iAlarmControl->DeleteAlarm(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::CountryCodeL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::CountryCodeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->RunCountryCodeL(); - STIF_LOG2( "RunCountryCodeL return value: %d, expected: %d", ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::VendorIdL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::VendorIdL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->RunVendorIdL(); - STIF_LOG2( "RunVendorIdL return value: %d, expected: %d", ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::ProductIdL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::ProductIdL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->RunProductIdL(); - STIF_LOG2( "RunProductIdL return value: %d, expected: %d", ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::SetProtocol -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::SetProtocolL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->RunSetProtocolL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::GetProtocoL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::GetProtocoL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->RunGetProtocoL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::GetReportL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::GetReportL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->RunGetReportL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::SetReportL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::SetReportL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ) - { - HBufC8* report = ConvertArray(aTestSubOption); - CleanupStack::PushL( report ); - iGenericHIDTest->RunSetReportL( *report ); - CleanupStack::PopAndDestroy(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::DataOutL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::DataOutL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ) - { - HBufC8* report = ConvertArray(aTestSubOption); - CleanupStack::PushL( report ); - iGenericHIDTest->RunDataOutL( *report ); - CleanupStack::PopAndDestroy(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::GetIdleL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::GetIdleL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->GetGetIdleL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::SetIdleL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::SetIdleL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->RunSetIdleL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } -// ----------------------------------------------------------------------------- -// CGenericHidTest::CommandResultL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::CommandResultL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->GetCommandResultL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } -// ----------------------------------------------------------------------------- -// CGenericHidTest::ReportDescriptorL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::ReportDescriptorL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->GetReportDescriptorL(); - STIF_LOG2( "GetReportDescriptorL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::ReportDescriptorL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::CreateReportGeneratorL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->CreateReportGeneratorL(); - STIF_LOG2( "CreateReportGeneratorL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::ReportDescriptorL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::DeleteReportGeneratorL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->DeleteReportGeneratorL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::ReportDescriptorL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::ReportGeneratorReportL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->ReportGeneratorReport(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::ReportGeneratorSetFieldL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::ReportGeneratorSetFieldL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ) - { - TInt ret; - TInt expectedResult = KErrNone; - - if ( !aTestSubOption.Compare( _L( "Array" ) ) ) - { - iLog -> Log( _L("Test type: Array") ); - ret = iGenericHIDTest->ReportGeneratorSetFieldL( ETrue, EFalse, EFalse, EFalse, ETrue, EFalse ); - } - else if ( !aTestSubOption.Compare( _L( "NotArray" ) ) ) - { - iLog -> Log( _L("Test type: NotArray") ); - ret = iGenericHIDTest->ReportGeneratorSetFieldL( EFalse, EFalse, EFalse, EFalse, ETrue, EFalse ); - } - else if ( !aTestSubOption.Compare( _L( "NotArrayOutOfRange" ) ) ) - { - iLog -> Log( _L("Test type: NotArrayOutOfRange") ); - ret = iGenericHIDTest->ReportGeneratorSetFieldL( EFalse, ETrue, EFalse, EFalse, ETrue, EFalse ); - expectedResult = KErrValueOutOfRange; - } - else if ( !aTestSubOption.Compare( _L( "FieldNull" ) ) ) - { - iLog -> Log( _L("Test type: FieldNull") ); - ret = iGenericHIDTest->ReportGeneratorSetFieldL( EFalse, EFalse, ETrue, EFalse, ETrue, EFalse ); - expectedResult = KErrUsageNotFound; - } - else if ( !aTestSubOption.Compare( _L( "FieldCountZero" ) ) ) - { - iLog -> Log( _L("Test type: FieldCountZero") ); - ret = iGenericHIDTest->ReportGeneratorSetFieldL( ETrue, EFalse, EFalse, ETrue, ETrue, EFalse ); - expectedResult = KErrNoSpaceInArray; - } - else if ( !aTestSubOption.Compare( _L( "NotExistingUsage" ) ) ) - { - iLog -> Log( _L("Test type: NotExistingUsage") ); - ret = iGenericHIDTest->ReportGeneratorSetFieldL( ETrue, EFalse, EFalse, ETrue, EFalse, EFalse );//getIndexOfUsage - expectedResult = KErrUsageNotFound; - } - else if ( !aTestSubOption.Compare( _L( "NotExistingUsage2" ) ) ) - { - iLog -> Log( _L("Test type: NotExistingUsage2") ); - ret = iGenericHIDTest->ReportGeneratorSetFieldL( ETrue, EFalse, EFalse, EFalse, EFalse, EFalse );//getIndexOfUsage - expectedResult = KErrUsageNotFound; - } - else if ( !aTestSubOption.Compare( _L( "BadIndex" ) ) ) - { - iLog -> Log( _L("Test type: BadIndex") ); - ret = iGenericHIDTest->ReportGeneratorSetFieldL( EFalse, EFalse, EFalse, EFalse, ETrue, ETrue ); - expectedResult = KErrBadControlIndex; - } - else - { - iLog -> Log( _L("Test type: not supported") ); - return KErrNotFound; - } - - - STIF_LOG2( "ReportGeneratorSetFieldL return value: %d, expected: %d" , ret, expectedResult); - STIF_ASSERT_EQUALS(ret, expectedResult); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::CreateReportTranslatorL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::CreateReportTranslatorL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ) - { - HBufC8* report = ConvertArray(aTestSubOption); - CleanupStack::PushL( report ); - iGenericHIDTest->CreateReportTranslatorL( *report , ETrue, EFalse, EFalse); - CleanupStack::PopAndDestroy(); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::CreateReportTranslator_FieldNullL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ) - { - HBufC8* report = ConvertArray(aTestSubOption); - CleanupStack::PushL( report ); - iGenericHIDTest->CreateReportTranslatorL( *report, EFalse, ETrue, EFalse ); - CleanupStack::PopAndDestroy(); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::CreateReportTranslator_NotArrayL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ) - { - HBufC8* report = ConvertArray(aTestSubOption); - CleanupStack::PushL( report ); - iGenericHIDTest->CreateReportTranslatorL( *report , EFalse, EFalse, EFalse); - CleanupStack::PopAndDestroy(); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::CreateReportTranslator_FieldCountZeroL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ) - { - HBufC8* report = ConvertArray(aTestSubOption); - CleanupStack::PushL( report ); - iGenericHIDTest->CreateReportTranslatorL( *report , ETrue, EFalse, ETrue); - CleanupStack::PopAndDestroy(); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - - -// ----------------------------------------------------------------------------- -// CGenericHidTest::DeleteReportTranslatorL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::DeleteReportTranslatorL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->DeleteReportTranslatorL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::ReportTranslatorGetValueL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ) - { - TInt ret; - TInt expectedResult = KErrNone; - - if ( !aTestSubOption.Compare( _L( "Ok" ) ) ) - { - iLog -> Log( _L("Test type: Ok") ); - } - else if ( !aTestSubOption.Compare( _L( "NotFound" ) ) ) - { - iLog -> Log( _L("Test type: NotFound") ); - expectedResult = KErrUsageNotFound; - } - else - { - iLog -> Log( _L("Test type: not supported") ); - return KErrNotFound; - } - - ret = iGenericHIDTest->ReportTranslatorGetValueL(); - STIF_LOG2( "ReportTranslatorGetValueL return value: %d, expected: %d" , ret, expectedResult); - STIF_ASSERT_EQUALS(ret, expectedResult); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::ReportTranslatorValueL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::ReportTranslatorValueL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->ReportTranslatorValueL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::ReportTranslatorGetUsageIdL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::ReportTranslatorGetUsageIdL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ) - { - TInt ret; - TInt expectedResult = KErrNone; - TInt badIndex = EFalse; - - if ( !aTestSubOption.Compare( _L( "Ok" ) ) ) - { - iLog -> Log( _L("Test type: Ok") ); - } - else if ( !aTestSubOption.Compare( _L( "Error" ) ) ) - { - iLog -> Log( _L("Test type: Error") ); - expectedResult = KErrNoMemory; - } - else if ( !aTestSubOption.Compare( _L( "BadIndex" ) ) ) - { - iLog -> Log( _L("Test type: BadIndex") ); - badIndex = ETrue; - expectedResult = KErrBadControlIndex; - } - else - { - iLog -> Log( _L("Test type: not supported") ); - return KErrNotFound; - } - - ret = iGenericHIDTest->ReportTranslatorGetUsageIdL( badIndex ); - STIF_LOG2( "ReportTranslatorGetUsageIdL return value: %d, expected: %d" , ret, expectedResult); - STIF_ASSERT_EQUALS(ret, expectedResult); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::ReportTranslatorUsageIdL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::ReportTranslatorUsageIdL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->ReportTranslatorUsageIdL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::ReportTranslatorRawValueL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::ReportTranslatorRawValueL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->ReportTranslatorRawValueL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::ReportTranslatorCountL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::ReportTranslatorCountL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult) - { - TInt zeroExpected = EFalse; - - if ( !aTestSubOption.Compare( _L( "Zero" ) ) ) - { - iLog -> Log( _L("Test type: Zero") ); - zeroExpected = ETrue; - } - else if ( !aTestSubOption.Compare( _L( "NotZero" ) ) ) - { - iLog -> Log( _L("Test type: NotZero") ); - } - else - { - iLog -> Log( _L("Test type: not supported") ); - return KErrNotFound; - } - - TInt count = iGenericHIDTest->ReportTranslatorCountL(); - - STIF_LOG1( "ReportTranslatorCountL return value: %d" , count); - if(zeroExpected != EFalse) - { - STIF_ASSERT_EQUALS(0, count) - } - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::CollectiontypeL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::CollectiontypeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->CollectiontypeL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::CollectionIsPhysicalL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::CollectionIsPhysicalL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->CollectionIsPhysicalL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::CollectionIsLogicalL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::CollectionIsLogicalL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->CollectionIsLogicalL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::CollectionIsReportL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::CollectionIsReportL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->CollectionIsReportL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::CollectionIsNamedArrayL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::CollectionIsNamedArrayL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->CollectionIsNamedArrayL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } -// ----------------------------------------------------------------------------- -// CGenericHidTest::CollectionIsUsageSwitchL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::CollectionIsUsageSwitchL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->CollectionIsUsageSwitchL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::CollectionIsUsageModifierL -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::CollectionIsUsageModifierL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->CollectionIsUsageModifierL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::CollectionIsApplicationL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->CollectionIsApplicationL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - - -TInt CGenericHidTest::CollectionUsagePageL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->CollectionUsagePageL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::CollectionUsageL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->CollectionUsageL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::CollectionCollectionCountL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->CollectionCollectionCountL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::CollectionFieldCountL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->CollectionFieldCountL(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::CollectionCollectionByIndexL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ) - { - TInt ret; - - if ( !aTestSubOption.Compare( _L( "Present" ) ) ) - { - iLog -> Log( _L("Test type: Present") ); - ret = iGenericHIDTest->CollectionCollectionByIndexL(ETrue); - } - else if ( !aTestSubOption.Compare( _L( "NotPresent" ) ) ) - { - iLog -> Log( _L("Test type: NotPresent") ); - ret = iGenericHIDTest->CollectionCollectionByIndexL(EFalse); - } - else - { - iLog -> Log( _L("Test type: not supported") ); - return KErrNotFound; - } - - STIF_LOG2( "CollectionCollectionByIndexL return value: %d, expected: %d", ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::CollectionFieldByIndexL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->CollectionFieldByIndexL(); - STIF_LOG2( "CollectionFieldByIndexL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - - -// ----------------------------------------------------------------------------- -// CGenericHidTest::ReportrootReportSizeBytes -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::ReportrootReportSizeBytes( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - iGenericHIDTest->ReportrootReportSizeBytes(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldLogicalMax -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldLogicalMaxL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldLogicalMaxL(); - STIF_LOG2( "FieldLogicalMaxL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldPhysicalMin -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldPhysicalMinL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldPhysicalMinL(); - STIF_LOG2( "FieldPhysicalMinL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldPhysicalMax -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldPhysicalMaxL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldPhysicalMaxL(); - STIF_LOG2( "FieldPhysicalMaxL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldUnit -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldUnitL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldUnitL(); - STIF_LOG2( "FieldUnitL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldUnitExponent -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldUnitExponentL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldUnitExponentL(); - STIF_LOG2( "FieldUnitExponentL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldCountL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldCountL(); - STIF_LOG2( "FieldCountL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldSizeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldSizeL(); - STIF_LOG2( "FieldSizeL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldOffsetL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ) - { - TInt ret; - - if ( !aTestSubOption.Compare( _L( "SetReport" ) ) ) - { - iLog -> Log( _L("Test type: SetReport") ); - ret = iGenericHIDTest->FieldOffsetL(ETrue); - } - else if ( !aTestSubOption.Compare( _L( "NotSetReport" ) ) ) - { - iLog -> Log( _L("Test type: NotSetReport") ); - ret = iGenericHIDTest->FieldOffsetL(EFalse); - } - else - { - iLog -> Log( _L("Test type: not supported") ); - return KErrNotFound; - } - - STIF_LOG2( "FieldOffsetL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldReportIdL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldReportIdL(); - STIF_LOG2( "FieldReportIdL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldIsInReportL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldIsInReportL(); - STIF_LOG2( "FieldIsInReportL return value: %d, expected: %d", ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldDesignatorIndexL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldDesignatorIndexL(); - STIF_LOG2( "FieldDesignatorIndexL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldStringIndexL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldStringIndexL(); - STIF_LOG2( "FieldStringIndexL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldUsagePageL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldUsagePageL(); - STIF_LOG2( "FieldUsagePageL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - - -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldHasUsage -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldHasUsageL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldHasUsageL(); - STIF_LOG2( "FieldHasUsageL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldUsageArrayL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldUsageArrayL(); - STIF_LOG2( "FieldUsageArrayL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldUsageL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldUsageL(); - STIF_LOG2( "FieldUsageL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldUsageCountL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldUsageCountL(); - STIF_LOG2( "FieldUsageCountL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldClearUsageListL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldClearUsageListL(); - STIF_LOG2( "FieldClearUsageListL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldLastUsageL( TPtrC aTestOption, TPtrC aTestSubOption, TGenericHidTestResult& aTestResult ) - { - TInt ret; - - if ( !aTestSubOption.Compare( _L( "Empty" ) ) ) - { - iLog -> Log( _L("Test type: Empty") ); - ret = iGenericHIDTest->FieldLastUsageL( ETrue ); - } - else if ( !aTestSubOption.Compare( _L( "NotEmpty" ) ) ) - { - iLog -> Log( _L("Test type: NotEmpty") ); - ret = iGenericHIDTest->FieldLastUsageL( EFalse ); - } - else - { - iLog -> Log( _L("Test type: not supported") ); - return KErrNotFound; - } - - STIF_LOG2( "FieldLastUsageL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - - -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldAttributes -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldAttributesL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldAttributesL(); - STIF_LOG2( "FieldAttributesL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldType -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldTypeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldTypeL(); - STIF_LOG2( "FieldTypeL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldIsVariable -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldIsVariableL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldIsVariableL(); - STIF_LOG2( "FieldIsVariableL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldIsArrayL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldIsArrayL(); - STIF_LOG2( "FieldIsArrayL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldIsConstant -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldIsConstantL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldIsConstantL(); - STIF_LOG2( "FieldIsConstantL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldIsDataL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldIsDataL(); - STIF_LOG2( "FieldIsDataL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldSetLogicalMin -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldSetLogicalMinL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldSetLogicalMinL(); - STIF_LOG2( "FieldSetLogicalMinL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldSetLogicalMax -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldSetLogicalMaxL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldSetLogicalMaxL(); - STIF_LOG2( "FieldSetLogicalMaxL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldSetPhysicalMin -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldSetPhysicalMinL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldSetPhysicalMinL(); - STIF_LOG2( "FieldSetPhysicalMinL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldSetPhysicalMax -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldSetPhysicalMaxL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldSetPhysicalMaxL(); - STIF_LOG2( "FieldSetPhysicalMaxL return value: %d, expected: %d", ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldSetDesignatorMin -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldSetDesignatorMinL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldSetDesignatorMinL(); - STIF_LOG2( "FieldSetDesignatorMinL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldSetDesignatorMax -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldSetDesignatorMaxL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldSetDesignatorMaxL(); - STIF_LOG2( "FieldSetDesignatorMaxL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldSetUsageMinL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldSetUsageMinL(); - STIF_LOG2( "FieldSetUsageMinL return value: %d, expected: %d" , ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldSetUsageMaxL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldSetUsageMaxL(); - STIF_LOG2( "FieldSetUsageMaxL return value: %d, expected: %d", ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldSetStringMin -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldSetStringMinL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldSetStringMinL(); - STIF_LOG2( "FieldSetStringMinL return value: %d, expected: %d", ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldSetStringMax -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldSetStringMaxL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldSetStringMaxL(); - STIF_LOG2( "FieldSetStringMaxL return value: %d, expected: %d", ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldSetLogicalRangeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldSetLogicalRangeL(); - STIF_LOG2( "FieldSetLogicalRangeL return value: %d, expected: %d", ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldSetUsageRangeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldSetUsageRangeL(); - STIF_LOG2( "FieldSetUsageRangeL return value: %d, expected: %d", ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldSetPhysicalRangeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldSetPhysicalRangeL(); - STIF_LOG2( "FieldSetPhysicalRangeL return value: %d, expected: %d", ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldSetStringRangeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldSetStringRangeL(); - STIF_LOG2( "FieldSetStringRangeL return value: %d, expected: %d", ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldSetDesignatorRangeL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldSetDesignatorRangeL(); - STIF_LOG2( "FieldSetDesignatorRangeL return value: %d, expected: %d", ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -TInt CGenericHidTest::FieldIsInputL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldIsInputL(); - STIF_LOG2( "FieldIsInputL return value: %d, expected: %d", ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldIsOutput -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldIsOutputL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldIsOutputL(); - STIF_LOG2( "FieldIsOutputL return value: %d, expected: %d", ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::FieldIsFeature -// ----------------------------------------------------------------------------- -// -TInt CGenericHidTest::FieldIsFeatureL( TPtrC aTestOption, TGenericHidTestResult& aTestResult ) - { - TInt ret = iGenericHIDTest->FieldIsFeatureL(); - STIF_LOG2( "FieldIsFeatureL return value: %d, expected: %d", ret, KErrNone); - STIF_ASSERT_EQUALS(ret, KErrNone); - - aTestResult = ETestCasePassed; - - STIF_LOG( "Test case passed" ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::ConvSingleItem -// ----------------------------------------------------------------------------- -// -TUint CGenericHidTest::ConvSingleItem(TBuf8<2>& singleItem) - { - TLex8 lex(singleItem); - TUint value; - lex.Val(value,EHex); - singleItem.Delete(0,2); - return value; - } - -// ----------------------------------------------------------------------------- -// CGenericHidTest::ConvertArray -// ----------------------------------------------------------------------------- -// -HBufC8* CGenericHidTest::ConvertArray( const TPtrC& aFilename ) - { - RFs theFs; - - RFile someFile; - if(theFs.Connect() != KErrNone) - { - return NULL; - } - TInt error = someFile.Open(theFs, aFilename, EFileShareExclusive); - - RArray arrDesc; - if (!error) - { - TBool seekEOL = EFalse; - TBuf8<2> singleItem; - - TInt hexByte = 0; - - TBool bTerminator = EFalse; - - TBuf8<1> oneChar; - someFile.Read(oneChar, 1); - - while ( (!error) && (oneChar.Size()) ) - { - switch ( oneChar[0] ) - { - case 10: - case 13: - seekEOL = EFalse; - break; - - case '/': - seekEOL = ETrue; - // Comments are special case terminators - // interntional drop through to the next case line - case ' ': - case '\t': - case ',': - // whitespace - ignore, unless we've started storing a value - // (in which case treat the char as a terminator) - bTerminator = ETrue; - break; - - default: - if (!seekEOL) - { - if (4==hexByte) - { - error = KErrGeneral; // Can't store more than two digits - } - else if (hexByte>1) - { - singleItem.Append(oneChar); - } - - hexByte++; - } - break; - } - - if ( bTerminator && singleItem.Size() ) - { - TUint value = ConvSingleItem(singleItem); - arrDesc.Append(value); - hexByte = 0; - } - - bTerminator = EFalse; - - someFile.Read(oneChar, 1); - } - - if (singleItem.Size()) - { - TUint value = ConvSingleItem(singleItem); - arrDesc.Append(value); - } - - someFile.Close(); - } - - theFs.Close(); - - HBufC8* theDesc = 0; - - if (!error) - { - TInt size = arrDesc.Count(); - TRAPD( error, theDesc = HBufC8::NewL(size) ); - if ( error != KErrNone ) - { - return NULL; - } - TPtr8 des = theDesc->Des(); - for(TInt x=0; x -#include -#include -// EXTERNAL DATA STRUCTURES - -// EXTERNAL FUNCTION PROTOTYPES - -// ================= OTHER EXPORTED FUNCTIONS ================================= - -/* -------------------------------------------------------------------------------- - - Class: - - - Method: E32Main - - Description: - - Parameters: None - - Return Values: TInt: Symbian error code - - Errors/Exceptions: None - - Status: Draft - -------------------------------------------------------------------------------- -*/ -GLDEF_C TInt E32Main() - { - _LIT( KProcessMsgStart, "New process starting" ); - RDebug::Print( KProcessMsgStart ); - - - // This starts a new session that get capabilites that is used in - // GenericHidTest_exe.mmp file. - TInt r = StartSession(); - - _LIT( KProcessMsgEnd, "New process ends" ); - RDebug::Print( KProcessMsgEnd ); - - return r; - - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/src/alarmcontrol.cpp --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/src/alarmcontrol.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* -* Copyright (c) 2009 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: Dialhandling class for hid test application -* -*/ - - -#include "alarmcontrol.h" -#include "ASShdAlarm.h" -#include "asshddefs.h" - -_LIT(KSoundName, "a"); // For the alarm alert note. -const TUid KAlarmClockOne = { 0x101F793A }; - -// --------------------------------------------------------------------------- -// NewL -// --------------------------------------------------------------------------- -// -CAlarmControl* CAlarmControl::NewL( CStifLogger* aLogger ) - { - CAlarmControl* self = CAlarmControl::NewLC(aLogger); - CleanupStack::Pop( self ); - return self; - } - - -// --------------------------------------------------------------------------- -// NewLC -// --------------------------------------------------------------------------- -// -CAlarmControl* CAlarmControl::NewLC( CStifLogger* aLogger ) - { - CAlarmControl* self = new( ELeave ) CAlarmControl(aLogger); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// -CAlarmControl::CAlarmControl( CStifLogger* aLogger ): -iLog(aLogger) - { - } - -// --------------------------------------------------------------------------- -// destructor -// --------------------------------------------------------------------------- -// -CAlarmControl::~CAlarmControl() - { - if (iAlarmServer.Handle() != KNullHandle) - { - iAlarmServer.Close(); - } - } - -// --------------------------------------------------------------------------- -// ConstructL -// --------------------------------------------------------------------------- -// -void CAlarmControl::ConstructL() - { - User::LeaveIfError(iAlarmServer.Connect()); - } -// --------------------------------------------------------------------------- -// CreateClockAlarm -// --------------------------------------------------------------------------- -// -void CAlarmControl::CreateClockAlarm( TInt aTime ) - { - STIF_LOG("CreateClockAlarm"); - TInt minute; - TTime tmp; - tmp.HomeTime(); - TDateTime alarmdtime = tmp.DateTime(); - minute = alarmdtime.Minute(); - minute = minute+aTime; - alarmdtime.SetMinute(minute); - - STIF_LOG("CreateClockAlarm solve minutes"); - TASShdAlarm alarm; - alarm.Category() = KAlarmClockOne; - alarm.RepeatDefinition() = EAlarmRepeatDefintionRepeatOnce; - alarm.OriginalExpiryTime() = alarmdtime; - alarm.NextDueTime() = alarmdtime; - alarm.SoundName() = KSoundName; - - STIF_LOG("CreateClockAlarm solve data"); - alarm.ClientFlags().Set( 0 ); - - STIF_LOG("CreateClockAlarm solve add alarm"); - iAlarmServer.AlarmAdd(alarm); - iAlarmID = alarm.Id(); - - STIF_LOG("CreateClockAlarm solve add activate alarm"); - iAlarmServer.SetAlarmStatus(iAlarmID, EAlarmStatusEnabled); - - STIF_LOG("CreateClockAlarm completed"); - } - -// --------------------------------------------------------------------------- -// CreateClockAlarm -// --------------------------------------------------------------------------- -// -void CAlarmControl::DeleteAlarm() - { - iAlarmServer.AlarmDelete(iAlarmID); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/src/tdialclient.cpp --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/src/tdialclient.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -/* -* Copyright (c) 2009 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: Dialhandling class for hid test application -* -*/ - - -#include "tdialclient.h" - -// ======== MEMBER FUNCTIONS ======== - - -// --------------------------------------------------------------------------- -// ?description_if_needed -// --------------------------------------------------------------------------- -// -CDialClient* CDialClient::NewL() - { - CDialClient* self = CDialClient::NewLC(); - CleanupStack::Pop( self ); - return self; - } - - -// --------------------------------------------------------------------------- -// ?description_if_needed -// --------------------------------------------------------------------------- -// -CDialClient* CDialClient::NewLC() - { - CDialClient* self = new( ELeave ) CDialClient; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// -CDialClient::CDialClient() -: CActive(EPriorityNormal), iCallParamsPckg(iCallParams), - iCallStarted(EFalse) - { - CActiveScheduler::Add(this); - } - -// --------------------------------------------------------------------------- -// ConstructL -// --------------------------------------------------------------------------- -// -void CDialClient::ConstructL() - { - iTelephony = CTelephony::NewL(); - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CDialClient::~CDialClient() - { - Cancel(); - delete iTelephony; - } - -// --------------------------------------------------------------------------- -// RunL -// --------------------------------------------------------------------------- -// -void CDialClient::RunL() - { - if ( iSyncWaiter.IsStarted() ) - { - iSyncWaiter.AsyncStop(); - } - } - -// --------------------------------------------------------------------------- -// DoCancel() -// --------------------------------------------------------------------------- -// -void CDialClient::DoCancel() - { - - } -// --------------------------------------------------------------------------- -// CreateCall() -// --------------------------------------------------------------------------- -// -void CDialClient::CreateCall(const TDesC& aNumber) - { - if ( IsActive() ) - { - return; - } - CTelephony::TTelNumber telNumber(aNumber); - iCallParams.iIdRestrict = CTelephony::ESendMyId; - iTelephony->DialNewCall(iStatus, iCallParamsPckg, telNumber, iCallId); - - SetActive(); - iSyncWaiter.Start(); - } - -// --------------------------------------------------------------------------- -// HangUp() -// --------------------------------------------------------------------------- -// -void CDialClient::HangUp() - { - iTelephony->Hangup( iStatus , iCallId ); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/src/tgenerichidapi.cpp --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/src/tgenerichidapi.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1540 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: HID field search -* -*/ - -#include - -#include "tGenericHIDAPI.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// NewLC -// --------------------------------------------------------------------------- -// -CtGenericHIDAPI* CtGenericHIDAPI::NewLC() - { - CtGenericHIDAPI* self = new (ELeave) CtGenericHIDAPI(); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// NewL -// --------------------------------------------------------------------------- -// -CtGenericHIDAPI* CtGenericHIDAPI::NewL() - { - CtGenericHIDAPI* self = NewLC(); - CleanupStack::Pop(); - return self; - } -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// -CtGenericHIDAPI::CtGenericHIDAPI() - { - } -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CtGenericHIDAPI::~CtGenericHIDAPI() - { - delete iHidDriver; - iFieldList.Close(); - delete iGenHID; - } -// --------------------------------------------------------------------------- -// ConstructL() -// --------------------------------------------------------------------------- -// -void CtGenericHIDAPI::ConstructL() - { - iGenHID = CGenericHid::NewL( this ); - iDriverAcces=iGenHID; - - iHidDriver = CHidDriver::NewL(TUid::Uid(0xE000B187),iGenHID); - } -// --------------------------------------------------------------------------- -// ConnectL() -// --------------------------------------------------------------------------- -// -void CtGenericHIDAPI::ConnectL(TInt aConnectionId, const TDesC8& aDescriptor) - { - TInt16 ret = iGenHID->ConnectedL( aConnectionId, aDescriptor ); - ret = iGenHID->DriverActive( aConnectionId , CHidTransport::EActive); - - //todo retval - } - -// --------------------------------------------------------------------------- -// DisconnectL() -// --------------------------------------------------------------------------- -// -void CtGenericHIDAPI::DisconnectL(TInt aConnectionId ) - { - TInt16 ret = iGenHID->Disconnected( aConnectionId ); - //todo retval - } - -// --------------------------------------------------------------------------- -// DataInL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::DataInL(TInt aConnectionId, const TDesC8& aDescriptor) - { - TInt16 ret = iGenHID->DataIn(aConnectionId, CHidTransport::EHidChannelInt, aDescriptor); - return ret; - } - -// --------------------------------------------------------------------------- -// RunCountryCodeL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::RunCountryCodeL() - { - TInt16 countryCode = iGenHID->CountryCodeL(0); - if(countryCode != 0) - return KErrNotFound; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// RunVendorIdL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::RunVendorIdL() - { - TUint vendorId = iGenHID->VendorIdL(0); - if(vendorId != 0x0421) - return KErrNotFound; - return KErrNone; - } - -// --------------------------------------------------------------------------- -// RunProductIdL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::RunProductIdL() - { - TUint productId = iGenHID->ProductIdL(0); - if(productId != 0x0083) - return KErrNotFound; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// RunSetProtocol() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::RunSetProtocolL() - { - iGenHID->SetProtocolL(0,0,MDriverAccess::EReport,iHidDriver); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// RunGetProtocoL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::RunGetProtocoL() - { - iGenHID->GetProtocolL(0,0); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// RunGetReportL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::RunGetReportL() - { - iGenHID->GetReportL(0, 0 ,0 , 0); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// RunSetReportL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::RunSetReportL(const TDesC8& aDescriptor) - { - iGenHID->SetReportL(0,0, MDriverAccess::EOutput, aDescriptor,0, iHidDriver); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// GetDataOutL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::RunDataOutL(const TDesC8& aDescriptor) - { - iGenHID->DataOutL( 0, 0, aDescriptor, 0); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// GetGetIdleL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::GetGetIdleL() - { - iGenHID->GetIdleL(0, 0, 0); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// RunSetIdleL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::RunSetIdleL() - { - iGenHID->SetIdleL(0, 10, 0, 0, iHidDriver); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// GetCommandResultL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::GetCommandResultL() - { - iGenHID->CommandResult(0, 1); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// GetReportDescriptorL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::GetReportDescriptorL() - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - if(tmp == NULL) - return KErrNotFound; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CreateReportGeneratorL -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::CreateReportGeneratorL() - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - - if(tmp == NULL) - return KErrNotFound; - - iReportGenerator = CReportGenerator::NewL(tmp, 0, CField::EInput); - - if(iReportGenerator == NULL) - return KErrNotFound; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// DeleteReportGeneratorL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::DeleteReportGeneratorL() - { - delete iReportGenerator; - iReportGenerator = NULL; - return KErrNone; - } - -// --------------------------------------------------------------------------- -// ReportGeneratorReport() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::ReportGeneratorReport() - { - iReportGenerator->Report(); - //todo check return value??? - return KErrNone; - } - -// --------------------------------------------------------------------------- -// ReportGeneratorReport() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::ReportGeneratorSetFieldL( TBool aIsArray, TBool aOutOfRange, TBool aFieldNull, TBool aFieldCountZero, TBool aExistingUsageId, TBool aBadIndex ) - { - CField* field = CreateCFieldL(); - - TInt usageId = EConsumerUsageVolumeInc;//233;//0xE9 - TInt indexOffset = 0; - - if(aBadIndex != EFalse) - { - indexOffset = 1000; - } - - if(aExistingUsageId == EFalse) - { - usageId = EConsumerUsagePlayPause;//205 - field->SetUsageRange(0,255); - } - - if(aIsArray == EFalse) - { - field->SetAttributes(KFieldAttributeVariable); - if(field->IsArray() != EFalse) - { - return KErrGeneral; - } - } - else - { - field->SetAttributes(!KFieldAttributeVariable); - if(field->IsArray() == EFalse) - { - return KErrGeneral; - } - } - - field->SetLogicalMax(10); - if(aOutOfRange != EFalse) - { - field->SetLogicalMin(5); - } - - if(aFieldCountZero != EFalse) - { - field->SetCount(0); - } - - const CField* constField; - if(aFieldNull == EFalse) - { - constField = (const CField*)field; - } - else - { - constField = NULL; - } - TInt16 ret = iReportGenerator->SetField(constField, usageId, 1, indexOffset); - return ret; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::CreateReportTranslatorL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::CreateReportTranslatorL( const TDesC8& aDescriptor, TBool aIsArray, TBool aFieldNull, TBool aFieldCountZero) - { - CField* field = CreateCFieldL(); - - - if(aIsArray == EFalse) - { - field->SetAttributes(KFieldAttributeVariable); - if(field->IsArray() != EFalse) - { - return KErrGeneral; - } - } - else - { - field->SetAttributes(!KFieldAttributeVariable); - if(field->IsArray() == EFalse) - { - return KErrGeneral; - } - } - - /* field->SetLogicalMax(10); - if(aOutOfRange != EFalse) - { - field->SetLogicalMin(5); - }*/ - - if(aFieldCountZero != EFalse) - { - field->SetCount(0); - } - - const CField* constField; - if(aFieldNull == EFalse) - { - constField = (const CField*)field; - } - else - { - constField = NULL; - } - - - - - //const CField* field = CreateConstCFieldL(); - iTranslator = new (ELeave) TReportTranslator(aDescriptor, constField); - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::CreateReportTranslator_FieldNullL -// ----------------------------------------------------------------------------- -// -/*TInt CtGenericHIDAPI::CreateReportTranslator_FieldNullL( const TDesC8& aDescriptor ) - { - const CField* field = NULL; - iTranslator = new (ELeave) TReportTranslator(aDescriptor, field); - return KErrNone; - }*/ - -// ----------------------------------------------------------------------------- -// CtGenericHid::DeleteReportTranslatorL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::DeleteReportTranslatorL( ) - { - delete iTranslator; - iTranslator =NULL; - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::ReportTranslatorGetValueL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::ReportTranslatorGetValueL() - { - //todo if - TInt value = 0; - TInt res = iTranslator->GetValue(value,EConsumerUsageVolumeInc); - - return res; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::ReportTranslatorValueL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::ReportTranslatorValueL() - { - TInt value = iTranslator->ValueL(EConsumerUsageVolumeInc); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::ReportTranslatorGetUsageIdL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::ReportTranslatorGetUsageIdL( TBool aBadControlIndex ) - { - TInt id; - TInt index = 0; - - if(aBadControlIndex != EFalse) - { - index = -1;//bad index - } - //todo if - TInt ret = iTranslator->GetUsageId(id,index); - - return ret; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::ReportTranslatorUsageIdL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::ReportTranslatorUsageIdL( ) - { - TInt value = iTranslator->UsageIdL(0); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::ReportTranslatorRawValueL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::ReportTranslatorRawValueL( ) - { - TInt value = iTranslator->RawValueL(0); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::ReportTranslatorCountL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::ReportTranslatorCountL( ) - { - TInt count =iTranslator->Count(); - //todo if, retval - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::CollectiontypeL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::CollectiontypeL( ) - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - User::LeaveIfNull(tmp); - TUint32 type=tmp->Type(); - //todo check type? - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::CollectionIsPhysicalL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::CollectionIsPhysicalL( ) - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - User::LeaveIfNull(tmp); - TBool result=tmp->IsPhysical(); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::CollectionIsLogicalL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::CollectionIsLogicalL( ) - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - User::LeaveIfNull(tmp); - TBool result=tmp->IsLogical(); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::CollectionIsReportL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::CollectionIsReportL( ) - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - User::LeaveIfNull(tmp); - TBool result=tmp->IsReport(); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::CollectionIsNamedArrayL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::CollectionIsNamedArrayL( ) - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - User::LeaveIfNull(tmp); - TBool result =tmp->IsNamedArray(); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::CollectionIsUsageSwitchL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::CollectionIsUsageSwitchL( ) - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - User::LeaveIfNull(tmp); - TBool resul = tmp->IsUsageSwitch(); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::CollectionIsUsageModifierL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::CollectionIsUsageModifierL( ) - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - User::LeaveIfNull(tmp); - TInt result = tmp->IsUsageModifier(); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::CollectionIsApplicationL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::CollectionIsApplicationL( ) - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - User::LeaveIfNull(tmp); - TInt result = tmp->IsApplication(); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::CollectionUsagePageL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::CollectionUsagePageL( ) - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - User::LeaveIfNull(tmp); - TInt result = tmp->UsagePage(); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::CollectionUsageL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::CollectionUsageL( ) - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - User::LeaveIfNull(tmp); - TInt result = tmp->Usage(); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::CollectionCollectionCountL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::CollectionCollectionCountL( ) - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - User::LeaveIfNull(tmp); - TInt result = tmp->CollectionCount(); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::CollectionFieldCountL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::CollectionFieldCountL( ) - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - User::LeaveIfNull(tmp); - TInt result = tmp->FieldCount(); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::CollectionCollectionByIndexL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::CollectionCollectionByIndexL( TBool aPresent ) - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - User::LeaveIfNull(tmp); - TInt index; - - index = (aPresent != EFalse) ? 0 : -1; - - const CCollection* result = tmp->CollectionByIndex(index); - - if(aPresent != EFalse && result == NULL) - return KErrGeneral; - - if(aPresent == EFalse && result != NULL) - return KErrGeneral; - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::CollectionFieldByIndexL -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::CollectionFieldByIndexL( ) - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - User::LeaveIfNull(tmp); - const CField* result = tmp->FieldByIndex(-1); - - if(result != NULL) - return KErrGeneral; - //todo if - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CtGenericHid::ReportrootReportSizeBytes -// ----------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::ReportrootReportSizeBytes( ) - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - User::LeaveIfNull(tmp); - TInt16 size = tmp->ReportSizeBytes(0,CField::EInput); - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldLogicalMaxL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldLogicalMaxL( )//todo remove - { - CField* field = CreateCFieldL(); - const TInt max = 5; - field->SetLogicalMax(max); - TInt ret = field->LogicalMax(); - if(ret != max) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldPhysicalMinL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldPhysicalMinL( )//todo remove - { - CField* field = CreateCFieldL(); - const TInt min = 0; - field->SetPhysicalMin(min); - TInt ret = field->PhysicalMin(); - if(ret != min) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldPhysicalMaxL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldPhysicalMaxL( )//todo remove - { - CField* field = CreateCFieldL(); - const TInt max = 5; - field->SetPhysicalMax(max); - TInt ret=field->PhysicalMax(); - if(ret != max) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldUnitL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldUnitL( ) - { - CField* field = CreateCFieldL(); - TInt unit = 5; - field->SetUnit(unit); - TInt ret = field->Unit(); - if(ret != unit) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldUnitExponentL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldUnitExponentL( ) - { - CField* field = CreateCFieldL(); - TInt unitExponent = 5; - field->SetUnitExponent(unitExponent); - TInt ret = field->UnitExponent(); - if(ret != unitExponent) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldCountL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldCountL( ) - { - CField* field = CreateCFieldL(); - TInt count = 5; - field->SetCount(count); - TInt ret = field->Count(); - if(ret != count) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldSizeL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldSizeL( ) - { - CField* field = CreateCFieldL(); - TInt size = 5; - field->SetSize(size); - TInt ret = field->Size(); - if(ret != size) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldOffsetL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldOffsetL(TBool setReport ) - { - CField* field = CreateCFieldL(); - - if(setReport != EFalse) - { - field->SetReportId(5); - } - - TInt offset = 5; - field->SetOffset(offset); - TInt ret = field->Offset(); - - if(setReport != EFalse) - { - offset += KSizeOfByte; - } - - if(ret != offset) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldReportIdL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldReportIdL( ) - { - CField* field = CreateCFieldL(); - TInt reportId = 5; - field->SetReportId(reportId); - TInt ret = field->ReportId(); - if(ret != reportId) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldIsInReportL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldIsInReportL( ) - { - CField* field = CreateCFieldL(); - TInt reportId = 5; - field->SetReportId(reportId); - TBool ret = field->IsInReport(reportId); - if(!ret) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldDesignatorIndexL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldDesignatorIndexL( ) - { - CField* field = CreateCFieldL(); - TInt designatorIndex = 5; - field->SetDesignatorIndex(designatorIndex); - TInt ret = field->DesignatorIndex(); - if(ret != designatorIndex) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldStringIndexL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldStringIndexL( ) - { - CField* field = CreateCFieldL(); - TInt stringIndex = 5; - field->SetStringIndex(stringIndex); - TInt ret = field->StringIndex(); - if(ret != stringIndex) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldUsagePageL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldUsagePageL( ) - { - CField* field = CreateCFieldL(); - TInt usagePage = 5; - field->SetUsagePage(usagePage); - TInt ret = field->UsagePage(); - if(ret != usagePage) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldHasUsageL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldHasUsageL( ) - { - CField* field = CreateCFieldL(); - TInt usage = 233; - field->AddUsageL(usage); - TBool ret = field->HasUsage(usage); - if(!ret) - return KErrGeneral; - //todo check EFalse - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldUsageArrayL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldUsageArrayL( ) - { - CField* field = CreateCFieldL(); - TInt usage = 233; - field->AddUsageL(usage); - TArray usageArray = field->UsageArray(); - - if(usageArray[0] != usage) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldUsageL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldUsageL( ) - { - CField* field = CreateCFieldL(); - TInt usage = 233; - field->AddUsageL(usage); - TInt ret = field->Usage(0); - - if(ret != usage) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldUsageCountL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldUsageCountL( ) - { - CField* field = CreateCFieldL(); - TInt firstCount = field->UsageCount(); - TInt usage = 233; - field->AddUsageL(usage); - TInt secondCount = field->UsageCount(); - - if(secondCount != firstCount+1) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldClearUsageListL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldClearUsageListL( ) - { - CField* field = CreateCFieldL(); - TInt usage = 233; - field->AddUsageL(usage); - TInt ret = field->UsageCount(); - - if(ret == 0) - return KErrGeneral; - - field->ClearUsageList(); - ret = field->UsageCount(); - if(ret != 0) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldLastUsageL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldLastUsageL( TBool empty ) - { - CField* field = CreateCFieldL(); - //todo if - without add - TInt usage = 233; - - if(empty != EFalse) - { - field->ClearUsageList(); - usage = 0; - } - else - { - field->AddUsageL(usage); - } - - TInt ret = field->LastUsage(); - - if(ret != usage) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldAttributesL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldAttributesL( ) - { - CField* field = CreateCFieldL(); - TUint32 attributes = KFieldAttributeConstant; - field->SetAttributes(attributes); - TUint32 ret = field->Attributes(); - if(ret != attributes) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldTypeL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldTypeL( ) - { - CField* field = CreateCFieldL(); - CField::TType type = CField::EInput; - field->SetType(type); - CField::TType ret = field->Type(); - if(ret != type) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldIsVariableL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldIsVariableL( ) - { - CField* field = CreateCFieldL(); - TUint32 attributes = KFieldAttributeVariable; - field->SetAttributes(attributes); - TBool ret = field->IsVariable(); - if(!ret) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldIsArrayL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldIsArrayL( ) - { - CField* field = CreateCFieldL(); - TUint32 attributes = KFieldAttributeVariable; - field->SetAttributes(attributes); - TBool ret = field->IsArray(); - if(ret) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldIsConstantL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldIsConstantL( ) - { - CField* field = CreateCFieldL(); - TUint32 attributes = KFieldAttributeConstant; - field->SetAttributes(attributes); - TBool ret = field->IsConstant(); - if(!ret) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldIsDataL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldIsDataL( ) - { - CField* field = CreateCFieldL(); - TUint32 attributes = KFieldAttributeConstant; - field->SetAttributes(attributes); - TBool ret = field->IsData(); - if(ret) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldSetLogicalMinL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldSetLogicalMinL() - { - CField* field = CreateCFieldL(); - - TInt value = 0; - field->SetLogicalMin(value); - - TInt ret = field->LogicalMin(); - if(ret != value) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldSetLogicalMaxL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldSetLogicalMaxL( ) - { - CField* field = CreateCFieldL(); - TInt value = 10; - field->SetLogicalMax(value); - - TInt ret = field->LogicalMax(); - if(ret != value) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldSetPhysicalMinL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldSetPhysicalMinL( ) - { - CField* field = CreateCFieldL(); - TInt value = 0; - field->SetPhysicalMin(value); - TInt ret = field->PhysicalMin(); - if(ret != value) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldSetPhysicalMaxL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldSetPhysicalMaxL( ) - { - CField* field = CreateCFieldL(); - TInt value = 2; - field->SetPhysicalMax(value); - TInt ret = field->PhysicalMax(); - if(ret != value) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldSetDesignatorMinL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldSetDesignatorMinL( ) - { - CField* field = CreateCFieldL(); - TInt value = 0; - field->SetDesignatorMin(value); - TInt ret = field->DesignatorMin(); - if(ret != value) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldSetDesignatorMaxL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldSetDesignatorMaxL( ) - { - CField* field = CreateCFieldL(); - TInt value = 2; - field->SetDesignatorMax(value); - TInt ret = field->DesignatorMax(); - if(ret != value) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldSetUsageMinL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldSetUsageMinL( ) - { - CField* field = CreateCFieldL(); - TInt value = 0; - field->SetUsageMin(value); - TInt ret = field->UsageMin(); - if(ret != value) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldSetUsageMaxL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldSetUsageMaxL( ) - { - CField* field = CreateCFieldL(); - TInt value = 2; - field->SetUsageMax(value); - TInt ret = field->UsageMax(); - if(ret != value) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldSetStringMinL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldSetStringMinL( ) - { - CField* field = CreateCFieldL(); - TInt value = 0; - field->SetStringMin(value); - TInt ret = field->StringMin(); - if(ret != value) - return KErrGeneral; - - return KErrNone; - } -// --------------------------------------------------------------------------- -// FieldSetStringMaxL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldSetStringMaxL( ) - { - CField* field = CreateCFieldL(); - TInt value = 2; - field->SetStringMax(value); - TInt ret = field->StringMax(); - if(ret != value) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldSetLogicalRangeL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldSetLogicalRangeL( ) - { - CField* field = CreateCFieldL(); - TInt min = 0; - TInt max = 5; - field->SetLogicalRange(min,max); - TInt retMin = field->LogicalMin(); - TInt retMax = field->LogicalMax(); - if(min != retMin || max != retMax) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldSetUsageRangeL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldSetUsageRangeL( ) - { - CField* field = CreateCFieldL(); - TInt min = 0; - TInt max = 5; - field->SetUsageRange(min,max); - TInt retMin = field->UsageMin(); - TInt retMax = field->UsageMax(); - if(min != retMin || max != retMax) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldSetPhysicalRangeL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldSetPhysicalRangeL( ) - { - CField* field = CreateCFieldL(); - TInt min = 0; - TInt max = 5; - field->SetPhysicalRange(min,max); - TInt retMin = field->PhysicalMin(); - TInt retMax = field->PhysicalMax(); - if(min != retMin || max != retMax) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldSetStringRangeL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldSetStringRangeL( ) - { - CField* field = CreateCFieldL(); - TInt min = 0; - TInt max = 5; - field->SetStringRange(min,max); - TInt retMin = field->StringMin(); - TInt retMax = field->StringMax(); - if(min != retMin || max != retMax) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldSetDesignatorRangeL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldSetDesignatorRangeL( ) - { - CField* field = CreateCFieldL(); - TInt min = 0; - TInt max = 5; - field->SetDesignatorRange(min,max); - TInt retMin = field->DesignatorMin(); - TInt retMax = field->DesignatorMax(); - if(min != retMin || max != retMax) - return KErrGeneral; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldIsInputL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldIsInputL( ) - { - CField* field = CreateCFieldL(); - CField::TType type = CField::EInput; - field->SetType(type); - TBool ret = field->IsInput(); - if(!ret) - return KErrGeneral; - //todo check EFalse - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldIsOutputL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldIsOutputL( ) - { - CField* field = CreateCFieldL(); - CField::TType type = CField::EOutput; - field->SetType(type); - TBool ret = field->IsOutput(); - if(!ret) - return KErrGeneral; - //todo check EFalse - return KErrNone; - } - -// --------------------------------------------------------------------------- -// FieldIsFeatureL() -// --------------------------------------------------------------------------- -// -TInt CtGenericHIDAPI::FieldIsFeatureL( ) - { - CField* field = CreateCFieldL(); - CField::TType type = CField::EFeature; - field->SetType(type); - TBool ret = field->IsFeature(); - if(!ret) - return KErrGeneral; - //todo check EFalse - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CountryCodeL() -// --------------------------------------------------------------------------- -// -TUint CtGenericHIDAPI::CountryCodeL(TInt /*aConnID*/) - { - return 0; - } - -// --------------------------------------------------------------------------- -// VendorIdL -// --------------------------------------------------------------------------- -// -TUint CtGenericHIDAPI::VendorIdL(TInt /*aConnID*/) - { - return 0x0421; - } - -// --------------------------------------------------------------------------- -// ProductIdL -// --------------------------------------------------------------------------- -// -TUint CtGenericHIDAPI::ProductIdL(TInt /*aConnID*/) - { - return 0x0083; - } - -// --------------------------------------------------------------------------- -// GetProtocolL -// --------------------------------------------------------------------------- -// -void CtGenericHIDAPI::GetProtocolL(TInt /*aConnID*/, TUint16 /*aInterface*/) - { - } - -// --------------------------------------------------------------------------- -// SetProtocolL -// --------------------------------------------------------------------------- -// -void CtGenericHIDAPI::SetProtocolL(TInt /*aConnID*/, TUint16 /*aValue*/, - TUint16 /*aInterface*/) - { - } - -// --------------------------------------------------------------------------- -// GetReportL -// --------------------------------------------------------------------------- -// -void CtGenericHIDAPI::GetReportL(TInt /*aConnID*/, TUint8 /*aReportType*/, - TUint8 /*aReportID*/, TUint16 /*aInterface*/, TUint16 /*aLength*/) - { - } - -// --------------------------------------------------------------------------- -// SetReportL -// --------------------------------------------------------------------------- -// -void CtGenericHIDAPI::SetReportL(TInt /*aConnID*/, TUint8 /*aReportType*/,TUint8 /*aReportID*/, - TUint16 /*aInterface*/, const TDesC8& /*aReport*/) - { - } - -// --------------------------------------------------------------------------- -// DataOutL() -// --------------------------------------------------------------------------- -// -void CtGenericHIDAPI::DataOutL(TInt /*aConnID*/, TUint8 /*aReportID*/, - TUint16 /*aInterface*/, const TDesC8& /*aReport*/) - { - } - -// --------------------------------------------------------------------------- -// GetIdleL -// --------------------------------------------------------------------------- -// -void CtGenericHIDAPI::GetIdleL(TInt /*aConnID*/, TUint8 /*aReportID*/, - TUint16 /*aInterface*/) - { - } - -// --------------------------------------------------------------------------- -// SetIdleL -// --------------------------------------------------------------------------- -// -void CtGenericHIDAPI::SetIdleL(TInt /*aConnID*/, TUint8 /*aDuration*/, TUint8 /*aReportID*/, - TUint16 /*aInterface*/) - { - } - -const CField* CtGenericHIDAPI::CreateConstCFieldL() - { - CReportRoot* tmp=iGenHID->ReportDescriptor(0); - User::LeaveIfNull(tmp); - const CCollection* collection = tmp->CollectionByIndex(0); - if(collection == NULL) - User::Leave(KErrGeneral); - const CField* field=collection->FieldByIndex(0); - return field; - } - -CField* CtGenericHIDAPI::CreateCFieldL() - { - return (CField*)CreateConstCFieldL(); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/generichid/tsrc/GenericHidTest/src/timer.cpp --- a/localconnectivityservice/generichid/tsrc/GenericHidTest/src/timer.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: HID Heaset plugin timeouttimer -* -*/ - - -#include "timer.h" - -// ======== MEMBER FUNCTIONS ======== -// --------------------------------------------------------------------------- -// NewL -// --------------------------------------------------------------------------- -// -CWaitTimer* CWaitTimer::NewL( TTimeIntervalMicroSeconds32 aTimeOutTime ) - { - CWaitTimer* self = CWaitTimer::NewLC( aTimeOutTime ); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// NewLC -// --------------------------------------------------------------------------- -// -CWaitTimer* CWaitTimer::NewLC( TTimeIntervalMicroSeconds32 aTimeOutTime ) - { - CWaitTimer* self = new (ELeave) CWaitTimer(); - CleanupStack::PushL(self); - self->ConstructL( aTimeOutTime ); - return self; - } - -// --------------------------------------------------------------------------- -// CTimeOutTimer() -// --------------------------------------------------------------------------- -// -CWaitTimer::CWaitTimer(): - CTimer( EPriorityStandard ) - { - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CWaitTimer::~CWaitTimer() - { - } - -// --------------------------------------------------------------------------- -// ConstructL() -// --------------------------------------------------------------------------- -// -void CWaitTimer::ConstructL( TTimeIntervalMicroSeconds32 aTimeOutTime ) - { - CTimer::ConstructL(); - CActiveScheduler::Add(this); - After( aTimeOutTime ); - iSyncWaiter.Start(); - } - -// --------------------------------------------------------------------------- -// From class CActive -// RunL() -// --------------------------------------------------------------------------- -// -void CWaitTimer::RunL() - { - // Timer request has completed, so notify the timer's owner - iSyncWaiter.AsyncStop(); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/group/bld.inf --- a/localconnectivityservice/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +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 project ?myapp -* -*/ - - -PRJ_PLATFORMS -DEFAULT - -#include "../locod/group/bld.inf" -#include "../obexserviceman/group/bld.inf" -#include "../obexsendservices/group/bld.inf" -#include "../obexreceiveservices/group/bld.inf" -#include "../dun/group/bld.inf" -#include "../lcstylustap/group/bld.inf" -#include "../generichid/group/bld.inf" -#include "../headset/group/bld.inf" - -PRJ_EXPORTS - - -PRJ_MMPFILES - -PRJ_TESTMMPFILES - -PRJ_TESTEXPORTS diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/data/hidheadset.rss --- a/localconnectivityservice/headset/data/hidheadset.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2007-2009 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: ECOM plugin resource file for headset driver. -* -*/ - -#include -#include "headsetuids.h" - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = HEADSET_UID; - interfaces = - { - INTERFACE_INFO - { - interface_uid = DRIVER_PLUGIN_IF; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = HEADSET_DRIVER_IMP; - version_no = 1; - display_name = "HID Headset Driver Plugin"; - } - }; - } - }; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/group/bld.inf --- a/localconnectivityservice/headset/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2006-2007 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 project headset -* -*/ - -#include - -PRJ_MMPFILES -hidheadset.mmp - -PRJ_PLATFORMS -WINSCW ARMV5 - -#include "../hidremconbearer/group/bld.inf" - -PRJ_EXPORTS -../rom/hidheadset.iby CORE_MW_LAYER_IBY_EXPORT_PATH(hidheadset.iby) \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/group/hidheadset.mmp --- a/localconnectivityservice/headset/group/hidheadset.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Project definition file for project hidheadset -* -*/ - - -#include -#include "../inc/headsetuids.h" - -TARGET hidheadset.dll -TARGETTYPE PLUGIN -UID ECOM_UID HEADSET_UID - -CAPABILITY CAP_APPLICATION CommDD ProtServ -VENDORID VID_DEFAULT - -SOURCEPATH ../src -SOURCE headset.cpp -SOURCE finder.cpp -SOURCE hidheadsetdriverproxy.cpp -SOURCE keypresstimer.cpp - -START RESOURCE ../data/hidheadset.rss - TARGET hidheadset.rsc -END // ECOM resource definition - -USERINCLUDE ../inc ../hidremconbearer/inc - -APP_LAYER_SYSTEMINCLUDE -SYSTEMINCLUDE ../../../inc - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY generichid.lib -LIBRARY etel3rdparty.lib -LIBRARY alarmclient.lib -LIBRARY mpxplaybackutility.lib -LIBRARY mpxcommon.lib - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/hidremconbearer/data/hidremconbearer.rss --- a/localconnectivityservice/headset/hidremconbearer/data/hidremconbearer.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: Resource definitions for project hidremconbearer -* -*/ - - -// INCLUDES -#include -#include "headsetuids.h" - -// RESOURCE DEFINITIONS -// ----------------------------------------------------------------------------- -// -// REGISTRY_INFO theInfo -// Information needed for Ecom Plugin -// -// ----------------------------------------------------------------------------- -// -RESOURCE REGISTRY_INFO theInfo - { - resource_format_version = RESOURCE_FORMAT_VERSION_2; - dll_uid = HIDREMCON_UID; - interfaces = - { - INTERFACE_INFO - { - interface_uid = REMCON_PLUGIN_IF; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = HIDREMCON_IMP; - version_no = 1; - display_name = "HidRemconBearer"; - default_data = ""; - opaque_data = ""; - } - }; - } - }; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/hidremconbearer/group/bld.inf --- a/localconnectivityservice/headset/hidremconbearer/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2007-2007 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 project hidremconbearer -* -*/ - -PRJ_PLATFORMS -DEFAULT - -PRJ_MMPFILES -hidremconbearer.mmp - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/hidremconbearer/group/hidremconbearer.mmp --- a/localconnectivityservice/headset/hidremconbearer/group/hidremconbearer.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2007-2007 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: Project definition file for project hidremconbearer -* -*/ - -#include -#include -#include -#include "../../inc/headsetuids.h" - - -TARGET hidremconbearer.dll - -// CAPABILITY CAP_ECOM_PLUGIN -// capabilities are required as that of remconbearerplugin.dll -// getting it from #include - -TARGETTYPE PLUGIN -UID 0x10009d8d HIDREMCON_UID -VENDORID VID_DEFAULT - -SOURCEPATH ../src -SOURCE hidremconbearermain.cpp -SOURCE hidremconbearerimplementation.cpp -SOURCE hidremconbearerobserver.cpp - - -START RESOURCE ../data/hidremconbearer.rss -TARGET hidremconbearer.rsc -END // ECOM resource definition - - -USERINCLUDE . ../inc ../../inc - -MW_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY remconbearerplugin.lib -LIBRARY remcontypes.lib - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/hidremconbearer/inc/debug.h --- a/localconnectivityservice/headset/hidremconbearer/inc/debug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ -/* -* Copyright (c) 2006-2009 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: Logging definition -* -*/ - -#ifndef DEBUG_H -#define DEBUG_H - -#include "debugconfig.h" - -#ifdef PRJ_ENABLE_TRACE - -#ifdef PRJ_FILE_TRACE -#include -#else -#include -#endif - -const TInt KMaxLogLineLength = 512; - -#define KPRINTERROR 0x00000001 // Tracing level: error -#define KPRINTINFO 0x00000002 // Tracing level: function trace -#define KPRINTSTATE 0x00000004 // Tracing level: state machine info -#define KPRINTWARNING 0x00000008 // Tracing level: warning - -const TInt KTraceMask = KPRINTERROR | KPRINTINFO | KPRINTSTATE | KPRINTWARNING; - -NONSHARABLE_CLASS(TOverflowTruncate16) : public TDes16Overflow - { -public: - void Overflow(TDes16& /*aDes*/) {} - }; - -NONSHARABLE_CLASS(TOverflowTruncate8) : public TDes8Overflow - { -public: - void Overflow(TDes8& /*aDes*/) {} - }; - -inline void Trace(TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); -#ifdef PRJ_FILE_TRACE - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); -#else - TBuf16 theFinalString; - theFinalString.Append(KTracePrefix16); - TOverflowTruncate16 overflow; - theFinalString.AppendFormatList(aFmt,list,&overflow); - RDebug::Print(theFinalString); -#endif - } - -inline void Trace(TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list, aFmt); -#ifdef PRJ_FILE_TRACE - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); -#else - TOverflowTruncate8 overflow; - TBuf8 buf8; - buf8.Append(KTracePrefix8); - buf8.AppendFormatList(aFmt, list, &overflow); - TBuf16 buf16(buf8.Length()); - buf16.Copy(buf8); - TRefByValue tmpFmt(_L("%S")); - RDebug::Print(tmpFmt, &buf16); -#endif - } - -inline void TracePanic( - char* aFile, - TInt aLine, - TInt aPanicCode, - const TDesC& aPanicCategory) - { - TPtrC8 fullFileName((const TUint8*)aFile); - TPtrC8 fileName(fullFileName.Ptr()+fullFileName.LocateReverse('\\')+1); - TBuf8 buf; - buf.Append(KPanicPrefix8); - buf.AppendFormat(_L8("%d at line %d in file %S"), aPanicCode, aLine, &fileName); - Trace(buf); - User::Panic(aPanicCategory, aPanicCode); - } - -inline void TraceLeave(char* aFile, TInt aLine, TInt aReason) - { - TPtrC8 fullFileName((const TUint8*)aFile); - TPtrC8 fileName(fullFileName.Ptr()+fullFileName.LocateReverse('\\')+1); - TBuf8 buf; - buf.Append(KLeavePrefix8); - buf.AppendFormat(_L8("%d at line %d in file %S"), aReason, aLine, &fileName); - Trace(buf); - User::LeaveIfError(aReason); - } - -#define TRACE_INFO(p) {if(KTraceMask & KPRINTINFO) Trace p;} - -#define TRACE_ERROR(p) {if(KTraceMask & KPRINTERROR) Trace p;} - -#define TRACE_STATE(p) {if(KTraceMask & KPRINTSTATE) Trace p;} - -#define TRACE_WARNING(p) {if(KTraceMask & KPRINTWARNING) Trace p;} - -#define TRACE_INFO_SEG(p) {if(KTraceMask & KPRINTINFO) p;} - -#define TRACE_ASSERT(GUARD, CODE) {if (!(GUARD)) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory);} - -#define PANIC(CODE) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory) - -#define LEAVE_IF_ERROR(REASON) {if (REASON) TraceLeave(__FILE__, __LINE__, REASON);} - -#define LEAVE(REASON) {TraceLeave(__FILE__, __LINE__, REASON);} - -#define TRACE_FUNC_ENTRY {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryFormat8, &ptr8);}} - -#define TRACE_FUNC_ENTRY_THIS {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryThisFormat8, &ptr8, this);}} - -#define TRACE_FUNC_EXIT {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncExitFormat8, &ptr8);}} - -#define TRACE_FUNC {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncFormat8, &ptr8);}} - -#define TRACE_FUNC_THIS {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncThisFormat8, &ptr8, this);}} - -#define RETURN_IF_ERR(ERR) {if(ERR) {TPtrC8 ptr8((TUint8*)__FILE__); Trace(_L8(" RETURN %d at file %S line %d"), ERR, &ptr8, __LINE__); return ERR;}} - -#else // PRJ_ENABLE_TRACE not defined - -#define TRACE_INFO(p) - -#define TRACE_ERROR(p) - -#define TRACE_STATE(p) - -#define TRACE_WARNING(p) - -#define TRACE_INFO_SEG(p) - -#define TRACE_ASSERT(GUARD, CODE) - -#define PANIC(CODE) {User::Panic(KPanicCategory, CODE);} - -#define LEAVE_IF_ERROR(REASON) {static_cast(User::LeaveIfError(REASON));} - -#define LEAVE(REASON) {static_cast(User::Leave(REASON));} - -#define TRACE_FUNC_ENTRY - -#define TRACE_FUNC_ENTRY_THIS - -#define TRACE_FUNC_EXIT - -#define TRACE_FUNC - -#define TRACE_FUNC_THIS - -#define RETURN_IF_ERR(ERR) {if(ERR) return ERR;} -#endif // PRJ_ENABLE_TRACE - -#endif // PRJ_LOGGING_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/hidremconbearer/inc/debugconfig.h --- a/localconnectivityservice/headset/hidremconbearer/inc/debugconfig.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2006-2009 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: Project configure file. -* -*/ - -#ifndef DEBUGCONFIG_H -#define DEBUGCONFIG_H - -#include "prjconfig.h" - - -/** - * Custom logging variations. - */ -#ifdef PRJ_FILE_TRACE -_LIT(KLogFile,"hidremcon.txt"); -_LIT(KLogDir,"hidremcon"); -#endif - -#ifdef PRJ_ENABLE_TRACE -_LIT(KTracePrefix16, "[hidremcon] "); -_LIT8(KTracePrefix8, "[hidremcon] "); -_LIT8(KFuncFormat8, "><%S"); -_LIT8(KFuncThisFormat8, "><%S, [0x%08X]"); -_LIT8(KFuncEntryFormat8, ">%S"); -_LIT8(KFuncEntryThisFormat8, ">%S, [0x%08X]"); -_LIT8(KFuncExitFormat8, "<%S"); - -_LIT(KPanicCategory, "hidremcon"); -_LIT8(KPanicPrefix8, "PANIC code "); -_LIT8(KLeavePrefix8, "LEAVE code "); -#endif - -#endif // REMCONBEARER_DEBUGCONFIG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/hidremconbearer/inc/hidremconbearerimplementation.h --- a/localconnectivityservice/headset/hidremconbearer/inc/hidremconbearerimplementation.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,287 +0,0 @@ -/* -* Copyright (c) 2005-2009 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: Declaration of class CHidRemconBearer. - * -*/ - - -#ifndef C_HIDREMCONBEARER_H -#define C_HIDREMCONBEARER_H - -#include -#include -#include -#include -#include -#include -#include - -#include "hidremconbearerobserver.h" - -//CONSTANTS -const TInt KDataBufferSize = 10; - -/** - * CHidRemconBearer - * Implementation of the Rem Con Bearer Plugin - * - */ -class CHidRemconBearer : public CRemConBearerPlugin, - public MRemConBearerInterface, - public MCallBackReceiver - { -public: - - /** - * Two-phased constructor. - * @param aParams required for the CRemConBearerPlugin - * @return hidremconbearer plugin - */ - static CHidRemconBearer* NewL( TBearerParams& aParams ); - - /** - * Destructor. - */ - virtual ~CHidRemconBearer(); - -private: - - /** - * Constructor - * @param aParams bearer parameters - */ - CHidRemconBearer( TBearerParams& aParams ); - - /** - * Two - phase construction. - */ - void ConstructL(); - -private: - // from CRemConBearerPlugin - - /** - * From class CRemConBearerPlugin - * Called by RemCon server to get a pointer to an object which implements - * the bearer API with UID aUid. This is a mechanism for allowing future - * change to the bearer API without breaking BC in existing (non-updated) - * bearer plugins. - * - * @param aUid Inteface uid - * @return Return pointer to interface - */ - TAny* GetInterface( TUid aUid ); - -private: - // from MRemConBearerInterface - - /** - * From class MRemConBearerInterface - * Called by RemCon to retrieve a response on a connection. - * - * @param aInterfaceUid Inteface uid - * @param aTransactionId Transaction id - * @param aOperationId operation ID - * @param aData API-specific message data. - * @param aAddr The connection. - * @return Error code - */ - TInt GetResponse( TUid& aInterfaceUid, TUint& aTransactionId, - TUint& aOperationId, RBuf8& aData, TRemConAddress& aAddr ); - - /** - * From class MRemConBearerInterface - * Send Remcon command - * - * @param aInterfaceUid Inteface uid - * @param aCommand command id - * @param aTransactionId Transaction id - * @param aData API-specific message data. - * @param aAddr The connection. - * @return Error code - */ - TInt SendCommand( TUid aInterfaceUid, TUint aCommand, - TUint aTransactionId, RBuf8& aData, const TRemConAddress& aAddr ); - - /** - * From class MRemConBearerInterface - * Get Remcon command - * - * @param aInterfaceUid Inteface uid - * @param aTransactionId Transaction id - * @param aCommand command id - * @param aData API-specific message data. - * @param aAddr The connection. - * @return Error code - */ - TInt GetCommand( TUid& aInterfaceUid, TUint& aTransactionId, - TUint& aCommand, RBuf8& aData, TRemConAddress& aAddr ); - - /** - * From class MRemConBearerInterface - * Send Response - * - * @param aInterfaceUid Inteface uid - * @param aOperationID operation id - * @param aTransactionId Transaction id - * @param aData API-specific message data. - * @param aAddr The connection. - * @return Error code - */ - TInt SendResponse( TUid aInterfaceUid, TUint aOperationId, - TUint aTransactionId, RBuf8& aData, const TRemConAddress& aAddr ); - - /** - * From class MRemConBearerInterface - * Connect request - * - * @param aAddr The connection. - */ - void ConnectRequest( const TRemConAddress& aAddr ); - - /** - * From class MRemConBearerInterface - * Disconnect request - * - * @param aAddr The connection. - */ - void DisconnectRequest( const TRemConAddress& aAddr ); - - /** - * From class MRemConBearerInterface - * Clientstatus - * - * @param aControllerPresent Controllerpresent status - * @param aTargetPresent Target present status - */ - void ClientStatus( TBool aControllerPresent, TBool aTargetPresent ); - - /** - * From class MRemConBearerInterface - * Return security policy - * - * @return Security policy - */ - TSecurityPolicy SecurityPolicy() const; - -private: - // from MCallBackReceiver - - /** - * From class MCallBackReceiver - * Return security policy - * - * @param aScanCode a scancode - * @param aKeyType a Keytype - */ - void ReceivedKeyEvent( TInt aScanCode, TInt aKeyType ); - -private: - /** - * From class MCallBackReceiver - * Set SVK Operation ID and Data - * - * @param aEnumValue OperationID and data field - */ - void SetSVKOperationIdAndData( TInt aEnumValue ); - - /** - * From class MCallBackReceiver - * Set Mute Operation ID and Data - * - * @param aEnumValue OperationID and data field - */ - void SetMuteKeyOperationIdAndData( TInt aEnumValue ); - - /** - * From class MCallBackReceiver - * Set Media key Operation ID and Data - * - * @param aEnumValue OperationID and data field - */ - void SetMediaKeyOperationIdAndData( TInt aEnumValue ); - - /** - * From class MCallBackReceiver - * Set Media key Operation ID and Data - * - * @param aEnumValue OperationID and data field - */ - void SetPhoneKeyOperationIdAndData( TInt aEnumValue ); - - /** - * RestartExpired observer - * - * @param aKeyType type of key - */ - void RestartKeyObeserver( TInt aKeyType ); - - /** - * Restart Expired observer - * - * @param aEnumValue a value of key - * @param aKeyType A type of key - */ - void HandleKeyOperation( TInt aEnumValue, TInt aKeyType ); - -private: - // Data - - /** - * Interface uid of last correct-decoded message - */ - TUid iInterfaceUid; - - /** - * Operation uid of last correct-decoded message - */ - TUint iOperationId; - - /** - * Data of last correct-decoded message - */ - TBuf8 iData; - - /** - * Transactionid uid of last correct-decoded message - */ - TUint iTransactionId; - - /** - * Media key observer - * Own. - */ - CHidRemconBearerObserver* iMediaKeyObserver; - - /** - * Accessory volume key observer - * Own. - */ - CHidRemconBearerObserver* iAccessoryVolKeyObserver; - - /** - * Mute key observer - * Own. - */ - CHidRemconBearerObserver* iMuteKeyObserver; - - /** - * Phone key observer - * Own. - */ - CHidRemconBearerObserver* iHookKeyObserver; - - }; - -#endif // HIDREMCONBEARERIMPLEMENTATION_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/hidremconbearer/inc/hidremconbearerinternalpskeys.h --- a/localconnectivityservice/headset/hidremconbearer/inc/hidremconbearerinternalpskeys.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* Copyright (c) 2005-2009 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: HidRemconBearer internal Publish & Subscribe keys. - * -*/ - - -#ifndef HIDREMCONBEARERINTERNALPSKEYS_H -#define HIDREMCONBEARERINTERNALPSKEYS_H - -const TUid KPSUidHidEventNotifier = - { - 0x101f9067 - /*0x10282c19*/}; // hid event publisher uid - -// Media Keys Notification API - -const TUint32 KHidControlKeyEvent = 0x00000001; -const TUint32 KHidAccessoryVolumeEvent = 0x00000002; -const TUint32 KHidMuteKeyEvent = 0x00000003; -const TUint32 KHidHookKeyEvent = 0x00000004; - -#endif // __HIDREMCONBEARERINTERNALPSKEYS_H__ diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/hidremconbearer/inc/hidremconbearerobserver.h --- a/localconnectivityservice/headset/hidremconbearer/inc/hidremconbearerobserver.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,147 +0,0 @@ -/* -* Copyright (c) 2005-2009 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: Declaration of class CHidRemconBearerObserver - * -*/ - - -#ifndef C_HIDREMCONBEAREROBSERVER_H -#define C_HIDREMCONBEAREROBSERVER_H - -#include -#include - -/** - * Observer key types - */ -enum TObserverKeyType - { - EMediaKeys = 0, - EAccessoryVolumeKeys, - EMuteKey, - EHookKeys - }; - -/** - * Call Back Receiver - * On receiving event from the P & S, CHidRemconBearerObserver calls - * this function - * - */ -class MCallBackReceiver - { -public: - /** - * Called when event has arrived from P&S. - * - * @param aEnumValue Enum value representing the key and action - * @param aKeyType will indicate whether it is Volume key or Media key - */ - virtual void ReceivedKeyEvent( TInt aEnumValue, TInt aKeyType ) = 0; - }; - -/** - * Hid remcon bearer observer - * This class inplements the Active Object. There will be two instance - * of this ,one for handling Volume keys and other for Media Keys - * - */ -class CHidRemconBearerObserver : public CActive - { -public: - // Constructors and destructor - - /** - * Two-phased constructor. - * @param aCallback reference of the class which implements - * MCallBackReceiver for handling call back - * functions - * @param aKeyType Indiacates whether it is side volume key or - * media key - * @return remconbearer observer - */ - static CHidRemconBearerObserver* NewL( MCallBackReceiver& aCallback, - TInt aKeyType ); - /** - * Destructor. - */ - virtual ~CHidRemconBearerObserver(); - -public: - /** - * Start remconbearer observer key events - * - * @return Error code - */ - TInt Start(); - - /** - * Stop remconbearer observer key events - * - */ - void Stop(); - -private: - /** - * Two-phased constructor. - * @param aCallback reference of the class which implements - * MCallBackReceiver for handling call back - * functions - */ - CHidRemconBearerObserver( MCallBackReceiver& aCallback ); - - /** - * Two-phased constructor. - * @param aKeyType Indiacates whether it is side volume key or - * media key - */ - void ConstructL( TInt aKeyType ); - -private: - // From Base class CActive - - /** - * From CActive - * Handles an active object's request completion event. - * - */ - void RunL(); - - /** - * From CActive - * Canceling outstanding request - * - */ - void DoCancel(); - -private: - // Data - /** - * RProperty for key subscribing key values - */ - RProperty iProperty; - - /** - * Callback to request handler - */ - MCallBackReceiver& iCallback; - - /** - * Key type - */ - TInt iKeyType; // Vol key or media Key - }; - -#endif // HIDREMCONBEAREROBSERVER_H -// End of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/hidremconbearer/inc/hidremconbearerscancodes.h --- a/localconnectivityservice/headset/hidremconbearer/inc/hidremconbearerscancodes.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* -* Copyright (c) 2005-2009 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: Hid remconbearer scan codes - * -*/ - - -#ifndef HIDREMCONBEARERBEARERSCANCODES_H -#define HIDREMCONBEARERBEARERSCANCODES_H - -/** - * Side volume Key Codes - */ -const TInt KPSVolumeDownReleased = -3; -const TInt KPSVolumeDownPressed = -2; -const TInt KPSVolumeDownClicked = -1; -const TInt KPSVolumeNoKey = 0; -const TInt KPSVolumeUpClicked = 1; -const TInt KPSVolumeUpPressed = 2; -const TInt KPSVolumeUpReleased = 3; -const TInt KPSMuteClicked = 4; -const TInt KPSMutePressed = 5; -const TInt KPSMuteReleased = 6; -// Hook keys keys -const TInt KPSAnsweClicked = 1; -const TInt KPSHangUpClicked = 2; -const TInt KPSRedial = 3; -const TInt KPSVoiceDial = 4; - -/** - * Media Key codes - */ -enum TMediaKeyValues - { - EPlayReleased = 0, - EPlayPressed, - EPlayClicked, - EStopReleased, - EStopPressed, - EStopClicked, - EForwardReleased, - EForwardPressed, - EForwardClicked, - ERewindReleased, - ERewindPressed, - ERewindClicked, - EFastForwardReleased, - EFastForwardPressed, - EFastForwardClicked, - EBackwardReleased, - EBackwardPressed, - EBackwardClicked, - EMuteReleased, - EMutePressed, - EMuteClicked - }; - -#endif // HIDREMCONBEARERBEARERSCANCODE_H -//End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/hidremconbearer/inc/prjconfig.h --- a/localconnectivityservice/headset/hidremconbearer/inc/prjconfig.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2006-2009 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: Project configure file. -* -*/ - - -#ifndef PRJCONFIG_H -#define PRJCONFIG_H - -/** - * Traces are enabled via RDebug::Print() in UDEB build, by default. - */ -#ifdef _DEBUG -#define PRJ_ENABLE_TRACE -#endif - -/** - * Traces will be written to file if this is defined. - */ -//#define PRJ_FILE_TRACE - - -/** - * build the project for module test purpose if this is defined - */ -//#define PRJ_MODULETEST_BUILD - -/** - * build the project using stubs to replace the dependencies if this is defined - */ -//#define PRJ_USE_STUB - -#endif // PRJCONFIG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/hidremconbearer/src/hidremconbearerimplementation.cpp --- a/localconnectivityservice/headset/hidremconbearer/src/hidremconbearerimplementation.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,522 +0,0 @@ -/* -* Copyright (c) 2005-2009 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: Bearer plugin API Implementation file - * -*/ - -#include -#include -#include -#include -#include -#include -#include // Property values -#include -#include "hidremconbearerinternalpskeys.h" -#include "hidremconbearerscancodes.h" -#include "hidremconbearerimplementation.h" -#include "hidremconbearerobserver.h" -#include "debug.h" - -_LIT8(KFormatString,"%c"); -_LIT8(KVoiceFormatString,"%d"); -_LIT_SECURITY_POLICY_C1(KHidRemconBearerReadPolicy, ECapability_None); -_LIT_SECURITY_POLICY_C1(KHidRemconBearerWritePolicy, ECapability_None); - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CHidRemconBearer::NewL() -// Description: Factory function. -// return: Ownership of a new CHidRemconBearer. -// --------------------------------------------------------------------------- -// -CHidRemconBearer* CHidRemconBearer::NewL( TBearerParams& aParams ) - { - CHidRemconBearer* self = new ( ELeave ) CHidRemconBearer( aParams ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CHidRemconBearer::~CHidRemconBearer() -// Destructor. -// --------------------------------------------------------------------------- -// -CHidRemconBearer::~CHidRemconBearer() - { - delete iMediaKeyObserver; - delete iAccessoryVolKeyObserver; - delete iMuteKeyObserver; - delete iHookKeyObserver; - } - -// --------------------------------------------------------------------------- -// CHidRemconBearer::CHidRemconBearer() -// construction. -// --------------------------------------------------------------------------- -// -CHidRemconBearer::CHidRemconBearer( TBearerParams& aParams ) : - CRemConBearerPlugin( aParams ) - { - //Pass - } - -// --------------------------------------------------------------------------- -// CHidRemconBearer::ConstructL() -// 2nd-phase construction. -// --------------------------------------------------------------------------- -// -void CHidRemconBearer::ConstructL() - { - TRACE_FUNC_ENTRY - // throw an indication up to RemCon. - TRemConAddress addr; - addr.BearerUid() = Uid(); - TInt err = Observer().ConnectIndicate( addr ); - - //Define the P&S for Volume keys and Media Keys - RProperty::Define( KPSUidHidEventNotifier, KHidControlKeyEvent, - RProperty::EInt, KHidRemconBearerReadPolicy, - KHidRemconBearerWritePolicy ); - // Define P&S Key for Volume keys from Accessory device - RProperty::Define( KPSUidHidEventNotifier, KHidAccessoryVolumeEvent, - RProperty::EInt, KHidRemconBearerReadPolicy, - KHidRemconBearerWritePolicy ); - // Define P&S Key for Mute key from Accessory device - RProperty::Define( KPSUidHidEventNotifier, KHidMuteKeyEvent, - RProperty::EInt, KHidRemconBearerReadPolicy, - KHidRemconBearerWritePolicy ); - - // Define P&S Key for phone keys from Accessory device - RProperty::Define( KPSUidHidEventNotifier, KHidHookKeyEvent, - RProperty::EInt, KHidRemconBearerReadPolicy, - KHidRemconBearerWritePolicy ); - - // Start Active object for listening key events from P&S - - iMediaKeyObserver = CHidRemconBearerObserver::NewL( *this, EMediaKeys ); - iAccessoryVolKeyObserver = CHidRemconBearerObserver::NewL( *this, - EAccessoryVolumeKeys ); - - iMuteKeyObserver = CHidRemconBearerObserver::NewL( *this, EMuteKey ); - - iHookKeyObserver = CHidRemconBearerObserver::NewL( *this, EHookKeys ); - } -// --------------------------------------------------------------------------- -// CHidRemconBearer::ConnectRequest() -// Rem Con server send connect request to Bearer Plugin -// --------------------------------------------------------------------------- -// -void CHidRemconBearer::ConnectRequest( const TRemConAddress& /*aAddr*/) - { - TRACE_FUNC - // Pass - } -// --------------------------------------------------------------------------- -// CHidRemconBearer::DisconnectRequest() -// Rem Con server send disconnect request to Bearer Plugin -// --------------------------------------------------------------------------- -// -void CHidRemconBearer::DisconnectRequest( const TRemConAddress& /*aAddr*/) - { - TRACE_FUNC - // Pass - } - -// --------------------------------------------------------------------------- -// CHidRemconBearer::SendResponse() -// -// --------------------------------------------------------------------------- -// -TInt CHidRemconBearer::SendResponse( TUid /* aInterfaceUid */, - TUint /*aOperationId*/, - TUint /*aTransactionId*/, // we don't care about this transaction ID - RBuf8& aData, - const TRemConAddress& /*aAddr*/) - { - TRACE_FUNC - aData.Close(); - return KErrNone; - } -// --------------------------------------------------------------------------- -// CHidRemconBearer::SendCommand() -// -// --------------------------------------------------------------------------- -// -TInt CHidRemconBearer::SendCommand( TUid /* aInterfaceUid */, - TUint /* aOperationId */, TUint /* aTransactionId */, - RBuf8& /* aData */, const TRemConAddress& /*aAddr*/) - { - TRACE_FUNC - return KErrNone; - } -// --------------------------------------------------------------------------- -// CHidRemconBearer::GetResponse() -// -// --------------------------------------------------------------------------- -// -TInt CHidRemconBearer::GetResponse( TUid& /* aInterfaceUid */, - TUint& /* aTransactionId*/, TUint& /* aOperationId */, - RBuf8& /* aData */, TRemConAddress& /*aAddr */) - { - TRACE_FUNC - return KErrNone; - } -// --------------------------------------------------------------------------- -// CHidRemconBearer::GetCommand() -// -// --------------------------------------------------------------------------- -// -TInt CHidRemconBearer::GetCommand( TUid& aInterfaceUid, - TUint& aTransactionId, TUint& aOperationId, RBuf8& aData, - TRemConAddress& aAddr ) - { - TRACE_FUNC - aInterfaceUid = iInterfaceUid; - aOperationId = iOperationId; - // Pass ownership of this to RemCon. - TRAPD(retTrap, aData.CreateL(iData)); - if ( retTrap != KErrNone ) - { - return retTrap; - } - aAddr.BearerUid() = Uid(); - aAddr.Addr() = KNullDesC8(); - aTransactionId = iTransactionId; - return KErrNone; - } -// --------------------------------------------------------------------------- -// CHidRemconBearer::SetSVKOperationIdAndData() -// --------------------------------------------------------------------------- -// -void CHidRemconBearer::SetSVKOperationIdAndData( TInt aEnumValue ) - { - TRACE_FUNC - // 1. Interface ID is required when Getcommand is called - iInterfaceUid = TUid::Uid( KRemConCoreApiUid ); // from Remconcoreapi.h - switch ( aEnumValue ) - { - case KPSVolumeUpPressed: - iOperationId = ERemConCoreApiVolumeUp; - iData.Format( KFormatString, ERemConCoreApiButtonPress ); - break; - case KPSVolumeUpReleased: - iOperationId = ERemConCoreApiVolumeUp; - iData.Format( KFormatString, ERemConCoreApiButtonRelease ); - break; - case KPSVolumeUpClicked: - iOperationId = ERemConCoreApiVolumeUp; - iData.Format( KFormatString, ERemConCoreApiButtonClick ); - break; - case KPSVolumeDownPressed: - iOperationId = ERemConCoreApiVolumeDown; - iData.Format( KFormatString, ERemConCoreApiButtonPress ); - break; - case KPSVolumeDownReleased: - iOperationId = ERemConCoreApiVolumeDown; - iData.Format( KFormatString, ERemConCoreApiButtonRelease ); - break; - case KPSVolumeDownClicked: - iOperationId = ERemConCoreApiVolumeDown; - iData.Format( KFormatString, ERemConCoreApiButtonClick ); - break; - case KPSVolumeNoKey: // This should never execute - break; - default: - iOperationId = aEnumValue; - iData.Format( KFormatString, ERemConCoreApiButtonClick ); - break; - } - } - -// --------------------------------------------------------------------------- -// CHidRemconBearer::SetMuteKeyOperationIdAndData -// --------------------------------------------------------------------------- -// -void CHidRemconBearer::SetMuteKeyOperationIdAndData( TInt aEnumValue ) - { - TRACE_INFO((_L("[HID]\tCHidRemconBearer::SetMuteKeyOperation \ - IdAndData( %d )"), aEnumValue)); - // 1. Interface ID is required when Getcommand is called - iInterfaceUid = TUid::Uid( KRemConCoreApiUid ); // from Remconcoreapi.h - switch ( aEnumValue ) - { - case KPSMutePressed: - iOperationId = ERemConCoreApiMute; - iData.Format( KFormatString, ERemConCoreApiButtonPress ); - break; - case KPSMuteReleased: - iOperationId = ERemConCoreApiMute; - iData.Format( KFormatString, ERemConCoreApiButtonRelease ); - break; - case KPSMuteClicked: - iOperationId = ERemConCoreApiMute; - iData.Format( KFormatString, ERemConCoreApiButtonClick ); - break; - default: - TRACE_INFO(_L("CHidRemconBearer::SetMuteKeyOperationIdAndData : \ - Not supported")) - ; - } - } - -// --------------------------------------------------------------------------- -// CHidRemconBearer::SetMediaKeyOperationIdAndData() -// --------------------------------------------------------------------------- -// -void CHidRemconBearer::SetMediaKeyOperationIdAndData( TInt aEnumValue ) - { - TRACE_FUNC - // 1. Interface ID is required when Getcommand is called - iInterfaceUid = TUid::Uid( KRemConCoreApiUid ); // from Remconcoreapi.h - switch ( aEnumValue ) - { - case EPlayReleased: - iOperationId = ERemConCoreApiPausePlayFunction; - iData.Format( KFormatString, ERemConCoreApiButtonRelease ); - break; - case EPlayPressed: - iOperationId = ERemConCoreApiPausePlayFunction; - iData.Format( KFormatString, ERemConCoreApiButtonPress ); - break; - case EPlayClicked: - iOperationId = ERemConCoreApiPausePlayFunction; - iData.Format( KFormatString, ERemConCoreApiButtonClick ); - break; - case EStopReleased: - iOperationId = ERemConCoreApiStop; - iData.Format( KFormatString, ERemConCoreApiButtonRelease ); - break; - case EStopPressed: - iOperationId = ERemConCoreApiStop; - iData.Format( KFormatString, ERemConCoreApiButtonPress ); - break; - case EStopClicked: - iOperationId = ERemConCoreApiStop; - iData.Format( KFormatString, ERemConCoreApiButtonClick ); - break; - case EForwardReleased: - iOperationId = ERemConCoreApiForward; - iData.Format( KFormatString, ERemConCoreApiButtonRelease ); - break; - case EForwardPressed: - iOperationId = ERemConCoreApiForward; - iData.Format( KFormatString, ERemConCoreApiButtonPress ); - break; - case EForwardClicked: - iOperationId = ERemConCoreApiForward; - iData.Format( KFormatString, ERemConCoreApiButtonClick ); - break; - case ERewindReleased: - iOperationId = ERemConCoreApiRewind; - iData.Format( KFormatString, ERemConCoreApiButtonRelease ); - break; - case ERewindPressed: - iOperationId = ERemConCoreApiRewind; - iData.Format( KFormatString, ERemConCoreApiButtonPress ); - break; - case ERewindClicked: - iOperationId = ERemConCoreApiRewind; - iData.Format( KFormatString, ERemConCoreApiButtonClick ); - break; - case EFastForwardReleased: - iOperationId = ERemConCoreApiFastForward; - iData.Format( KFormatString, ERemConCoreApiButtonRelease ); - break; - case EFastForwardPressed: - iOperationId = ERemConCoreApiFastForward; - iData.Format( KFormatString, ERemConCoreApiButtonPress ); - break; - case EFastForwardClicked: - iOperationId = ERemConCoreApiFastForward; - iData.Format( KFormatString, ERemConCoreApiButtonClick ); - break; - case EBackwardReleased: - iOperationId = ERemConCoreApiBackward; - iData.Format( KFormatString, ERemConCoreApiButtonRelease ); - break; - case EBackwardPressed: - iOperationId = ERemConCoreApiBackward; - iData.Format( KFormatString, ERemConCoreApiButtonPress ); - break; - case EBackwardClicked: - iOperationId = ERemConCoreApiBackward; - iData.Format( KFormatString, ERemConCoreApiButtonClick ); - break; - // This should never execute - default: - iOperationId = aEnumValue; - iData.Format( KFormatString, ERemConCoreApiButtonClick ); - break; - - } - } -// --------------------------------------------------------------------------- -// CHidRemconBearer::ReceivedKeyEvent() -// --------------------------------------------------------------------------- -// -void CHidRemconBearer::SetPhoneKeyOperationIdAndData( TInt aEnumValue ) - { - TRACE_FUNC_ENTRY - iInterfaceUid = TUid::Uid( KRemConExtCallHandlingApiUid ); - switch ( aEnumValue ) - { - case KPSAnsweClicked: - TRACE_INFO((_L("[HID]\tCHidRemconBearer::SetPhoneKey \ - OperationIdAndData Answer"))); - iOperationId = ERemConExtAnswerCall; - iData.Format( KFormatString, ERemConCoreApiButtonClick ); - break; - case KPSHangUpClicked: - iOperationId = ERemConExtEndCall; - iData.Format( KFormatString, ERemConCoreApiButtonClick ); - break; - case KPSRedial: - iOperationId = ERemConExtLastNumberRedial; - iData.Format( KFormatString, ERemConCoreApiButtonClick ); - break; - case KPSVoiceDial: - iOperationId = ERemConExtVoiceDial; - iData.Format( KVoiceFormatString, ERemConCoreApiButtonRelease ); - break; - default: - TRACE_INFO(_L("CHidRemconBearer::SetPhoneKeyOperationIdAndData \ - : Not supported")); } - TRACE_FUNC_EXIT - } -// --------------------------------------------------------------------------- -// CHidRemconBearer::ReceivedKeyEvent() -// --------------------------------------------------------------------------- -// -void CHidRemconBearer::ReceivedKeyEvent( TInt aEnumValue, TInt aKeyType ) - { - TRACE_INFO((_L("[HID]\tCHidRemconBearer::ReceivedKeyEvent: value %d, \ - type %d )"), aEnumValue, aKeyType)); - - /* To keep the background light on */ - User::ResetInactivityTime(); - - // 2. Transaction ID - iTransactionId = Observer().NewTransactionId(); - - // 3. Addr - TRemConAddress addr; - addr.BearerUid() = Uid(); - addr.Addr() = KNullDesC8(); - - // 4 & 5. Operation ID and Data - HandleKeyOperation( aEnumValue, aKeyType ); - - // Msgtype is ERemConCommand - TInt error = Observer().NewCommand( addr ); - TRACE_INFO((_L("[HID]\tCHidRemconBearer::ReceivedKeyEvent: error %d )"), - error)); - //Start the listener once again - RestartKeyObeserver( aKeyType ); - - } - -// --------------------------------------------------------------------------- -// CHidRemconBearer::RestartKeyObeserver -// --------------------------------------------------------------------------- -// -void CHidRemconBearer::RestartKeyObeserver( TInt aKeyType ) - { - TRACE_FUNC_ENTRY - switch ( aKeyType ) - { - case EMediaKeys: - iMediaKeyObserver->Start(); - break; - case EAccessoryVolumeKeys: - iAccessoryVolKeyObserver->Start(); - break; - case EMuteKey: - iMuteKeyObserver->Start(); - break; - case EHookKeys: - iHookKeyObserver->Start(); - break; - default: - TRACE_INFO(_L("CHidRemconBearer::RestartKeyObeserver : Not supported")) - ; - } - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// CHidRemconBearer::RestartObexserver -// --------------------------------------------------------------------------- -// -void CHidRemconBearer::HandleKeyOperation( TInt aEnumValue, TInt aKeyType ) - { - TRACE_FUNC_ENTRY - switch ( aKeyType ) - { - case EAccessoryVolumeKeys: - SetSVKOperationIdAndData( aEnumValue ); - break; - case EMuteKey: - SetMuteKeyOperationIdAndData( aEnumValue ); - break; - case EMediaKeys: - SetMediaKeyOperationIdAndData( aEnumValue ); - break; - case EHookKeys: - SetPhoneKeyOperationIdAndData( aEnumValue ); - break; - default: - TRACE_INFO(_L("CHidRemconBearer::HandleKeyOperation : Not \ - supported")) - ; - } - TRACE_FUNC_EXIT - } -// --------------------------------------------------------------------------- -// CHidRemconBearer::SecurityPolicy() -// --------------------------------------------------------------------------- -// -TSecurityPolicy CHidRemconBearer::SecurityPolicy() const - { - return TSecurityPolicy( ECapabilityLocalServices ); - } - -// --------------------------------------------------------------------------- -// CHidRemconBearer::ClientStatus() -// --------------------------------------------------------------------------- -// -void CHidRemconBearer::ClientStatus( TBool /*aControllerPresent*/, TBool /*aTargetPresent*/) - { - //Pass - TRACE_FUNC - } - -// --------------------------------------------------------------------------- -// CHidRemconBearer::GetInterface() -// --------------------------------------------------------------------------- -// -TAny* CHidRemconBearer::GetInterface( TUid aUid ) - { - TRACE_FUNC - TAny* ret = NULL; - if ( aUid == TUid::Uid( KRemConBearerInterface1 ) ) - { - ret = reinterpret_cast ( - static_cast ( this ) ); - } - return ret; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/hidremconbearer/src/hidremconbearermain.cpp --- a/localconnectivityservice/headset/hidremconbearer/src/hidremconbearermain.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2007-2009 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: Bearer plugin implementation proxy - * -*/ - - -#include -#include "hidremconbearerimplementation.h" -#include "headsetuids.h" - -/** - * Implementation table - */ -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY(HIDREMCON_IMP, CHidRemconBearer::NewL), - }; - -// --------------------------------------------------------------------------- -// ImplementationGroupProxy () -// --------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - return ImplementationTable; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/hidremconbearer/src/hidremconbearerobserver.cpp --- a/localconnectivityservice/headset/hidremconbearer/src/hidremconbearerobserver.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,156 +0,0 @@ -/* -* Copyright (c) 2007-2009 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: Remcon bearer observer implementation - * -*/ - - -//INCLUDE -#include -#include -#include - -#include "hidremconbearerinternalpskeys.h" -#include "hidremconbearerobserver.h" -#include "debug.h" -// ======== MEMBER FUNCTIONS ======== -// -// --------------------------------------------------------------------------- -// CHidRemconBearerObserver::NewL() -// Constructs a new entry with given values. -// --------------------------------------------------------------------------- -// -CHidRemconBearerObserver* CHidRemconBearerObserver::NewL( - MCallBackReceiver& aCallback, TInt aKeyType ) - { - CHidRemconBearerObserver* self = new ( ELeave ) CHidRemconBearerObserver( - aCallback ); - CleanupStack::PushL( self ); - self->ConstructL( aKeyType ); - CleanupStack::Pop(); - return self; - } -// --------------------------------------------------------------------------- -// CHidRemconBearerObserver::CHidRemconBearerObserver() -// C++ constructor -// --------------------------------------------------------------------------- -// -CHidRemconBearerObserver::CHidRemconBearerObserver( - MCallBackReceiver& aCallback ) : - CActive( EPriorityStandard ), iCallback( aCallback ) - { - //Pass - TRACE_FUNC - } -// --------------------------------------------------------------------------- -// CHidRemconBearerObserver::CHidRemconBearerObserver() -// Destructor -// --------------------------------------------------------------------------- -// -CHidRemconBearerObserver::~CHidRemconBearerObserver() - { - TRACE_FUNC - Stop(); - if ( iProperty.Handle() != KNullHandle ) - { - iProperty.Close(); - } - } -// --------------------------------------------------------------------------- -// CHidRemconBearerObserver::ConstructL() -// Symbian OS default constructor -// --------------------------------------------------------------------------- -// -void CHidRemconBearerObserver::ConstructL( TInt aKeyType ) - { - TRACE_FUNC - iKeyType = aKeyType; - // Add this active object to the scheduler. - CActiveScheduler::Add( this ); - switch ( iKeyType ) - { - case EMediaKeys: - User::LeaveIfError( iProperty.Attach( KPSUidHidEventNotifier, - KHidControlKeyEvent ) ); - break; - case EAccessoryVolumeKeys: - User::LeaveIfError( iProperty.Attach( KPSUidHidEventNotifier, - KHidAccessoryVolumeEvent ) ); - break; - case EMuteKey: - User::LeaveIfError( iProperty.Attach( KPSUidHidEventNotifier, - KHidMuteKeyEvent ) ); - break; - case EHookKeys: - User::LeaveIfError( iProperty.Attach( KPSUidHidEventNotifier, - KHidHookKeyEvent ) ); - break; - default: - User::Leave( KErrArgument ); - } - Start(); - } -// --------------------------------------------------------------------------- -// CHidRemconBearerObserver::Start() -// Starts listening KUidCurrentCall event -// --------------------------------------------------------------------------- -// -TInt CHidRemconBearerObserver::Start() - { - TRACE_FUNC - if ( IsActive() ) - { - return KErrInUse; - } - iStatus = KRequestPending; - iProperty.Subscribe( iStatus ); - SetActive(); - return KErrNone; - } -// --------------------------------------------------------------------------- -// CHidRemconBearerObserver::Stop() -// Stops listening KUidCurrentCall event -// --------------------------------------------------------------------------- -// -void CHidRemconBearerObserver::Stop() - { - TRACE_FUNC - Cancel(); - } -// --------------------------------------------------------------------------- -// CHidRemconBearerObserver::RunL() -// --------------------------------------------------------------------------- -// -void CHidRemconBearerObserver::RunL() - { - TInt scanCode; - TInt ret = 0; - ret = iProperty.Get( scanCode ); - if ( ret == KErrNone ) - { - // If this Active Object is for receiving the USB MTP status, the - // scanCode varibale contains the status whether transfer is - // happening now(active) or not(not active). - iCallback.ReceivedKeyEvent( scanCode, iKeyType ); - } - } -// --------------------------------------------------------------------------- -// CHidRemconBearerObserver::DoCancel() -// Cancels event listening -// --------------------------------------------------------------------------- -// -void CHidRemconBearerObserver::DoCancel() - { - iProperty.Cancel(); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/inc/debug.h --- a/localconnectivityservice/headset/inc/debug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,176 +0,0 @@ -/* -* Copyright (c) 2007-2009 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: Logging definition - * -*/ - - -#ifndef DEBUG_H -#define DEBUG_H - -#include "debugconfig.h" - -#ifdef PRJ_ENABLE_TRACE - -#ifdef PRJ_FILE_TRACE -#include -#else -#include -#endif - -const TInt KMaxLogLineLength = 512; - -#define KPRINTERROR 0x00000001 // Tracing level: error -#define KPRINTINFO 0x00000002 // Tracing level: function trace -#define KPRINTSTATE 0x00000004 // Tracing level: state machine info -#define KPRINTWARNING 0x00000008 // Tracing level: warning -const TInt KTraceMask = KPRINTERROR | KPRINTINFO | KPRINTSTATE - | KPRINTWARNING; - -NONSHARABLE_CLASS(TOverflowTruncate16) : public TDes16Overflow - { -public: - void Overflow( TDes16& /*aDes*/) - { - } - }; - -NONSHARABLE_CLASS(TOverflowTruncate8) : public TDes8Overflow - { -public: - void Overflow( TDes8& /*aDes*/) - { - } - }; - -inline void Trace( TRefByValue aFmt, ... ) - { - VA_LIST list; - VA_START(list,aFmt); -#ifdef PRJ_FILE_TRACE - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); -#else - TBuf16 theFinalString; - theFinalString.Append( KTracePrefix16 ); - TOverflowTruncate16 overflow; - theFinalString.AppendFormatList( aFmt, list, &overflow ); - RDebug::Print( theFinalString ); -#endif - } - -inline void Trace( TRefByValue aFmt, ... ) - { - VA_LIST list; - VA_START(list, aFmt); -#ifdef PRJ_FILE_TRACE - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); -#else - TOverflowTruncate8 overflow; - TBuf8 buf8; - buf8.Append( KTracePrefix8 ); - buf8.AppendFormatList( aFmt, list, &overflow ); - TBuf16 buf16( buf8.Length() ); - buf16.Copy( buf8 ); - TRefByValue tmpFmt( _L("%S")); - RDebug::Print( tmpFmt, &buf16 ); -#endif - } - -inline void TracePanic( char* aFile, TInt aLine, TInt aPanicCode, - const TDesC& aPanicCategory ) - { - TPtrC8 fullFileName( (const TUint8*) aFile ); - TPtrC8 fileName( fullFileName.Ptr() + fullFileName.LocateReverse( '\\' ) - + 1 ); - TBuf8 buf; - buf.Append( KPanicPrefix8 ); - buf.AppendFormat( _L8("%d at line %d in file %S"), aPanicCode, aLine, &fileName ); - Trace( buf ); - User::Panic( aPanicCategory, aPanicCode ); - } - -inline void TraceLeave( char* aFile, TInt aLine, TInt aReason ) - { - TPtrC8 fullFileName( (const TUint8*) aFile ); - TPtrC8 fileName( fullFileName.Ptr() + fullFileName.LocateReverse( '\\' ) - + 1 ); - TBuf8 buf; - buf.Append( KLeavePrefix8 ); - buf.AppendFormat( _L8("%d at line %d in file %S"), aReason, aLine, &fileName ); - Trace( buf ); - User::LeaveIfError( aReason ); - } - -#define TRACE_INFO(p) {if(KTraceMask & KPRINTINFO) Trace p;} - -#define TRACE_ERROR(p) {if(KTraceMask & KPRINTERROR) Trace p;} - -#define TRACE_STATE(p) {if(KTraceMask & KPRINTSTATE) Trace p;} - -#define TRACE_WARNING(p) {if(KTraceMask & KPRINTWARNING) Trace p;} - -#define TRACE_INFO_SEG(p) {if(KTraceMask & KPRINTINFO) p;} - -#define TRACE_ASSERT(GUARD, CODE) {if (!(GUARD)) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory);} - -#define PANIC(CODE) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory) - -#define LEAVE_IF_ERROR(REASON) {if (REASON) TraceLeave(__FILE__, __LINE__, REASON);} - -#define LEAVE(REASON) {TraceLeave(__FILE__, __LINE__, REASON);} - -#define TRACE_FUNC_ENTRY {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryFormat8, &ptr8);}} - -#define TRACE_FUNC_ENTRY_THIS {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryThisFormat8, &ptr8, this);}} - -#define TRACE_FUNC_EXIT {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncExitFormat8, &ptr8);}} - -#define TRACE_FUNC {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncFormat8, &ptr8);}} - -#define TRACE_FUNC_THIS {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncThisFormat8, &ptr8, this);}} - -#define RETURN_IF_ERR(ERR) {if(ERR) {TPtrC8 ptr8((TUint8*)__FILE__); Trace(_L8(" RETURN %d at file %S line %d"), ERR, &ptr8, __LINE__); return ERR;}} - -#else // PRJ_ENABLE_TRACE not defined -#define TRACE_INFO(p) - -#define TRACE_ERROR(p) - -#define TRACE_STATE(p) - -#define TRACE_WARNING(p) - -#define TRACE_INFO_SEG(p) - -#define TRACE_ASSERT(GUARD, CODE) - -#define PANIC(CODE) {User::Panic(KPanicCategory, CODE);} - -#define LEAVE_IF_ERROR(REASON) {static_cast(User::LeaveIfError(REASON));} - -#define LEAVE(REASON) {static_cast(User::Leave(REASON));} - -#define TRACE_FUNC_ENTRY - -#define TRACE_FUNC_ENTRY_THIS - -#define TRACE_FUNC_EXIT - -#define TRACE_FUNC - -#define TRACE_FUNC_THIS - -#define RETURN_IF_ERR(ERR) {if(ERR) return ERR;} -#endif // PRJ_ENABLE_TRACE -#endif // PRJ_LOGGING_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/inc/debugconfig.h --- a/localconnectivityservice/headset/inc/debugconfig.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* Copyright (c) 2006-2009 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: Project configure file. -* -*/ - - -#ifndef DEBUGCONFIG_H -#define DEBUGCONFIG_H - -#include "prjconfig.h" - - -/** - * Custom logging variations. - */ -#ifdef PRJ_FILE_TRACE -_LIT(KLogFile,"headset.txt"); -_LIT(KLogDir,"headset"); -#endif - -#ifdef PRJ_ENABLE_TRACE -_LIT(KTracePrefix16, "[headset] "); -_LIT8(KTracePrefix8, "[headset] "); -_LIT8(KFuncFormat8, "><%S"); -_LIT8(KFuncThisFormat8, "><%S, [0x%08X]"); -_LIT8(KFuncEntryFormat8, ">%S"); -_LIT8(KFuncEntryThisFormat8, ">%S, [0x%08X]"); -_LIT8(KFuncExitFormat8, "<%S"); - -_LIT(KPanicCategory, "headsetS"); -_LIT8(KPanicPrefix8, "PANIC code "); -_LIT8(KLeavePrefix8, "LEAVE code "); -#endif - -#endif // HEADSET_DEBUGCONFIG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/inc/finder.h --- a/localconnectivityservice/headset/inc/finder.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/* -* Copyright (c) 2004-2009 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: Hid headset field finder - * -*/ - -#ifndef T_FINDER_H -#define T_FINDER_H - -#include -#include "hidreportroot.h" - -/** - * Headset finder - * - * Field finder for the consumer/multimedia keys field. - * - */ -class THeadsetFinder : public MHidFieldFinder - { -public: - // From MHidFieldFinder - /** - * From MHidFieldFinder - * Called by THidFieldSearch::SearchL() during traversal of the - * report descriptor tree when a CCollection is encountered. It - * will be called once, and only once, for every CCollection in the - * descriptor. It is not called for the root collection - * (the CReportRoot). - * - * @param aCollection A pointer to the collection object. - * @return ETrue if the contents of this collection (any child CField - * or CCollection objects) should be examined. A driver would return - * EFalse if a collection was not of a compatible type, for - * example if the usage page was inappropriate. - */ - virtual TBool BeginCollection( const CCollection *aCollection ); - - /** - * From MHidFieldFinder - * Called by THidFieldSearch::SearchL() during traversal of the - * report descriptor tree when all CFields and child CCollections - * of a CCollection have been examined. It will be called once, - * and only once, for every CCollection in the descriptor. It is - * not called for the root collection (the CReportRoot). - * - * @param aCollection Collection pointer - * @return ETrue if the search (tree traversal) should - * continue. A driver returns EFalse if it has finished examining - * the whole descriptor, in general this will be if it has - * established that it is compatible with the report descriptor. - */ - virtual TBool EndCollection( const CCollection *aCollection ); - - /** - * From MHidFieldFinder - * Called once for each CField in a CCollection by - * THidFieldSearch::SearchL() during the traversal of a report - * descriptor tree. - * - * @param aField THe pointer to field - */ - virtual void Field( const CField* aField ); - -public: - - /** - * Constructor - */ - THeadsetFinder(); - - /** - * Check whether supported fields has been found. - * - * @return ETrue if it has. - */ - TBool Found() const; - - /** - * Check whether a given field contains the consumer usages. - * - * @param aField Pointer to the field to test. - * @return ETrue if it does. - */ - TBool IsConsumer( const CField* aField ) const; - - /** - * Check whether a given field contains the telephony usages. - * - * @param aField Pointer to the field to test. - * @return ETrue if it does. - */ - TBool IsTelephony( const CField* aField ) const; - - /** - * Reset the field pointer array - * - */ - void EmptyList(); - - /** - * Returns number of supported fields. - * - * @return Field count - */ - TInt FieldCount(); - - /** - * Read the field pointer from array at specified index - * - * @param aIndex Index to the field pointer array - * @return Pointer to the desired field - */ - CField* GetFieldAtIndex( TInt aIndex ); - -private: - - /** - * Pointer to the top level application collection being searched. - * Not own. - */ - const CCollection* iAppCollection; - - /** - * Array of field pointers: - * Not own. - */ - RPointerArray iFieldList; - }; -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/inc/headset.h --- a/localconnectivityservice/headset/inc/headset.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,523 +0,0 @@ -/* -* Copyright (c) 2004-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: Hid headset driver - * -*/ - - -#ifndef C_HIDHEADSETDRIVER_H -#define C_HIDHEADSETDRIVER_H - -#include -#include -#include -#include -#include -#include -#include -#include "keypresstimer.h" - -class CField; -class CHidHeadsetDriver; -class CTelephony; - -/** - * Scan status - */ -enum TScanStatus - { - EScanNotPressed, EScanPressed, EScanLongPress - }; - -/** - * HID headset driver class - * - * HidDriver interface for handlign headset related - * functionality. - * - */ - -class CHidHeadsetDriver : public CHidDriver, - public MTimerNotifier, - public MMPXPlaybackObserver - { - -private: - /** - * Initialisation states - */ - enum THeadsetDriverState - { - EUninitialised, // Driver has not been initialised - EInitialised, // Driver is initialised - EDisabled - // The driver will not respond to interrupt data - }; - - /** - * Hook handling - */ - enum THookHandling - { - EOnHook, EOffHook, ENoHook - }; -public: - - /** - * Two-phased constructor. - * @param aHid The generic HID layer that requested the driver - */ - static CHidHeadsetDriver* NewL( MDriverAccess* aHid ); - - /** - * Two-phased constructor. - * @param aHid The generic HID layer that requested the driver - */ - static CHidHeadsetDriver* NewLC( MDriverAccess* aHid ); - - /** - * Destructor - */ - virtual ~CHidHeadsetDriver(); - -private: - - // from base class CHidDriver - /** - * From class CHidDriver - * Called by the Generic HID layer to see if the driver can is able to - * use reports from a newly-connected device. Supported hid fields van - * be later request with SupportedFieldCount function - * - * @param aReportRoot HID report descriptor - * @return KErrNone The driver will handle reports from the report - * descriptor and KErrHidUnrecognised The driver cannot - * handle reports from the device - */ - TInt CanHandleReportL( CReportRoot* aReportRoot ); - - /** - * From class CHidDriver - * Called by the Generic HID layer when a device has been removed, prior - * to the driver being removed. This allows the driver to notify any - * applications of disconnection, if required - * - * @param aReason The reason for device disconnection - */ - void Disconnected( TInt aReason ); - - /** - * From class CHidDriver - * Called by the Generic HID layer when data has been received from the - * device handled by this driver. - * - * @param aChannel The channel on which the data was received - * (as defined by the transport layer) - * @param aPayload A pointer to the data buffer - */ - TInt DataIn( CHidTransport::THidChannelType aChannel, - const TDesC8& aPayload ); - - /** - * From class CHidDriver - * Called by the transport layers to inform the generic HID of the - * success of the last Set... command. - * - * @param aCmdAck Status of the last Set... command - */ - void CommandResult( TInt aCmdAck ); - - /** - * From class CHidDriver - * Called after a driver is sucessfully created by the Generic HID, when - * a device is connected - * - * @param aConnectionId An number used to identify the device in - * subsequent calls from the driver to the - * generic HI - */ - void InitialiseL( TInt aConnectionId ); - - /** - * From class CHidDriver - * Resets the internal state of the driver (any pressed keys are released) - * and enables the driver - * - * @param aConnectionId An number used to identify the device in - * subsequent calls from the driver to the - * generic HI - */ - void StartL( TInt aConnectionId ); - - /** - * From class CHidDriver - * Cancels all pressed keys and disables the driver (so it will not - * process interrupt data) - * - */ - void Stop(); - - /** - * From class CHidDriver - * Return count of supported fields - * - * @return Number of supported fields - */ - TInt SupportedFieldCount(); - - /** - * From class CHidDriver - * Set input handling registy - * - * @param aHandlingReg a Input handling registry - */ - void SetInputHandlingReg( CHidInputDataHandlingReg* aHandlingReg ); - - // from base class MTimerNotifier - /** - * From class MTimerNotifier - * The function to be called when a timeout occurs. - * - * @param aTimerType a Type of timer - */ - void TimerExpired( TTimerType aTimerType ); - - /** - * From class MMPXPlaybackObserver - * Handle playback message. - * - * @param aMsg playback message, ownership not transferred. - * Please check aMsg is not NULL before using it. If aErr is not - * KErrNone, plugin might still call back with more info in the - * aMsg. - * @param aErr system error code. - */ - void HandlePlaybackMessage( CMPXMessage* aMsg, TInt /*aErr*/); - -private: - /** - * Constructor - * @param aHid The generic HID layer that requested the driver - */ - CHidHeadsetDriver( MDriverAccess* aHid ); - /** - * ConstructL - */ - void ConstructL(); - -private: - - /** - * Called from within DataIn to handle interrupt and control channel data - * - * @param aPayload a Payload data - * @return error if data can't be handled - */ - TInt InterruptData( const TDesC8& aPayload ); - - /** - * Handles the report - * - * @param aReport HID report descriptor - * @param aField HID field - * @return KErrNotSupported if report can't be handled - */ - TInt HandleReport( const TDesC8& aReport, const CField* aField ); - - /** - * Handles the report - * - * @param aReportTranslator Report Translator - */ - void ReleasePressedKeys( TReportTranslator& aReportTranslator ); - - /** - * Handle hook key pres - * - * @param aStatus Hook key status - */ - void HookKeyPres( TBool aStatus ); - - /** - * Release hook key - * - */ - void ReleaseHookKey(); - - /** - * Get Hook Status - * - * @return hook handling status. - */ - THookHandling HookStatus(); - - /** - * Get alarm status - * - * @return ETrue if ui is showing alarm, EFalse if not. - */ - TBool AlarmStatus(); - - /** - * MusicPlayingStatus - * - * @return ETrue if plyaer is playing, EFalse if not. - */ - TBool MusicPlayingStatus(); - - /** - * HandleNoneHookPress - * Handle hook press when there are phone call is in idle state - * - */ - void HandleNoneHookPressL(); - - /** - * ReleasePressedVolumeKeys - * Release volume keys if they are pressed - * - * @param aReportTranslator HID report translator - */ - void ReleasePressedVolumeKeys( TReportTranslator& aReportTranslator ); - - /** - * ReleasePressedScanKeys - * Release scan keys if they are pressed - * - * @param aReportTranslator HID report report translator - */ - void ReleasePressedScanKeys( TReportTranslator& aReportTranslator ); - /** - * HandleAlarmHookReleaseL - * Handle hook release when phone is alarming - * - */ - void HandleAlarmHookReleaseL(); - - /** - * HandleIdleHookReleaseL - * Handle hook release when phone is not alarming - * and call is in idle state - * - */ - void HandleIdleHookReleaseL(); - - /** - * Handle doubleclick timer expiration - * - */ - void ExpiredDoubleClickTimer(); - - /** - * Handle long press timer expiration - * - */ - void ExpiredLongClickTimer(); - - /** - * Handle scan next pressed - * - */ - void HandleScanNextPressL(); - - /** - * Handle scan prev pressed - * - */ - void HandleScanPrevPressL(); - - /** - * Handle scan next release - * - * @param aKeyCode a Key id - * @param aValue a Key value - */ - void HandleScanNextRelease( TUint& aKeyCode, TInt& aValue ); - - /** - * Handle scan previous release - * - * @param aKeyCode a Key id - * @param aValue a Key value - */ - void HandleScanPreviousRelease( TUint& aKeyCode, TInt& aValue ); - - /** - * Handle telephony usage page - * - * @param aReport a Report translator - * @return KErrNone if report can be handled. - */ - TInt HandleTelephonyUsage( TReportTranslator& aReport ); - - /** - * Handle controller usage page - * - * @param aReport a Report translator - * @return KErrNone if report can be handled. - */ - TInt HandleControlUsage( TReportTranslator& aReport ); - - /** - * Handle volume usage - * - * @param aReport a Report translator - * @return KErrNone if report can be handled. - */ - TInt HandleVolumeUsage( TReportTranslator& aReport ); - -private: - - /** - * The Generic HID layer - * Not own. - */ - MDriverAccess *iGenericHid; - - /** - * Field list array - * Own. - */ - RPointerArray iFieldList; - - /** - * Driver state - */ - THeadsetDriverState iDriverState; - - /** - * Connection id - */ - TInt iConnectionId; - - /** - * Application menu id - */ - TInt iAppMenuId; - - /** - * On hook status - */ - TBool iOnHookPressed; - - /** - * Off hook - */ - TBool iOffHookPressed; - - /** - * No active calls - */ - TBool iNoneHookPressed; - - /** - * Telephony service - * Own. - */ - CTelephony* iTelephony; - - /** - * Double click timer - * Own. - */ - CKeyPressTimer* iDoubleClicktimer; - - /** - * Long click timer - * Own. - */ - CKeyPressTimer* iLongClicktimer; - - /** - * Long click timer - */ - TBool iLongPress; - - /** - * Alarm server session - */ - RASCliSession iAlarmServerSession; - - /** - * Incoming call status - */ - TBool iIncomingCallStatus; - - /** - * Alarm statusd - */ - TBool iAlarmStatus; - - /** - * Music player utility - * Own. - */ - MMPXPlaybackUtility* iMusicPlayer; - - /** - * Playing status - */ - TBool iPlayingStatus; - - /** - * Double next Click status - */ - TBool iDoubleNextClick; - - /** - * Count of supported fields - */ - TInt iSupportedFieldCount; - - /** - * Volume up key pressed down - */ - TBool iVolumeUpPressed; - - /** - * Volume down key pressed down - */ - TBool iVolumeDownPressed; - - /** - * Forward press status - */ - TScanStatus iForwardStatus; - - /** - * Backward press status - */ - TScanStatus iBackwardStatus; - - /** - * Scan next timer - * Own. - */ - CKeyPressTimer* iScanNextTimer; - - /** - * Scan previous timer - * Own. - */ - CKeyPressTimer* iScanPreviousTimer; - - /** - * Input handling reg - * Not own. - */ - CHidInputDataHandlingReg* iInputHandlingReg; - - }; - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/inc/headsetuids.h --- a/localconnectivityservice/headset/inc/headsetuids.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2004-2009 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: Hid headset driver - * -*/ - - -#ifndef HEADSETUIDS_H -#define HEADSETUIDS_H - -#define ECOM_UID 0x10009d8d -#define REMCON_PLUGIN_IF 0x10204546 -#define HEADSET_UID 0x10282c15 -#define HEADSET_DRIVER_IMP 0x10282c16 -#define HIDREMCON_UID 0x10282c17 -#define HIDREMCON_IMP 0x10282c18 -#define DRIVER_PLUGIN_IF 0x10201d26 - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/inc/keypresstimer.h --- a/localconnectivityservice/headset/inc/keypresstimer.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -/* -* Copyright (c) 2004-2009 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: Hid timeout timer - * -*/ - -#ifndef C_KEYPRESSTIMER_H -#define C_KEYPRESSTIMER_H - -#include - -enum TTimerType - { - EDoubleClickTimer, - ELongPressTimer, - EScanNextPressTimer, - EScanPrevPressTimer - }; - -/** - * HID headset driver class - * - * This class specifies the function to be called when a timeout occurs. - * Used in conjunction with CTimeOutTimer class - * - */ -class MTimerNotifier - { -public: - /** - * The function to be called when a timeout occurs. - * - * @param aTimerType a Type of timer - */ - virtual void TimerExpired( TTimerType aTimerType ) = 0; - }; - -/** - * HID headset driver class - * - * This class will notify an object after a specified timeout. - * - */ -class CKeyPressTimer : public CTimer - { -public: - /** - * Two-phased constructor. - * @param aTimeOutNotify object to notify of timeout event - * @param aTimeOutTime a Timeout time - * @paran aTimerType a Type of timer - * @return keypress timer - */ - static CKeyPressTimer* NewL( MTimerNotifier* aTimeOutNotify, - TTimeIntervalMicroSeconds32 aTimeOutTime, TTimerType aTimerType ); - - /** - * Two-phased constructor. - * @param aTimeOutNotify object to notify of timeout event - * @param aTimeOutTime a Timeout time - * @paran aTimerType a Type of timer - * @return keypress timer - */ - static CKeyPressTimer* NewLC( MTimerNotifier* aTimeOutNotify, - TTimeIntervalMicroSeconds32 aTimeOutTime, TTimerType aTimerType ); - - /** - * Destructor - */ - virtual ~CKeyPressTimer(); - -protected: - - /** - * From CTimer - * Invoked when a timeout occurs - * - */ - virtual void RunL(); - -private: - - /** - * Constructor - * @param aTimeOutNotify object to notify of timeout event - * @paran aTimerType a Type of timer - */ - CKeyPressTimer( MTimerNotifier* aTimeOutNotify, TTimerType aTimerType ); - /** - * Two-phased constructor. - * @param aTimeOutTime a Timeout time - */ - void ConstructL( TTimeIntervalMicroSeconds32 aTimeOutTime ); - -private: - // Member variables - - /** - * The observer for this objects events - * Not own. - */ - MTimerNotifier* iNotify; - - /** - * Type of timer - */ - TTimerType iTimerType; - }; -#endif // C_KEYPRESSTIMER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/inc/prjconfig.h --- a/localconnectivityservice/headset/inc/prjconfig.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2006-2009 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: Project configure file. - * -*/ - - -#ifndef PRJCONFIG_H -#define PRJCONFIG_H - -/** - * Traces are enabled via RDebug::Print() in UDEB build, by default. - */ -#ifdef _DEBUG -#define PRJ_ENABLE_TRACE -#endif - -/** - * Traces will be written to file if this is defined. - */ -//#define PRJ_FILE_TRACE - - -/** - * build the project for module test purpose if this is defined - */ -//#define PRJ_MODULETEST_BUILD - -/** - * build the project using stubs to replace the dependencies if this is defined - */ -//#define PRJ_USE_STUB - -#endif // OBEXSM_PRJCONFIG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/rom/hidheadset.iby --- a/localconnectivityservice/headset/rom/hidheadset.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2008-2009 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: Image description file for project generichid -* -*/ - - -#ifndef HIDHEADSET_IBY__ -#define HIDHEADSET_IBY__ - -ECOM_PLUGIN(hidheadset.dll, hidheadset.rsc) -ECOM_PLUGIN(hidremconbearer.dll, hidremconbearer.rsc) - - -#endif \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/src/finder.cpp --- a/localconnectivityservice/headset/src/finder.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,244 +0,0 @@ -/* -* Copyright (c) 2004-2009 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: Generic hid finder implementation - * -*/ - - -#include -#include - -#include "finder.h" -#include "debug.h" - -// ---------------------------------------------------------------------- - -// Define this for additional debug output (this file only): -#define EXTRA_DEBUG - -#ifdef EXTRA_DEBUG -#define DBG(a) a; -#else -#define DBG(a) -#endif - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// THeadsetFinder() -// --------------------------------------------------------------------------- -// -THeadsetFinder::THeadsetFinder() : - iAppCollection( 0 ), iFieldList() - { - // Nothing else to do - } - -// -------------------------------------------------------------------------- -// From class MHidFieldFinder -// BeginCollection() -// -------------------------------------------------------------------------- -// -TBool THeadsetFinder::BeginCollection( const CCollection* aCollection ) - { - TBool examineCollection = ETrue; - - const TInt KConsumerControl = 0x01; - - // Only look at top-level application (consumer devices: consumer - // control) collections: - // - - if ( ( aCollection->IsApplication() ) && ( iAppCollection == 0 ) ) - { - // Top-level application collection. - - if ( ( aCollection->UsagePage() == EUsagePageConsumer ) - && ( aCollection->Usage() == KConsumerControl ) ) - { - TRACE_INFO(_L("[HID]\tTHeadsetFinder::BeginCollection: this is \ - consumer collection ")); - // Collection is a consumer device: - iAppCollection = aCollection; - iFieldList.Reset(); - } - else - { - TRACE_INFO(_L("[HID]\tTHeadsetFinder::BeginCollection: not \ - consumer collection")); - // Skip other types of top-level application collection: - examineCollection = EFalse; - } - } - return examineCollection; - - } - -// --------------------------------------------------------------------------- -// From class MHidFieldFinder -// EndCollection() -// --------------------------------------------------------------------------- -// -TBool THeadsetFinder::EndCollection( const CCollection* aCollection ) - { - TBool continueSearch = ETrue; - - TRACE_INFO(_L("[HID]\tTHeadsetFinder::EndCollection")); - if ( aCollection == iAppCollection ) - { - // Top-level application(Consumer Devices:Consumer Control) finished: - // - iAppCollection = 0; - - // Stop if we've found a device we can use in this - // application collection: - // - continueSearch = !Found(); - } - - return continueSearch; - } - -// --------------------------------------------------------------------------- -// From class MHidFieldFinder -// Field() -// --------------------------------------------------------------------------- -// -void THeadsetFinder::Field( const CField* aField ) - { - TRACE_INFO((_L("[HID]\tTHeadsetFinder::Field( 0x%08x)"),aField)); - TInt error = KErrNone; - if ( iAppCollection ) - { - - if ( IsTelephony( aField ) ) - { - TRACE_INFO((_L("[HID]\tTHeadsetFinder::Field, telephony"))); - error = iFieldList.Append( aField ); - if ( error != KErrNone ) - { - TRACE_INFO((_L("[HID]\tTHeadsetFinder::Field, telephony \ - failed"))); - } - } - else if ( IsConsumer( aField ) ) - { - TRACE_INFO(_L("[HID]\tTHeadsetFinder::Field, consumer")); - error = iFieldList.Append( aField ); - if ( error != KErrNone ) - { - TRACE_INFO((_L("[HID]\tTHeadsetFinder::Field, telephony \ - failed"))); - } - } - else - { - TRACE_INFO(_L("[HID]\tTHeadsetFinder::Field, other, or empty \ - field")); - } - } - } - -// --------------------------------------------------------------------------- -// IsConsumer() -// --------------------------------------------------------------------------- -// -TBool THeadsetFinder::IsConsumer( const CField* aField ) const - { - TBool found = EFalse; - - if ( aField->IsInput() && aField->IsData() && ( aField->UsagePage() - == EUsagePageConsumer ) ) - { -#ifdef _DEBUG - for ( TInt i = 0; i < aField->UsageCount(); i++ ) - { - TRACE_INFO((_L("[HID]\tTHeadsetFinder::IsConsumer: Usage %d: \ - %02x"),i,aField->Usage(i))); - } -#endif - // *** Add usage test here *** - TRACE_INFO(_L("[HID]\tTHeadsetFinder::IsConsumer: Consumer keys \ - field found\r\n")); - found = ETrue; - } - return found; - } - -// --------------------------------------------------------------------------- -// IsTelephony() -// --------------------------------------------------------------------------- -// -TBool THeadsetFinder::IsTelephony( const CField* aField ) const - { - TBool found = EFalse; - - if ( aField->IsInput() && aField->IsData() && ( aField->UsagePage() - == EUsagePageTelephony ) ) - { - const TInt KHookSwitch = 0x20; - const TInt KPhoneMute = 0x2F; -#ifdef _DEBUG - for ( TInt i = 0; i < aField->UsageCount(); i++ ) - { - TRACE_INFO((_L("[HID]\tTHeadsetFinder::IsTelephony: \ - Usage %d: %02x"),i,aField->Usage(i))); - } -#endif - if ( ( aField->UsageMin() <= KPhoneMute ) && ( aField->UsageMax() - >= KHookSwitch ) ) - { - TRACE_INFO(_L("[HID]\tTHeadsetFinder::IsTelephony: Telephony \ - field found")); - found = ETrue; - } - } - return found; - } - -// --------------------------------------------------------------------------- -// EmptyList() -// --------------------------------------------------------------------------- -// -void THeadsetFinder::EmptyList() - { - iFieldList.Reset(); - } - -// --------------------------------------------------------------------------- -// FieldCount() -// --------------------------------------------------------------------------- -// -TInt THeadsetFinder::FieldCount() - { - return iFieldList.Count(); - } - -// --------------------------------------------------------------------------- -// GetFieldAtIndex() -// --------------------------------------------------------------------------- -// -CField* THeadsetFinder::GetFieldAtIndex( TInt aIndex ) - { - return iFieldList[aIndex]; - } - -// --------------------------------------------------------------------------- -// Found() -// --------------------------------------------------------------------------- -// -TBool THeadsetFinder::Found() const - { - return ( iFieldList.Count() != 0 ); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/src/headset.cpp --- a/localconnectivityservice/headset/src/headset.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1206 +0,0 @@ -/* -* Copyright (c) 2004-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: Generic hid implementation - * -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "hidremconbearerinternalpskeys.h" -#include "hidremconbearerscancodes.h" -#include "headset.h" -#include "finder.h" - -#include "debug.h" - -const TInt KHidUndefinedKeyCode = 0; -const TInt KHidNotSetKeyValue = 0; -const TInt KDoubleClickTimeout = 900000; // 0,9 seconds -const TInt KDoubleClickTimeoutRing = 500000; // 0,5 seconds -const TInt KScanClickTimeout = 500000; // 0,5 seconds -const TInt KLongClickTimeout = 3000000; // 3 seconds - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CHidHeadsetDriver() -// --------------------------------------------------------------------------- -// -CHidHeadsetDriver::CHidHeadsetDriver( MDriverAccess* aGenericHid ) : - iGenericHid( aGenericHid ), iFieldList(), iDriverState( EUninitialised ), - iConnectionId( 0 ), iSupportedFieldCount( 0 ), iForwardStatus( - EScanNotPressed ), iBackwardStatus( EScanNotPressed ) - { - TRACE_FUNC_ENTRY_THIS - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// NewLC -// --------------------------------------------------------------------------- -// -CHidHeadsetDriver* CHidHeadsetDriver::NewLC( MDriverAccess* aGenericHid ) - { - TRACE_INFO((_L("[HID]\tCHidHeadsetDriver::NewLC(0x%08x)"), aGenericHid)); - CHidHeadsetDriver* self = new ( ELeave ) CHidHeadsetDriver( aGenericHid ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// NewL -// --------------------------------------------------------------------------- -// -CHidHeadsetDriver* CHidHeadsetDriver::NewL( MDriverAccess* aGenericHid ) - { - CHidHeadsetDriver* self = CHidHeadsetDriver::NewLC( aGenericHid ); - CleanupStack::Pop(); - return self; - } - -// --------------------------------------------------------------------------- -// ConstructL() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::ConstructL() - { - TRACE_FUNC_THIS - iTelephony = CTelephony::NewL(); - User::LeaveIfError( iAlarmServerSession.Connect() ); - iMusicPlayer = MMPXPlaybackUtility::UtilityL( KPbModeActivePlayer ); - iMusicPlayer->AddObserverL( *this ); - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CHidHeadsetDriver::~CHidHeadsetDriver() - { - TRACE_FUNC_THIS - iAlarmServerSession.Close(); - delete iTelephony; - iFieldList.Reset(); - iFieldList.Close(); - delete iDoubleClicktimer; - if ( iMusicPlayer ) - { - iMusicPlayer->Close(); - } - delete iScanPreviousTimer; - delete iScanNextTimer; - delete iLongClicktimer; - } - -// --------------------------------------------------------------------------- -// From class CHidDriver -// StartL() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::StartL( TInt /*aConnectionId*/) - { - TRACE_FUNC - // Ready to process headset events: - iDriverState = EInitialised; - } - -// --------------------------------------------------------------------------- -// From class CHidDriver -// InitialiseL() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::InitialiseL( TInt aConnectionId ) - { - TRACE_FUNC - TRACE_INFO((_L("[HID]\tCHidHeadsetDriver::InitialiseL(%d)"), - aConnectionId)); - // Store the connection ID: - iConnectionId = aConnectionId; - } - -// --------------------------------------------------------------------------- -// From class CHidDriver -// Stop() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::Stop() - { - TRACE_FUNC - iDriverState = EDisabled; - } - -// --------------------------------------------------------------------------- -// From class CHidDriver -// DataIn() -// --------------------------------------------------------------------------- -// -TInt CHidHeadsetDriver::DataIn( CHidTransport::THidChannelType aChannel, - const TDesC8& aPayload ) - { - TInt retVal = KErrNone; - switch ( aChannel ) - { - case CHidTransport::EHidChannelInt: - if ( EInitialised == iDriverState ) - { - retVal = InterruptData( aPayload ); - } - break; - - case CHidTransport::EHidChannelCtrl: - retVal = KErrNotSupported; - break; - - default: - retVal = KErrNotSupported; - break; - } - return retVal; - } - -// --------------------------------------------------------------------------- -// From class CHidDriver -// CommandResult() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::CommandResult( TInt /*aCmdAck*/) - { - // No implementation as we don't issue any requests to be acknowledged - } - -// --------------------------------------------------------------------------- -// From class CHidDriver -// Disconnected() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::Disconnected( TInt aReason ) - { - TRACE_INFO((_L("[HID]\tCHidHeadsetDriver::Disconnected(%d)"), aReason)); - aReason = aReason; - Stop(); - } - -// --------------------------------------------------------------------------- -// From class CHidDriver -// SetInputHandlingReg() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::SetInputHandlingReg( - CHidInputDataHandlingReg* aHandlingReg ) - { - iInputHandlingReg = aHandlingReg; - } - -// --------------------------------------------------------------------------- -// From class CHidDriver -// InterruptData() -// --------------------------------------------------------------------------- -// -TInt CHidHeadsetDriver::InterruptData( const TDesC8& aPayload ) - { - // If the report has a report ID, it is in the first byte. - // If not, this value is ignored (see CField::IsInReport()). - // - TInt retVal = KErrNone; - TInt ret = KErrNotSupported; - TInt firstByte = aPayload[0]; - - TRACE_INFO((_L("[HID]\tCHidHeadsetDriver::InterruptData(), report \ - 0x%x (%d), length %d"),firstByte, firstByte, aPayload.Length())); - - if ( iFieldList.Count() == 0 ) - { - retVal = KErrNotSupported; - } - for ( TInt i = 0; i < iFieldList.Count(); i++ ) - { - if ( iFieldList[i]->IsInReport( firstByte ) ) - { - ret = HandleReport( aPayload, iFieldList[i] ); - if ( ret == KErrNone ) - { - retVal = KErrNone; - } - } - else - { - retVal = KErrNotSupported; - } - } - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleReport() -// --------------------------------------------------------------------------- -// -TInt CHidHeadsetDriver::HandleReport( const TDesC8& aReport, - const CField* aField ) - { - TRACE_FUNC_ENTRY - TReportTranslator report( aReport, aField ); - TInt retVal = KErrNotSupported; - - // release if key if it pressed and relased - ReleasePressedKeys( report ); - - if ( HandleTelephonyUsage( report ) == KErrNone ) - { - retVal = KErrNone; - } - - if ( HandleControlUsage( report ) == KErrNone ) - { - retVal = KErrNone; - } - - if ( HandleVolumeUsage( report ) == KErrNone ) - { - retVal = KErrNone; - } - TRACE_FUNC_EXIT - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleTelephonyUsage() -// --------------------------------------------------------------------------- -// -TInt CHidHeadsetDriver::HandleTelephonyUsage( TReportTranslator& aReport ) - { - TRACE_FUNC_ENTRY - TInt retVal = KErrNotSupported; - TInt hookSwitch = 0; - TInt mute = 0; - TInt poc = 0; - - // P&S key variables - TUint key = KHidUndefinedKeyCode; - TInt value = KHidNotSetKeyValue; - - if ( aReport.GetValue( mute, ETelephonyUsagePhoneMute ) == KErrNone - && mute == 1 ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::HandleReport(): Send mute \ - command")); - if ( iInputHandlingReg->AllowedToHandleEvent( EUsagePageTelephony, - ETelephonyUsagePhoneMute ) ) - { - key = KHidMuteKeyEvent; - value = KPSMuteClicked; - iInputHandlingReg->AddHandledEvent( EUsagePageTelephony, - ETelephonyUsagePhoneMute ); - } - } - else if ( aReport.GetValue( hookSwitch, ETelephonyUsageHookSwitch ) - == KErrNone && hookSwitch == 1 ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::HandleReport(): Send hook \ - switch command (disabled)")); - if ( iInputHandlingReg->AllowedToHandleEvent( EUsagePageTelephony, - ETelephonyUsageHookSwitch ) ) - { - HookKeyPres( ETrue ); - iInputHandlingReg->AddHandledEvent( EUsagePageTelephony, - ETelephonyUsageHookSwitch ); - } - } - else if ( aReport.GetValue( poc, ETelephonyUsagePoC ) == KErrNone && poc - == 1 ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::HandleReport(): Send PoC \ - command (disabled)")); - if ( iInputHandlingReg->AllowedToHandleEvent( EUsagePageTelephony, - ETelephonyUsagePoC ) ) - { - key = KHidMuteKeyEvent; - value = KPSMuteClicked; - iInputHandlingReg->AddHandledEvent( EUsagePageTelephony, - ETelephonyUsagePoC ); - } - } - if ( key != KHidUndefinedKeyCode && value != KHidNotSetKeyValue ) - { - TInt err = RProperty::Set( KPSUidHidEventNotifier, key, value ); - retVal = KErrNone; - } - - TRACE_FUNC_EXIT - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleTelephonyUsage() -// --------------------------------------------------------------------------- -// -TInt CHidHeadsetDriver::HandleControlUsage( TReportTranslator& aReport ) - { - TRACE_FUNC_ENTRY - TInt retVal = KErrNotSupported; - TInt playPause = 0; - TInt scanNext = 0; - TInt scanPrev = 0; - TInt stop = 0; - - // P&S key variables - TUint key = KHidUndefinedKeyCode; - TInt value = KHidNotSetKeyValue; - - if ( aReport.GetValue( playPause, EConsumerUsagePlayPause ) == KErrNone - && playPause ) - { - if ( iInputHandlingReg->AllowedToHandleEvent( EUsagePageConsumer, - EConsumerUsagePlayPause ) ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::HandleReport(): Send \ - play/pause command (currently only play)")); - key = KHidControlKeyEvent; - value = EPlayClicked; - iInputHandlingReg->AddHandledEvent( EUsagePageConsumer, - EConsumerUsagePlayPause ); - } - } - else if ( aReport.GetValue( scanNext, EConsumerUsageScanNext ) - == KErrNone && scanNext ) - { - if ( iInputHandlingReg->AllowedToHandleEvent( EUsagePageConsumer, - EConsumerUsageScanNext ) ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::HandleReport(): Send \ - scan next command")); - TRAP_IGNORE( HandleScanNextPressL() ); - iInputHandlingReg->AddHandledEvent( EUsagePageConsumer, - EConsumerUsageScanNext ); - } - } - else if ( aReport.GetValue( scanPrev, EConsumerUsageScanPrev ) - == KErrNone && scanPrev ) - { - if ( iInputHandlingReg->AllowedToHandleEvent( EUsagePageConsumer, - EConsumerUsageScanPrev ) ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::HandleReport(): Scan \ - prev command")); - TRAP_IGNORE( HandleScanPrevPressL()); - iInputHandlingReg->AddHandledEvent( EUsagePageConsumer, - EConsumerUsageScanPrev ); - } - } - else if ( aReport.GetValue( stop, EConsumerUsageStop ) == KErrNone - && stop ) - { - if ( iInputHandlingReg->AllowedToHandleEvent( EUsagePageConsumer, - EConsumerUsageStop ) ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::HandleReport(): Send \ - stop command")); - key = KHidControlKeyEvent; - value = EStopClicked; - iInputHandlingReg->AddHandledEvent( EUsagePageConsumer, - EConsumerUsageScanPrev ); - } - } - if ( key != KHidUndefinedKeyCode && value != KHidNotSetKeyValue ) - { - TInt err = RProperty::Set( KPSUidHidEventNotifier, key, value ); - retVal = KErrNone; - } - - TRACE_FUNC_EXIT - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleVolumeUsage() -// --------------------------------------------------------------------------- -// -TInt CHidHeadsetDriver::HandleVolumeUsage( TReportTranslator& aReport ) - { - TRACE_FUNC_ENTRY - TInt retVal = KErrNotSupported; - - TInt volUp = 0; - TInt volDown = 0; - TInt speakermute = 0; - - // P&S key variables - TUint key = KHidUndefinedKeyCode; - TInt value = KHidNotSetKeyValue; - - if ( aReport.GetValue( volUp, EConsumerUsageVolumeInc ) == KErrNone - && volUp ) - { - if ( iInputHandlingReg->AllowedToHandleEvent( EUsagePageConsumer, - EConsumerUsageVolumeInc ) ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::HandleReport(): \ - Send volume up command")); - key = KHidAccessoryVolumeEvent; - iVolumeUpPressed = ETrue; - value = KPSVolumeUpPressed; - iInputHandlingReg->AddHandledEvent( EUsagePageConsumer, - EConsumerUsageScanPrev ); - } - } - else if ( aReport.GetValue( volDown, EConsumerUsageVolumeDec ) - == KErrNone && volDown ) - { - if ( iInputHandlingReg->AllowedToHandleEvent( EUsagePageConsumer, - EConsumerUsageVolumeDec ) ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::HandleReport(): Send \ - volume down command")); - key = KHidAccessoryVolumeEvent; - iVolumeDownPressed = ETrue; - value = KPSVolumeDownPressed; - iInputHandlingReg->AddHandledEvent( EUsagePageConsumer, - EConsumerUsageVolumeDec ); - } - } - else if ( ( aReport.GetValue( speakermute, EConsumerUsageMute ) - == KErrNone && speakermute == 1 ) ) - { - if ( iInputHandlingReg->AllowedToHandleEvent( EUsagePageConsumer, - EConsumerUsageMute ) ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::HandleReport(): Send \ - mute command")); - key = KHidMuteKeyEvent; - value = KPSMuteClicked; - iInputHandlingReg->AddHandledEvent( EUsagePageConsumer, - EConsumerUsageMute ); - } - } - - if ( key != KHidUndefinedKeyCode && value != KHidNotSetKeyValue ) - { - TInt err = RProperty::Set( KPSUidHidEventNotifier, key, value ); - retVal = KErrNone; - } - - TRACE_FUNC_EXIT - return retVal; - } - -// --------------------------------------------------------------------------- -// HandleScanNextPressL() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::HandleScanNextPressL() - { - TRACE_FUNC_ENTRY - iForwardStatus = EScanPressed; - - delete iScanNextTimer; - iScanNextTimer = NULL; - - /** - * Scan key has two different behaviour if you are short click buttun or long - * click button. In short press next track command is sent and whit long press - * is sending seek forward command. iScanNextTimer is used to detect if click - * is long click or short click. - */ - - iScanNextTimer = CKeyPressTimer::NewL( this, TTimeIntervalMicroSeconds32( - KScanClickTimeout ), EScanNextPressTimer ); - - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// HandleScanNextPressL() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::HandleScanPrevPressL() - { - TRACE_FUNC_ENTRY - iBackwardStatus = EScanPressed; - - delete iScanPreviousTimer; - iScanPreviousTimer = NULL; - - /** - * Scan key has two different behaviour if you are short click buttun or - * long click button. In short press previous track command is sent and - * whit long press is sending seek forward command. iScanPreviousTimer - * is used to detect if click is long click or short click. - */ - iScanPreviousTimer = CKeyPressTimer::NewL( this, - TTimeIntervalMicroSeconds32( KScanClickTimeout ), - EScanPrevPressTimer ); - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// ReleasePressedVolumeKeys -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::ReleasePressedVolumeKeys( - TReportTranslator& aReportTranslator ) - { - TInt volUp = 0; - TInt volDown = 0; - TUint key = KHidUndefinedKeyCode; - TInt value = KHidNotSetKeyValue; - - if ( iVolumeUpPressed ) - { - if ( aReportTranslator.GetValue( volUp, EConsumerUsageVolumeInc ) - == KErrNone && volDown == 0 ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::ReleasepressedKeys(): \ - Volume up released")); - key = KHidAccessoryVolumeEvent; - iVolumeUpPressed = EFalse; - value = KPSVolumeUpReleased; - } - } - else if ( iVolumeDownPressed ) - { - if ( aReportTranslator.GetValue( volDown, EConsumerUsageVolumeDec ) - == KErrNone && volDown == 0 ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::ReleasepressedKeys(): \ - Volume downkey realeased")); - key = KHidAccessoryVolumeEvent; - iVolumeDownPressed = EFalse; - value = KPSVolumeDownReleased; - } - } - if ( key != KHidUndefinedKeyCode && value != KHidNotSetKeyValue ) - { - TInt err = RProperty::Set( KPSUidHidEventNotifier, key, value ); - - } - } - -// --------------------------------------------------------------------------- -// ReleasePressedScanKeys() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::ReleasePressedScanKeys( - TReportTranslator& aReportTranslator ) - { - TInt scanNext = 0; - TInt scanPrev = 0; - TUint key = KHidUndefinedKeyCode; - TInt value = KHidNotSetKeyValue; - - if ( iForwardStatus != EScanNotPressed ) - { - if ( aReportTranslator.GetValue( scanNext, EConsumerUsageScanNext ) - == KErrNone && scanNext == 0 ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::HandleReport(): Scan \ - next command released")); - HandleScanNextRelease( key, value ); - } - } - else if ( iBackwardStatus != EScanNotPressed ) - { - if ( aReportTranslator.GetValue( scanPrev, EConsumerUsageScanPrev ) - == KErrNone && scanPrev == 0 ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::HandleReport(): Scan \ - prev command released")); - HandleScanPreviousRelease( key, value ); - } - } - if ( key != KHidUndefinedKeyCode && value != KHidNotSetKeyValue ) - { - TInt err = RProperty::Set( KPSUidHidEventNotifier, key, value ); - } - } -// --------------------------------------------------------------------------- -// ReleasePressedKeys() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::ReleasePressedKeys( - TReportTranslator& aReportTranslator ) - { - TRACE_FUNC_ENTRY - - TInt hookSwitch = 0; - /* - * Check hook key release here, because hook key long press - * is handled different way. - */ - if ( iOnHookPressed || iOffHookPressed || iNoneHookPressed ) - { - if ( aReportTranslator.GetValue( hookSwitch, - ETelephonyUsageHookSwitch ) == KErrNone && hookSwitch == 0 ) - { - ReleaseHookKey(); - } - } - ReleasePressedVolumeKeys( aReportTranslator ); - - ReleasePressedScanKeys( aReportTranslator ); - - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// HandleScanNextRelease() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::HandleScanNextRelease( TUint& aKeyCode, TInt& aValue ) - { - TRACE_FUNC_ENTRY - aKeyCode = KHidControlKeyEvent; - if ( iForwardStatus == EScanPressed ) - { - aValue = EForwardClicked; - } - else //long press - { - aValue = EFastForwardReleased; - } - iForwardStatus = EScanNotPressed; - - delete iScanNextTimer; - iScanNextTimer = NULL; - - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// HandleScanPreviousRelease() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::HandleScanPreviousRelease( TUint& aKeyCode, - TInt& aValue ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::HandleReport(): Scan prev \ - command released")); - aKeyCode = KHidControlKeyEvent; - if ( iBackwardStatus == EScanPressed ) - { - aValue = EBackwardClicked; - } - else //long press - { - aValue = ERewindReleased; - } - iBackwardStatus = EScanNotPressed; - - delete iScanPreviousTimer; - iScanPreviousTimer = NULL; - - TRACE_FUNC_EXIT - } -// --------------------------------------------------------------------------- -// HookKeyPres() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::HookKeyPres( TBool aStatus ) - { - TRACE_FUNC_ENTRY - - THookHandling hookStatus = HookStatus(); - if ( !iAlarmStatus ) - { - iAlarmStatus = AlarmStatus(); - } - - iPlayingStatus = MusicPlayingStatus(); - - if ( aStatus ) - { - switch ( hookStatus ) - { - case EOnHook: - if ( !iIncomingCallStatus ) - { - // For the first click, trigger the timer - // single click is handled in ExpiredDoubleClickTimer - if ( iDoubleClicktimer ) - { - delete iDoubleClicktimer; - iDoubleClicktimer = NULL; - } - TRAP_IGNORE( iDoubleClicktimer = CKeyPressTimer::NewL( this, - TTimeIntervalMicroSeconds32( KDoubleClickTimeoutRing ), - EDoubleClickTimer ) ); - if ( iDoubleClicktimer ) - { - iIncomingCallStatus = ETrue; - } - else // If fail to create timer, handle as single click, - // for double click case, the next click will hang off - { - iIncomingCallStatus = EFalse; - iOnHookPressed = ETrue; - } - break; // switch - } - else - { - iIncomingCallStatus = EFalse; - if ( iDoubleClicktimer ) - { - delete iDoubleClicktimer; - iDoubleClicktimer = NULL; - } - // This is the double click case, handle as EOffHook - } - // No break here - case EOffHook: - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver Hook Off Pressed")); - iOffHookPressed = ETrue; - break; - case ENoHook: - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver Hook None Pressed")); - TRAP_IGNORE( HandleNoneHookPressL() ); - break; - default: - TRACE_INFO(_L("CHidHeadsetDriver::HookKeyPres : Not \ - supported")); - } - } - else - { - ReleaseHookKey(); - } - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// ReleaseHookKey() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::ReleaseHookKey() - { - TRACE_FUNC_ENTRY - - if ( iOnHookPressed ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver Hook On released")); - iOnHookPressed = EFalse; - // Incoming call - RProperty::Set( KPSUidHidEventNotifier, KHidHookKeyEvent, - KPSAnsweClicked ); - } - if ( iOffHookPressed ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver Hook Off released")); - iOffHookPressed = EFalse; - // Disconnect connected call - RProperty::Set( KPSUidHidEventNotifier, KHidHookKeyEvent, - KPSHangUpClicked ); - } - if ( iNoneHookPressed && !iAlarmStatus ) - { - TRAP_IGNORE( HandleIdleHookReleaseL() ); - } - if ( iNoneHookPressed && iAlarmStatus ) - { - TRAP_IGNORE( HandleAlarmHookReleaseL() ); - } - if ( iLongClicktimer ) - { - iLongPress = EFalse; - } - delete iLongClicktimer; - iLongClicktimer = NULL; - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// HandleNoneHook() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::HandleNoneHookPressL() - { - TRACE_FUNC_ENTRY - /** Start long press timer is alarm is ongoing, or phone - * is not alarming and thre are no hook key press whitout - * release - */ - if ( iAlarmStatus || ( !iNoneHookPressed && !iAlarmStatus ) ) - { - iNoneHookPressed = ETrue; - iLongPress = EFalse; - - delete iLongClicktimer; - iLongClicktimer = NULL; - - iLongClicktimer = CKeyPressTimer::NewL( this, - TTimeIntervalMicroSeconds32( KLongClickTimeout ), - ELongPressTimer ); - } - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// HandleAlarmHookReleaseL() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::HandleAlarmHookReleaseL() - { - TRACE_FUNC_ENTRY - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver Hook None released")); - /** - * Hook key is released when there is active alarm. Start double - * click timer for monitoring double click. - */ - if ( !iDoubleClicktimer && !iLongPress ) - { - iDoubleClicktimer = CKeyPressTimer::NewL( this, - TTimeIntervalMicroSeconds32( KDoubleClickTimeout ), - EDoubleClickTimer ); - } - /** - * Stot alar when hook key is pressed long time during alarm. - */ - else if ( iLongPress ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver Stop alarm")); - RProperty::Set( KPSUidAlarmExtCntl, KAlarmStopKey, - EAlarmUIStopAlarm ); - iAlarmStatus = EFalse; - iLongPress = EFalse; - } - /** - * Double click timer exsist and is it not long press, so - * this is double click release. Then snooze alarm. - */ - else if ( !iLongPress ) - { - delete iDoubleClicktimer; - iDoubleClicktimer = NULL; - iAlarmStatus = EFalse; - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver Snooze")); - RProperty::Set( KPSUidAlarmExtCntl, KAlarmSnoozeKey, - EAlarmUISnoozeAlarm ); - } - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// HandleIdleHookReleaseL -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::HandleIdleHookReleaseL() - { - TRACE_FUNC_ENTRY - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver Hook None released")); - iNoneHookPressed = EFalse; - /** - * Hook key is released when there is music playing ongoing. Start double - * click timer for monitoring double click. - */ - if ( !iDoubleClicktimer && !iLongPress ) - { - iDoubleClicktimer = CKeyPressTimer::NewL( this, - TTimeIntervalMicroSeconds32( KDoubleClickTimeout ), - EDoubleClickTimer ); - } - /** - * Hook key is released when there is not music playing ongoing. - * Because double click timer is active this is second release in - * short beriod and redial needs to be issued. - */ - else if ( !iLongPress && !iPlayingStatus ) - { - delete iDoubleClicktimer; - iDoubleClicktimer = NULL; - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver Redial")); - RProperty::Set( KPSUidHidEventNotifier, KHidHookKeyEvent, - KPSRedial ); - } - /** - * Hook key is released when there is music playing ongoing. - * Because double click timer is active, is send forward command sent - * and DoubleNextClick set to true for sending next command. - */ - else if ( iPlayingStatus && !iLongPress ) - { - delete iDoubleClicktimer; - iDoubleClicktimer = NULL; - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver next after next")); - if ( !iLongPress ) - { - iDoubleNextClick = ETrue; //set to true and when player change - //track press next again - } - RProperty::Set( KPSUidHidEventNotifier, KHidControlKeyEvent, - EForwardClicked ); //next after next - } - /** - * Long press release when there are no actie calls, alarms, and music - * playing is stopped, activates voice dialing. - */ - else if ( iLongPress ) - { - delete iDoubleClicktimer; - iDoubleClicktimer = NULL; - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver VoiceDial")); - RProperty::Set( KPSUidHidEventNotifier, KHidHookKeyEvent, - KPSVoiceDial ); - iLongPress = EFalse; - } - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// GetHookStatus() -// --------------------------------------------------------------------------- -// -CHidHeadsetDriver::THookHandling CHidHeadsetDriver::HookStatus() - { - TRACE_FUNC_ENTRY - THookHandling retVal = EOffHook; - TInt ret = KErrNone; - CTelephony::TCallStatusV1 callStatusV1; - CTelephony::TCallStatusV1Pckg callStatusV1Pckg( callStatusV1 ); - ret = iTelephony->GetLineStatus( CTelephony::EVoiceLine, - callStatusV1Pckg ); - if ( ret != KErrNone ) - { - retVal = ENoHook; - } - CTelephony::TCallStatus voiceLineStatus = callStatusV1.iStatus; - TRACE_INFO((_L("[HID]\tCHidHeadsetDriver GetHookStatus voiceline \ - status %d"), voiceLineStatus)); - - if ( voiceLineStatus == CTelephony::EStatusHold || voiceLineStatus - == CTelephony::EStatusRinging ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver GetHookStatus on hook")); - retVal = EOnHook; - } - else if ( voiceLineStatus == CTelephony::EStatusUnknown - || voiceLineStatus == CTelephony::EStatusIdle ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver GetHookStatus no hook")); - retVal = ENoHook; - } - TRACE_FUNC_EXIT - return retVal; - } - -// --------------------------------------------------------------------------- -// From class CHidDriver -// CanHandleReportL() -// --------------------------------------------------------------------------- -// -TInt CHidHeadsetDriver::CanHandleReportL( CReportRoot* aReportRoot ) - { - TRACE_INFO((_L("[HID]\tCHidHeadsetDriver::CanHandleReport(0x%08x)"), - aReportRoot)); - - THidFieldSearch search; - - THeadsetFinder headsetFinder; - search.SearchL( aReportRoot, &headsetFinder ); - - iSupportedFieldCount = headsetFinder.FieldCount(); - for ( TInt i = 0; i < headsetFinder.FieldCount(); i++ ) - { - User::LeaveIfError( iFieldList.Append( headsetFinder.GetFieldAtIndex( - i ) ) ); - TRACE_INFO((_L("[HID]\tCHidHeadsetDriver::CanHandleReportL, field \ - pointer: 0x%08x"), iFieldList[i])); - } - - TInt valid = KErrHidUnrecognised; - - if ( headsetFinder.Found() ) - { - valid = KErrNone; - } - // empty finder's field list before going out of scope. - headsetFinder.EmptyList(); - - TRACE_INFO((_L("[HID]\tCHidHeadsetDriver::CanHandleReport() returning \ - %d"), valid)); - return valid; - } - -// --------------------------------------------------------------------------- -// From class CHidDriver -// SupportedFieldCount -// --------------------------------------------------------------------------- -// -TInt CHidHeadsetDriver::SupportedFieldCount() - { - return iSupportedFieldCount; - } -// --------------------------------------------------------------------------- -// From class MTimerNotifier -// TimerExpired() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::TimerExpired( TTimerType aTimerType ) - { - TRACE_FUNC_ENTRY - switch ( aTimerType ) - { - case EDoubleClickTimer: - ExpiredDoubleClickTimer(); - break; - case ELongPressTimer: - ExpiredLongClickTimer(); - break; - case EScanNextPressTimer: - iForwardStatus = EScanLongPress; - RProperty::Set( KPSUidHidEventNotifier, KHidControlKeyEvent, - EFastForwardPressed ); - break; - case EScanPrevPressTimer: - iBackwardStatus = EScanLongPress; - RProperty::Set( KPSUidHidEventNotifier, KHidControlKeyEvent, - ERewindPressed ); - break; - default: - TRACE_INFO(_L("CHidHeadsetDriver::TimerExpired : Not supported")) - ; - } - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// ExpiredDoubleClickTimer() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::ExpiredDoubleClickTimer() - { - TRACE_FUNC_ENTRY - if ( iDoubleClicktimer ) - { - delete iDoubleClicktimer; - iDoubleClicktimer = NULL; - - if ( iIncomingCallStatus ) - { - iIncomingCallStatus = EFalse; - iOnHookPressed = ETrue; - ReleaseHookKey(); - } - if ( iAlarmStatus ) - { - RProperty::Set( KPSUidAlarmExtCntl, KAlarmStopKey, - EAlarmUIStopAlarm ); - iAlarmStatus = EFalse; - } - if ( iPlayingStatus ) - { - RProperty::Set( KPSUidHidEventNotifier, KHidControlKeyEvent, - EForwardClicked ); - iPlayingStatus = EFalse; - } - } - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// ExpiredLongClickTimer() -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::ExpiredLongClickTimer() - { - TRACE_FUNC_ENTRY - if ( iLongClicktimer ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::TimerExpired long click")); - delete iLongClicktimer; - iLongClicktimer = NULL; - iLongPress = ETrue; - ReleaseHookKey(); - } - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// AlarmStatus() -// --------------------------------------------------------------------------- -// -TBool CHidHeadsetDriver::AlarmStatus() - { - TRACE_FUNC_ENTRY - TInt activealarmcount = 0; - TBool retVal = EFalse; - activealarmcount = iAlarmServerSession.AlarmCountByState( - EAlarmStateNotifying ); - if ( activealarmcount > 0 ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::AlarmStatus active alarms")); - retVal = ETrue; - } - else - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::AlarmStatus no active \ - alarms")); - retVal = EFalse; - } - TRACE_FUNC_EXIT - return retVal; - } - -// --------------------------------------------------------------------------- -// AlarmStatus() -// --------------------------------------------------------------------------- -// -TBool CHidHeadsetDriver::MusicPlayingStatus() - { - TRACE_FUNC_ENTRY - TBool retVal = EFalse; - TMPXPlaybackState state = EPbStateNotInitialised; - TRAPD( err, state = iMusicPlayer->StateL() ); - if ( state == EPbStatePlaying && err == KErrNone ) - { - TRACE_INFO(_L("[HID]\tCHidHeadsetDriver::MusicPlayingStatus play \ - active")); - retVal = ETrue; - } - TRACE_FUNC_EXIT - return retVal; - } - -// --------------------------------------------------------------------------- -// HandlePlaybackMessage -// --------------------------------------------------------------------------- -// -void CHidHeadsetDriver::HandlePlaybackMessage( CMPXMessage* aMsg, TInt /*aErr*/) - { - TRACE_FUNC_ENTRY - - TMPXMessageId id( aMsg->ValueTObjectL ( - KMPXMessageGeneralId ) ); - // send nect track whit double hook click when track is changed - if ( id == KMPXMessagePbMediaChanged && iDoubleNextClick ) - { - TRACE_INFO(_L("[HID]\tHandlePlaybackMessage: PbMediaChangeg")); - RProperty::Set( KPSUidHidEventNotifier, KHidControlKeyEvent, - EForwardClicked ); - iDoubleNextClick = EFalse; - } - TRACE_FUNC_EXIT - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/src/hidheadsetdriverproxy.cpp --- a/localconnectivityservice/headset/src/hidheadsetdriverproxy.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* Copyright (c) 2007-2009 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: Heaset plugin implementation table - * -*/ - - -#include -#include -#include "headset.h" -#include "headsetuids.h" - -// Constantshrr -// -const TImplementationProxy KHidHeadsetDriverProxy[] = - { - IMPLEMENTATION_PROXY_ENTRY( HEADSET_DRIVER_IMP, CHidHeadsetDriver::NewL ) - }; - -// --------------------------------------------------------------------------- -// ImplementationGroupProxy -// --------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( - TInt& aTableCount ) - { - aTableCount = sizeof( KHidHeadsetDriverProxy ) - / sizeof(TImplementationProxy); - return KHidHeadsetDriverProxy; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/headset/src/keypresstimer.cpp --- a/localconnectivityservice/headset/src/keypresstimer.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2007-2009 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: HID Heaset plugin timeouttimer - * -*/ - - -#include "keypresstimer.h" -#include "debug.h" - -// ======== MEMBER FUNCTIONS ======== -// --------------------------------------------------------------------------- -// NewL -// --------------------------------------------------------------------------- -// -CKeyPressTimer* CKeyPressTimer::NewL( MTimerNotifier* aTimeOutNotify, - TTimeIntervalMicroSeconds32 aTimeOutTime, TTimerType aTimerType ) - { - CKeyPressTimer* self = CKeyPressTimer::NewLC( aTimeOutNotify, - aTimeOutTime, aTimerType ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// NewLC -// --------------------------------------------------------------------------- -// -CKeyPressTimer* CKeyPressTimer::NewLC( MTimerNotifier* aTimeOutNotify, - TTimeIntervalMicroSeconds32 aTimeOutTime, TTimerType aTimerType ) - { - CKeyPressTimer* self = new ( ELeave ) CKeyPressTimer( aTimeOutNotify, - aTimerType ); - CleanupStack::PushL( self ); - self->ConstructL( aTimeOutTime ); - return self; - } - -// --------------------------------------------------------------------------- -// CTimeOutTimer() -// --------------------------------------------------------------------------- -// -CKeyPressTimer::CKeyPressTimer( MTimerNotifier* aTimeOutNotify, - TTimerType aTimerType ) : - CTimer( EPriorityStandard ), iNotify( aTimeOutNotify ), iTimerType( - aTimerType ) - { - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CKeyPressTimer::~CKeyPressTimer() - { - } - -// --------------------------------------------------------------------------- -// ConstructL() -// --------------------------------------------------------------------------- -// -void CKeyPressTimer::ConstructL( TTimeIntervalMicroSeconds32 aTimeOutTime ) - { - TRACE_FUNC - CTimer::ConstructL(); - CActiveScheduler::Add( this ); - After( aTimeOutTime ); - } - -// --------------------------------------------------------------------------- -// From class CActive -// RunL() -// --------------------------------------------------------------------------- -// -void CKeyPressTimer::RunL() - { - TRACE_FUNC - // Timer request has completed, so notify the timer's owner - if ( iNotify ) - { - iNotify->TimerExpired( iTimerType ); - } - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/data/10204DAE.rss --- a/localconnectivityservice/lcstylustap/data/10204DAE.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Resource definitions for touch functional plug in -* -*/ - - - - -#include "registryinfov2.rh" -#include "AknIndicatorPluginImplUIDs.hrh" - - - -RESOURCE REGISTRY_INFO theInfo - { - resource_format_version = RESOURCE_FORMAT_VERSION_2; - dll_uid = 0x10204DAE; // Plugin dll UID - interfaces = - { - INTERFACE_INFO - { - interface_uid = KAknIndicatorPluginInterfaceUid; - - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KImplUIDBTIndicatorsPlugin; - version_no = 1; - display_name = "LC Stylus Tap Plug in for BT"; // Plugin debug name - default_data = "lcstylustapbt"; // Parent UID - opaque_data = ""; - // This implementation CANNOT be overridden by a RAM-based plug-in - rom_only = 1; - }, - IMPLEMENTATION_INFO - { - implementation_uid = KImplUIDUSBIndicatorsPlugin; - version_no = 1; - display_name = "LC Stylus Tap Plug in for USB"; // Plugin debug name - default_data = "lcstylustapusb"; // Parent UID - opaque_data = ""; - // This implementation CANNOT be overridden by a RAM-based plug-in - rom_only = 1; - }, - IMPLEMENTATION_INFO - { - implementation_uid = KImplUIDIRIndicatorsPlugin; - version_no = 1; - display_name = "LC Stylus Tap Plug in for IRDA"; // Plugin debug name - default_data = "lcstylustapirda"; // Parent UID - opaque_data = ""; - // This implementation CANNOT be overridden by a RAM-based plug-in - rom_only = 1; - }, - IMPLEMENTATION_INFO - { - implementation_uid = 0x20026FC4; - version_no = 1; - display_name = "LC Stylus Tap Plug in for USBMEM"; // Plugin debug name - default_data = "lcstylustapusbmem"; // Parent UID - opaque_data = ""; - // This implementation CANNOT be overridden by a RAM-based plug-in - rom_only = 1; - } - }; - } - }; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/data/lcstylustaprsc.rss --- a/localconnectivityservice/lcstylustap/data/lcstylustaprsc.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Resource definitions for project lcstylustap -* -*/ - - -// RESOURCE IDENTIFIER -NAME LCSX // 4 letter ID - -// INCLUDES - -#include -#include -#include - -// CONSTANTS - -// RESOURCE DEFINITIONS - -RESOURCE RSS_SIGNATURE - { - } -RESOURCE TBUF r_lcstylustap_bt_name { buf = qtn_bt_title_bluetooth; } -RESOURCE TBUF r_lcstylustap_usb_name { buf = qtn_usb_stylus_tap; } -RESOURCE TBUF r_lcstylustap_usb_mem_eject { buf = qtn_usb_mem_eject; } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/group/bld.inf --- a/localconnectivityservice/lcstylustap/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2007-2008 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 Stylus Tap. -* -*/ - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -../rom/lcstylustap.iby CORE_MW_LAYER_IBY_EXPORT_PATH(lcstylustap.iby) -../rom/lcstylustapResource.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(lcstylustapResource.iby) - -PRJ_MMPFILES -lcstylustap.mmp - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/group/lcstylustap.mmp --- a/localconnectivityservice/lcstylustap/group/lcstylustap.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* -* Copyright (c) 2007-2009 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: This is plug in to UI Framework Core -* -*/ - - - -#include // For RESOURCE_FILES_DIR -#include - -//EPOCALLOWDLLDATA - -CAPABILITY CAP_ECOM_PLUGIN - -TARGET lcstylustap.dll -TARGETTYPE PLUGIN -UID 0x10009D8D 0x10204DAE -VENDORID VID_DEFAULT - - -SOURCEPATH ../src -SOURCE lcstylustapproxy.cpp -SOURCE lcstylustap.cpp -SOURCE lcstylustapdismount.cpp -SOURCE forcedismounttimer.cpp - - -//User include paths -USERINCLUDE ../inc - - -//System include paths -MW_LAYER_SYSTEMINCLUDE -SYSTEMINCLUDE /epoc32/include/ecom - -SOURCEPATH ../data - -START RESOURCE 10204DAE.rss -TARGET lcstylustap.rsc -END - - -START RESOURCE lcstylustaprsc.rss -HEADER -TARGET lcstylustaprsc.rsc -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END - - -LIBRARY ecom.lib -LIBRARY euser.lib -LIBRARY bafl.lib -LIBRARY avkon.lib -LIBRARY cone.lib -LIBRARY commonengine.lib -LIBRARY efsrv.lib - -LIBRARY flogger.lib - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/inc/debug.h --- a/localconnectivityservice/lcstylustap/inc/debug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,167 +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: Logging definition -* -*/ - - -#ifndef PRJ_LOGGING_H -#define PRJ_LOGGING_H - -#include -#include "debugconfig.h" - -#ifdef PRJ_ENABLE_TRACE - -#ifdef PRJ_FILE_TRACE -#include -#else -#include -#endif - -NONSHARABLE_CLASS(TOverflowTruncate16) : public TDes16Overflow - { -public: - void Overflow(TDes16& /*aDes*/) {} - }; - -NONSHARABLE_CLASS(TOverflowTruncate8) : public TDes8Overflow - { -public: - void Overflow(TDes8& /*aDes*/) {} - }; - -inline void Trace(TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); -#ifdef PRJ_FILE_TRACE - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); -#else - TBuf16 theFinalString; - theFinalString.Append(KTracePrefix16); - TOverflowTruncate16 overflow; - theFinalString.AppendFormatList(aFmt,list,&overflow); - RDebug::Print(theFinalString); -#endif - } - -inline void Trace(TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list, aFmt); -#ifdef PRJ_FILE_TRACE - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); -#else - TOverflowTruncate8 overflow; - TBuf8 buf8; - buf8.Append(KTracePrefix8); - buf8.AppendFormatList(aFmt, list, &overflow); - TBuf16 buf16(buf8.Length()); - buf16.Copy(buf8); - TRefByValue tmpFmt(_L("%S")); - RDebug::Print(tmpFmt, &buf16); -#endif - } - -inline void TracePanic( - char* aFile, - TInt aLine, - TInt aPanicCode, - const TDesC& aPanicCategory) - { - TPtrC8 fullFileName((const TUint8*)aFile); - TPtrC8 fileName(fullFileName.Ptr()+fullFileName.LocateReverse('\\')+1); - TBuf8 buf; - buf.Append(KPanicPrefix8); - buf.AppendFormat(_L8("%d at line %d in file %S"), aPanicCode, aLine, &fileName); - Trace(buf); - User::Panic(aPanicCategory, aPanicCode); - } - -inline void TraceLeave(char* aFile, TInt aLine, TInt aReason) - { - TPtrC8 fullFileName((const TUint8*)aFile); - TPtrC8 fileName(fullFileName.Ptr()+fullFileName.LocateReverse('\\')+1); - TBuf8 buf; - buf.Append(KLeavePrefix8); - buf.AppendFormat(_L8("%d at line %d in file %S"), aReason, aLine, &fileName); - Trace(buf); - User::LeaveIfError(aReason); - } - -#define TRACE_INFO(p) {if(KTraceMask & KPRINTINFO) Trace p;} - -#define TRACE_ERROR(p) {if(KTraceMask & KPRINTERROR) Trace p;} - -#define TRACE_STATE(p) {if(KTraceMask & KPRINTSTATE) Trace p;} - -#define TRACE_WARNING(p) {if(KTraceMask & KPRINTWARNING) Trace p;} - -#define TRACE_INFO_SEG(p) {if(KTraceMask & KPRINTINFO) p;} - -#define TRACE_ASSERT(GUARD, CODE) {if (!(GUARD)) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory);} - -#define PANIC(CODE) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory) - -#define LEAVE_IF_ERROR(REASON) {if (REASON) TraceLeave(__FILE__, __LINE__, REASON);} - -#define LEAVE(REASON) {TraceLeave(__FILE__, __LINE__, REASON);} - -#define TRACE_FUNC_ENTRY {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryFormat8, &ptr8);}} - -#define TRACE_FUNC_ENTRY_THIS {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryThisFormat8, &ptr8, this);}} - -#define TRACE_FUNC_EXIT {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncExitFormat8, &ptr8);}} - -#define TRACE_FUNC {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncFormat8, &ptr8);}} - -#define TRACE_FUNC_THIS {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncThisFormat8, &ptr8, this);}} - -#define RETURN_IF_ERR(ERR) {if(ERR) {TPtrC8 ptr8((TUint8*)__FILE__); Trace(_L8(" RETURN %d at file %S line %d"), ERR, &ptr8, __LINE__); return ERR;}} - -#else // PRJ_ENABLE_TRACE not defined - -#define TRACE_INFO(p) - -#define TRACE_ERROR(p) - -#define TRACE_STATE(p) - -#define TRACE_WARNING(p) - -#define TRACE_INFO_SEG(p) - -#define TRACE_ASSERT(GUARD, CODE) - -#define PANIC(CODE) {User::Panic(KPanicCategory, CODE);} - -#define LEAVE_IF_ERROR(REASON) {static_cast(User::LeaveIfError(REASON));} - -#define LEAVE(REASON) {static_cast(User::Leave(REASON));} - -#define TRACE_FUNC_ENTRY - -#define TRACE_FUNC_ENTRY_THIS - -#define TRACE_FUNC_EXIT - -#define TRACE_FUNC - -#define TRACE_FUNC_THIS - -#define RETURN_IF_ERR(ERR) {if(ERR) return ERR;} -#endif // PRJ_ENABLE_TRACE - -#endif // PRJ_LOGGING_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/inc/debugconfig.h --- a/localconnectivityservice/lcstylustap/inc/debugconfig.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +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: Project configure file. -* -*/ - - -#ifndef ___DEBUGCONFIG_H__ -#define ___DEBUGCONFIG_H__ - - -#ifdef _DEBUG -#define PRJ_ENABLE_TRACE -#endif - - -//#define PRJ_FILE_TRACE - -/** - * build the project for module test purpose if this is defined - */ -//#define PRJ_MODULETEST_BUILD - -/** - * build the project using stubs to replace the dependencies if this is defined - */ -//#define PRJ_USE_STUB - - -/** - * Custom logging variations. - */ -#ifdef PRJ_FILE_TRACE -_LIT(KLogFile,"lcstylustap.txt"); -_LIT(KLogDir,"lcstylustap"); -#endif - -#ifdef PRJ_ENABLE_TRACE -_LIT(KTracePrefix16, "[lcstylustap] "); -_LIT8(KTracePrefix8, "[lcstylustap] "); -_LIT8(KFuncFormat8, "><%S"); -_LIT8(KFuncThisFormat8, "><%S, [0x%08X]"); -_LIT8(KFuncEntryFormat8, ">%S"); -_LIT8(KFuncEntryThisFormat8, ">%S, [0x%08X]"); -_LIT8(KFuncExitFormat8, "<%S"); - -_LIT(KPanicCategory, "LC lcstylustap"); -_LIT8(KPanicPrefix8, "PANIC code "); -_LIT8(KLeavePrefix8, "LEAVE code "); -#endif - -const TInt KMaxLogLineLength = 512; - -#define KPRINTERROR 0x00000001 // Tracing level: error -#define KPRINTINFO 0x00000002 // Tracing level: function trace -#define KPRINTSTATE 0x00000004 // Tracing level: state machine info -#define KPRINTWARNING 0x00000008 // Tracing level: warning - -const TInt KTraceMask = KPRINTERROR | KPRINTINFO | KPRINTSTATE | KPRINTWARNING; - -#endif // ___DEBUGCONFIG_H__ diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/inc/forcedismounttimer.h --- a/localconnectivityservice/lcstylustap/inc/forcedismounttimer.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2009 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: Header file for Stylus Tap indicator -* -*/ - -#ifndef C_FORCEDISMOUNTTIMER_H -#define C_FORCEDISMOUNTTIMER_H - -#include - -/** - * Timer callback interface for force mount - * - * This class specifies the function to be called when a timeout occurs. - * Used in conjunction with CTimeOutTimer class - * - */ -class MTimerNotifier - { -public: - /** - * The function to be called when a timeout occurs. - * - */ - virtual void TimerExpired() = 0; - }; - -/** - * Timer interface for force mount - * - * This class will notify an object after a specified timeout. - * - */ -class CForceDismountTimer : public CTimer - { -public: - /** - * Two-phased constructor. - * @param aTimeOutNotify object to notify of timeout event - */ - static CForceDismountTimer* NewL( MTimerNotifier* aTimeOutNotify ); - - /** - * Two-phased constructor. - * @param aTimeOutNotify object to notify of timeout event - */ - static CForceDismountTimer* NewLC( MTimerNotifier* aTimeOutNotify); - - /** - * Destructor - */ - virtual ~CForceDismountTimer(); - -protected: - - /** - * From CTimer - * Invoked when a timeout occurs - * - */ - virtual void RunL(); - -private: - /** - * Constructor. - * @param aTimeOutNotify object to notify of timeout event - */ - CForceDismountTimer( MTimerNotifier* aTimeOutNotify ); - - /** - * Default constructor. - */ - void ConstructL(); - -private: // Member variables - - /** - * The observer for this objects events - * Not own. - */ - MTimerNotifier* iNotify; - - - }; -#endif // C_FORCEMOUNTTIMER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/inc/lcstylustap.h --- a/localconnectivityservice/lcstylustap/inc/lcstylustap.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +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: Header file for Stylus Tap indicator -* -*/ - - -#ifndef C_LCSTYLUSTAP_H -#define C_LCSTYLUSTAP_H - -#include - - -class CLcStylusTapDismount; -/** - * Implements stylus tap actions for the indicator provided by - * UID - * @lib - * @since S60 v5.0 - */ - -NONSHARABLE_CLASS( CLcStylusTap ) : public CAknIndicatorPlugin - { - -public: - - /** - * Two-phase constructor - * @since S60 5.0 - * @param none - */ - static CLcStylusTap* NewL( ); - - /** - * Destructor - */ - virtual ~CLcStylusTap(); - -public: // CAknIndicatorPlugin - - /** - * HandleIndicatorTapL is called when user tap on the UI - * @since S60 5.0 - * @param aUid, implementation Uid - */ - void HandleIndicatorTapL( const TInt aUid ); - /** - * TextL, the text that should be shown in the tap area - * @since S60 5.0 - * @param aUid, implementation Uid - * @param aTextType, text type linked or no link - */ - HBufC* TextL( const TInt aUid, TInt& aTextType ); - -private: - - /** - * C++ default constructor - * @since S60 5.0 - * @param none - */ - CLcStylusTap( ); - - /** - * Symbian 2nd-phase constructor - * @since S60 5.0 - * @param none - */ - void ConstructL(); - /** - * Create the setting application - * @since S60 5.0 - * @param aProcessName, process name whose setting view will be launched - * @param aUidType TUidType of the desired process - */ - void CreateDesiredViewL(const TDesC & aProcessName,const TUidType & aUidType) const; - - - /** - * Ejec usb memory - */ - void EjectUSBMemL(); - -private: // data - /** - * Dismount manageer - * Own. - */ - CLcStylusTapDismount* iDismountManager; - }; - - -#endif // __LCSTYLUSTAP_H__ diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/inc/lcstylustapdismount.h --- a/localconnectivityservice/lcstylustap/inc/lcstylustapdismount.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -/* -* Copyright (c) 2009 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: Header file for Stylus Tap indicator -* -*/ - - -#ifndef C_LCSTYLUSTAPDISMOUNT_H -#define C_LCSTYLUSTAPDISMOUNT_H - -#include // CActive -#include -#include "forcedismounttimer.h" - - -/** - * Active class dismount notifications notifiers - * - */ -NONSHARABLE_CLASS( CLcStylusTapDismount ) : public CActive, - public MTimerNotifier - { -public: - virtual ~CLcStylusTapDismount(); - static CLcStylusTapDismount* NewL(); - static CLcStylusTapDismount* NewLC(); - -public: - /** - * Send dismount notifications for all usb drives. - */ - void DisMountUsbDrives(); - -protected: - /** - * Constructor - */ - CLcStylusTapDismount(); - - /** - * ConstructL - */ - void ConstructL(); - -private: - /** - * Send dismount nontication - */ - void DoDismount(); - -private: //from CActive - // CActive implementation - /** - * RunL - */ - void RunL(); - - /** - * DoCancel - */ - void DoCancel(); - -private: // from MTimerNotifier - - /** - * Force dismount timer callback - */ - void TimerExpired(); - -private: - /** - * Drive index - */ - TInt iDriveIndex; - /** - * RFs session - */ - RFs iRFs; - - /** - * List of drives - */ - TDriveList iDriveList; - - /** - * Force dismount timer - * Own - */ - CForceDismountTimer* iDismountTimer; - }; - - - -#endif // __LCSTYLUSTAP_H__ diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/rom/lcstylustap.iby --- a/localconnectivityservice/lcstylustap/rom/lcstylustap.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ -#ifndef LCSTYLUSTAP_IBY -#define LCSTYLUSTAP_IBY - -//ECOM plugin for tapping(Ecom DLL) -ECOM_PLUGIN(lcstylustap.dll,lcstylustap.rsc) - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/rom/lcstylustapResource.iby --- a/localconnectivityservice/lcstylustap/rom/lcstylustapResource.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ -#ifndef LCSTYLUSTAPRESOURCE_IBY -#define LCSTYLUSTAPRESOURCE_IBY - -//View resource in Ecom plugin -data=DATAZ_\RESOURCE_FILES_DIR\lcstylustaprsc.rsc RESOURCE_FILES_DIR\lcstylustaprsc.rsc - - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/src/forcedismounttimer.cpp --- a/localconnectivityservice/lcstylustap/src/forcedismounttimer.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +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: LC stylustap force unmount timeouttimer -*/ - -#include "debug.h" -#include "forcedismounttimer.h" - - -const TInt KForceDismountTimeOut = 6000000; // 6 seconds - -// ======== MEMBER FUNCTIONS ======== -// --------------------------------------------------------------------------- -// NewL -// --------------------------------------------------------------------------- -// -CForceDismountTimer* CForceDismountTimer::NewL( MTimerNotifier* aTimeOutNotify) - { - TRACE_FUNC - CForceDismountTimer* self = CForceDismountTimer::NewLC( aTimeOutNotify ); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// NewLC -// --------------------------------------------------------------------------- -// -CForceDismountTimer* CForceDismountTimer::NewLC( MTimerNotifier* aTimeOutNotify ) - { - TRACE_FUNC - CForceDismountTimer* self = new (ELeave) CForceDismountTimer( aTimeOutNotify ); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// CTimeOutTimer() -// --------------------------------------------------------------------------- -// -CForceDismountTimer::CForceDismountTimer( MTimerNotifier* aTimeOutNotify): - CTimer(EPriorityStandard), - iNotify(aTimeOutNotify) - { - TRACE_FUNC - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CForceDismountTimer::~CForceDismountTimer() - { - TRACE_FUNC - Cancel(); - } - -// --------------------------------------------------------------------------- -// ConstructL() -// --------------------------------------------------------------------------- -// -void CForceDismountTimer::ConstructL() - { - TRACE_FUNC - if ( !iNotify ) - { - User::Leave(KErrArgument); - } - CTimer::ConstructL(); - CActiveScheduler::Add(this); - After( KForceDismountTimeOut ); - } - -// --------------------------------------------------------------------------- -// From class CActive -// RunL() -// --------------------------------------------------------------------------- -// -void CForceDismountTimer::RunL() - { - TRACE_FUNC - // Timer request has completed, so notify the timer's owner - iNotify->TimerExpired(); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/src/lcstylustap.cpp --- a/localconnectivityservice/lcstylustap/src/lcstylustap.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,221 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: ECOM implementation for touch indicator -* -*/ - - -#include -#include -#include -#include -#include -#include // KExecutableImageUid -#include -#include "lcstylustap.h" -#include "debug.h" -#include "lcstylustapdismount.h" - -const TInt KUsbUIUID = 0x102068E2; -const TInt KBtUIUID = 0x10005951; - - -// Constants -_LIT(KFileDrive, "z:"); -_LIT( KLCStylustapPluginResourceFile, "lcstylustaprsc.rsc" ); -_LIT(KBTUIExe, "BTUI.exe"); // Hard coded name can be used, since it will not be changed -_LIT(KUSBExe, "USBClassChangeUI.exe"); - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// C++ default constructor -// --------------------------------------------------------------------------- -// -CLcStylusTap::CLcStylusTap() - { - - } - - -// --------------------------------------------------------------------------- -// Symbian 2nd-phase constructor -// --------------------------------------------------------------------------- -// -void CLcStylusTap::ConstructL() - { - - } - - -// --------------------------------------------------------------------------- -// NewL -// --------------------------------------------------------------------------- -// -CLcStylusTap* CLcStylusTap::NewL( ) - { - TRACE_FUNC_ENTRY - CLcStylusTap* self = new( ELeave ) CLcStylusTap( ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - TRACE_FUNC_EXIT - return self; - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CLcStylusTap::~CLcStylusTap() - { - TRACE_FUNC_ENTRY - delete iDismountManager; - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// TextL. -// Return the text that should be displayed in the link. -// --------------------------------------------------------------------------- -// - -HBufC* CLcStylusTap::TextL( const TInt aUid, TInt& aTextType ) - { - TRACE_INFO((_L("CLcStylusTap::TextL aUid = %d"), aUid)) - - CEikonEnv* eikEnv = CEikonEnv::Static(); - RConeResourceLoader rLoader(*eikEnv); - - TFileName filename; - filename += KFileDrive; - filename += KDC_RESOURCE_FILES_DIR; - filename += KLCStylustapPluginResourceFile; - - - CleanupClosePushL(rLoader); - rLoader.OpenL(filename); - - HBufC* dynStringBuf = NULL; - - switch(aUid) - { - case EAknIndicatorBluetooth: - case EAknIndicatorBluetoothVisible: - case EAknIndicatorBluetoothModuleOn: - case EAknIndicatorBluetoothModuleOnVisible: - { - dynStringBuf = eikEnv->AllocReadResourceL(R_LCSTYLUSTAP_BT_NAME ); - aTextType = EAknIndicatorPluginLinkText; - break; - } - case EAknIndicatorUSBConnection: - { - aTextType = EAknIndicatorPluginLinkText; - dynStringBuf = eikEnv->AllocReadResourceL(R_LCSTYLUSTAP_USB_NAME ); - break; - } - case EAknIndicatorUSBMemConnected: - case EAknIndicatorUSBMemActive: - { - aTextType = EAknIndicatorPluginLinkText; - dynStringBuf = eikEnv->AllocReadResourceL(R_LCSTYLUSTAP_USB_MEM_EJECT ); - break; - } - default: - break; - } - - CleanupStack::PopAndDestroy(); // rLoader - TRACE_INFO((_L("CLcStylusTap::TextL = %S"), dynStringBuf)) - - return dynStringBuf; - } - -// --------------------------------------------------------------------------- -// HandleIndicatorTapL. -// Filter the aUid and find the app plug in for the view. -// --------------------------------------------------------------------------- -// -void CLcStylusTap::HandleIndicatorTapL( const TInt aUid ) - { - - TRACE_INFO((_L("CLcStylusTap::HandleIndicatorTapL aUid = %d"), aUid)) - - switch(aUid) - { - case EAknIndicatorBluetooth: - case EAknIndicatorBluetoothVisible: - case EAknIndicatorBluetoothModuleOn: - case EAknIndicatorBluetoothModuleOnVisible: - { - TUidType uidtype(KExecutableImageUid, KUidApp,TUid::Uid(KBtUIUID)); - CreateDesiredViewL(KBTUIExe(),uidtype); - break; - } - case EAknIndicatorUSBConnection: - { - TUidType uidtype(KExecutableImageUid, TUid::Uid(0x00),TUid::Uid(KUsbUIUID)); - CreateDesiredViewL(KUSBExe(),uidtype); - break; - } - case EAknIndicatorUSBMemConnected: - case EAknIndicatorUSBMemActive: - { - EjectUSBMemL(); - break; - } - case EAknIndicatorIrActive: // IR not required - default: - TRACE_INFO((_L(" CLcStylusTap::HandleIndicatorTapL default"))) - break; - } - TRACE_FUNC_EXIT - } - - -// --------------------------------------------------------------------------- -// CreateDesiredViewL. -// Create the desired view via control panel. -// --------------------------------------------------------------------------- -// -void CLcStylusTap::CreateDesiredViewL(const TDesC & aProcessName,const TUidType & aUidType) const - { - TRACE_FUNC_ENTRY - RProcess NewProcess; - User::LeaveIfError(NewProcess.Create(aProcessName, KNullDesC, aUidType)); - NewProcess.Resume(); - NewProcess.Close(); - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// CreateDesiredViewL. -// Create the desired view via control panel. -// --------------------------------------------------------------------------- -// -void CLcStylusTap::EjectUSBMemL() - { - TRACE_FUNC_ENTRY - delete iDismountManager; - iDismountManager = NULL; - iDismountManager= CLcStylusTapDismount::NewL(); - iDismountManager->DisMountUsbDrives(); - TRACE_FUNC_EXIT - } - - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/src/lcstylustapdismount.cpp --- a/localconnectivityservice/lcstylustap/src/lcstylustapdismount.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: ECOM implementation for touch indicator -* -*/ - -#include "debug.h" -#include "lcstylustapdismount.h" - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CLcStylusTapDismount::~CLcStylusTapDismount() - { - TRACE_FUNC - Cancel(); - delete iDismountTimer; - iRFs.Close(); - } - -// --------------------------------------------------------------------------- -// Symbian two phase constructor. -// --------------------------------------------------------------------------- -// -CLcStylusTapDismount* CLcStylusTapDismount::NewL() - { - TRACE_FUNC - CLcStylusTapDismount* self = CLcStylusTapDismount::NewLC(); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// Symbian two phase constructor. Object pushed to cleanup stack -// --------------------------------------------------------------------------- -// -CLcStylusTapDismount* CLcStylusTapDismount::NewLC() - { - TRACE_FUNC - - CLcStylusTapDismount* self = new (ELeave) CLcStylusTapDismount(); - CleanupStack::PushL(self); - self->ConstructL(); - - return self; - - } - -// --------------------------------------------------------------------------- -// Returning of previous notifier and starting of new one -// --------------------------------------------------------------------------- -// -void CLcStylusTapDismount::RunL() - { - TRACE_FUNC - - delete iDismountTimer; - iDismountTimer = NULL; - - if ( iDriveIndex < KMaxDrives ) - { - DoDismount(); - } - } - -// --------------------------------------------------------------------------- -// Cancel pending notifier and those in queue -// --------------------------------------------------------------------------- -// -void CLcStylusTapDismount::DoCancel() - { - TRACE_FUNC - iRFs.NotifyDismountCancel(iStatus); - } - -// --------------------------------------------------------------------------- -// C++ constructor -// --------------------------------------------------------------------------- -// -CLcStylusTapDismount::CLcStylusTapDismount() - : CActive(EPriorityStandard) - { - TRACE_FUNC - CActiveScheduler::Add(this); - } - -// --------------------------------------------------------------------------- -// 2nd-phase constructor -// --------------------------------------------------------------------------- -// -void CLcStylusTapDismount::ConstructL() - { - TRACE_FUNC - User::LeaveIfError( iRFs.Connect()); - } - -// --------------------------------------------------------------------------- -// Dismount drive -// --------------------------------------------------------------------------- -// -void CLcStylusTapDismount::DisMountUsbDrives() - { - TRACE_FUNC - Cancel(); - iDriveIndex = 0; - iRFs.DriveList( iDriveList ); - DoDismount(); - } - -// --------------------------------------------------------------------------- -// Dismount next drive -// --------------------------------------------------------------------------- -// -void CLcStylusTapDismount::DoDismount() - { - TRACE_FUNC - TDriveInfo info; - TInt err = KErrNone; - for ( ; iDriveIndex < KMaxDrives; iDriveIndex++ ) - { - if ( iDriveList[iDriveIndex] ) - { - err = iRFs.Drive( info , iDriveIndex ); - if ( info.iConnectionBusType == EConnectionBusUsb && - info.iDriveAtt & KDriveAttExternal && - err == KErrNone ) - { - TRACE_INFO(_L("CLcStylusTapDismount::DoDismount Dismount notify request ")); - iRFs.NotifyDismount( iDriveIndex, iStatus, EFsDismountNotifyClients ); - TRAP_IGNORE( iDismountTimer = CForceDismountTimer::NewL(this) ); - SetActive(); - break; - } - } - } - } - -// --------------------------------------------------------------------------- -// Dismount next drive -// --------------------------------------------------------------------------- -// -void CLcStylusTapDismount::TimerExpired() - { - TRACE_FUNC - - Cancel(); - delete iDismountTimer; - iDismountTimer = NULL; - iRFs.NotifyDismount( iDriveIndex, iStatus, EFsDismountForceDismount ); - SetActive(); - - } -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/src/lcstylustapproxy.cpp --- a/localconnectivityservice/lcstylustap/src/lcstylustapproxy.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +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: ECOM proxy table for this plugin -* -*/ - - - -#include -#include -#include "lcstylustap.h" - - - -// ======== LOCAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Definition of ECOM interface UID -// --------------------------------------------------------------------------- -// -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( KImplUIDBTIndicatorsPlugin, CLcStylusTap::NewL ), - IMPLEMENTATION_PROXY_ENTRY( KImplUIDUSBIndicatorsPlugin, CLcStylusTap::NewL ), - IMPLEMENTATION_PROXY_ENTRY( KImplUIDIRIndicatorsPlugin, CLcStylusTap::NewL ), - IMPLEMENTATION_PROXY_ENTRY( 0x20026FC4, CLcStylusTap::NewL ) - }; - - -// --------------------------------------------------------------------------- -// ECOM factory method -// --------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) - { - aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); - return ImplementationTable; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/Bmarm/LcStylusTapTestU.DEF --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/Bmarm/LcStylusTapTestU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/Bwins/LcStylusTapTestU.DEF --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/Bwins/LcStylusTapTestU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/EABI/LcStylusTapTestU.def --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/EABI/LcStylusTapTestU.def Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z9LibEntryLR13CTestModuleIf @ 1 NONAME - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/conf/ui_LcStylusTapTest.cfg --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/conf/ui_LcStylusTapTest.cfg Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +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: Test Scripter configuration file -* -*/ - - -// LcStylusTapTest Module - total ... tc - -// LcStylusTapTest Api Tests (... tc) - -[Test] -title Create LcStylusTap USB -create LcStylusTapTest tester -tester ExecuteApiTestBlock CreateLcStylusTap API USB -delete tester -[Endtest] - -[Test] -title Create LcStylusTap BT -create LcStylusTapTest tester -tester ExecuteApiTestBlock CreateLcStylusTap API BT -delete tester -[Endtest] - -[Test] -title Create LcStylusTap IRDA -create LcStylusTapTest tester -tester ExecuteApiTestBlock CreateLcStylusTap API IRDA -delete tester -[Endtest] - -[Test] -title Create LcStylusTap USBMEM -create LcStylusTapTest tester -tester ExecuteApiTestBlock CreateLcStylusTap API USBMEM -delete tester -[Endtest] -/////////////////////////////////////////////// - -[Test] -title Text LcStylusTap USB -create LcStylusTapTest tester -tester ExecuteApiTestBlock TextTapTest API USB -delete tester -[Endtest] - -[Test] -title Text LcStylusTap BT -create LcStylusTapTest tester -tester ExecuteApiTestBlock TextTapTest API BT -delete tester -[Endtest] - -[Test] -title Text LcStylusTap USBMEM -create LcStylusTapTest tester -tester ExecuteApiTestBlock TextTapTest API USBMEM -delete tester -[Endtest] -/* -[Test] -title Text LcStylusTap USBMEM_loc -create LcStylusTapTest tester -tester ExecuteApiTestBlock TextTapTest API USBMEM_loc -delete tester -[Endtest] -*/ -/////////////////////////////////////////////// -[Test] -title CallHandleIndicatorTap USB -create LcStylusTapTest tester -tester ExecuteApiTestBlock CallHandleIndicatorTap API USB -pause 700 -presskey global EKeyDevice1 -delete tester -[Endtest] - -[Test] -title CallHandleIndicatorTap BT -create LcStylusTapTest tester -tester ExecuteApiTestBlock CallHandleIndicatorTap API BT -pause 1000 -presskey global EKeyEnter -pause 700 -presskey global EKeyDevice1 -delete tester -[Endtest] - -[Test] -title CallHandleIndicatorTap USBMEM -create LcStylusTapTest tester -tester ExecuteApiTestBlock CallHandleIndicatorTap API USBMEM -delete tester -[Endtest] - -[Test] -title Create LcStylusTap IRDA -create LcStylusTapTest tester -tester ExecuteApiTestBlock CreateLcStylusTap API IRDA -delete tester -[Endtest] -/////////////////////////////////////////////////////////// -// Add new api tests here -// ... - - -// LcStylusTapTest Module Tests (... tc) -/* - [Test] - title Example Module Test - create LcStylusTapTest tester - tester ExecuteModuleTestBlock ExampleTestL MODULE option 2 b - delete tester - [Endtest] -*/ -// Add new module tests here -// ... - - -// LcStylusTapTest Branch Tests (... tc) -/* - [Test] - title Example Branch Test - create LcStylusTapTest tester - tester ExecuteBranchTestBlock ExampleTestL BRANCH option 3 c - delete tester - [Endtest] -*/ -// Add new branch tests here -// ... diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/Bld.inf --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/Bld.inf Thu Aug 19 10:46:39 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 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/LcStylusTapTest.mmp --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/LcStylusTapTest.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/*TYPE TESTCLASS*/ -/* -* 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: -* -*/ - - -#if defined(__S60_) - // To get the MW_LAYER_SYSTEMINCLUDE-definition - #include -#endif - -TARGET LcStylusTapTest.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E3 - -CAPABILITY CAP_ECOM_PLUGIN - -/* Remove comments and replace 0x00000000 with correct vendor id */ -// VENDORID 0x00000000 -/* Remove comments and replace 0x00000000 with correct secure id */ -// SECUREID 0x00000000 - -//TARGETPATH ?target_path -DEFFILE LcStylusTapTest.def - -MW_LAYER_SYSTEMINCLUDE - -USERINCLUDE ../inc -USERINCLUDE ../../../inc - -SYSTEMINCLUDE /EPOC32/INCLUDE/ECOM - -SOURCEPATH ../src - -SOURCE LcStylusTapTest.cpp -SOURCE LcStylusTapTestBlocks.cpp LcStylusTapTest_exe.cpp - -//RESOURCE resource_file -//RESOURCE resource_file2 - -LIBRARY euser.lib -LIBRARY stiftestinterface.lib -LIBRARY stiftestengine.lib - -LIBRARY apparc.lib -LIBRARY avkon.lib -LIBRARY efsrv.lib -LIBRARY cone.lib -LIBRARY eikcore.lib -LIBRARY bafl.lib // Basic Application Framework -LIBRARY AknSkins.lib // Skinned icons -LIBRARY aknicon.lib -LIBRARY commonengine.lib -LIBRARY ecom.lib -LIBRARY eikcoctl.lib -LIBRARY aknnotify.lib eiksrv.lib CommonEngine.lib -LIBRARY mmfstandardcustomcommands.lib -LIBRARY ECom.lib -LIBRARY defaultappclient.lib -LIBRARY apgrfx.lib -LIBRARY ws32.lib // wssession -LIBRARY viewcli.lib -LIBRARY estor.lib -LIBRARY gslauncher.lib - - -LANG SC - -/* -START WINS -?wins_specific_information -END - -START MARM -?marm_specific_information -END -*/ -// Other possible keywords: - -// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) -/* -START BITMAP ?target -TARGETPATH ?emulated_path_on_target_machine -HEADER -SOURCE ?color_depth ?source_bitmap -END -*/ -// DEFFILE ?filename -// AIF ?filename - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/LcStylusTapTest.pkg --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/LcStylusTapTest.pkg Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -; -; Copyright (c) 2009 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: -; -; -; Installation file for STIF -; - -; Languages -&EN - -; Provide value for uid -#{"LcStylusTapTest"},(0x00000000),1,1,0,TYPE=SA - -; Series60 product id for S60 5.1 -[0x10283160], 0, 0, 0, {"Series60ProductID"} - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name; -:"Nokia" - - -; Logo -; None - -; Package signature - Optional -; None - -; Start of Package body - -; Condition blocks -; None - -; Options list -; None - -; Install files -"\epoc32\release\armv5\udeb\LcStylusTapTest.dll"-"C:\Sys\Bin\LcStylusTapTest.dll" - -"..\conf\ui_LcStylusTapTest.cfg"-"E:\testing\conf\ui_LcStylusTapTest.cfg" -"..\init\LcStylusTapTest.ini"-"E:\testing\init\LcStylusTapTest.ini" - -; Embedded SIS -; None - -; End of Package body - -; PKG dependencies -; None - -; PKG capabilities -; None - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/LcStylusTapTest_exe.mmp --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/LcStylusTapTest_exe.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/*TYPE TESTCLASS*/ -/* -* 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: -* -*/ - - -#if defined(__S60_) - #include -#endif - -TARGET LcStylusTapTest.exe -TARGETTYPE exe -UID 0 0xEF4892C6 - -CAPABILITY CAP_ECOM_PLUGIN - - -MW_LAYER_SYSTEMINCLUDE - -SOURCEPATH ../src - -SOURCE LcStylusTapTest_exe.cpp - -LIBRARY euser.lib -LIBRARY stiftestinterface.lib - -EPOCSTACKSIZE 40960 - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/LcStylusTapTest_nrm.mmp --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/LcStylusTapTest_nrm.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/*TYPE TESTCLASS*//* -* Copyright (c) 2002 - 2007 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: ?Description -* -*/ - - -#if defined(__S60_) - // To get the MW_LAYER_SYSTEMINCLUDE-definition - #include -#endif - -TARGET LcStylusTapTest.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E3 - -CAPABILITY ALL -TCB -/* Remove comments and replace 0x00000000 with correct vendor id */ -// VENDORID 0x00000000 -/* Remove comments and replace 0x00000000 with correct secure id */ -// SECUREID 0x00000000 - -//TARGETPATH ?target_path -DEFFILE LcStylusTapTest.def - -MW_LAYER_SYSTEMINCLUDE - -USERINCLUDE ../inc -SOURCEPATH ../src - -SOURCE LcStylusTapTest.cpp -SOURCE LcStylusTapTestBlocks.cpp - -//RESOURCE resource_file -//RESOURCE resource_file2 - -LIBRARY euser.lib -LIBRARY stiftestinterface.lib -LIBRARY stiftestengine.lib - -LANG SC - -/* -START WINS -?wins_specific_information -END - -START MARM -?marm_specific_information -END -*/ -// Other possible keywords: - -// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) -/* -START BITMAP ?target -TARGETPATH ?emulated_path_on_target_machine -HEADER -SOURCE ?color_depth ?source_bitmap -END -*/ -// DEFFILE ?filename -// AIF ?filename - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/LcStylusTapTest_phone.pkg --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/LcStylusTapTest_phone.pkg Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -; -; Copyright (c) 2009 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: -; -; -; Installation file for STIF -; - -; Languages -&EN - -; Provide value for uid -#{"LcStylusTapTest"},(0x00000000),1,1,0,TYPE=SA - -; Series60 product id for S60 5.1 -[0x10283160], 0, 0, 0, {"Series60ProductID"} - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name; -:"Nokia" - - -; Logo -; None - -; Package signature - Optional -; None - -; Start of Package body - -; Condition blocks -; None - -; Options list -; None - -; Install files -"\epoc32\release\armv5\udeb\LcStylusTapTest.dll"-"C:\Sys\Bin\LcStylusTapTest.dll" - -"..\conf\ui_LcStylusTapTest.cfg"-"C:\testframework\ui_LcStylusTapTest.cfg" -"..\init\LcStylusTapTest_phone.ini"-"C:\testframework\testframework.ini" - -; Embedded SIS -; None - -; End of Package body - -; PKG dependencies -; None - -; PKG capabilities -; None - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/make_and_sign_sis.bat --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/make_and_sign_sis.bat Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem - -makesis -v LcStylusTapTest.pkg -signsis.exe LcStylusTapTest.sis LcStylusTapTest.sisx rd.cer rd-key.pem -del LcStylusTapTest.sis \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/make_and_sign_sis_phone.bat --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/make_and_sign_sis_phone.bat Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem - -makesis -v LcStylusTapTest_phone.pkg -signsis.exe LcStylusTapTest_phone.sis LcStylusTapTest_phone.sisx rd.cer rd-key.pem -del LcStylusTapTest_phone.sis \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/rebuild_for_ats3.bat --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/rebuild_for_ats3.bat Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem - -echo Kompilacja na armv5 udeb - -del LcStylusTapTest.sisx -rd /S /Q \epoc32\BUILD -call bldmake bldfiles -call abld test reallyclean armv5 udeb -call abld test build armv5 udeb -call abld test freeze armv5 -call make_and_sign_sis.bat LcStylusTapTest - -call pause \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/rebuild_for_phone.bat --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/group/rebuild_for_phone.bat Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem - -echo Kompilacja na armv5 udeb - -del LcStylusTapTest_phone.sisx -rd /S /Q \epoc32\BUILD -call bldmake bldfiles -call abld test reallyclean armv5 udeb -call abld test build armv5 udeb -call abld test freeze armv5 -call make_and_sign_sis_phone.bat - -call pause \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/inc/LcStylusTapTest.h --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/inc/LcStylusTapTest.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,281 +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: Header file for LcStylusTapTest -* -*/ - - - - -#ifndef LcStylusTapTest_H -#define LcStylusTapTest_H - -// INCLUDES -#include -#include -#include -#include -#include -#include -#include "lcstylustap.h" - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def -#define TEST_CLASS_VERSION_MAJOR 0 -#define TEST_CLASS_VERSION_MINOR 0 -#define TEST_CLASS_VERSION_BUILD 0 - -#ifdef STIF_LOG -#undef STIF_LOG -#endif - -#define STIF_LOG( s )\ - {\ - TBuf traceBuf;\ - traceBuf.Append( _L( "[STIF_LOG] " ) );\ - traceBuf.Append( _L( s ) );\ - iLog->Log( _L( s ) );\ - RDebug::Print( traceBuf );\ - } - -#define STIF_LOG1( s, v ) \ - {\ - TBuf traceBuf;\ - traceBuf.Append( _L( "[STIF_LOG] " ) );\ - traceBuf.Append( _L( s ) );\ - iLog->Log( _L( s ), v );\ - RDebug::Print( traceBuf, v );\ - } - -#define STIF_LOG2( s, v1, v2 ) \ - {\ - TBuf traceBuf;\ - traceBuf.Append( _L( "[STIF_LOG] " ) );\ - traceBuf.Append( _L( s ) );\ - iLog->Log( _L( s ), v1, v2 );\ - RDebug::Print( traceBuf, v1, v2 );\ - } - -#define STIF_LOG3( s, v1, v2, v3 ) \ - {\ - TBuf traceBuf;\ - traceBuf.Append( _L( "[STIF_LOG] " ) );\ - traceBuf.Append( _L( s ) );\ - iLog->Log( _L( s ), v1, v2, v3 );\ - RDebug::Print( traceBuf, v1, v2, v3 );\ - } - -// Logging path -_LIT( KLcStylusTapTestLogPath, "\\logs\\testframework\\LcStylusTapTest\\" ); - -// Logging path for ATS - for phone builds comment this line -//_LIT( KLcStylusTapTestLogPath, "e:\\testing\\stiflogs\\" ); - -// Log file -_LIT( KLcStylusTapTestLogFile, "LcStylusTapTest.txt" ); -_LIT( KLcStylusTapTestLogFileWithTitle, "LcStylusTapTest_[%S].txt" ); - -// FUNCTION PROTOTYPES -//?type ?function_name(?arg_list); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; -class CLcStylusTapTest; -class CLcStylusTap; - -// DATA TYPES -//enum ?declaration - -enum TLcStylusTapTestResult - { - ETestCasePassed, - ETestCaseFailed - }; - -//typedef ?declaration -//extern ?data_type; - -// CLASS DECLARATION - -NONSHARABLE_CLASS( TLcStylusTapTestBlockParams ) - { - public: - TPtrC iTestBlockName; - - TPtrC iTestOption1; - TPtrC iTestOption2; - TPtrC iTestOption3; - - TInt iTestIntOption1; - TInt iTestIntOption2; - - TChar iTestCharOption1; - TChar iTestCharOption2; - }; - -/** -* CLcStylusTapTest test class for STIF Test Framework TestScripter. -* ?other_description_lines -* -* @lib ?library -* @since ?Series60_version -*/ -NONSHARABLE_CLASS( CLcStylusTapTest ) : public CScriptBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CLcStylusTapTest* NewL( CTestModuleIf& aTestModuleIf ); - - /** - * Destructor. - */ - virtual ~CLcStylusTapTest(); - - public: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - public: // Functions from base classes - - /** - * From CScriptBase Runs a script line. - * @since ?Series60_version - * @param aItem Script line containing method name and parameters - * @return Symbian OS error code - */ - virtual TInt RunMethodL( CStifItemParser& aItem ); - - protected: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - protected: // Functions from base classes - - /** - * From ?base_class ?member_description - */ - //?type ?member_function(); - - private: - - /** - * C++ default constructor. - */ - CLcStylusTapTest( CTestModuleIf& aTestModuleIf ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - // Prohibit copy constructor if not deriving from CBase. - // ?classname( const ?classname& ); - // Prohibit assigment operator if not deriving from CBase. - // ?classname& operator=( const ?classname& ); - - /** - * Frees all resources allocated from test methods. - * @since ?Series60_version - */ - void Delete(); - - /** - * Test methods are listed below. - */ - - virtual TInt ExecuteApiTestBlock( CStifItemParser& aItem ); - virtual TInt ExecuteModuleTestBlock( CStifItemParser& aItem ); - virtual TInt ExecuteBranchTestBlock( CStifItemParser& aItem ); - - /** - * Method used to log version of test class - */ - void SendTestClassVersion(); - - //ADD NEW METHOD DEC HERE - //[TestMethods] - Do not remove - - void GetTestBlockParamsL( CStifItemParser& aItem ); - - void DoExecuteApiTestBlockL( CStifItemParser& aItem, TLcStylusTapTestResult& aTestResult ); - void DoExecuteModuleTestBlockL( CStifItemParser& aItem, TLcStylusTapTestResult& aTestResult ); - void DoExecuteBranchTestBlockL( CStifItemParser& aItem, TLcStylusTapTestResult& aTestResult ); - - void ExampleTestL( TPtrC aTestOption, TPtrC aTestSubOption, - TInt aTestIntOption, TInt aTestCharOption, TLcStylusTapTestResult& aTestResult ); - - //tests method - void CreateLcStylusTapTestL( TPtrC aTestOption, TPtrC aTestSubOption, TLcStylusTapTestResult& aTestResult ); - - void TextTapTestL( TPtrC aTestOption, TPtrC aTestSubOption, TLcStylusTapTestResult& aTestResult ); - - void CallHandleIndicatorTapTestL( TPtrC aTestOption, TPtrC aTestSubOption, TLcStylusTapTestResult& aTestResult ); - - //other methods - TBool GetPluginImplementation(TInt aValue); - void DestroyImplementation(); - //cheks if TextL method of lcstylustap returns correct values - TInt CheckTextResult(TInt aValue, HBufC* &aMedia); - - public: // Data - // ?one_line_short_description_of_data - //?data_declaration; - - protected: // Data - // ?one_line_short_description_of_data - //?data_declaration; - - private: // Data - TLcStylusTapTestBlockParams iTestBlockParams; - - CLcStylusTap* iLcStylusTap; - - RImplInfoPtrArray iPluginImpArray; - TUid iDtor_Key; - TInt iTextType; - RImplInfoPtrArray iImplementations; - - // Reserved pointer for future extension - //TAny* iReserved; - - public: // Friend classes - //?friend_class_declaration; - protected: // Friend classes - //?friend_class_declaration; - private: // Friend classes - //?friend_class_declaration; - - }; - -#endif // LcStylusTapTest_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/init/LcStylusTapTest.ini --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/init/LcStylusTapTest.ini Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,198 +0,0 @@ -# -# This is STIF initialization file -# Comment lines start with '#'-character. -# See STIF TestFramework users guide.doc for instructions - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Set following test engine settings: -# - Set Test Reporting mode. TestReportMode's possible values are: -# + 'Summary': Summary of the tested test cases. -# + 'Environment': Hardware and software info. -# + 'TestCases': Test case report. -# + 'FullReport': Set of all above ones. -# + Example 'TestReportMode= Summary TestCases' -# -# - CreateTestReport setting controls report creation mode -# + YES, Test report will created. -# + NO, No Test report. -# -# - File path indicates the base path of the test report. -# - File name indicates the name of the test report. -# -# - File format indicates the type of the test report. -# + TXT, Test report file will be txt type, for example 'TestReport.txt'. -# + HTML, Test report will be html type, for example 'TestReport.html'. -# -# - File output indicates output source of the test report. -# + FILE, Test report logging to file. -# + RDEBUG, Test report logging to using rdebug. -# -# - File Creation Mode indicates test report overwriting if file exist. -# + OVERWRITE, Overwrites if the Test report file exist. -# + APPEND, Continue logging after the old Test report information if -# report exist. -# - Sets a device reset module's dll name(Reboot). -# + If Nokia specific reset module is not available or it is not correct one -# StifHWResetStub module may use as a template for user specific reset -# module. -# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation -# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02 -# - -[Engine_Defaults] - -TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', - 'TestCases' or 'FullReport' - -CreateTestReport= YES # Possible values: YES or NO - -TestReportFilePath= E:\Testing\Logs\ -TestReportFileName= LcStylusTapTest_TestReport.log - -TestReportFormat= TXT # Possible values: TXT or HTML -TestReportOutput= FILE # Possible values: FILE or RDEBUG -TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND - -DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting - -DisableMeasurement= stifmeasurementdisablenone # Possible values are: - # 'stifmeasurementdisablenone', 'stifmeasurementdisableall' - # 'stifmeasurementplugin01', 'stifmeasurementplugin02', - # 'stifmeasurementplugin03', 'stifmeasurementplugin04', - # 'stifmeasurementplugin05' or 'stifbappeaprofiler' - -Timeout= 0 # Default timeout value for each test case. In milliseconds -UITestingSupport= YES # Possible values: YES or NO - -[End_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Module configurations start -# Modules are added between module tags -# tags. Module name is specified after ModuleName= tag, like -# ModuleName= LcStylusTapTestLcStylusTapTestLcStylusTapTest -# Modules might have initialisation file, specified as -# IniFile= c:\testframework\YYYYYY -# Modules might have several configuration files, like -# TestCaseFile= c:\testframework\NormalCases.txt -# TestCaseFile= c:\testframework\SmokeCases.txt -# TestCaseFile= c:\testframework\ManualCases.txt - -# (TestCaseFile is synonym for old term ConfigFile) - -# Following case specifies demo module settings. Demo module -# does not read any settings from file, so tags -# IniFile and TestCaseFile are not used. -# In the simplest case it is enough to specify only the -# name of the test module when adding new test module - -[New_Module] -ModuleName= TestScripter -TestCaseFile= E:\testing\conf\ui_LcStylusTapTest.cfg -[End_Module] - - -# Load testmoduleLcStylusTapTest, optionally with initialization file and/or test case files -#[New_Module] -#ModuleName= testmodulexxx - -#TestModuleLcStylusTapTest used initialization file -#IniFile= c:\testframework\init.txt - -#TestModuleLcStylusTapTest used configuration file(s) -#TestCaseFile= c:\testframework\testcases1.cfg -#TestCaseFile= c:\testframework\testcases2.cfg -#TestCaseFile= c:\testframework\manualtestcases.cfg - -#[End_Module] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Set STIF logging overwrite parameters for Logger. -# Hardware and emulator environment logging path and styles can -# be configured from here to overwrite the Logger's implemented values. -# -# Settings description: -# - Indicates option for creation log directory/directories. If log directory/directories -# is/are not created by user they will make by software. -# + YES, Create log directory/directories if not allready exist. -# + NO, Log directory/directories not created. Only created one is used. -# -# - Overwrite emulator path setting. -# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined -# Logger's path 'D:\\LOGS\\Module\\' with those definition the path -# will be 'C:\LOGS\TestFramework\LOGS\Module\' -# -# - Overwrite emulator's logging format. -# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. -# + HTML, Log file(s) will be html type(s), for example 'Module.html'. -# -# - Overwrited emulator logging output source. -# + FILE, Logging to file(s). -# + RDEBUG, Logging to using rdebug(s). -# -# - Overwrite hardware path setting (Same description as above in emulator path). -# - Overwrite hardware's logging format(Same description as above in emulator format). -# - Overwrite hardware's logging output source(Same description as above in emulator output). -# -# - File Creation Mode indicates file overwriting if file exist. -# + OVERWRITE, Overwrites if file(s) exist. -# + APPEND, Continue logging after the old logging information if file(s) exist. -# -# - Will thread id include to the log filename. -# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. -# + NO, No thread id to log file(s), Example filename 'Module.txt'. -# -# - Will time stamps include the to log file. -# + YES, Time stamp added to each line in log file(s). Time stamp is -# for example'12.Nov.2003 115958 LOGGING INFO' -# + NO, No time stamp(s). -# -# - Will line breaks include to the log file. -# + YES, Each logging event includes line break and next log event is in own line. -# + NO, No line break(s). -# -# - Will event ranking include to the log file. -# + YES, Event ranking number added to each line in log file(s). Ranking number -# depends on environment's tics, for example(includes time stamp also) -# '012 12.Nov.2003 115958 LOGGING INFO' -# + NO, No event ranking. -# -# - Will write log file in unicode format. -# + YES, Log file will be written in unicode format -# + NO, Log will be written as normal, not unicode, file. -# - -[Logger_Defaults] - -#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' -#NOTE: TestEngine and TestServer logging settings cannot change here - -CreateLogDirectories= YES # Possible values: YES or NO - -#EmulatorBasePath= C:\LOGS\TestFramework\ -#EmulatorFormat= HTML # Possible values: TXT or HTML -#EmulatorOutput= FILE # Possible values: FILE or RDEBUG - -#HardwareBasePath= D:\LOGS\TestFramework\ -#HardwareFormat= HTML # Possible values: TXT or HTML -#HardwareOutput= FILE # Possible values: FILE or RDEBUG - -#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND - -#ThreadIdToLogFile= YES # Possible values: YES or NO -#WithTimeStamp= YES # Possible values: YES or NO -#WithLineBreak= YES # Possible values: YES or NO -#WithEventRanking= YES # Possible values: YES or NO - -#FileUnicode= YES # Possible values: YES or NO - -[End_Logger_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -# End of file \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/init/LcStylusTapTest_phone.ini --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/init/LcStylusTapTest_phone.ini Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,198 +0,0 @@ -# -# This is STIF initialization file -# Comment lines start with '#'-character. -# See STIF TestFramework users guide.doc for instructions - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Set following test engine settings: -# - Set Test Reporting mode. TestReportMode's possible values are: -# + 'Summary': Summary of the tested test cases. -# + 'Environment': Hardware and software info. -# + 'TestCases': Test case report. -# + 'FullReport': Set of all above ones. -# + Example 'TestReportMode= Summary TestCases' -# -# - CreateTestReport setting controls report creation mode -# + YES, Test report will created. -# + NO, No Test report. -# -# - File path indicates the base path of the test report. -# - File name indicates the name of the test report. -# -# - File format indicates the type of the test report. -# + TXT, Test report file will be txt type, for example 'TestReport.txt'. -# + HTML, Test report will be html type, for example 'TestReport.html'. -# -# - File output indicates output source of the test report. -# + FILE, Test report logging to file. -# + RDEBUG, Test report logging to using rdebug. -# -# - File Creation Mode indicates test report overwriting if file exist. -# + OVERWRITE, Overwrites if the Test report file exist. -# + APPEND, Continue logging after the old Test report information if -# report exist. -# - Sets a device reset module's dll name(Reboot). -# + If Nokia specific reset module is not available or it is not correct one -# StifHWResetStub module may use as a template for user specific reset -# module. -# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation -# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02 -# - -[Engine_Defaults] - -TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', - 'TestCases' or 'FullReport' - -CreateTestReport= YES # Possible values: YES or NO - -TestReportFilePath= C:\LOGS\TestFramework\ -TestReportFileName= LcStylusTapTest_TestReport.log - -TestReportFormat= TXT # Possible values: TXT or HTML -TestReportOutput= FILE # Possible values: FILE or RDEBUG -TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND - -DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting - -DisableMeasurement= stifmeasurementdisablenone # Possible values are: - # 'stifmeasurementdisablenone', 'stifmeasurementdisableall' - # 'stifmeasurementplugin01', 'stifmeasurementplugin02', - # 'stifmeasurementplugin03', 'stifmeasurementplugin04', - # 'stifmeasurementplugin05' or 'stifbappeaprofiler' - -Timeout= 0 # Default timeout value for each test case. In milliseconds -UITestingSupport= YES # Possible values: YES or NO - -[End_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Module configurations start -# Modules are added between module tags -# tags. Module name is specified after ModuleName= tag, like -# ModuleName= LcStylusTapTestLcStylusTapTestLcStylusTapTest -# Modules might have initialisation file, specified as -# IniFile= c:\testframework\YYYYYY -# Modules might have several configuration files, like -# TestCaseFile= c:\testframework\NormalCases.txt -# TestCaseFile= c:\testframework\SmokeCases.txt -# TestCaseFile= c:\testframework\ManualCases.txt - -# (TestCaseFile is synonym for old term ConfigFile) - -# Following case specifies demo module settings. Demo module -# does not read any settings from file, so tags -# IniFile and TestCaseFile are not used. -# In the simplest case it is enough to specify only the -# name of the test module when adding new test module - -[New_Module] -ModuleName= TestScripter -TestCaseFile= c:\testframework\ui_LcStylusTapTest.cfg -[End_Module] - - -# Load testmoduleLcStylusTapTest, optionally with initialization file and/or test case files -#[New_Module] -#ModuleName= testmodulexxx - -#TestModuleLcStylusTapTest used initialization file -#IniFile= c:\testframework\init.txt - -#TestModuleLcStylusTapTest used configuration file(s) -#TestCaseFile= c:\testframework\testcases1.cfg -#TestCaseFile= c:\testframework\testcases2.cfg -#TestCaseFile= c:\testframework\manualtestcases.cfg - -#[End_Module] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Set STIF logging overwrite parameters for Logger. -# Hardware and emulator environment logging path and styles can -# be configured from here to overwrite the Logger's implemented values. -# -# Settings description: -# - Indicates option for creation log directory/directories. If log directory/directories -# is/are not created by user they will make by software. -# + YES, Create log directory/directories if not allready exist. -# + NO, Log directory/directories not created. Only created one is used. -# -# - Overwrite emulator path setting. -# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined -# Logger's path 'D:\\LOGS\\Module\\' with those definition the path -# will be 'C:\LOGS\TestFramework\LOGS\Module\' -# -# - Overwrite emulator's logging format. -# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. -# + HTML, Log file(s) will be html type(s), for example 'Module.html'. -# -# - Overwrited emulator logging output source. -# + FILE, Logging to file(s). -# + RDEBUG, Logging to using rdebug(s). -# -# - Overwrite hardware path setting (Same description as above in emulator path). -# - Overwrite hardware's logging format(Same description as above in emulator format). -# - Overwrite hardware's logging output source(Same description as above in emulator output). -# -# - File Creation Mode indicates file overwriting if file exist. -# + OVERWRITE, Overwrites if file(s) exist. -# + APPEND, Continue logging after the old logging information if file(s) exist. -# -# - Will thread id include to the log filename. -# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. -# + NO, No thread id to log file(s), Example filename 'Module.txt'. -# -# - Will time stamps include the to log file. -# + YES, Time stamp added to each line in log file(s). Time stamp is -# for example'12.Nov.2003 115958 LOGGING INFO' -# + NO, No time stamp(s). -# -# - Will line breaks include to the log file. -# + YES, Each logging event includes line break and next log event is in own line. -# + NO, No line break(s). -# -# - Will event ranking include to the log file. -# + YES, Event ranking number added to each line in log file(s). Ranking number -# depends on environment's tics, for example(includes time stamp also) -# '012 12.Nov.2003 115958 LOGGING INFO' -# + NO, No event ranking. -# -# - Will write log file in unicode format. -# + YES, Log file will be written in unicode format -# + NO, Log will be written as normal, not unicode, file. -# - -[Logger_Defaults] - -#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' -#NOTE: TestEngine and TestServer logging settings cannot change here - -CreateLogDirectories= YES # Possible values: YES or NO - -#EmulatorBasePath= C:\LOGS\TestFramework\ -#EmulatorFormat= HTML # Possible values: TXT or HTML -#EmulatorOutput= FILE # Possible values: FILE or RDEBUG - -#HardwareBasePath= D:\LOGS\TestFramework\ -#HardwareFormat= HTML # Possible values: TXT or HTML -#HardwareOutput= FILE # Possible values: FILE or RDEBUG - -#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND - -#ThreadIdToLogFile= YES # Possible values: YES or NO -#WithTimeStamp= YES # Possible values: YES or NO -#WithLineBreak= YES # Possible values: YES or NO -#WithEventRanking= YES # Possible values: YES or NO - -#FileUnicode= YES # Possible values: YES or NO - -[End_Logger_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -# End of file \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/src/LcStylusTapTest.cpp --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/src/LcStylusTapTest.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,217 +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: Implementation -* -*/ - - - - -// INCLUDE FILES -#include -#include "LcStylusTapTest.h" -#include -#include -//components headers -#include - - -// EXTERNAL DATA STRUCTURES -//extern ?external_data; - -// EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def - -// LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def - -// MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration - -// LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CLcStylusTapTest::CLcStylusTapTest -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CLcStylusTapTest::CLcStylusTapTest( - CTestModuleIf& aTestModuleIf ): - CScriptBase( aTestModuleIf ) - { - iTextType = 0; - } - -// ----------------------------------------------------------------------------- -// CLcStylusTapTest::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CLcStylusTapTest::ConstructL() - { - //Read logger settings to check whether test case name is to be - //appended to log file name. - RSettingServer settingServer; - TInt ret = settingServer.Connect(); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Struct to StifLogger settigs. - TLoggerSettings loggerSettings; - // Parse StifLogger defaults from STIF initialization file. - ret = settingServer.GetLoggerSettings(loggerSettings); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Close Setting server session - settingServer.Close(); - - TFileName logFileName; - - if(loggerSettings.iAddTestCaseTitle) - { - TName title; - TestModuleIf().GetTestCaseTitleL(title); - logFileName.Format(KLcStylusTapTestLogFileWithTitle, &title); - } - else - { - logFileName.Copy(KLcStylusTapTestLogFile); - } - - iLog = CStifLogger::NewL( KLcStylusTapTestLogPath, - logFileName, - CStifLogger::ETxt, - CStifLogger::EFile, - EFalse ); - - SendTestClassVersion(); - - } - -// ----------------------------------------------------------------------------- -// CLcStylusTapTest::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CLcStylusTapTest* CLcStylusTapTest::NewL( - CTestModuleIf& aTestModuleIf ) - { - CLcStylusTapTest* self = new (ELeave) CLcStylusTapTest( aTestModuleIf ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - - return self; - - } - -// Destructor -CLcStylusTapTest::~CLcStylusTapTest() - { - // Delete resources allocated from test methods - Delete(); - - if(iLcStylusTap) - delete iLcStylusTap; - iLcStylusTap = NULL; - - - //if(REComSession::GetImplementationUidL(iDtor_Key) != TUid::Null()) - // REComSession::DestroyedImplementation(iDtor_Key); - - REComSession::FinalClose(); - - STIF_LOG("<<~CLcStylusTapTest"); - // Delete logger - delete iLog; - } - -//----------------------------------------------------------------------------- -// CLcStylusTapTest::SendTestClassVersion -// Method used to send version of test class -//----------------------------------------------------------------------------- -// -void CLcStylusTapTest::SendTestClassVersion() - { - TVersion moduleVersion; - moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; - moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; - moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; - - TFileName moduleName; - moduleName = _L("LcStylusTapTest.dll"); - - TBool newVersionOfMethod = ETrue; - TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); - } - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// LibEntryL is a polymorphic Dll entry point. -// Returns: CScriptBase: New CScriptBase derived object -// ----------------------------------------------------------------------------- -// -EXPORT_C CScriptBase* LibEntryL( - CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework - { - - return ( CScriptBase* ) CLcStylusTapTest::NewL( aTestModuleIf ); - - } - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/src/LcStylusTapTestBlocks.cpp --- a/localconnectivityservice/lcstylustap/tsrc/LcStylusTapTest/src/LcStylusTapTestBlocks.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,652 +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: Implementation -* -*/ - - - - -// [INCLUDE FILES] - do not remove -#include -#include -#include -#include -//tests headers -#include "LcStylusTapTest.h" - -// EXTERNAL DATA STRUCTURES -//extern ?external_data; - -// EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); - -// CONSTANTS -//const ?type ?constant_var = ?constant; -_LIT(KBlueTooth, "Bluetooth"); -_LIT(KUSB, "USB"); -_LIT(KIRDA, "Infrared"); - -// MACROS -//#define ?macro ?macro_def - -// LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def - -// MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration - -// LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CLcStylusTapTest::Delete -// Delete here all resources allocated and opened from test methods. -// Called from destructor. -// ----------------------------------------------------------------------------- -// -void CLcStylusTapTest::Delete() - { - - } - -// ----------------------------------------------------------------------------- -// CLcStylusTapTest::RunMethodL -// Run specified method. Contains also table of test mothods and their names. -// ----------------------------------------------------------------------------- -// -TInt CLcStylusTapTest::RunMethodL( - CStifItemParser& aItem ) - { - - static TStifFunctionInfo const KFunctions[] = - { - //ADD NEW ENTRY HERE - // [test cases entries] - Do not remove - ENTRY( "ExecuteApiTestBlock", CLcStylusTapTest::ExecuteApiTestBlock ), - ENTRY( "ExecuteModuleTestBlock", CLcStylusTapTest::ExecuteModuleTestBlock ), - ENTRY( "ExecuteBranchTestBlock", CLcStylusTapTest::ExecuteBranchTestBlock ), - }; - - const TInt count = sizeof( KFunctions ) / - sizeof( TStifFunctionInfo ); - - return RunInternalL( KFunctions, count, aItem ); - - } - -// ----------------------------------------------------------------------------- -// CLcStylusTapTest::GetTestBlockParamsL -// ----------------------------------------------------------------------------- - -void CLcStylusTapTest::GetTestBlockParamsL( CStifItemParser& aItem ) - { - STIF_LOG( ">>> GetTestBlockParamsL" ); - - // Add new test block branches below, get all required test parameters - if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ExampleTestL" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - User::LeaveIfError( aItem.GetNextInt( iTestBlockParams.iTestIntOption1 ) ); - User::LeaveIfError( aItem.GetNextChar( iTestBlockParams.iTestCharOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CreateLcStylusTap" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "TextTapTest" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CallHandleIndicatorTap" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else// - { - STIF_LOG( "Test type: not found" ); - User::Leave( KErrNotFound ); - } - STIF_LOG( "<<< GetTestBlockParamsL" ); - } - -// ----------------------------------------------------------------------------- -// CLcStylusTapTest::ExecuteApiTestBlock -// ----------------------------------------------------------------------------- - -TInt CLcStylusTapTest::ExecuteApiTestBlock( CStifItemParser& aItem ) - { - STIF_LOG( ">>>ExecuteApiTestBlock" ); - - TInt res; - TLcStylusTapTestResult testResult = ETestCaseFailed; - - TRAP( res, DoExecuteApiTestBlockL( aItem, testResult ) ); - if ( res != KErrNone ) - { - STIF_LOG1( "DoExecuteApiTestBlockL error: %d", res ); - return res; - } - - STIF_ASSERT_EQUALS( ETestCasePassed, testResult ); - STIF_LOG( "Test case passed" ); - STIF_LOG( "<<>>DoExecuteApiTestBlockL" ); - - User::LeaveIfError( aItem.GetString( _L( "ExecuteApiTestBlock" ), iTestBlockParams.iTestBlockName ) ); - STIF_LOG1( "Api test type: %S", &iTestBlockParams.iTestBlockName ); - - GetTestBlockParamsL( aItem ); - - // Add new API test block branches with optional test parameters here - if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ExampleTestL" ) ) ) - { - ExampleTestL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, - iTestBlockParams.iTestIntOption1, iTestBlockParams.iTestCharOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CreateLcStylusTap" ) ) ) - { - CreateLcStylusTapTestL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "TextTapTest" ) ) ) - { - TextTapTestL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CallHandleIndicatorTap" ) ) ) - { - CallHandleIndicatorTapTestL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, aTestResult ); - } - else - { - STIF_LOG( "Test type: not found" ); - User::Leave( KErrNotFound ); - } - - STIF_LOG( "<<>>ExecuteModuleTestBlock" ); - - TInt res; - TLcStylusTapTestResult testResult; - - TRAP( res, DoExecuteModuleTestBlockL( aItem, testResult ) ); - if ( res != KErrNone ) - { - STIF_LOG1( "DoExecuteModuleTestBlockL error: %d", res ); - return res; - } - - STIF_ASSERT_EQUALS( ETestCasePassed, testResult ); - STIF_LOG( "[STIF_LOG] Test case passed" ); - STIF_LOG( "[STIF_LOG] <<>>DoExecuteModuleTestBlockL" ); - - User::LeaveIfError( aItem.GetString( _L( "ExecuteModuleTestBlock" ), iTestBlockParams.iTestBlockName ) ); - STIF_LOG1( "Module test type: %S", &iTestBlockParams.iTestBlockName ); - - GetTestBlockParamsL( aItem ); - - // Add new module test block branches with optional test parameters here - if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ExampleTestL" ) ) ) - { - ExampleTestL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, - iTestBlockParams.iTestIntOption1, iTestBlockParams.iTestCharOption1, aTestResult ); - } - else - { - STIF_LOG( "Test type: not found" ); - User::Leave( KErrNotFound ); - } - - STIF_LOG( "[STIF_LOG] <<>>ExecuteBranchTestBlock" ); - - TInt res; - TLcStylusTapTestResult testResult; - - TRAP( res, DoExecuteBranchTestBlockL( aItem, testResult ) ); - if ( res != KErrNone ) - { - STIF_LOG1( "DoExecuteBranchTestBlockL error: %d", res ); - return res; - } - - STIF_ASSERT_EQUALS( ETestCasePassed, testResult ); - STIF_LOG( "[STIF_LOG] Test case passed" ); - STIF_LOG( "[STIF_LOG] <<>>DoExecuteBranchTestBlockL" ); - - User::LeaveIfError( aItem.GetString( _L( "ExecuteBranchTestBlock" ), iTestBlockParams.iTestBlockName ) ); - STIF_LOG1( "Branch test type: %S", &iTestBlockParams.iTestBlockName ); - - GetTestBlockParamsL( aItem ); - - // Add new branch test block branches with optional test parameters here - if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ExampleTestL" ) ) ) - { - ExampleTestL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, - iTestBlockParams.iTestIntOption1, iTestBlockParams.iTestCharOption1, aTestResult ); - } - else - { - STIF_LOG( "Test type: not found" ); - User::Leave( KErrNotFound ); - } - - STIF_LOG( "[STIF_LOG] <<>>ExampleTestL" ); - - if ( !aTestOption.Compare( _L( "API" ) ) ) - { - STIF_LOG1( "Api test option: %S", &aTestOption ); - STIF_LOG1( "Api test sub-option: %S", &aTestSubOption ); - STIF_LOG1( "Api test int option: %d", aTestIntOption ); - STIF_LOG1( "Api test char option: %c", aTestCharOption ); - } - else if ( !aTestOption.Compare( _L( "MODULE" ) ) ) - { - STIF_LOG1( "Module test option: %S", &aTestOption ); - STIF_LOG1( "Module test sub-option: %S", &aTestSubOption ); - STIF_LOG1( "Module test int option: %d", aTestIntOption ); - STIF_LOG1( "Module test char option: %c", aTestCharOption ); - } - else if ( !aTestOption.Compare( _L( "BRANCH" ) ) ) - { - STIF_LOG1( "Branch test option: %S", &aTestOption ); - STIF_LOG1( "Branch test sub-option: %S", &aTestSubOption ); - STIF_LOG1( "Branch test int option: %d", aTestIntOption ); - STIF_LOG1( "Branch test char option: %c", aTestCharOption ); - } - else - { - STIF_LOG( "Invalid test parameter" ); - User::Leave( KErrNotFound ); - } - - aTestResult = ETestCasePassed; - - STIF_LOG( "<<>>CreateLcStylusTapL" ); - - delete iLcStylusTap; - iLcStylusTap = NULL; - - if( !aTestSubOption.Compare(_L( "BT" )) ) - { - GetPluginImplementation(EAknIndicatorBluetoothModuleOnVisible); - STIF_LOG1( "CreateLcStylusTapL BT result: %d", iLcStylusTap ? 1 : 0 ); - } - else if( !aTestSubOption.Compare(_L( "USB" )) ) - { - GetPluginImplementation(EAknIndicatorUSBConnection); - STIF_LOG1( "CreateLcStylusTapL USB result: %d", iLcStylusTap ? 1 : 0 ); - } - else if( !aTestSubOption.Compare(_L( "IRDA" )) ) - { - GetPluginImplementation(EAknIndicatorIrActive); - STIF_LOG1( "CreateLcStylusTapL IR result: %d", iLcStylusTap ? 1 : 0 ); - } - else if( !aTestSubOption.Compare(_L( "USBMEM" )) ) - { - GetPluginImplementation(EAknIndicatorUSBMemConnected); - STIF_LOG1( "CreateLcStylusTapL USB result: %d", iLcStylusTap ? 1 : 0 ); - } - else - {} - - if(!iLcStylusTap) - { - STIF_LOG( "Error iLcStylusTap == NULL" ); - return; - } - - DestroyImplementation(); - - aTestResult = ETestCasePassed; - - STIF_LOG( "<<>CLcStylusTapTest::TextTapTestL"); - - HBufC* Media = NULL; - delete iLcStylusTap; - iLcStylusTap = NULL; - - if( !aTestSubOption.Compare(_L( "BT" )) ) - { - GetPluginImplementation(EAknIndicatorBluetoothModuleOnVisible); - if(iLcStylusTap) - { - Media = iLcStylusTap->TextL(EAknIndicatorBluetoothModuleOnVisible, iTextType); - STIF_LOG1( "CheckTextResult err: %d", CheckTextResult(EAknIndicatorBluetoothModuleOnVisible, Media) ); - STIF_LOG1( "TextL: %S, OK", Media ); - } - } - else if( !aTestSubOption.Compare(_L( "USB" )) ) - { - GetPluginImplementation(EAknIndicatorUSBConnection); - if(iLcStylusTap) - { - Media = iLcStylusTap->TextL(EAknIndicatorUSBConnection, iTextType); - STIF_LOG1( "TextL: %S, OK", Media ); - STIF_LOG1( "CheckTextResult err: %d", CheckTextResult(EAknIndicatorUSBConnection, Media) ); - } - } - else if( !aTestSubOption.Compare(_L( "USBMEM" )) ) - { - GetPluginImplementation(EAknIndicatorUSBMemConnected); - if(iLcStylusTap) - { - Media = iLcStylusTap->TextL(EAknIndicatorUSBMemConnected, iTextType); - STIF_LOG1( "TextL: %S no checked", Media ); - //STIF_LOG1( "CheckTextResult err: %d", CheckTextResult(EAknIndicatorUSBMemConnected, Media) ); - } - } - else if( !aTestSubOption.Compare(_L( "USBMEM_loc" )) ) - { - GetPluginImplementation(EAknIndicatorUSBMemConnected); - if(iLcStylusTap) - { - Media = iLcStylusTap->TextL(EAknIndicatorUSBMemConnected, iTextType); - STIF_LOG1( "CheckTextResult err: %d", CheckTextResult(EAknIndicatorUSBMemConnected, Media) ); - STIF_LOG1( "TextL: %S, OK", Media ); - } - } - else - User::LeaveIfError(KErrNotFound); - - DestroyImplementation(); - - aTestResult = ETestCasePassed; - - STIF_LOG("<>CLcStylusTapTest::CallHandleIndicatorTapL"); - - if( !aTestSubOption.Compare(_L( "BT" )) ) - { - GetPluginImplementation(EAknIndicatorBluetoothModuleOnVisible); - if(iLcStylusTap) - { - iLcStylusTap->HandleIndicatorTapL(EAknIndicatorBluetoothModuleOnVisible); - STIF_LOG("HandleIndicatorTapL OK"); - } - } - else if( !aTestSubOption.Compare(_L( "USB" )) ) - { - GetPluginImplementation(EAknIndicatorUSBConnection); - if(iLcStylusTap) - { - iLcStylusTap->HandleIndicatorTapL(EAknIndicatorUSBConnection); - STIF_LOG("HandleIndicatorTapL OK"); - } - } - else if( !aTestSubOption.Compare(_L( "USBMEM" )) ) - { - GetPluginImplementation(EAknIndicatorUSBMemConnected); - if(iLcStylusTap) - { - iLcStylusTap->HandleIndicatorTapL(EAknIndicatorUSBMemConnected); - STIF_LOG("HandleIndicatorTapL OK"); - } - } - else if( !aTestSubOption.Compare(_L( "IRDA" )) ) - { - GetPluginImplementation(EAknIndicatorIrActive); - if(iLcStylusTap) - { - iLcStylusTap->HandleIndicatorTapL(EAknIndicatorIrActive); - STIF_LOG("HandleIndicatorTapL OK"); - } - } - else - User::LeaveIfError(KErrNotFound); - - DestroyImplementation(); - - aTestResult = ETestCasePassed; - - STIF_LOG(">>CLcStylusTapTest::CallHandleIndicatorTapL"); - } - -// Other operaton functions -// ----------------------------------------------------------------------------- -// CLcStylusTapTest::GetPluginImplementation -// returns CLcStylusTap pointer -// ----------------------------------------------------------------------------- -// -TBool CLcStylusTapTest::GetPluginImplementation(TInt aValue) - { - STIF_LOG( ">>CLcStylusTapTest::GetPluginImplementation" ); - - - const TUid uidInterfacetobepop = TUid::Uid(KAknIndicatorPluginInterfaceUid); - TRAPD(err, REComSession::ListImplementationsL(uidInterfacetobepop, iImplementations)); - STIF_LOG1( "REComSession::ListImplementationsL err: %d", err ); - if(err != KErrNone) - User::LeaveIfError(err); - - delete iLcStylusTap; - iLcStylusTap = NULL; - //HBufC* Media = NULL; - - TUid btimpluid = {KImplUIDBTIndicatorsPlugin}; - TUid usbimpluid = {KImplUIDUSBIndicatorsPlugin}; - TUid irimpluid = {KImplUIDIRIndicatorsPlugin}; - TUid usbMemImp = {0x20026FC4};//usb_mem - - switch (aValue) - { - case EAknIndicatorBluetooth://12 - case EAknIndicatorBluetoothVisible: - case EAknIndicatorBluetoothModuleOn: - case EAknIndicatorBluetoothModuleOnVisible://55 - iLcStylusTap = REINTERPRET_CAST(CLcStylusTap*, REComSession::CreateImplementationL(btimpluid, iDtor_Key) ); - break; - case EAknIndicatorUSBConnection: //28 - iLcStylusTap = REINTERPRET_CAST(CLcStylusTap*, REComSession::CreateImplementationL(usbimpluid, iDtor_Key) ); - break; - case EAknIndicatorIrActive: - iLcStylusTap = REINTERPRET_CAST(CLcStylusTap*, REComSession::CreateImplementationL(irimpluid, iDtor_Key) ); - break; - case EAknIndicatorUSBMemConnected: - case EAknIndicatorUSBMemActive: - iLcStylusTap = REINTERPRET_CAST(CLcStylusTap*, REComSession::CreateImplementationL(usbMemImp, iDtor_Key) ); - break; - default: - STIF_LOG( "GetPluginImplementation ERROR!" ); - User::LeaveIfError(KErrNotFound); - break; - } - - STIF_LOG1( "iLcStylusTap: %d", iLcStylusTap ? 1 : 0 ); - - return ETrue; - } - - -// ----------------------------------------------------------------------------- -// CLcStylusTapTest::CheckTextResult -// ------------------------------------------- -// -TInt CLcStylusTapTest::CheckTextResult(TInt aValue, HBufC* &aMedia) - { - TInt err = KErrNone; - - if(!aMedia) - { - User::Leave(KErrNotFound); - } - - switch(aValue) - { - case EAknIndicatorBluetooth://12 - case EAknIndicatorBluetoothVisible: - case EAknIndicatorBluetoothModuleOn: - case EAknIndicatorBluetoothModuleOnVisible://55 - if(aMedia->Compare(KBlueTooth())!= 0 || iTextType != CAknIndicatorPlugin::EAknIndicatorPluginLinkText) - err = KErrNotFound; - break; - case EAknIndicatorUSBConnection: - if(aMedia->Compare(KUSB())!= 0 || iTextType != CAknIndicatorPlugin::EAknIndicatorPluginLinkText) - err = KErrNotFound; - break; - case EAknIndicatorIrActive: - if(aMedia->Compare(KIRDA())!= 0 || iTextType != CAknIndicatorPlugin::EAknIndicatorPluginLinkText) - err = KErrNotFound; - break; - default: - err = KErrNotFound; - break; - } - - if(err == KErrNotFound) - { - delete aMedia; - aMedia = NULL; - User::LeaveIfError(KErrNotFound); // Did not match that should - } - - STIF_LOG("CallHandleIndicatorTapL::CompareMedia OK"); - - return err; - } -// ----------------------------------------------------------------------------- -// CLcStylusTapTest::DestroyImplementation -// destroy plugin implementation -// ------------------------------------------- -// -void CLcStylusTapTest::DestroyImplementation() - { - STIF_LOG( ">>CLcStylusTapTest::DestroyImplementation" ); - - if(iLcStylusTap) - { - delete iLcStylusTap; - iLcStylusTap = NULL; - } - - iImplementations.ResetAndDestroy(); - iImplementations.Close(); - - REComSession::DestroyedImplementation(iDtor_Key); - - STIF_LOG("< -#include -#include -// EXTERNAL DATA STRUCTURES - -// EXTERNAL FUNCTION PROTOTYPES - -// ================= OTHER EXPORTED FUNCTIONS ================================= - -/* -------------------------------------------------------------------------------- - - Class: - - - Method: E32Main - - Description: - - Parameters: None - - Return Values: TInt: Symbian error code - - Errors/Exceptions: None - - Status: Draft - -------------------------------------------------------------------------------- -*/ -GLDEF_C TInt E32Main() - { - _LIT( KProcessMsgStart, "New process starting" ); - RDebug::Print( KProcessMsgStart ); - - - // This starts a new session that get capabilites that is used in - // LcStylusTapTest_exe.mmp file. - TInt r = StartSession(); - - _LIT( KProcessMsgEnd, "New process ends" ); - RDebug::Print( KProcessMsgEnd ); - - return r; - - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/commoninc/locodbearer.h --- a/localconnectivityservice/locod/commoninc/locodbearer.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +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: Defines the LCD Bearer Plugin identifier. -* -*/ - - -#ifndef T_LOCODBEARER_H -#define T_LOCODBEARER_H - -#include - -/** bearer value in LC */ -enum TLocodBearer - { - ELocodBearerBT = 0x0001, - ELocodBearerIR = 0x0010, - ELocodBearerUSB = 0x0100, - }; - -#endif // T_LOCODBEARER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/commoninc/locodbearerplugin.h --- a/localconnectivityservice/locod/commoninc/locodbearerplugin.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +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: This is the LCD Bearer Plugin base class declaration. -* -*/ - - -#ifndef C_LOCODBEARERPLUGIN_H -#define C_LOCODBEARERPLUGIN_H - -#include -#include "locodbearerpluginparams.h" - -/** - * Bearer Plugin base class - * - * This is the base class from which bearer plugins inherit. - * - * See locodplugin.hrh for the resource registration definitions. - * - * @lib euser.lib - * @since S60 v3.2 - */ -class CLocodBearerPlugin : public CBase - { -public: - - static CLocodBearerPlugin* NewL(TLocodBearerPluginParams& aParams); - - virtual ~CLocodBearerPlugin(); - - /** - * Gets the implementation uid of this plugin - * - * @since S60 v3.2 - * @return The implementation uid - */ - TUid ImplementationUid() const; - -protected: - - CLocodBearerPlugin(TLocodBearerPluginParams& aParams); - - /** - * Gets the observer interface object associated with this plugin - * - * @since S60 v3.2 - * @return The observer object - */ - MLocodBearerPluginObserver& Observer() const; - -private: // data - - /** - * UID set by ECOM when the instance is created. Used when the instance - * is destroyed. - */ - TUid iInstanceUid; - - /** - * Implementation UID of the concrete instance. - */ - TUid iImplementationUid; - - /** - * Holds the observer object which will be notified when the operations - * complete - * Not own. - */ - MLocodBearerPluginObserver& iObserver; - - }; - -#include "locodbearerplugin.inl" - -#endif // C_LOCODBEARERPLUGIN_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/commoninc/locodbearerplugin.inl --- a/localconnectivityservice/locod/commoninc/locodbearerplugin.inl Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +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: This is the LCD Bearer Plugin construction parameters -* declaration -* -*/ - - -#include - -// ----------------------------------------------------------------------------- -// Creates the bearer plug ins and return it to caller -// ----------------------------------------------------------------------------- -// -inline CLocodBearerPlugin* CLocodBearerPlugin::NewL(TLocodBearerPluginParams& aParams) - { - CLocodBearerPlugin* self = reinterpret_cast( - REComSession::CreateImplementationL( - aParams.ImplementationUid(), - _FOFF(CLocodBearerPlugin, iInstanceUid), - (TAny*)&aParams) - ); - - return self; - } - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -inline CLocodBearerPlugin::~CLocodBearerPlugin() - { - REComSession::DestroyedImplementation(iInstanceUid); - } - -// ----------------------------------------------------------------------------- -// Return the implemtation uid -// ----------------------------------------------------------------------------- -// -inline TUid CLocodBearerPlugin::ImplementationUid() const - { - return iImplementationUid; - } - -// ----------------------------------------------------------------------------- -// Constructor method, just saves the arguments into member variables -// ----------------------------------------------------------------------------- -// -inline CLocodBearerPlugin::CLocodBearerPlugin(TLocodBearerPluginParams& aParams) - : iImplementationUid(aParams.ImplementationUid()), - iObserver(aParams.Observer()) - { - } - -// ----------------------------------------------------------------------------- -// Return the observer class -// ----------------------------------------------------------------------------- -// -inline MLocodBearerPluginObserver& CLocodBearerPlugin::Observer() const - { - return iObserver; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/commoninc/locodbearerpluginobserver.h --- a/localconnectivityservice/locod/commoninc/locodbearerpluginobserver.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +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: This is the LCD Bearer Plugin observer interface definition. -* -*/ - - -#ifndef M_LOCODBEARERPLUGINOBSERVER_H -#define M_LOCODBEARERPLUGINOBSERVER_H - -#include "locodbearer.h" - -/** - * LCD Bearer Plugin Observer interface class - * - * This is the bearer plugin observer interface definition used by LCD - * Bearer Plugins to inform the daemon about the plugin's event. - * - * @euser.lib - * @since S60 v3.2 - */ -class MLocodBearerPluginObserver - { -public: - - /** - * This is a callback function used by the plugins to inform when the - * bearer's availability changes. - * - * @since S60 v3.2 - * @param aBearer the bearer which calls this nothification - * @param aStatus the status of this bearer, ETrue if it is available; - * EFalse otherwise. - */ - virtual void NotifyBearerStatus(TLocodBearer aBearer, TBool aStatus) = 0; - }; - -#endif // M_LOCODBEARERPLUGINOBSERVER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/commoninc/locodbearerpluginparams.h --- a/localconnectivityservice/locod/commoninc/locodbearerpluginparams.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +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: This is the LCD Bearer Plugin construction parameters -* declaration -* -*/ - - -#ifndef T_LOCODBEARERPLUGINPARAMS_H -#define T_LOCODBEARERPLUGINPARAMS_H - -class MLocodBearerPluginObserver; - -/** - * LCD Bearer Plugin Callback construction parameters - * - * This interface class is used to pass construction parameters to the - * plugins. These parameters include the callback interface and the ECOM - * plugin implementation UID - * - * @euser.lib - * @since S60 v3.2 - */ -class TLocodBearerPluginParams - { -public: - - /** - * Constructor. - * - * @since S60 v3.2 - * @param aUid Implementation UID of the plugin being constructed - * @param aObserver Callback interface object - */ - TLocodBearerPluginParams(const TUid aUid, MLocodBearerPluginObserver& aObserver); - - /** - * Gets the implementation UID of the plugin - * - * @since S60 v3.2 - * @return Implementaion UID - */ - TUid ImplementationUid() const; - - /** - * Gets the observer interface object - * - * @since S60 v3.2 - * @return The observer object - */ - MLocodBearerPluginObserver& Observer() const; - -private: // data - - /** - * The implementation UID - */ - const TUid iImplementationUid; - - /** - * Reference to the observer object - */ - MLocodBearerPluginObserver& iObserver; - - }; - -#include "locodbearerpluginparams.inl" - -#endif // T_LOCODBEARERPLUGINPARAMS_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/commoninc/locodbearerpluginparams.inl --- a/localconnectivityservice/locod/commoninc/locodbearerpluginparams.inl Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +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: This is the LCD Bearer Plugin construction parameters -* declaration -* -*/ - - -// ----------------------------------------------------------------------------- -// Constructor method, just saves the arguments into member variables -// ----------------------------------------------------------------------------- -// -inline TLocodBearerPluginParams::TLocodBearerPluginParams(const TUid aUid, MLocodBearerPluginObserver& aObserver) - : iImplementationUid(aUid), - iObserver(aObserver) - { - } - -// ----------------------------------------------------------------------------- -// returns the implementation UID -// ----------------------------------------------------------------------------- -// -inline TUid TLocodBearerPluginParams::ImplementationUid() const - { - return iImplementationUid; - } - -// ----------------------------------------------------------------------------- -// returns the observer class -// ----------------------------------------------------------------------------- -// -inline MLocodBearerPluginObserver& TLocodBearerPluginParams::Observer() const - { - return iObserver; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/commoninc/locodplugin.hrh --- a/localconnectivityservice/locod/commoninc/locodplugin.hrh Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +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: Definitions for plugin resource registration. -* -*/ - - -#ifndef LOCODPLUGIN_HRH -#define LOCODPLUGIN_HRH - -/** - * This file contains the defintions for plugin resource registration. - * - * All plugins should use version 2 registration resource file and set the - * rom_only field to 1 to prevent it from being overridden by RAM-based plugins. - * - * All bearer plugins should use KLOCODBEARERINTERFACEUID as the interface UID. - * - * A bearer plugin should use its corresponding feature ID (from features.hrh) as the - * implementation UID, that is, - * Implementation UID of IR bearer is KFeatureIdIrda, - * Implementation UID of BT bearer is KFeatureIdBt, - * Implementation UID of USB bearer is KFeatureIdUsb. - * - * All service plugins should use KLOCODSERVICEINTERFACEUID as the interface UID. - * - * A service plugin should use its corresponding feature ID (from features.hrh) as the - * implementation UID, that is, - * Implementation UID of Dun is KFeatureIdDun, (not exist yet, CR created) - * Implementation UID of Obex is KFeatureIdSrcs, - * - */ - -// Interface UID of bearer plugins -#define KLOCODBEARERINTERFACEUID 0x20002771 - -// Interface UID of service plugins -#define KLOCODSERVICEINTERFACEUID 0x20002772 - -#endif // LOCODPLUGIN_HRH diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/commoninc/locodserviceplugin.h --- a/localconnectivityservice/locod/commoninc/locodserviceplugin.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +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: This is the LCD Service Plugin base class declaration. -* -*/ - - -#ifndef C_LOCODSERVICEPLUGIN_H -#define C_LOCODSERVICEPLUGIN_H - -#include - -#include "locodservicepluginparams.h" -#include "locodbearer.h" - -/** - * Service Plugin base class - * - * This is the base class from which service plugins inherit. - * - * When a service plugin is constructed, it should not start any service by default. - * A service is started on demand when the bearer is available. - * - * @euser.lib - * @since S60 v3.2 - */ -class CLocodServicePlugin : public CBase - { -public: - - static CLocodServicePlugin* NewL(TLocodServicePluginParams& aParams); - - virtual ~CLocodServicePlugin(); - - /** - * Tell service plugin which service should be enabled or disabled according to - * specified bearer and its status. - * - * On completion, the plugin should call - * MLocodServicePluginObserver::ManageServiceCompleted() to inform the result. - * - * @since S60 v3.2 - * @param aBearer the bearer identification - * @param aStatus the status of this bearer, ETrue if it is available; - * EFalse otherwise. - */ - virtual void ManageService(TLocodBearer aBearer, TBool aStatus) = 0; - - TUid ImplementationUid() const; - -protected: - - CLocodServicePlugin(TLocodServicePluginParams& aParams); - - /** - * Gets the observer interface object associated with this plugin - * - * @since S60 v3.2 - * @return The observer object - */ - MLocodServicePluginObserver& Observer() const; - -private: // data - - /** - * UID set by ECOM when the instance is created. Used when the instance - * is destroyed. - */ - TUid iInstanceUid; - - /** - * Implementation UID of the concrete instance. - */ - const TUid iImplementationUid; - - /** - * Holds the observer object which will be notified when the operations - * complete - * Not own. - */ - MLocodServicePluginObserver& iObserver; - - }; - -#include - -#endif // C_LOCODSERVICEPLUGIN_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/commoninc/locodserviceplugin.inl --- a/localconnectivityservice/locod/commoninc/locodserviceplugin.inl Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +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: This is the LCD Service Plugin construction parameters -* declaration -* -*/ - - -#include - -// ----------------------------------------------------------------------------- -// Constructor method, just saves the arguments into member variables -// ----------------------------------------------------------------------------- -// -inline CLocodServicePlugin* CLocodServicePlugin::NewL(TLocodServicePluginParams& aParams) - { - CLocodServicePlugin* self = reinterpret_cast( - REComSession::CreateImplementationL( - aParams.ImplementationUid(), - _FOFF(CLocodServicePlugin, iInstanceUid), - (TAny*)&aParams) - ); - - return self; - } - - -// ----------------------------------------------------------------------------- -// Service plug ins destructor -// ----------------------------------------------------------------------------- -// -inline CLocodServicePlugin::~CLocodServicePlugin() - { - REComSession::DestroyedImplementation(iInstanceUid); - } - -// ----------------------------------------------------------------------------- -// returns the implementation UID -// ----------------------------------------------------------------------------- -// -inline TUid CLocodServicePlugin::ImplementationUid() const - { - return iImplementationUid; - } - -// ----------------------------------------------------------------------------- -// CLocodServicePlugin C++ constructor -// ----------------------------------------------------------------------------- -// -inline CLocodServicePlugin::CLocodServicePlugin(TLocodServicePluginParams& aParams) - : iImplementationUid(aParams.ImplementationUid()), - iObserver(aParams.Observer()) - { - } - -// ----------------------------------------------------------------------------- -// return the observer class -// ----------------------------------------------------------------------------- -// -inline MLocodServicePluginObserver& CLocodServicePlugin::Observer() const - { - return iObserver; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/commoninc/locodservicepluginobserver.h --- a/localconnectivityservice/locod/commoninc/locodservicepluginobserver.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +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: This is the LCD Service Plugin observer interface definition. -* -*/ - - -#ifndef M_LOCODSERVICEPLUGINOBSERVER_H -#define M_LOCODSERVICEPLUGINOBSERVER_H - -#include "locodbearer.h" - -/** - * LCD Service Plugin Observer interface class - * - * This is the service plugin observer interface definition used by LCD - * Service Plugins to inform the daemon when an action is complete. - * - * @lib - * @since S60 v3.2 - */ -class MLocodServicePluginObserver - { -public: - - /** - * This is a callback function used by the plugins to inform when - * managing the service have completed. The parameters passed should be - * identical to the ones used when the plugin's ManageService() was called, - * plus this service plugin's implemnetation UID and the completion status. - * - * @since S60 v3.2 - * @param aBearer the bearer identification passed in ManageService() - * @param aStatus the status of this bearer passed in ManageService() - * @param aServiceImplUid, the implementation UID of this service plugin. - * @param err KErrNone if the operation succeeded; otherwise a Symbian - * error code. - */ - virtual void ManageServiceCompleted( - TLocodBearer aBearer, - TBool aStatus, - TUid aServiceImplUid, - TInt err) = 0; - }; - -#endif // M_LOCODSERVICEPLUGINOBSERVER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/commoninc/locodservicepluginparams.h --- a/localconnectivityservice/locod/commoninc/locodservicepluginparams.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +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: This is the LCD Service Plugin construction parameters -* declaration -* -*/ - - -#ifndef T_LOCODSERVICEPLUGINPARAMS_H -#define T_LOCODSERVICEPLUGINPARAMS_H - -class MLocodServicePluginObserver; - -/** - * LCD Service Plugin Callback construction parameters - * - * This interface class is used to pass construction parameters to the - * plugins. These parameters include the callback interface (usually - * implemented by the LCD) and the ECOM plugin implementation UID - * - * @lib ?library - * @since S60 v3.2 - */ -class TLocodServicePluginParams - { -public: - /** - * Constructor. - * - * @since S60 v3.2 - * @param aUid Implementation UID of the plugin being constructed - * @param aObserver Callback interface object - */ - TLocodServicePluginParams(TUid aUid, MLocodServicePluginObserver& aObserver); - - /** - * Gets the implementation UID of the plugin - * - * @since S60 v3.2 - * @return Implementaion UID - */ - TUid ImplementationUid() const; - - /** - * Gets the observer interface object - * - * @since S60 v3.2 - * @return The observer object - */ - MLocodServicePluginObserver& Observer() const; - -private: // data - - /** - * The implementation UID - */ - const TUid iImplementationUid; - - /** - * Reference to the observer object - */ - MLocodServicePluginObserver& iObserver; - - }; - -#include "locodservicepluginparams.inl" - -#endif // T_LOCODSERVICEPLUGINPARAMS_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/commoninc/locodservicepluginparams.inl --- a/localconnectivityservice/locod/commoninc/locodservicepluginparams.inl Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +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: This is the LCD Service Plugin construction parameters -* declaration -* -*/ - - -// ----------------------------------------------------------------------------- -// Constructor method, just saves the arguments into member variables -// ----------------------------------------------------------------------------- -// -inline TLocodServicePluginParams::TLocodServicePluginParams(TUid aUid, MLocodServicePluginObserver& aObserver) - : iImplementationUid(aUid), - iObserver(aObserver) - { - } - -// ----------------------------------------------------------------------------- -// Returns the implementation UID -// ----------------------------------------------------------------------------- -// -inline TUid TLocodServicePluginParams::ImplementationUid() const - { - return iImplementationUid; - } - -// ----------------------------------------------------------------------------- -// return the observer class -// ----------------------------------------------------------------------------- -// -inline MLocodServicePluginObserver& TLocodServicePluginParams::Observer() const - { - return iObserver; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/group/bld.inf --- a/localconnectivityservice/locod/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +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 project Local Connectivity Daemon. -* -*/ - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_MMPFILES -locod.mmp - -PRJ_TESTMMPFILES - -PRJ_EXPORTS -../commoninc/locodbearer.h |../../../inc/locodbearer.h -../commoninc/locodplugin.hrh |../../../inc/locodplugin.hrh -../commoninc/locodbearerplugin.h |../../../inc/locodbearerplugin.h -../commoninc/locodbearerplugin.inl |../../../inc/locodbearerplugin.inl -../commoninc/locodbearerpluginobserver.h |../../../inc/locodbearerpluginobserver.h -../commoninc/locodbearerpluginparams.h |../../../inc/locodbearerpluginparams.h -../commoninc/locodbearerpluginparams.inl |../../../inc/locodbearerpluginparams.inl -../commoninc/locodserviceplugin.h |../../inc/locodserviceplugin.h -../commoninc/locodserviceplugin.inl |../../inc/locodserviceplugin.inl -../commoninc/locodservicepluginobserver.h |../../inc/locodservicepluginobserver.h -../commoninc/locodservicepluginparams.h |../../inc/locodservicepluginparams.h -../commoninc/locodservicepluginparams.inl |../../inc/locodservicepluginparams.inl -../rom/locod.iby CORE_MW_LAYER_IBY_EXPORT_PATH(locod.iby) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/group/locod.mmp --- a/localconnectivityservice/locod/group/locod.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +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: Project definition file for project Local Connectivity Daemon. -* -*/ - -#include -#include "../inc/prjconfig.h" - -TARGET locod.exe -TARGETTYPE exe - -UID 0x1000008d 0x2000276D - -VENDORID VID_DEFAULT - -CAPABILITY LocalServices ReadDeviceData NetworkControl WriteDeviceData ReadUserData WriteUserData NetworkServices - -SOURCEPATH ../src -SOURCE locodmain.cpp -SOURCE locodaemon.cpp -SOURCE locodserviceman.cpp -SOURCE locodservice.cpp - -USERINCLUDE ../inc -SYSTEMINCLUDE ../../inc ../../../inc -SYSTEMINCLUDE /epoc32/include/ecom -MW_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY featmgr.lib -LIBRARY centralrepository.lib -LIBRARY cenrepnotifhandler.lib - -#ifdef PRJ_FILE_TRACE -LIBRARY flogger.lib -#endif - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/inc/debug.h --- a/localconnectivityservice/locod/inc/debug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,167 +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: Logging definition -* -*/ - - -#ifndef PRJ_LOGGING_H -#define PRJ_LOGGING_H - -#include -#include "debugconfig.h" - -#ifdef PRJ_ENABLE_TRACE - -#ifdef PRJ_FILE_TRACE -#include -#else -#include -#endif - -NONSHARABLE_CLASS(TOverflowTruncate16) : public TDes16Overflow - { -public: - void Overflow(TDes16& /*aDes*/) {} - }; - -NONSHARABLE_CLASS(TOverflowTruncate8) : public TDes8Overflow - { -public: - void Overflow(TDes8& /*aDes*/) {} - }; - -inline void Trace(TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); -#ifdef PRJ_FILE_TRACE - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); -#else - TBuf16 theFinalString; - theFinalString.Append(KTracePrefix16); - TOverflowTruncate16 overflow; - theFinalString.AppendFormatList(aFmt,list,&overflow); - RDebug::Print(theFinalString); -#endif - } - -inline void Trace(TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list, aFmt); -#ifdef PRJ_FILE_TRACE - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); -#else - TOverflowTruncate8 overflow; - TBuf8 buf8; - buf8.Append(KTracePrefix8); - buf8.AppendFormatList(aFmt, list, &overflow); - TBuf16 buf16(buf8.Length()); - buf16.Copy(buf8); - TRefByValue tmpFmt(_L("%S")); - RDebug::Print(tmpFmt, &buf16); -#endif - } - -inline void TracePanic( - char* aFile, - TInt aLine, - TInt aPanicCode, - const TDesC& aPanicCategory) - { - TPtrC8 fullFileName((const TUint8*)aFile); - TPtrC8 fileName(fullFileName.Ptr()+fullFileName.LocateReverse('\\')+1); - TBuf8 buf; - buf.Append(KPanicPrefix8); - buf.AppendFormat(_L8("%d at line %d in file %S"), aPanicCode, aLine, &fileName); - Trace(buf); - User::Panic(aPanicCategory, aPanicCode); - } - -inline void TraceLeave(char* aFile, TInt aLine, TInt aReason) - { - TPtrC8 fullFileName((const TUint8*)aFile); - TPtrC8 fileName(fullFileName.Ptr()+fullFileName.LocateReverse('\\')+1); - TBuf8 buf; - buf.Append(KLeavePrefix8); - buf.AppendFormat(_L8("%d at line %d in file %S"), aReason, aLine, &fileName); - Trace(buf); - User::LeaveIfError(aReason); - } - -#define TRACE_INFO(p) {if(KTraceMask & KPRINTINFO) Trace p;} - -#define TRACE_ERROR(p) {if(KTraceMask & KPRINTERROR) Trace p;} - -#define TRACE_STATE(p) {if(KTraceMask & KPRINTSTATE) Trace p;} - -#define TRACE_WARNING(p) {if(KTraceMask & KPRINTWARNING) Trace p;} - -#define TRACE_INFO_SEG(p) {if(KTraceMask & KPRINTINFO) p;} - -#define TRACE_ASSERT(GUARD, CODE) {if (!(GUARD)) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory);} - -#define PANIC(CODE) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory) - -#define LEAVE_IF_ERROR(REASON) {if (REASON) TraceLeave(__FILE__, __LINE__, REASON);} - -#define LEAVE(REASON) {TraceLeave(__FILE__, __LINE__, REASON);} - -#define TRACE_FUNC_ENTRY {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryFormat8, &ptr8);}} - -#define TRACE_FUNC_ENTRY_THIS {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryThisFormat8, &ptr8, this);}} - -#define TRACE_FUNC_EXIT {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncExitFormat8, &ptr8);}} - -#define TRACE_FUNC {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncFormat8, &ptr8);}} - -#define TRACE_FUNC_THIS {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncThisFormat8, &ptr8, this);}} - -#define RETURN_IF_ERR(ERR) {if(ERR) {TPtrC8 ptr8((TUint8*)__FILE__); Trace(_L8(" RETURN %d at file %S line %d"), ERR, &ptr8, __LINE__); return ERR;}} - -#else // PRJ_ENABLE_TRACE not defined - -#define TRACE_INFO(p) - -#define TRACE_ERROR(p) - -#define TRACE_STATE(p) - -#define TRACE_WARNING(p) - -#define TRACE_INFO_SEG(p) - -#define TRACE_ASSERT(GUARD, CODE) - -#define PANIC(CODE) {User::Panic(KPanicCategory, CODE);} - -#define LEAVE_IF_ERROR(REASON) {static_cast(User::LeaveIfError(REASON));} - -#define LEAVE(REASON) {static_cast(User::Leave(REASON));} - -#define TRACE_FUNC_ENTRY - -#define TRACE_FUNC_ENTRY_THIS - -#define TRACE_FUNC_EXIT - -#define TRACE_FUNC - -#define TRACE_FUNC_THIS - -#define RETURN_IF_ERR(ERR) {if(ERR) return ERR;} -#endif // PRJ_ENABLE_TRACE - -#endif // PRJ_LOGGING_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/inc/debugconfig.h --- a/localconnectivityservice/locod/inc/debugconfig.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +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: Project configure file. -* -*/ - - -#ifndef LOCOD_DEBUGCONFIG_H -#define LOCOD_DEBUGCONFIG_H - -#include "prjconfig.h" - -/** - * Custom logging variations. - */ -#ifdef PRJ_FILE_TRACE -_LIT(KLogFile,"locod.txt"); -_LIT(KLogDir,"locod"); -#endif - -#ifdef PRJ_ENABLE_TRACE -_LIT(KTracePrefix16, "[Locod] "); -_LIT8(KTracePrefix8, "[Locod] "); -_LIT8(KFuncFormat8, "><%S"); -_LIT8(KFuncThisFormat8, "><%S, [0x%08X]"); -_LIT8(KFuncEntryFormat8, ">%S"); -_LIT8(KFuncEntryThisFormat8, ">%S, [0x%08X]"); -_LIT8(KFuncExitFormat8, "<%S"); - -_LIT(KPanicCategory, "LC Daemon"); -_LIT8(KPanicPrefix8, "PANIC code "); -_LIT8(KLeavePrefix8, "LEAVE code "); -#endif - -const TInt KMaxLogLineLength = 512; - -#define KPRINTERROR 0x00000001 // Tracing level: error -#define KPRINTINFO 0x00000002 // Tracing level: function trace -#define KPRINTSTATE 0x00000004 // Tracing level: state machine info -#define KPRINTWARNING 0x00000008 // Tracing level: warning - -const TInt KTraceMask = KPRINTERROR | KPRINTINFO | KPRINTSTATE | KPRINTWARNING; - -#endif // LOCOD_DEBUGCONFIG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/inc/locodaemon.h --- a/localconnectivityservice/locod/inc/locodaemon.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +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: Defines the Daemon class. -* -*/ - - -#ifndef T_LOCODAEMON_H -#define T_LOCODAEMON_H - -#include -#include -class CLocodBearerPlugin; -class CLocodServiceMan; - -/** - * The root of Daemon. - * - * It monitors system state, constructs service manager and loads all bearer - * plugins when system is up. - * It unloads all bearer and service plugins when system is shuting down. - * - * @euser.lib - * @since S60 v3.2 - */ -class CLocoDaemon : public CActive - { -public: - - /** - * Factory method, leave the object in cleanupstack. - * @since S60 v3.2 - */ - static CLocoDaemon* NewLC(); - - ~CLocoDaemon(); - -private: - - // From CActive - - void RunL(); - - void DoCancel(); - - TInt RunError(TInt aReason); - -private: - - CLocoDaemon(); - - void ConstructL(); - - /** - * Loads the bearer plug ins - * @since S60 v3.2 - */ - void LoadBearesL(); - -private: // data - - // the bearer plugins - RPointerArray iBearers; - - // the service manager - CLocodServiceMan* iServiceMan; - - // for system state monitoring - RProperty iSystemPS; - TInt iSystemState; - }; - - -#endif // T_LOCODAEMON_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/inc/locodservice.h --- a/localconnectivityservice/locod/inc/locodservice.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +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: A service which constains a service plugin and its status. -* -*/ - - -#ifndef C_LOCODSERVICE_H -#define C_LOCODSERVICE_H - -#include -#include -#include -#include - -class CLocodServicePlugin; -class TLocodServiceRequest; - -/** - * Specific service that is managed by locod - * Locod creates all service and add it to - * a an array - * @ euser.lib - * @since S60 3.2 - */ -class CLocodService : public CBase - { -public: - - /** - * Factory function - * @since S60 3.2 - * @param aPlugin the sevice plug ins that will be managed (for example DUN, obex) - * @return an instance of CLocodService - */ - static CLocodService* NewL(CLocodServicePlugin& aPlugin); - - ~CLocodService(); - - CLocodServicePlugin& Plugin(); - - /** - * Called to manage service when the bearer status has been changed - * @since S60 3.2 - * @param aBearer the bearer whose status has been changed - * @param aStatus status of the bearer connected, disconnected or on or off - * @return TInt - */ - TInt ManageService(TLocodBearer aBearer, - TBool aStatus); - - /** - * Called when the service has been managed by service plug ins - * @since S60 3.2 - * @param aBearer the bearer whose service has been managed - * @param aStatus status of the bearer connected, disconnected or on or off - * @param err error code that may occured during managing the service - * @return TInt - */ - void ManageServiceCompleted(TLocodBearer aBearer, - TBool aStatus, - TInt err); - - /** - * Check if there are any service pending - * @since S60 3.2 - * @return TBool if there are service pending - */ - TBool HasServiceToManage() const; - -private: - - CLocodService(CLocodServicePlugin& aPlugin); - - void ConstructL(); - -private: - // the service plugin, owned - CLocodServicePlugin* iPlugin; - - // The latest status of this service plugin - TInt iServiceStatus; - - // Queue of ManageService request - RArray iRequests; - }; - -/** - * A ManageService request - */ -class TLocodServiceRequest - { -public: - - TLocodServiceRequest(TLocodBearer aBearer, TBool aStatus); - - // The bearer whose status has changed - TLocodBearer iBearer; - - // The new bearer status - TBool iStatus; - - // The request status - TBool iRequesting; - }; - -#endif // C_LOCODSERVICE_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/inc/locodserviceman.h --- a/localconnectivityservice/locod/inc/locodserviceman.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +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: Defines the service manager class. -* -*/ - - -#ifndef T_LOCODSERVICEMAN_H -#define T_LOCODSERVICEMAN_H - -#include -#include -#include -#include -#include -#include - -class CLocodService; - -/** - * The service plugin manager. - * - * It loads, unloads service plugins on demand and manages a service availability - * according to bearer status. - * @euser.lib - * @since S60 v3.2 - */ -class CLocodServiceMan : - public CActive, - public MLocodBearerPluginObserver, - public MLocodServicePluginObserver - { -public: - - /** - * Factory method, leave the object in cleanupstack. - * - * @lib ?library - * @since S60 v3.2 - */ - static CLocodServiceMan* NewL(); - - ~CLocodServiceMan(); - -public: - -private: - - // From CActive - - void RunL(); - - void DoCancel(); - - TInt RunError(TInt aReason); - -private: - - // From MLocodBearerPluginObserver - /** - * This is a callback function used by the plugins to inform when the - * bearer's availability changes. - * - * @since S60 v3.2 - * @param aBearer the bearer which calls this nothification - * @param aStatus the status of this bearer, ETrue if it is available; - * EFalse otherwise. - */ - void NotifyBearerStatus(TLocodBearer aBearer, - TBool aStatus); - - // From MLocodServicePluginObserver - /** - * This is a callback function used by the plugins to inform when - * managing the service have completed. The parameters passed should be - * identical to the ones used when the plugin's ManageService() was called, - * plus this service plugin's implemnetation UID and the completion status. - * - * @since S60 v3.2 - * @param aBearer the bearer identification passed in ManageService() - * @param aStatus the status of this bearer passed in ManageService() - * @param aServiceImplUid, the implementation UID of this service plugin. - * @param err KErrNone if the operation succeeded; otherwise a Symbian - * error code. - */ - void ManageServiceCompleted(TLocodBearer aBearer, - TBool aStatus, - TUid aServiceImplUid, - TInt err); - -private: - - CLocodServiceMan(); - - void ConstructL(); - - void LoadServicesL(); - -private: // data - RPointerArray iServices; - TInt iBearerStatus; - TUid iUidDun; // DUN id - }; - - -#endif // T_LOCODSERVICEMAN_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/inc/prjconfig.h --- a/localconnectivityservice/locod/inc/prjconfig.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +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: Project configure file. -* -*/ - - -#ifndef LOCOD_PRJCONFIG_H -#define LOCOD_PRJCONFIG_H - -/** - * Traces are enabled in _DEBUG build, by default. - */ -#ifdef _DEBUG -#define PRJ_ENABLE_TRACE -#endif - -/** - * traces to file if this is defined. - */ -//#define PRJ_FILE_TRACE - - -/** - * build the project for module test purpose if this is defined - */ -//#define PRJ_MODULETEST_BUILD - -/** - * build the project using stubs to replace the dependencies if this is defined - */ -//#define PRJ_USE_STUB - - -#endif // LOCOD_PRJCONFIG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/inc/utils.h --- a/localconnectivityservice/locod/inc/utils.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +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: Defines utility functions. -* -*/ - - -#ifndef LOCODUTIL_H -#define LOCODUTIL_H - -#include - -template -class CleanupResetDestroyClose - { -public: - inline static void PushL(T& aRef) - { - CleanupStack::PushL(TCleanupItem(&ResetDestroyClose,&aRef)); - } -private: - static void ResetDestroyClose(TAny *aPtr) - { - static_cast(aPtr)->ResetAndDestroy(); - static_cast(aPtr)->Close(); - } - }; - -/** - * Pushes an object into CleanupStack and specifies the cleanup - * function as ResetAndDestroy() and Close(). -*/ -template -inline void CleanupResetDestroyClosePushL(T& aRef) - {CleanupResetDestroyClose::PushL(aRef);} - -#endif // LOCODUTIL_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/rom/locod.iby --- a/localconnectivityservice/locod/rom/locod.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ - -#ifndef LOCALCONNECTIVITYDAEMON_IBY -#define LOCALCONNECTIVITYDAEMON_IBY - -file=ABI_DIR\BUILD_DIR\locod.exe PROGRAMS_DIR\locod.exe - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/src/locodaemon.cpp --- a/localconnectivityservice/locod/src/locodaemon.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,188 +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: Daemon class implementation. -* -*/ - - -#include - -#include -#include -#include - -#include "locodaemon.h" -#include "locodserviceman.h" -#include "utils.h" -#include "debug.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// NewLC -// --------------------------------------------------------------------------- -// -CLocoDaemon* CLocoDaemon::NewLC() - { - CLocoDaemon* self = new (ELeave) CLocoDaemon(); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// C++ destrctor -// --------------------------------------------------------------------------- -// -CLocoDaemon::~CLocoDaemon() - { - FeatureManager::UnInitializeLib(); - Cancel(); - iSystemPS.Close(); - delete iServiceMan; - iBearers.ResetAndDestroy(); - iBearers.Close(); - REComSession::FinalClose(); - TRACE_FUNC - } - -// --------------------------------------------------------------------------- -// Called when the status of system pubsub keys are -// changed. Normally this is called after the system boot. -// --------------------------------------------------------------------------- -// -void CLocoDaemon::RunL() - { - TRACE_INFO((_L(" RunL %d"), iStatus.Int())) - if (iStatus == KErrNone) - { - iSystemPS.Subscribe(iStatus); - SetActive(); - - TRACE_INFO((_L(" [SYSTEM] prev %d"), iSystemState)) - LEAVE_IF_ERROR(iSystemPS.Get(iSystemState)); - TRACE_INFO((_L(" [SYSTEM] now %d"), iSystemState)) - - if (iSystemState == ESwStateNormalRfOn || - iSystemState == ESwStateNormalRfOff || - iSystemState == ESwStateCharging || - iSystemState == ESwStateNormalBTSap) - { // System is up, construct service man and load bearers. - if(!iServiceMan) - { - iServiceMan = CLocodServiceMan::NewL(); - } - if (!iBearers.Count()) - { - LoadBearesL(); - } - } - /* - ESwStateShuttingDown and ESWStateShuttingDown event is received when - the device is about to shut down - */ - else if (iSystemState == ESwStateShuttingDown) - { - TRACE_INFO((_L(" [SYSTEM] Shuting down and deleting"))) - delete iServiceMan; - iServiceMan = NULL; - iBearers.ResetAndDestroy(); - return; - } - } - RProcess::Rendezvous(KErrNone); - } - -// --------------------------------------------------------------------------- -// CActive method cancel listening pubsub keys -// --------------------------------------------------------------------------- -// -void CLocoDaemon::DoCancel() - { - TRACE_FUNC - iSystemPS.Cancel(); - } - -// --------------------------------------------------------------------------- -// CActive method -// --------------------------------------------------------------------------- -// -TInt CLocoDaemon::RunError(TInt /*aReason*/) - { - TRACE_FUNC - return KErrNone; - } - -// --------------------------------------------------------------------------- -// C++ Constructor -// --------------------------------------------------------------------------- -// -CLocoDaemon::CLocoDaemon() : CActive(CActive::EPriorityStandard) - { - CActiveScheduler::Add(this); - TRACE_FUNC_THIS - } - -// --------------------------------------------------------------------------- -// 2nd phase construction -// --------------------------------------------------------------------------- -// -void CLocoDaemon::ConstructL() - { - FeatureManager::InitializeLibL(); - LEAVE_IF_ERROR(iSystemPS.Attach(KPSUidStartup, KPSGlobalSystemState)); - iStatus = KRequestPending; - SetActive(); - TRequestStatus* sta = &iStatus; - User::RequestComplete(sta, KErrNone); - TRACE_FUNC - } - -// --------------------------------------------------------------------------- -// LoadBearesL Loads the bearer plug ins -// --------------------------------------------------------------------------- -// -void CLocoDaemon::LoadBearesL() - { - TRACE_FUNC_ENTRY - TRACE_INFO((_L("Load interface 0x%08X"), KLOCODBEARERINTERFACEUID)) - const TUid KBearerPluginInterface = TUid::Uid(KLOCODBEARERINTERFACEUID); - RImplInfoPtrArray implementations; - const TEComResolverParams noResolverParams; - REComSession::ListImplementationsL(KBearerPluginInterface, - noResolverParams, - KRomOnlyResolverUid, - implementations); - CleanupResetDestroyClosePushL(implementations); - const TUint count = implementations.Count(); - TRACE_INFO((_L(" Bearer count = %d"), count)) - for ( TUint ii = 0 ; ii < count ; ++ii ) - { - CImplementationInformation* impl = implementations[ii]; - TRACE_INFO((_L("Bearer: feature %d, name '%S', ROM only %d"), - impl->ImplementationUid().iUid, &(impl->DisplayName()), impl->RomOnly())) - if (FeatureManager::FeatureSupported(impl->ImplementationUid().iUid)) - { - TRACE_INFO((_L("Feature found"))) - TLocodBearerPluginParams params(impl->ImplementationUid(), *iServiceMan); - CLocodBearerPlugin* bearer = CLocodBearerPlugin::NewL(params); - CleanupStack::PushL(bearer); - iBearers.AppendL(bearer); - CleanupStack::Pop(bearer); - } - } - CleanupStack::PopAndDestroy(&implementations); - TRACE_FUNC_EXIT - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/src/locodmain.cpp --- a/localconnectivityservice/locod/src/locodmain.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +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: Global functions for Local Connectivity Daemon. -* -*/ - - -#include "locodaemon.h" -#include "debug.h" - -_LIT( KLocodName, "LocalConnectivityDaemon" ); - -static void StartDaemonL(); - -// ======== LOCAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// E32Main. -// Entry-point for LCD. -// --------------------------------------------------------------------------- -// -TInt E32Main() - { - TInt ret; - User::RenameThread( KLocodName ); - - __UHEAP_MARK; - - // create clean-up stack - CTrapCleanup* cleanup = CTrapCleanup::New(); - TRAP( ret, StartDaemonL() ); - delete cleanup; // destroy clean-up stack - __UHEAP_MARKEND; - - return ret; - } - -// ---------------------------------------------------------------------------- -// StartDaemonL(). -// Constructs and installs the active scheduler, constructs Daemon object. -// ---------------------------------------------------------------------------- -// -static void StartDaemonL() - { - TRACE_FUNC - - // Construct and install the active scheduler - CActiveScheduler *myScheduler = new ( ELeave ) CActiveScheduler(); - - // Push onto the cleanup stack - CleanupStack::PushL( myScheduler ); - - // Install as the active scheduler - CActiveScheduler::Install( myScheduler ); - - CLocoDaemon* daemon = NULL; - daemon = CLocoDaemon::NewLC(); - CActiveScheduler::Start(); - - CleanupStack::PopAndDestroy( daemon ); - CleanupStack::PopAndDestroy( myScheduler ); - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/src/locodservice.cpp --- a/localconnectivityservice/locod/src/locodservice.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,220 +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: The implementation of LCD service -* -*/ - - -#include - -#include "locodservice.h" -#include "debug.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Creates a service object based on the service plug in objects -// --------------------------------------------------------------------------- -// -CLocodService* CLocodService::NewL(CLocodServicePlugin& aPlugin) - { - CLocodService* self = new (ELeave) CLocodService(aPlugin); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// C++ destructor -// --------------------------------------------------------------------------- -// -CLocodService::~CLocodService() - { - delete iPlugin; - iRequests.Close(); - TRACE_FUNC - } - -// --------------------------------------------------------------------------- -// return the plugin instance -// --------------------------------------------------------------------------- -// -CLocodServicePlugin& CLocodService::Plugin() - { - return *iPlugin; - } - - -// --------------------------------------------------------------------------- -// A request is sent to service plug in to manage their services -// --------------------------------------------------------------------------- -// -TInt CLocodService::ManageService(TLocodBearer aBearer, TBool aStatus) - { - TRACE_INFO((_L("[Srvc %d] [SrvcState 0x%04x]"), iPlugin->ImplementationUid().iUid, iServiceStatus)) - - // if there is an outstanding request which has the same bearer, - // remove all later enqueued request, and - // enqueue this request if the bearer status is different from the ongoing one. - TInt count = iRequests.Count(); - for (TInt i = 0; i < count; i++) - { - if (iRequests[i].iBearer == aBearer && iRequests[i].iRequesting) - { - for (TInt j = count - 1; j > i; j--) - { - if (iRequests[j].iBearer == aBearer) - { - TRACE_INFO((_L("[Srvc %d] [ManSrvc] Remove buffered request(Bearer 0x%04x status %d)"), - iPlugin->ImplementationUid().iUid, aBearer, iRequests[j].iStatus)) - iRequests.Remove(j); - } - } - if ((!iRequests[i].iStatus && aStatus) || (iRequests[i].iStatus && !aStatus)) - { - TRACE_INFO((_L("[Srvc %d] [ManSrvc] Buffer request(Bearer 0x%04x status %d)"), - iPlugin->ImplementationUid().iUid, aBearer, aStatus)) - return iRequests.Append(TLocodServiceRequest(aBearer, aStatus)); - } - else - { - TRACE_INFO((_L("[Srvc %d] [ManSrvc] Request(Bearer 0x%04x status %d) discarded"), - iPlugin->ImplementationUid().iUid, aBearer, aStatus)) - return KErrNone; - } - } - } - - // else if the latest bearer status in this service plugin is different, - // Start ManageService() - if ( aStatus && !(iServiceStatus & aBearer) || - !aStatus && (iServiceStatus & aBearer)) - { - TLocodServiceRequest request(aBearer, aStatus); - request.iRequesting = ETrue; - TInt err = iRequests.Append(request); - TRACE_INFO((_L("[Srvc %d] [ManSrvc] Issue request(Bearer 0x%04x status %d)"), - iPlugin->ImplementationUid().iUid, aBearer, aStatus)) - if (!err) - { - iPlugin->ManageService(aBearer, aStatus); - } - return err; - } - - // else the latest bearer status in this service plugin is the same, - // do nothing - TRACE_INFO((_L("[Srvc %d] [ManSrvc] Request(Bearer 0x%04x status %d) discarded"), - iPlugin->ImplementationUid().iUid, aBearer, aStatus)) - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Based on the status of bearer either the request is removed or a new manage -// service is issued -// --------------------------------------------------------------------------- -// -void CLocodService::ManageServiceCompleted(TLocodBearer aBearer, - TBool aStatus, TInt err) - { - TRACE_INFO((_L("[Srvc %d] [ManSrvc complete] (Bearer 0x%04x status %d) return %d"), - iPlugin->ImplementationUid().iUid, aBearer, aStatus, err)) - // Save the latest status of this bearer - if (!err) - { - if (aStatus) - { - iServiceStatus |= aBearer; - } - else - { - iServiceStatus &= (~aBearer); - } - TRACE_INFO((_L("[Srvc %d] [SrvcState 0x%04x]"), iPlugin->ImplementationUid().iUid, iServiceStatus)) - } - - // Find the completed request and remove it from the request list. - TInt count = iRequests.Count(); - for (TInt i = 0; i < count; i++) - { - if (iRequests[i].iBearer == aBearer && iRequests[i].iRequesting) - { - TRACE_INFO((_L("[Srvc %d] [ManSrvc completed] Remove completed request(Bearer 0x%04x status %d)"), - iPlugin->ImplementationUid().iUid, aBearer, iRequests[i].iStatus)) - iRequests.Remove(i); - break; - } - } - - // Find the next request and start ManageService if the status is changed. - count = iRequests.Count(); - for (TInt i = 0; i < count; i++) - { - if (iRequests[i].iBearer == aBearer) - { - if ( (iRequests[i].iStatus && !(iServiceStatus & aBearer)) || - (!iRequests[i].iStatus && (iServiceStatus & aBearer))) - { - iRequests[i].iRequesting = ETrue; - TRACE_INFO((_L("[Srvc %d] [ManSrvc completed] Issue buffered request(Bearer 0x%04x status %d)"), - iPlugin->ImplementationUid().iUid, aBearer, iRequests[i].iStatus)) - iPlugin->ManageService(iRequests[i].iBearer, iRequests[i].iStatus); - } - else - { - TRACE_INFO((_L("[Srvc %d] [ManSrvc completed] Remove buffered request(Bearer 0x%04x status %d)"), - iPlugin->ImplementationUid().iUid, aBearer, iRequests[i].iStatus)) - iRequests.Remove(i); - } - break; - } - } - } - -// --------------------------------------------------------------------------- -// return if there are request pending -// --------------------------------------------------------------------------- -// -TBool CLocodService::HasServiceToManage() const - { - return iRequests.Count(); - } - -// --------------------------------------------------------------------------- -// C++ default constructor -// --------------------------------------------------------------------------- -// -CLocodService::CLocodService(CLocodServicePlugin& aPlugin) : iPlugin(&aPlugin) - { - TRACE_FUNC_THIS - } - -// --------------------------------------------------------------------------- -// C++ 2nd phase construction -// --------------------------------------------------------------------------- -// -void CLocodService::ConstructL() - { - } - -// --------------------------------------------------------------------------- -// C++ default constructor -// --------------------------------------------------------------------------- -// -TLocodServiceRequest::TLocodServiceRequest(TLocodBearer aBearer, TBool aStatus) -: iBearer(aBearer), iStatus(aStatus), iRequesting(EFalse) - { - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/src/locodserviceman.cpp --- a/localconnectivityservice/locod/src/locodserviceman.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,220 +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: Daemon class implementation. -* -*/ - - -#include -#include -#include - -#include "locodserviceman.h" -#include "locodservice.h" -#include "debug.h" -#include "utils.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// NewL -// --------------------------------------------------------------------------- -// -CLocodServiceMan* CLocodServiceMan::NewL() - { - CLocodServiceMan* self = new (ELeave) CLocodServiceMan(); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// C++ destructor -// --------------------------------------------------------------------------- -// -CLocodServiceMan::~CLocodServiceMan() - { - Cancel(); - iServices.ResetAndDestroy(); - iServices.Close(); - - TRACE_FUNC - } - -// --------------------------------------------------------------------------- -// CActive method, the request is only completed when there is no service -// to manage, so all the service plugins are destroyed -// --------------------------------------------------------------------------- -// -void CLocodServiceMan::RunL() - { - TRACE_FUNC_ENTRY - if(iStatus ==KErrNone) - { - iServices.ResetAndDestroy(); - } - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// CActive method -// --------------------------------------------------------------------------- -// -void CLocodServiceMan::DoCancel() - { - - } - -// --------------------------------------------------------------------------- -// CActive method -// --------------------------------------------------------------------------- -// -TInt CLocodServiceMan::RunError(TInt/* aReason */) - { - return KErrNone; - } - - -// --------------------------------------------------------------------------- -// NotifyBearerStatus -// --------------------------------------------------------------------------- -// -void CLocodServiceMan::NotifyBearerStatus(TLocodBearer aBearer, TBool aStatus) - { - TRACE_INFO((_L(" [BRRST] status of 0x%04x changes to %d"), aBearer, aStatus)) - TInt oldStatus = iBearerStatus; - if (aStatus) - { - iBearerStatus |= aBearer; - } - else - { - iBearerStatus &= (~aBearer); - } - TRACE_INFO((_L(" [BRRST] [OLD] 0x%08x [NEW] 0x%08x"), oldStatus, iBearerStatus)) - if (iBearerStatus && !iServices.Count()) - { - TRAP_IGNORE(LoadServicesL()); - } - TInt count = iServices.Count(); - for (TInt i = 0; i < count; i++) - { - if(iBearerStatus != oldStatus) - { - iServices[i]->ManageService(aBearer, aStatus); - } - } - } - -// --------------------------------------------------------------------------- -// Call back method from service plugins. This is called when the services has been -// managed by the plug ins. -// --------------------------------------------------------------------------- -// -void CLocodServiceMan::ManageServiceCompleted(TLocodBearer aBearer, - TBool aStatus, TUid aServiceImplUid, TInt err) - { - TInt count = iServices.Count(); - for (TInt i = 0; i < count; i++) - { - if (iServices[i]->Plugin().ImplementationUid() == aServiceImplUid) - { - iServices[i]->ManageServiceCompleted(aBearer, aStatus, err); - break; - } - } - - if (!iBearerStatus) - { - for (TInt i = 0; i < count; i++) - { - if (iServices[i]->HasServiceToManage()) - { - return; - } - } - - if(!IsActive()) - { - iStatus = KRequestPending; - SetActive(); - TRequestStatus* status = &iStatus; - User::RequestComplete(status, KErrNone); - } - - } - } - -// --------------------------------------------------------------------------- -// c++ constructor -// --------------------------------------------------------------------------- -// -CLocodServiceMan::CLocodServiceMan() : CActive(CActive::EPriorityStandard),iUidDun(TUid::Uid(KFeatureIdDialupNetworking)) - { - CActiveScheduler::Add(this); - TRACE_FUNC_THIS - } - -// --------------------------------------------------------------------------- -// 2nd phase construction -// --------------------------------------------------------------------------- -// -void CLocodServiceMan::ConstructL() - { - - } - -// --------------------------------------------------------------------------- -// Loaded all service plug ins who has implemented the KLOCODSERVICEINTERFACEUID -// --------------------------------------------------------------------------- -// -void CLocodServiceMan::LoadServicesL() - { - TRACE_FUNC_ENTRY - TRACE_INFO((_L("Load interface 0x%08X"), KLOCODSERVICEINTERFACEUID)) - const TUid KServicePluginInterface = TUid::Uid(KLOCODSERVICEINTERFACEUID); - RImplInfoPtrArray implementations; - const TEComResolverParams noResolverParams; - REComSession::ListImplementationsL(KServicePluginInterface, - noResolverParams, - KRomOnlyResolverUid, - implementations); - CleanupResetDestroyClosePushL(implementations); - const TUint count = implementations.Count(); - TRACE_INFO((_L(" [BRRST] Service Plug in found %d"), count)) - for ( TUint ii = 0 ; ii < count ; ++ii ) - { - CImplementationInformation* impl = implementations[ii]; - TRACE_INFO((_L("Service: feature %d, name '%S', ROM only %d"), - impl->ImplementationUid().iUid, &(impl->DisplayName()), impl->RomOnly())) - if (FeatureManager::FeatureSupported(impl->ImplementationUid().iUid)) - { - TRACE_INFO((_L("Feature found"))) - TLocodServicePluginParams params(impl->ImplementationUid(), *this); - CLocodServicePlugin* srvcplugin = CLocodServicePlugin::NewL(params); - CleanupStack::PushL(srvcplugin); - CLocodService* service = CLocodService::NewL(*srvcplugin); - CleanupStack::Pop(srvcplugin); - CleanupStack::PushL(service); - iServices.AppendL(service); - CleanupStack::Pop(service); - } - } - CleanupStack::PopAndDestroy(&implementations); - TRACE_FUNC_EXIT - } - - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/locod/src/utils.cpp --- a/localconnectivityservice/locod/src/utils.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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: utility function implementation. -* -*/ - - -#include "utils.h" -#include "debug.h" - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/bip/data/101F8671.rss --- a/localconnectivityservice/obexreceiveservices/bip/data/101F8671.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* -* Copyright (c) 2005 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: PC Connectivity Plug-in resource file -* -*/ - - -#include - -// Declares info for two implementations -RESOURCE REGISTRY_INFO theInfo - { - // UID for the DLL - dll_uid = 0x101F8671; - // Declare array of interface info - interfaces = - { - INTERFACE_INFO - { - // UID of interface that is implemented - interface_uid = 0x101F7C8C; - implementations = - { - // Info for CSConPCConnplugin - IMPLEMENTATION_INFO - { - implementation_uid = 0x101F8671; - version_no = 1; - display_name = "Obex Services"; - default_data = "OBEX/BT"; - - // - // opaque_data contains parameters used by following API calls in SRCS: - // 1. Setup USB interface string descriptor in Unicode; - // 2. TInt CObex::SetLocalWho(const TDesC8& aInfo); - // 3. TInt CBTConnection::RegisterSecuritySettingsL( TUint aService, - // TInt aProtocol, - // TInt aChannel, - // TBool aAuthenticate, - // TBool aAuthorise, - // TBool aEncrypt ); - // opaque_data = "@0||@1||@2||@3||@4||@5||@6" - // @0 aStrDesc e.g. "PC Connectivity" - // @1 aInfo e.g. KFolderBrowsingID, "\xF9\xEC\x7B\xC4\x95\x3C\x11\xd2\x98\x4E\x52\x54\x00\xDC\x9E\x09" - // @2 aService e.g. KBTSecurityUidFileTransfer, 0x1106 - // @3 aProtocol e.g. KSolBtRFCOMM, 0x1013 - // @4 aAuthenticate e.g. EFalse, 0 - // @5 aAuthorise e.g. EFalse, 0 - // @6 aEncrypt e.g. EFalse, 0 - // - opaque_data = "OBEX|"\ - "|\xE3\x3D\x95\x45\x83\x74\x4A\xD7\x9E\xC5\xC1\x6B\xE3\x1E\xDE\x8E|"\ - "|0x111b|"\ - "|0x1013|"\ - "|0|"\ - "|1|"\ - "|0|"\ - "|0xfffE|"\ - "|0xfffE"; - } - }; - } - }; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/bip/eabi/MtmUiServerBipu.DEF --- a/localconnectivityservice/obexreceiveservices/bip/eabi/MtmUiServerBipu.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z18NewMessageHandlerLv @ 1 NONAME - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/bip/group/bld.inf --- a/localconnectivityservice/obexreceiveservices/bip/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2002 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: This file provides the information required for building the -* whole of a MtmUiServerBip. -* -*/ - - - -PRJ_PLATFORMS - - -PRJ_EXPORTS - -PRJ_MMPFILES -../group/obexservicebip.mmp - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/bip/group/obexservicebip.mmp --- a/localconnectivityservice/obexreceiveservices/bip/group/obexservicebip.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2002 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: This is project specification file for the obexserviceopp. -* -* -*/ - -#include - -TARGET obexservicebip.dll -CAPABILITY CAP_GENERAL_DLL -TARGETTYPE PLUGIN -UID 0x10009d8d 0x101F8671 -VENDORID VID_DEFAULT - -SOURCEPATH ../src -SOURCE obexservicebip.cpp -SOURCE BIPController.cpp -SOURCE BIPCapabilityHandler.cpp -SOURCE BIPXMLWriter.cpp -SOURCE BIPImageHandler.cpp - - - -START RESOURCE ../data/101F8671.rss - TARGET obexservicebip.rsc -END - - -USERINCLUDE ../inc -SYSTEMINCLUDE ../../../inc ../../../../inc -MW_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib // Base library -LIBRARY irobex.lib // For Object exchange -LIBRARY efsrv.lib -LIBRARY imageconversion.lib -LIBRARY bafl.lib -LIBRARY obexutils.lib -LIBRARY ecom.lib -LIBRARY aknnotify.lib -LIBRARY avkon.lib -LIBRARY sysutil.lib -LIBRARY platformenv.lib -LIBRARY esock.lib -LIBRARY bluetooth.lib // Bluetooth libraries -LIBRARY btdevice.lib // Bluetooth library -LIBRARY btmanclient.lib - -//Bteng APIs -LIBRARY btengdevman.lib //btengdevman.dll -LIBRARY btengsettings.lib //btengsettings.dll -LIBRARY btengconnman.lib //btengconnman.dll - - -DEBUGLIBRARY flogger.lib // For logging - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/bip/inc/BIPCapabilityHandler.h --- a/localconnectivityservice/obexreceiveservices/bip/inc/BIPCapabilityHandler.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -/* -* Copyright (c) 2002 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: Capability object handler class declaration -* -*/ - - -#ifndef _BIPCAPABILITYHANDLER_H -#define _BIPCAPABILITYHANDLER_H - -//INCLUDES -#include -#include -#include "debug.h" - -// FORWARD DECLARATIONS -class CBIPXmlWriter; -class CImageTypeDescription; - -// CLASS DECLARATION - -/** -* Creates an xml capability object -*/ -NONSHARABLE_CLASS (CBIPCapabilityHandler) : public CBase - { - public: //Constructors and destructors - /** - * Two-phased constructor. - */ - static CBIPCapabilityHandler* NewL(); - - /** - * Destructor. - */ - virtual ~CBIPCapabilityHandler(); - - public: //New Functions - - /** - * Creates an array of supported image types. - * @param aFileName On return contains the name - * of the file that was created - * @return None. - */ - void CreateCapabilityObjectL( TFileName& aFileName ); - - /** - * Creates an array of supported image types. - * @param None. - * @return None. - */ - void SupportedImageTypesL( ); - - private: - - /** - * C++ default constructor. - */ - CBIPCapabilityHandler(); - - /** - * Symbian 2nd phase constructor. - */ - void ConstructL(); - - private: // Data - CBIPXmlWriter* iBIPXmlWriter; - CDesC8ArrayFlat* iImageTypeArray; - }; - -#endif //_BIPCAPABILITYHANDLER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/bip/inc/BIPController.h --- a/localconnectivityservice/obexreceiveservices/bip/inc/BIPController.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ -/* -* Copyright (c) 2004 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: Bip controller class declaration. -* -*/ - - -#ifndef _BIPCONTROLLER_H -#define _BIPCONTROLLER_H - -//INCLUDES - -#include -#include -#include -#include -#include -#include "obexutilspropertynotifier.h" -#include "debug.h" -#include -#include -#include -#include -#include "btengdevman.h" -#include - -// FORWARD DECLARATIONS - -class CBIPCapabilityHandler; -class CBIPImageHandler; - - -// CLASS DECLARATION - -/** -* The main controller for Basic Imaging Profile. -*/ -NONSHARABLE_CLASS (CBIPController): public CSrcsInterface, public MObexServerNotify, - public MObexUtilsPropertyNotifyHandler, - public MGlobalProgressCallback, public MGlobalNoteCallback, - public MBTEngDevManObserver - { -public: - static CBIPController* NewL(); - ~CBIPController(); - -private: // from CSrcsInterface - TBool IsOBEXActive(); - void SetMediaType(TSrcsMediaType aMediaType); - TInt SetObexServer(CObexServer* aServer); - -private: // from MObexServerNotify - void ErrorIndication(TInt aError); - void TransportUpIndication(); - void TransportDownIndication(); - TInt ObexConnectIndication(const TObexConnectInfo& aRemoteInfo, const TDesC8& aInfo); - void ObexDisconnectIndication(const TDesC8& aInfo); - CObexBufObject* PutRequestIndication(); - TInt PutPacketIndication(); - TInt PutCompleteIndication(); - CObexBufObject* GetRequestIndication(CObexBaseObject* aRequiredObject); - TInt GetPacketIndication(); - TInt GetCompleteIndication(); - TInt SetPathIndication(const CObex::TSetPathInfo& aPathInfo, const TDesC8& aInfo); - void AbortIndication(); - -private: // from MObexUtilsPropertyNotifyHandler - void HandleNotifyL(TMemoryPropertyCheckType aCheckType); - -private: // from MGlobalProgressCallback - void HandleGlobalProgressDialogL(TInt aSoftkey); - -private: // from MGlobalNoteCallback - void HandleGlobalNoteDialogL(TInt aSoftkey); - -private: // from MBTEngDevManObserver - void HandleGetDevicesComplete(TInt aErr, CBTDeviceArray* aDeviceArray); - -private: - CBIPController(); - void ConstructL(); - - void CancelTransfer(); - - void HandleError(TBool aAbort); - void HandleGetCapabilityRequestL(); - void HandlePutImageRequestL(); - TInt HandlePutCompleteIndication(); - TInt RemoveCapabilityObject(); - - TBool CheckCapacityL(); - void LaunchReceivingIndicatorL(); - inline TBool ReceivingIndicatorActive() const { return (iProgressDialog || iWaitDialog); } - void UpdateReceivingIndicator(); - void CloseReceivingIndicator(TBool aResetDisplayedState = ETrue); - TInt GetDriveWithMaximumFreeSpaceL(); - -private: - enum TBipTransferState - { - ETransferIdle, - ETransferPut, - ETransferGet, - ETransferPutDiskError, - ETransferPutInitError, - ETransferPutCancel, - }; - -private: // Data - CBIPCapabilityHandler* iBIPCapabilityHandler; - CObexBufObject* iBTObject; - CObexServer* iBTObexServer; - TBipTransferState iBTTransferState; - TInt iDrive; - CBIPImageHandler* iBIPImageHandler; - CObexBufObject* iGetObject; - CObexUtilsPropertyNotifier* iLowMemoryActiveCDrive; - CObexUtilsPropertyNotifier* iLowMemoryActiveMMC; - TMsvId iMsvIdParent; - TMsvId iMsvIdAttach; - RFile iFile; - RFs iFs; - TFileName iFullPathFilename; - TFileName iCapabilityFileName; - TFileName iDefaultFolder; - TFileName iPreviousDefaultFolder; - CBufFlat *iBuf; - TBool iLengthHeaderReceived; - TInt iTotalSizeByte; - CGlobalProgressDialog* iProgressDialog; - CGlobalDialog* iWaitDialog; - TBool iNoteDisplayed; - CBTEngDevMan* iDevMan; - CBTDeviceArray* iResultArray; - TBTDeviceName iRemoteDeviceName; - TFileName iReceivingFileName; - TFileName iCenRepFolder; - }; - -_LIT(KBipPanicCategory, "BIP"); -enum TBipPanicCode - { - EBipPanicNotBluetoothMediaType = 0, - }; - -#endif //_BIPCONTROLLER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/bip/inc/BIPImageHandler.h --- a/localconnectivityservice/obexreceiveservices/bip/inc/BIPImageHandler.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* -* Copyright (c) 2002 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: Bip image handler class declaration. -* -*/ - - -#ifndef _BIPIMAGEHANDLER_H -#define _BIPIMAGEHANDLER_H - -//INCLUDES -#include -#include -#include "debug.h" - -// FORWARD DECLARATIONS - -// CLASS DECLARATION - -/** -* Generates image handles and sets them to obex response packets. -*/ -NONSHARABLE_CLASS (CBIPImageHandler) : public CBase - { - public: //Constructors and destructors - - /** - * Two-phased constructor. - */ - static CBIPImageHandler* NewL(); - - /** - * Destructor. - */ - virtual ~CBIPImageHandler(); - - public: //New Functions - - /** - * Adds Image handle to Obex response packet - * @param aObexServer Current obex server - * @return None. - */ - void AddImageHandleHeaderL( CObexServer* aObexServer ); - - private: - - /** - * C++ default constructor. - */ - CBIPImageHandler(); - - /** - * Symbian 2nd phase constructor. - */ - void ConstructL(); - - private: // Data - TUint iImageHandleValue; - - }; - -#endif //_BIPIMAGEHANDLER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/bip/inc/BIPXMLWriter.h --- a/localconnectivityservice/obexreceiveservices/bip/inc/BIPXMLWriter.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ -/* -* Copyright (c) 2002 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: XML writer class declaration. -* -*/ - - -#ifndef _BIPXMLWRITER_H -#define _BIPXMLWRITER_H - -//INCLUDES -#include -#include -#include -#include "debug.h" - -// CONSTANTS -enum TElementType - { - EImageFormats, - EPreferredFormat, - EAttachmentFormats, - EFilteringParameters, - EDPOFOptions - }; - -enum TAttributeType - { - EEncoding, - EPixel, - ETransformation, - EMaxSize - }; - -// CLASS DECLARATION - -/** -* XML writer for BIP capability object -* -*/ -NONSHARABLE_CLASS (CBIPXmlWriter) : public CBase - { - public: //Constructors and destructors - - /** - * Two-phased constructor. - */ - static CBIPXmlWriter* NewL(); - - /** - * Destructor. - */ - virtual ~CBIPXmlWriter(); - - public: //New Functions - - /** - * Open temporary file - * @param TFileName Contains the new temp file name. - * @return None. - */ - void OpenXmlDocumentL( TFileName& aFileName); - - /** - * Close temporary file. So that it can be used by clients - * @param None. - * @return None. - */ - void CloseXmlDocumentL(); - - /** - * Opens xml element for writing - * @param TElementType Element to be written to file - * @return None. - */ - void OpenXmlElementL( TElementType aElement ); - - /** - * Close xml element - * @param None - * @return None. - */ - void CloseXmlElementL( ); - - /** - * Add xml attribute to the open element - * @param TAttributeType Type of the attribute - * @param TDesC8 Attribute - * @return None. - */ - void AddXmlAttributeL( TAttributeType aAttributeType, TDesC8& aAttr ); - - private: - - /** - * C++ default constructor. - */ - CBIPXmlWriter(); - - /** - * Symbian 2nd phase constructor. - */ - void ConstructL(); - - private: // Data - - RFile ifile; - RFs iFileSession; - TFileName iFileName; - }; - -#endif //_BIPXMLWRITER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/bip/inc/debug.h --- a/localconnectivityservice/obexreceiveservices/bip/inc/debug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,180 +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: Logging definition -* -*/ - - -#ifndef PRJ_LOGGING_H -#define PRJ_LOGGING_H - -#include "debugconfig.h" - -#ifdef PRJ_ENABLE_TRACE - -#ifdef PRJ_FILE_TRACE -#include -#else -#include -#endif - -const TInt KMaxLogLineLength = 512; - -#define KPRINTERROR 0x00000001 // Tracing level: error -#define KPRINTINFO 0x00000002 // Tracing level: function trace -#define KPRINTSTATE 0x00000004 // Tracing level: state machine info -#define KPRINTWARNING 0x00000008 // Tracing level: warning - -const TInt KTraceMask = KPRINTERROR | KPRINTINFO | KPRINTSTATE | KPRINTWARNING; - -NONSHARABLE_CLASS(TOverflowTruncate16) : public TDes16Overflow - { -public: - void Overflow(TDes16& /*aDes*/) {} - }; - -NONSHARABLE_CLASS(TOverflowTruncate8) : public TDes8Overflow - { -public: - void Overflow(TDes8& /*aDes*/) {} - }; - -inline void Trace(TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); -#ifdef PRJ_FILE_TRACE - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); -#else - TBuf16 theFinalString; - theFinalString.Append(KTracePrefix16); - TOverflowTruncate16 overflow; - theFinalString.AppendFormatList(aFmt,list,&overflow); - RDebug::Print(theFinalString); -#endif - } - -inline void Trace(TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list, aFmt); -#ifdef PRJ_FILE_TRACE - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); -#else - TOverflowTruncate8 overflow; - TBuf8 buf8; - buf8.Append(KTracePrefix8); - buf8.AppendFormatList(aFmt, list, &overflow); - TBuf16 buf16(buf8.Length()); - buf16.Copy(buf8); - TRefByValue tmpFmt(_L("%S")); - RDebug::Print(tmpFmt, &buf16); -#endif - } - -inline void TracePanic( - char* aFile, - TInt aLine, - TInt aPanicCode, - const TDesC& aPanicCategory) - { - TPtrC8 fullFileName((const TUint8*)aFile); - TPtrC8 fileName(fullFileName.Ptr()+fullFileName.LocateReverse('\\')+1); - TBuf8 buf; - buf.Append(KPanicPrefix8); - buf.AppendFormat(_L8("%d at line %d in file %S"), aPanicCode, aLine, &fileName); - Trace(buf); - User::Panic(aPanicCategory, aPanicCode); - } - -inline void TraceLeave(char* aFile, TInt aLine, TInt aReason) - { - TPtrC8 fullFileName((const TUint8*)aFile); - TPtrC8 fileName(fullFileName.Ptr()+fullFileName.LocateReverse('\\')+1); - TBuf8 buf; - buf.Append(KLeavePrefix8); - buf.AppendFormat(_L8("%d at line %d in file %S"), aReason, aLine, &fileName); - Trace(buf); - User::LeaveIfError(aReason); - } - -#define TRACE_INFO(p) {if(KTraceMask & KPRINTINFO) Trace p;} - -#define TRACE_ERROR(p) {if(KTraceMask & KPRINTERROR) Trace p;} - -#define TRACE_STATE(p) {if(KTraceMask & KPRINTSTATE) Trace p;} - -#define TRACE_WARNING(p) {if(KTraceMask & KPRINTWARNING) Trace p;} - -#define TRACE_INFO_SEG(p) {if(KTraceMask & KPRINTINFO) p;} - -#define TRACE_ASSERT(GUARD, CODE) {if (!(GUARD)) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory);} - -#define PANIC(CODE) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory) - -#define LEAVE_IF_ERROR(REASON) {if (REASON) TraceLeave(__FILE__, __LINE__, REASON);} - -#define LEAVE(REASON) {TraceLeave(__FILE__, __LINE__, REASON);} - -#define TRACE_FUNC_ENTRY {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryFormat8, &ptr8);}} - -#define TRACE_FUNC_ENTRY_THIS {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryThisFormat8, &ptr8, this);}} - -#define TRACE_FUNC_EXIT {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncExitFormat8, &ptr8);}} - -#define TRACE_FUNC {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncFormat8, &ptr8);}} - -#define TRACE_FUNC_THIS {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncThisFormat8, &ptr8, this);}} - -#define RETURN_IF_ERR(ERR) {if(ERR) {TPtrC8 ptr8((TUint8*)__FILE__); Trace(_L8(" RETURN %d at file %S line %d"), ERR, &ptr8, __LINE__); return ERR;}} - -#define TRACE_ONLY(p) p - -#else // PRJ_ENABLE_TRACE not defined - -#define TRACE_INFO(p) - -#define TRACE_ERROR(p) - -#define TRACE_STATE(p) - -#define TRACE_WARNING(p) - -#define TRACE_INFO_SEG(p) - -#define TRACE_ASSERT(GUARD, CODE) - -#define PANIC(CODE) {User::Panic(KPanicCategory, CODE);} - -#define LEAVE_IF_ERROR(REASON) {static_cast(User::LeaveIfError(REASON));} - -#define LEAVE(REASON) {static_cast(User::Leave(REASON));} - -#define TRACE_FUNC_ENTRY - -#define TRACE_FUNC_ENTRY_THIS - -#define TRACE_FUNC_EXIT - -#define TRACE_FUNC - -#define TRACE_FUNC_THIS - -#define RETURN_IF_ERR(ERR) {if(ERR) return ERR;} - -#define TRACE_ONLY(p) - -#endif // PRJ_ENABLE_TRACE - -#endif // PRJ_LOGGING_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/bip/inc/debugconfig.h --- a/localconnectivityservice/obexreceiveservices/bip/inc/debugconfig.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +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: Project configure file. -* -*/ - - -#ifndef OBEXSM_DEBUGCONFIG_H -#define OBEXSM_DEBUGCONFIG_H - -#include "prjconfig.h" - - -/** - * Custom logging variations. - */ -#ifdef PRJ_FILE_TRACE -_LIT(KLogFile,"bipreceiveservice.txt"); -_LIT(KLogDir,"locod"); -#endif - -#ifdef PRJ_ENABLE_TRACE -_LIT(KTracePrefix16, "[BIP] "); -_LIT8(KTracePrefix8, "[BIP] "); -_LIT8(KFuncFormat8, "><%S"); -_LIT8(KFuncThisFormat8, "><%S, [0x%08X]"); -_LIT8(KFuncEntryFormat8, ">%S"); -_LIT8(KFuncEntryThisFormat8, ">%S, [0x%08X]"); -_LIT8(KFuncExitFormat8, "<%S"); - -_LIT(KPanicCategory, "BIP"); -_LIT8(KPanicPrefix8, "PANIC code "); -_LIT8(KLeavePrefix8, "LEAVE code "); -#endif - -#endif // OBEXSM_DEBUGCONFIG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/bip/inc/prjconfig.h --- a/localconnectivityservice/obexreceiveservices/bip/inc/prjconfig.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +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: Project configure file. -* -*/ - - -#ifndef OBEXSM_PRJCONFIG_H -#define OBEXSM_PRJCONFIG_H - -/** - * Traces are enabled via RDebug::Print() in UDEB build, by default. - */ -#ifdef _DEBUG -#define PRJ_ENABLE_TRACE -#endif - -/** - * Traces will be written to file if this is defined. - */ -//#define PRJ_FILE_TRACE - - -/** - * build the project for module test purpose if this is defined - */ -//#define PRJ_MODULETEST_BUILD - -/** - * build the project using stubs to replace the dependencies if this is defined - */ -//#define PRJ_USE_STUB - -#endif // OBEXSM_PRJCONFIG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/bip/src/BIPCapabilityHandler.cpp --- a/localconnectivityservice/obexreceiveservices/bip/src/BIPCapabilityHandler.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +0,0 @@ -/* -* Copyright (c) 2002 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: Implementation of CBIPCapabilityHandler -* -*/ - - -// INCLUDE FILES -#include "BIPCapabilityHandler.h" -#include "BIPXMLWriter.h" -#include - -// CONSTANTS -_LIT8( KBIPXmlImagePixel, "\" pixel=\"0*0-65535*65535\""); -_LIT8( KBIPXmlImageMaxSize, " maxsize=\"50000000\""); - -const TInt KBIPMaxTypeLenght = 256; -const TInt KBIPMaxAttrLength = 32; - -// MODULE DATA STRUCTURES - -// ================= MEMBER FUNCTIONS ======================= - -// ----------------------------------------------------------------------------- -// NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBIPCapabilityHandler* CBIPCapabilityHandler::NewL() - { - TRACE_FUNC_ENTRY - CBIPCapabilityHandler* self = new ( ELeave ) CBIPCapabilityHandler(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(self); - return( self ); - } - -// --------------------------------------------------------- -// CBIPCapabilityHandler() -// --------------------------------------------------------- -// -CBIPCapabilityHandler::CBIPCapabilityHandler() - { - TRACE_FUNC_ENTRY - } - -// --------------------------------------------------------- -// CreateCapabilityObjectL() -// --------------------------------------------------------- -// -void CBIPCapabilityHandler::CreateCapabilityObjectL( TFileName& aFileName ) - { - TRACE_FUNC_ENTRY - iBIPXmlWriter = CBIPXmlWriter::NewL(); - iBIPXmlWriter->OpenXmlDocumentL( aFileName ); - SupportedImageTypesL(); - TBufC8 pixelRange( KBIPXmlImagePixel ); - TBufC8 maxSize( KBIPXmlImageMaxSize ); - TBufC8 encoding; - for( TInt index = 0; index < iImageTypeArray->Count(); index++ ) - { - encoding = iImageTypeArray->MdcaPoint( index ); - iBIPXmlWriter->OpenXmlElementL( EImageFormats ); - iBIPXmlWriter->AddXmlAttributeL( EEncoding, encoding ); - iBIPXmlWriter->AddXmlAttributeL( EPixel, pixelRange ); - iBIPXmlWriter->AddXmlAttributeL( EMaxSize, maxSize ); - iBIPXmlWriter->CloseXmlElementL(); - } - iBIPXmlWriter->CloseXmlDocumentL(); - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------- -// SupportedImageTypesL() -// --------------------------------------------------------- -// -void CBIPCapabilityHandler::SupportedImageTypesL( ) - { - TRACE_FUNC_ENTRY - TInt retVal = KErrNone; - RFileExtensionMIMETypeArray theFileExtensionArray; - iImageTypeArray->Reset(); - - TRAP( retVal, CImageDecoder::GetFileTypesL( theFileExtensionArray ) ); - if( retVal != KErrNone ) - { - theFileExtensionArray.ResetAndDestroy(); - User::Leave( retVal ); - } - - HBufC8* name = HBufC8::NewLC( KBIPMaxTypeLenght ); - for( TInt index = 0; index < theFileExtensionArray.Count(); index++ ) - { - CFileExtensionMIMEType& fileExtAndMIMEType = *theFileExtensionArray[index]; - name->Des().Copy( fileExtAndMIMEType.DisplayName() ); - - TInt dummy; - retVal = iImageTypeArray->Find( name->Des(), dummy ); - if( retVal != KErrNone ) - { - iImageTypeArray->AppendL( name->Des() ); - } - name->Des().Zero(); - } - CleanupStack::PopAndDestroy(name); - - theFileExtensionArray.ResetAndDestroy(); - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------- -// ConstructL() -// --------------------------------------------------------- -// -void CBIPCapabilityHandler::ConstructL() - { - TRACE_FUNC_ENTRY - iImageTypeArray = new (ELeave) CDesC8ArrayFlat(1); - } - -// --------------------------------------------------------- -// ~CBIPCapabilityHandler() -// --------------------------------------------------------- -// -CBIPCapabilityHandler::~CBIPCapabilityHandler() - { - TRACE_FUNC - delete iBIPXmlWriter; - delete iImageTypeArray; - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/bip/src/BIPController.cpp --- a/localconnectivityservice/obexreceiveservices/bip/src/BIPController.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,903 +0,0 @@ -/* -* Copyright (c) 2007 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 Server image receiver module implementation -* -*/ - - -// INCLUDE FILES -#include // AVKON components -#include "BIPController.h" -#include "BIPCapabilityHandler.h" -#include "BIPImageHandler.h" - - -#include -#include // Series 60 localisation stringloader -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "debug.h" - -// CONSTANTS -_LIT8(KBipCapabilityType, "x-bt/img-capabilities\0"); - - -const TInt KBufferSize = 0x10000; // 64 kB - -// ================= MEMBER FUNCTIONS ======================= - -CBIPController* CBIPController::NewL() - { - CBIPController* self = new ( ELeave ) CBIPController(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------- -// CBIPController() -// --------------------------------------------------------- -// -CBIPController::CBIPController() - { - } - -// --------------------------------------------------------- -// ConstructL() -// --------------------------------------------------------- -// -void CBIPController::ConstructL() - { - TRACE_FUNC_ENTRY - iBIPImageHandler = CBIPImageHandler::NewL(); - iLowMemoryActiveCDrive = CObexUtilsPropertyNotifier::NewL(this, ECheckPhoneMemory); - iLowMemoryActiveMMC = CObexUtilsPropertyNotifier::NewL(this, ECheckMMCMemory); - iDevMan = CBTEngDevMan::NewL(this); - iResultArray = new(ELeave) CBTDeviceArray(1); - // Get default folder from CenRep - TObexUtilsMessageHandler::GetCenRepKeyStringValueL(KCRUidBluetoothEngine, KLCReceiveFolder, iCenRepFolder); - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------- -// ~CBIPController() -// --------------------------------------------------------- -// -CBIPController::~CBIPController() - { - TRACE_FUNC_ENTRY - delete iGetObject; - delete iBIPCapabilityHandler; - delete iBIPImageHandler; - delete iLowMemoryActiveCDrive; - delete iLowMemoryActiveMMC; - delete iBuf; - delete iProgressDialog; - delete iWaitDialog; - delete iBTObject; - delete iDevMan; - if (iResultArray) - { - iResultArray->ResetAndDestroy(); - delete iResultArray; - } - iFs.Close(); - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------- -// ErrorIndication() -// --------------------------------------------------------- -// -void CBIPController::ErrorIndication(TInt TRACE_ONLY(aError)) - { - TRACE_FUNC_ENTRY - TRACE_ERROR((_L("[obexreceiveservicebip] CBIPController: ErrorIndication error:\t %d"), aError)); - HandleError(EFalse); // false because this is not an explicit abort - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------- -// AbortIndication() -// --------------------------------------------------------- -// -void CBIPController::AbortIndication() - { - TRACE_FUNC_ENTRY - HandleError(ETrue); // true because this is an explicit abort - TRACE_FUNC_EXIT - } - -void CBIPController::HandleError(TBool aAbort) - { - TRACE_FUNC_ENTRY - - if( iBTTransferState == ETransferPut || (!aAbort && iBTTransferState == ETransferPutDiskError) ) - { - if(iBTObject) - { - iBTObject->Reset(); - } - CancelTransfer(); - TRAP_IGNORE(TObexUtilsUiLayer::ShowGlobalConfirmationQueryL( R_BT_FAILED_TO_RECEIVE)); - } - delete iBuf; - iBuf = NULL; - - iBTTransferState = ETransferIdle; - TRAP_IGNORE(TObexUtilsMessageHandler::RemoveInboxEntriesL(iBTObject,iMsvIdParent)); - TRAP_IGNORE(TObexUtilsMessageHandler::RemoveTemporaryRFileL(iFullPathFilename)); - - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------- -// CancelTransfer() -// --------------------------------------------------------- -// -void CBIPController::CancelTransfer() - { - TRACE_FUNC_ENTRY - CloseReceivingIndicator(); - if(iBTTransferState == ETransferPut) - { - iBTTransferState = ETransferPutCancel; - } - else // go to idle for all other states - { - iBTTransferState = ETransferIdle; - } - } -// --------------------------------------------------------- -// TransportUpIndication() -// --------------------------------------------------------- -// -void CBIPController::TransportUpIndication() - { - TRACE_FUNC - if (!iFs.Handle()) - { - TRACE_INFO( (_L( "[bipreceiveservice] TransportUpIndication iFs.Connect()" )) ); - if (iFs.Connect()) // error value not checked, iFs.Handle() checked one more time before first useage - { - TRACE_INFO( (_L( "[bipreceiveservice] TransportUpIndication iFs.Connect() failed" )) ); - } - } - - iFile = RFile(); - iFullPathFilename.Zero(); - iCapabilityFileName.Zero(); - } - -// --------------------------------------------------------- -// ObexConnectIndication() -// --------------------------------------------------------- -// -TInt CBIPController::ObexConnectIndication( const TObexConnectInfo& /*aRemoteInfo*/, const TDesC8& /*aInfo*/ ) - { - TRACE_FUNC - - // Get remote device socket address and bluetooth name - // Remote bluetooth name will be displayed in the new message in inbox. - // - TSockAddr addr; - iBTObexServer->RemoteAddr(addr); - TBTDevAddr tBTDevAddr = static_cast(addr).BTAddr(); - - TBTRegistrySearch nameSearch; - nameSearch.FindAddress(tBTDevAddr); - - iResultArray->Reset(); - // Ignore any errors here, if we don't get the name, we don't get the name. - // It is also possible that the name is received too late.... - static_cast(iDevMan->GetDevices(nameSearch, iResultArray)); - - return KErrNone; - } - -// --------------------------------------------------------- -// ObexDisconnectIndication() -// --------------------------------------------------------- -// -void CBIPController::ObexDisconnectIndication(const TDesC8& /*aInfo*/) - { - TRACE_FUNC - } - -// --------------------------------------------------------- -// TransportDownIndication() -// --------------------------------------------------------- -// -void CBIPController::TransportDownIndication() - { - TRACE_FUNC - // Remove receiving buffer and files used during file receiving. - // - delete iBTObject; - iBTObject = NULL; - TRAP_IGNORE(TObexUtilsMessageHandler::RemoveTemporaryRFileL (iFullPathFilename)); - iFs.Close(); - } - -// --------------------------------------------------------- -// PutRequestIndication() -// --------------------------------------------------------- -// -CObexBufObject* CBIPController::PutRequestIndication() - { - TRACE_FUNC_ENTRY - iLengthHeaderReceived = EFalse; // New put request so clear header based state - iBTTransferState = ETransferPut; - - // Checking if backup is running now - if backup process is active, then we - // need to cancel transfer - otherwise phone will freeze during receiving - // data - if ( TObexUtilsUiLayer::IsBackupRunning() ) - { - TRACE_INFO ( _L ("Backup in progress! Canceling incoming transfer.")); - iBTTransferState = ETransferPutInitError; - return NULL; - } - - TRAPD(err, HandlePutImageRequestL()); - if (err == KErrNone) - { - return iBTObject; - } - if (iBTTransferState != ETransferPutInitError) - { - iBTTransferState = ETransferPutDiskError; - } - TRACE_FUNC_EXIT - return NULL; - } - -// --------------------------------------------------------- -// PutPacketIndication() -// --------------------------------------------------------- -// -TInt CBIPController::PutPacketIndication() - { - TRACE_FUNC_ENTRY - if(iBTTransferState == ETransferPutCancel) - { - // User cancelled the put request, so error the next packet to terminate the put request. - // BIP considers the Unauthorized error response suitable for this... - HandleError(ETrue); // reset state and clear up - return KErrIrObexRespUnauthorized; - } - - if (iBTObject) - { - if(iBTTransferState == ETransferPutDiskError) - { - return KErrDiskFull; - } - - if(iBTObject->Name().Length() > KMaxFileName) - { - TRACE_INFO( _L( "[oppreceiveservice] COPPController: PutPacketIndication truncating name of file being received\t" ) ); - TRAPD(err, iBTObject->SetNameL(iBTObject->Name().Left(KMaxFileName))); - if(err != KErrNone) - { - return KErrAccessDenied; - } - } - iReceivingFileName = iBTObject->Name(); // get name of receiving file - iTotalSizeByte = iBTObject->Length(); // get size of receiving file - - // Check that capacity is suitable as soon as possible - if(!iLengthHeaderReceived && iTotalSizeByte > 0) - { - iLengthHeaderReceived = ETrue; // total size value is from length header - TBool capacity = ETrue; - TRAPD(retTrap, capacity = CheckCapacityL()); - if(retTrap != KErrNone) - { - return KErrGeneral; - } - if(!capacity) - { - TRAP_IGNORE(TObexUtilsUiLayer::ShowGlobalConfirmationQueryL(R_OUT_OF_MEMORY)); - return KErrDiskFull; - } - } - - - // successfully received put packet if we reached here - iBTTransferState = ETransferPut; - - // Now we need to either create (in the first instance) or update the dialog on the UI. - if(ReceivingIndicatorActive()) - { - UpdateReceivingIndicator(); - } - else if(!iNoteDisplayed) - { - // No note launched yet, so try to launch - TRAPD(err, LaunchReceivingIndicatorL()); - iNoteDisplayed = (err == KErrNone); - } - } - - TRACE_FUNC_EXIT - return KErrNone; - } - -// --------------------------------------------------------- -// PutCompleteIndication() -// --------------------------------------------------------- -// -TInt CBIPController::PutCompleteIndication() // Once receive has completed. - { - TRACE_FUNC_ENTRY - TInt retVal = KErrNone; - if(iBTTransferState == ETransferPutCancel) - { - retVal = KErrIrObexRespUnauthorized; - HandleError(ETrue); - } - else - { - retVal = HandlePutCompleteIndication(); - iBTTransferState = ETransferIdle; - CloseReceivingIndicator(); - } - TRACE_FUNC_EXIT - return retVal; - } - -// --------------------------------------------------------- -// GetRequestIndication() -// --------------------------------------------------------- -// -CObexBufObject* CBIPController::GetRequestIndication( CObexBaseObject* aRequiredObject ) - { - TRACE_FUNC_ENTRY - iBTTransferState = ETransferGet; - TInt err = RemoveCapabilityObject(); - if (err == KErrNone) - { - if( aRequiredObject->Type() == KBipCapabilityType ) - { - TRAP( err, HandleGetCapabilityRequestL( ) ); - if( err == KErrNone ) - { - return iGetObject; - } - } - } - TRACE_FUNC_EXIT - return NULL; - } - -// --------------------------------------------------------- -// GetPacketIndication() -// --------------------------------------------------------- -// -TInt CBIPController::GetPacketIndication() - { - TRACE_FUNC_ENTRY - return KErrNone; - } - -// --------------------------------------------------------- -// GetCompleteIndication() -// --------------------------------------------------------- -// -TInt CBIPController::GetCompleteIndication() - { - TRACE_FUNC_ENTRY - delete iGetObject; - iGetObject=NULL; - TInt err = RemoveCapabilityObject(); - if (err != KErrNone) - { - err = KErrGeneral; - } - iBTTransferState = ETransferIdle; - TRACE_FUNC_EXIT - return err; - } - -// --------------------------------------------------------- -// SetPathIndication() -// --------------------------------------------------------- -// -TInt CBIPController::SetPathIndication( const CObex::TSetPathInfo& /*aPathInfo*/, - const TDesC8& /*aInfo*/) - { - TRACE_FUNC - // SetPath is not implemented in BIP - so following IrOBEX guidance, return - // the Forbidden response code. - return KErrIrObexRespForbidden; - } - -/** -* This function is implementation for mixin-class for Obexutils. -* It is called every time another instance modifies disk status, -* for example when it cross warning/critical level. -* Parameters: -* @param aCheckType Disktype changes. -*/ -void CBIPController::HandleNotifyL(TMemoryPropertyCheckType aCheckType) - { - TRACE_FUNC_ENTRY - // Only interested on this notification if we are receiving something - if ( iBTTransferState == ETransferPut ) - { - // Check the keys, what has been changed. - if ( aCheckType == ECheckPhoneMemory ) - { - if ( SysUtil::FFSSpaceBelowCriticalLevelL( NULL, 0 ) ) - { - TRACE_INFO( _L( "[obexreceiveservicebip] CBIPController: Obex Server error diskfull:\t" ) ); - iBTTransferState = ETransferPutDiskError; - } - } - else if ( aCheckType == ECheckMMCMemory ) - { - if ( SysUtil::MMCSpaceBelowCriticalLevelL( NULL, 0 ) ) - { - TRACE_INFO( _L( "[obexreceiveservicebip] CBIPController: Obex Server error diskfull:\t" ) ); - iBTTransferState = ETransferPutDiskError; - } - } - } - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------- -// HandleGetCapabilityRequestL() -// --------------------------------------------------------- -// -void CBIPController::HandleGetCapabilityRequestL() - { - TRACE_FUNC_ENTRY - CBIPCapabilityHandler* capHandler = CBIPCapabilityHandler::NewL(); - CleanupStack::PushL(capHandler); - capHandler->CreateCapabilityObjectL(iCapabilityFileName); - delete iGetObject; - iGetObject = NULL; - iGetObject = CObexBufObject::NewL(NULL); - iGetObject->SetDataBufL(iCapabilityFileName); - CleanupStack::PopAndDestroy(capHandler); - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------- -// HandlePutImageRequest() -// --------------------------------------------------------- -// -void CBIPController::HandlePutImageRequestL() - { - TRACE_FUNC_ENTRY - - delete iBTObject; - iBTObject = NULL; - - if (!iFs.Handle()) - { - User::Leave(KErrGeneral); - } - - // Assign an initial value to iDrive - iDrive = GetDriveWithMaximumFreeSpaceL(); - - // If iDrive is at critical space level, we immediately show out_of_memory. - // - if (SysUtil::DiskSpaceBelowCriticalLevelL(&iFs, 0, iDrive)) - { - TRAP_IGNORE(TObexUtilsUiLayer::ShowGlobalConfirmationQueryL(R_OUT_OF_MEMORY)); - User::Leave(KErrGeneral); - } - - iBTObject = CObexBufObject::NewL(NULL); - - delete iBuf; - iBuf = NULL; - - TChar driveLetter; - iDefaultFolder.Zero(); - iFs.DriveToChar(iDrive, driveLetter); - iDefaultFolder.Append(driveLetter); - if ( iDrive == EDriveC ) - { - iDefaultFolder.Append(_L(":\\data\\")); - } - else - { - iDefaultFolder.Append(_L(":\\")); - } - - iDefaultFolder.Append(iCenRepFolder); - - iFile = RFile(); - iFullPathFilename.Zero(); - TObexUtilsMessageHandler::CreateReceiveBufferAndRFileL(iFile, iDefaultFolder, iFullPathFilename, iBuf, KBufferSize); - User::LeaveIfError(iFile.Open(iFs, iFullPathFilename, EFileWrite)); - TObexRFileBackedBuffer bufferdetails(*iBuf, iFile, CObexBufObject::EDoubleBuffering); - TRAPD(err, iBTObject->SetDataBufL(bufferdetails)); - if (err != KErrNone) - { - iBTTransferState = ETransferPutInitError; - User::Leave(KErrGeneral); - } - - TRACE_FUNC_EXIT - } - - -// --------------------------------------------------------- -// HandlePutCompleteIndication() -// --------------------------------------------------------- -// -TInt CBIPController::HandlePutCompleteIndication() - { - TRACE_FUNC_ENTRY - TInt retVal = KErrNone; - - iDefaultFolder.Zero(); - TChar driveLetter; - if ( iDrive == EDriveC ) - { - iFs.DriveToChar(iDrive, driveLetter); - iDefaultFolder.Append(driveLetter); - iDefaultFolder.Append(_L(":\\data\\")); - iDefaultFolder.Append(iCenRepFolder); - } - else - { - iFs.DriveToChar(iDrive, driveLetter); - iDefaultFolder.Append(driveLetter); - iDefaultFolder.Append(_L(":\\")); - iDefaultFolder.Append(iCenRepFolder); - } - - iFullPathFilename.Zero(); - iFullPathFilename.Append(iDefaultFolder); - TRAP ( retVal, TObexUtilsMessageHandler::SaveFileToFileSystemL(iBTObject, - KUidMsgTypeBt, - iMsvIdParent, - iFullPathFilename, - iFile, - iRemoteDeviceName)); - if ( retVal == KErrNone) - { - TRAP (retVal, TObexUtilsMessageHandler::AddEntryToInboxL(iMsvIdParent, iFullPathFilename)); - } - - - if( retVal != KErrNone ) - { - TRACE_ERROR((_L( "[obexreceiveservicebip] CBIPController: HandlePutCompleteIndication error:\t %d" ), retVal ) ); - TRAP( retVal, TObexUtilsMessageHandler::RemoveInboxEntriesL(iBTObject, iMsvIdParent)); - retVal = KErrDiskFull; - } - // Even if the object saving fails we must return image handle with error code - TRAP_IGNORE( iBIPImageHandler->AddImageHandleHeaderL( iBTObexServer ) ); - TRACE_INFO( _L( "[obexreceiveservicebip] HandlePutCompleteIndication Done\t" ) ); - delete iBTObject; - iBTObject = NULL; - delete iBuf; - iBuf = NULL; - iPreviousDefaultFolder = iDefaultFolder; // save the last file path where file is successfully saved to file system. - iMsvIdParent = KMsvNullIndexEntryId; - TRACE_FUNC_EXIT - return retVal; - } -// --------------------------------------------------------- -// RemoveCapabilityObject() -// --------------------------------------------------------- -// -TInt CBIPController::RemoveCapabilityObject() - { - TRACE_FUNC_ENTRY - if ( (iCapabilityFileName.Compare(KNullDesC)) == 0 ) - { - return KErrNone; - } - if ( !iFs.Handle() ) - { - TRACE_INFO( (_L( "[bipreceiveservice] RemoveCapabilityObject return" )) ); - return KErrGeneral; - } - iFs.Delete(iCapabilityFileName); - iCapabilityFileName=KNullDesC; - TRACE_FUNC_EXIT - return KErrNone; - } - -// --------------------------------------------------------- -// CheckCapacity() -// --------------------------------------------------------- -// -TBool CBIPController::CheckCapacityL() - { - TRACE_FUNC_ENTRY - - iDrive = EDriveZ; // Intialize iDrive to Z - TInt filesize = iBTObject->Length(); - - TInt mmcDrive = KDefaultDrive; // External memory card - TInt imsDrive = KDefaultDrive; // Internal mass storage - - User::LeaveIfError(DriveInfo::GetDefaultDrive(DriveInfo::EDefaultMassStorage, imsDrive)); - User::LeaveIfError(DriveInfo::GetDefaultDrive(DriveInfo::EDefaultRemovableMassStorage, mmcDrive)); - - TRACE_INFO( (_L( "[oppreceiveservice] CheckCapacityL imsDrive=%d; mmcDrive=%d\t" ),imsDrive, mmcDrive ) ); - - TVolumeInfo volumeInfo; - TInt err = iFs.Volume(volumeInfo, imsDrive); - - // If err != KErrNone, Drive is not available. - // - if ( !err ) - { - // Check capacity on Internal mass storage - TRACE_INFO( (_L( "[obexreceiveservicebip] CheckCapacityL Internal mass storage \t" )) ); - if ( !SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, filesize, imsDrive ) ) - { - iDrive = imsDrive; - } - } - if ( iDrive == EDriveZ ) - { - err = iFs.Volume(volumeInfo, mmcDrive); - if ( !err ) - { - // Check capacity on memory card - TRACE_INFO( (_L( "[obexreceiveservicebip] CheckCapacityL Checking memory card\t" )) ); - if ( !SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, filesize, mmcDrive ) ) - { - iDrive = mmcDrive; - } - } - } - if ( iDrive == EDriveZ ) - { - TRACE_INFO( (_L( "[obexreceiveservicebip] CheckCapacityL Checking phone memory\t" )) ); - // Phone memory - if( !SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, filesize, EDriveC )) - { - iDrive = EDriveC; - } - } - - TRACE_INFO( (_L( "[obexreceiveservicebip] CheckCapacityL iDrive = %d\t" ),iDrive ) ); - TRACE_FUNC_EXIT - - if (iDrive == EDriveZ) - { - // If there is no free space for receiving file, we need to set iPreviousDefaultFolder back to iDefaultFolder. - // In order to show the file receveing dialog correctly. - iDefaultFolder = iPreviousDefaultFolder; - return EFalse; - } - return ETrue; - } - - -// --------------------------------------------------------- -// IsOBEXActive() -// --------------------------------------------------------- -// -TBool CBIPController::IsOBEXActive() - { - TRACE_FUNC - return ETrue; - } - -// --------------------------------------------------------- -// SetMediaType() -// --------------------------------------------------------- -// -void CBIPController::SetMediaType( TSrcsMediaType __DEBUG_ONLY(aMediaType) ) - { - TRACE_FUNC - // BIP is only for Bluetooth, so that is all we expect - __ASSERT_DEBUG(aMediaType == ESrcsMediaBT, User::Panic(KBipPanicCategory, EBipPanicNotBluetoothMediaType)); - } - -// --------------------------------------------------------- -// SetObexServer() -// --------------------------------------------------------- -// -TInt CBIPController::SetObexServer( CObexServer* aServer) - { - TInt retVal=KErrNone; - if (aServer) - { - iBTObexServer=aServer; - retVal=aServer->Start(this); - } - return retVal; - } - -void CBIPController::LaunchReceivingIndicatorL() - { - if(ReceivingIndicatorActive()) - { - return; - } - - if(iTotalSizeByte > 0) - { - iProgressDialog = CGlobalProgressDialog::NewL(this); - if(iReceivingFileName.Length() > 0) - { - iProgressDialog->ShowProgressDialogNameSizeL(iReceivingFileName, iTotalSizeByte); - } - else - { - iProgressDialog->ShowProgressDialogL(R_BT_RECEIVING_DATA); - } - } - else - { - iWaitDialog = CGlobalDialog::NewL(this); - iWaitDialog->ShowNoteDialogL(R_BT_RECEIVING_DATA, ETrue); - } - } - -void CBIPController::UpdateReceivingIndicator() - { - if(iProgressDialog) - { - iProgressDialog->UpdateProgressDialog(iBTObject->BytesReceived(), iTotalSizeByte); - } - // else we are using a wait note, so no "need" to update - } - -void CBIPController::HandleGlobalProgressDialogL( TInt aSoftkey ) - { - TRACE_FUNC - - if(aSoftkey == EAknSoftkeyCancel) - { - CancelTransfer(); - } - else if(aSoftkey == EAknSoftkeyHide) - { - CloseReceivingIndicator(EFalse); // Don't reset state as only hiding - } - } - -void CBIPController::HandleGlobalNoteDialogL( TInt aSoftkey ) - { - TRACE_FUNC - - if( aSoftkey == EAknSoftkeyCancel ) - { - CancelTransfer(); - } - else if( aSoftkey == EAknSoftkeyHide) - { - CloseReceivingIndicator(EFalse); // Don't reset state as only hiding - } - } - -void CBIPController::CloseReceivingIndicator(TBool aResetDisplayedState) - { - TRACE_FUNC - if(aResetDisplayedState) - { - iNoteDisplayed = EFalse; - } - if(iProgressDialog) - { - iProgressDialog->ProcessFinished(); - delete iProgressDialog; - iProgressDialog = NULL; - } - if(iWaitDialog) - { - iWaitDialog->ProcessFinished(); - delete iWaitDialog; - iWaitDialog = NULL; - } - } - - // --------------------------------------------------------- - // GetDriveWithMaximumFreeSpace() - // --------------------------------------------------------- - // - TInt CBIPController::GetDriveWithMaximumFreeSpaceL() - { - // Get drive with maximum freespace among phone memory, MMC, internal mass storage. - // - TRACE_FUNC - - TVolumeInfo volumeInfoC; - TVolumeInfo volumeInfoE; - TVolumeInfo volumeInfoF; - TInt64 max = 0; - TInt drive = 0; - - TInt err = iFs.Volume(volumeInfoC, EDriveC); - - if ( !err ) - { - // set initial values to max and drive. - max = volumeInfoC.iFree; - drive = EDriveC; - } - - err = iFs.Volume(volumeInfoE, EDriveE); - if ( !err ) - { - if (volumeInfoE.iFree >= max) - { - max = volumeInfoE.iFree; - drive = EDriveE; - } - - } - - err = iFs.Volume(volumeInfoF, EDriveF); - if ( !err ) - { - if (volumeInfoF.iFree >= max) - { - max = volumeInfoF.iFree; - drive = EDriveF; - } - } - max = 0; - return drive; - } - - // ---------------------------------------------------------- - // COPPController::HandleDevManComplete - // Callback from devman - // ---------------------------------------------------------- - // - // - void CBIPController::HandleGetDevicesComplete(TInt aErr, CBTDeviceArray* /*aDeviceArray*/) - { - if ( aErr == KErrNone ) - { - if ( iResultArray->Count()) - { - iRemoteDeviceName.Zero(); - if ( iResultArray->At(0)->FriendlyName().Length() > 0 ) - { - TRACE_INFO( _L( "[CBIPController] HandleGetDevicesComplete: got friendly name \t" ) ); - iRemoteDeviceName.Copy(iResultArray->At(0)->FriendlyName()); - } - else - { - TRACE_INFO( _L( "[CBIPController] HandleGetDevicesComplete: got devciename name \t" ) ); - TRAP_IGNORE(iRemoteDeviceName.Copy(BTDeviceNameConverter::ToUnicodeL(iResultArray->At(0)->DeviceName()))); - } - } - } - } - -//////////////////////////// Global part //////////////////////////// - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/bip/src/BIPImageHandler.cpp --- a/localconnectivityservice/obexreceiveservices/bip/src/BIPImageHandler.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* Copyright (c) 2004 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: Implementation of CBIPImageHandler class -* -*/ - - -#define __OBEX_USER_DEFINED_HEADERS__ - -// INCLUDE FILES -#include "BIPImageHandler.h" -#include - -const TInt KImageHandleWidth=7; - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// AddImageHandleHeaderL() -// --------------------------------------------------------- -// -void CBIPImageHandler::AddImageHandleHeaderL( CObexServer* aObexServer ) - { - TRACE_FUNC_ENTRY - - CObexHeaderSet* currentHeaders = CObexHeaderSet::NewL(); - CleanupStack::PushL( currentHeaders ); // 1. push - - CObexHeader* header = CObexHeader::NewL(); - CleanupStack::PushL( header ); //2. push - - TBuf16 imageHandle; - iImageHandleValue++; - imageHandle.AppendNumFixedWidth( iImageHandleValue, EDecimal, KImageHandleWidth ); - header->SetUnicodeL( 0x30, imageHandle ); - - User::LeaveIfError( currentHeaders->AddHeader( header ) ); - - CleanupStack::Pop( header); - if( aObexServer ) - { - TRACE_INFO( _L( "[MtmUiServerBip] CBIPImageHandler: SetPutFinalResponseHeaders \t" ) ); - User::LeaveIfError( aObexServer->SetPutFinalResponseHeaders( currentHeaders ) ); - CleanupStack::Pop( currentHeaders); - } - else - { - CleanupStack::PopAndDestroy(currentHeaders); - } - - TRACE_FUNC_ENTRY - } - -// --------------------------------------------------------- -// CBIPImageHandler() -// --------------------------------------------------------- -// -CBIPImageHandler::CBIPImageHandler() - { - } - -// --------------------------------------------------------- -// ~CBIPImageHandler() -// --------------------------------------------------------- -// -CBIPImageHandler::~CBIPImageHandler() - { - TRACE_FUNC_ENTRY - } -// --------------------------------------------------------- -// ConstructL() -// --------------------------------------------------------- -// -void CBIPImageHandler::ConstructL() - { - TRACE_FUNC - iImageHandleValue = 0; - } - -// ----------------------------------------------------------------------------- -// NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBIPImageHandler* CBIPImageHandler::NewL() - { - TRACE_FUNC_ENTRY - CBIPImageHandler* self = new ( ELeave ) CBIPImageHandler(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(self); - return( self ); - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/bip/src/BIPXMLWriter.cpp --- a/localconnectivityservice/obexreceiveservices/bip/src/BIPXMLWriter.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +0,0 @@ -/* -* Copyright (c) 2002 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: Implementation of CBIPXMLWriter class -* -*/ - - -// INCLUDE FILES -#include "BIPXMLWriter.h" -#include - - -// CONSTANTS -_LIT8( KBIPXmlDocBegin," " ); -_LIT8( KBIPXmlDocEnd, "" ); -_LIT8( KBIPXmlImageFormatsBegin, ""); -_LIT8( KBIPImageTypes, "JPEGBMPGIFWBMPPNGJPEG2000" ); -_LIT8( KBIPUserSeries60, "USR-SERIES60-" ); - -const TInt KBIPImageTypesLength = 30; -// ================= MEMBER FUNCTIONS ======================= - -// ----------------------------------------------------------------------------- -// NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBIPXmlWriter* CBIPXmlWriter::NewL() - { - TRACE_FUNC - CBIPXmlWriter* self = new ( ELeave ) CBIPXmlWriter(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(self); - return( self ); - } - -// --------------------------------------------------------- -// CBIPXmlWriter() -// --------------------------------------------------------- -// -CBIPXmlWriter::CBIPXmlWriter() - { - } - -// --------------------------------------------------------- -// OpenXmlDocumentL() -// --------------------------------------------------------- -// -void CBIPXmlWriter::OpenXmlDocumentL( TFileName& aFileName ) - { - TRACE_FUNC - User::LeaveIfError( iFileSession.Connect() ); - TPath tempPath; - TInt drive = TObexUtilsMessageHandler::GetMessageCentreDriveL(); - TDriveUnit driveString (drive); - User::LeaveIfError(iFileSession.CreatePrivatePath( drive )); - User::LeaveIfError(iFileSession.PrivatePath(tempPath)); - User::LeaveIfError(ifile.Temp( iFileSession, tempPath, aFileName, EFileWrite )); - User::LeaveIfError( ifile.Write( KBIPXmlDocBegin ) ); - } - -// --------------------------------------------------------- -// CloseXmlDocumentL() -// --------------------------------------------------------- -// -void CBIPXmlWriter::CloseXmlDocumentL() - { - TRACE_FUNC - User::LeaveIfError( ifile.Write( KBIPXmlDocEnd ) ); - User::LeaveIfError( ifile.Flush() ); - ifile.Close(); - iFileSession.Close(); - } - -// --------------------------------------------------------- -// OpenXmlElementL() -// --------------------------------------------------------- -// -void CBIPXmlWriter::OpenXmlElementL( TElementType aElement ) - { - switch( aElement ) - { - case EImageFormats: - { - User::LeaveIfError( ifile.Write( KBIPXmlImageFormatsBegin ) ); - break; - } - case EPreferredFormat: - { - break; - } - case EAttachmentFormats: - { - break; - } - case EFilteringParameters: - { - break; - } - case EDPOFOptions: - { - break; - } - default: - { - } - } - TRACE_FUNC - } - -// --------------------------------------------------------- -// AddXmlAttributeL() -// --------------------------------------------------------- -// -void CBIPXmlWriter::AddXmlAttributeL( TAttributeType aAttributeType, TDesC8& aAttr ) - { - TRACE_FUNC_ENTRY - TBuf8 attribute = KBIPImageTypes(); - switch( aAttributeType ) - { - case EEncoding: - { - if( attribute.Find( aAttr ) == KErrNotFound ) - { - User::LeaveIfError( ifile.Write( KBIPUserSeries60 ) ); - User::LeaveIfError( ifile.Write( aAttr ) ); - - } - else - { - User::LeaveIfError( ifile.Write( aAttr ) ); - } - break; - } - case EPixel: - { - User::LeaveIfError( ifile.Write( aAttr ) ); - break; - } - case EMaxSize: - { - User::LeaveIfError( ifile.Write( aAttr ) ); - break; - } - case ETransformation: - { - break; - } - default: - { - } - } - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------- -// CloseXmlElementL() -// --------------------------------------------------------- -// -void CBIPXmlWriter::CloseXmlElementL() - { - TRACE_FUNC - User::LeaveIfError( ifile.Write( KBIPXmlImageFormatsEnd ) ); - } - -// --------------------------------------------------------- -// ConstructL() -// --------------------------------------------------------- -// -void CBIPXmlWriter::ConstructL() - { - TRACE_FUNC - } - -// --------------------------------------------------------- -// ~CBIPXmlWriter() -// --------------------------------------------------------- -// -CBIPXmlWriter::~CBIPXmlWriter() - { - TRACE_FUNC - ifile.Close(); - iFileSession.Close(); - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/bip/src/obexservicebip.cpp --- a/localconnectivityservice/obexreceiveservices/bip/src/obexservicebip.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +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: Export ECom interface implementations -* -*/ - - -#include -#include "BIPController.h" - -// --------------------------------------------------------------------------- -// An array of TImplementationProxy objects which onnect each -// implemeation with its instantiation function -// --------------------------------------------------------------------------- -// -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY(0x101F8671, CBIPController::NewL) - }; - -// --------------------------------------------------------------------------- -// Exported proxy function to resolve instantiation methods for an Ecom plug-in DLL -// --------------------------------------------------------------------------- -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - return ImplementationTable; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/group/bld.inf --- a/localconnectivityservice/obexreceiveservices/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This file provides the information required for building the -* whole of a obexreceiveservices. -* -*/ - - -#include - -PRJ_EXPORTS - -../rom/mtmuibluetooth.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mtmuibluetooth.iby) -../rom/mtmuiinfrared.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mtmuiinfrared.iby) -../rom/obexservicebip.iby CORE_MW_LAYER_IBY_EXPORT_PATH(obexservicebip.iby) -../rom/obexserviceopp.iby CORE_MW_LAYER_IBY_EXPORT_PATH(obexserviceopp.iby) -../rom/mtmuibluetoothresources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(mtmuibluetoothresources.iby) -../rom/mtmuiinfraredResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(mtmuiinfraredResources.iby) - -#include "../mtmuibluetooth/group/bld.inf" -#include "../mtmuiinfrared/group/bld.inf" -#include "../opp/group/bld.inf" -#include "../bip/group/bld.inf" - - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuibluetooth/bmarm/BTMTMUIU.DEF --- a/localconnectivityservice/obexreceiveservices/mtmuibluetooth/bmarm/BTMTMUIU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -EXPORTS - NewBtMtmUiDataLayerL__FR17CRegisteredMtmDll @ 1 NONAME R3UNUSED ; NewBtMtmUiDataLayerL(CRegisteredMtmDll &) - NewBtMtmUiL__FR8CBaseMtmR17CRegisteredMtmDll @ 2 NONAME R3UNUSED ; NewBtMtmUiL(CBaseMtm &, CRegisteredMtmDll &) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuibluetooth/bwins/BTMTMUIU.DEF --- a/localconnectivityservice/obexreceiveservices/mtmuibluetooth/bwins/BTMTMUIU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -EXPORTS - ?NewBtMtmUiDataLayerL@@YAPAVCBaseMtmUiData@@AAVCRegisteredMtmDll@@@Z @ 1 NONAME ; class CBaseMtmUiData * __cdecl NewBtMtmUiDataLayerL(class CRegisteredMtmDll &) - ?NewBtMtmUiL@@YAPAVCBaseMtmUi@@AAVCBaseMtm@@AAVCRegisteredMtmDll@@@Z @ 2 NONAME ; class CBaseMtmUi * __cdecl NewBtMtmUiL(class CBaseMtm &,class CRegisteredMtmDll &) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuibluetooth/data/btmtmui.rss --- a/localconnectivityservice/obexreceiveservices/mtmuibluetooth/data/btmtmui.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This file contains btmtmui resource. Entry points to Mtm. -* -* -*/ - - -// INCLUDES -#include -#include - -// RESOURCE DEFINITIONS -// --------------------------------------------------------- -// -// -// MTM info resource for Bt -// -// --------------------------------------------------------- -// - - - -#include - -RESOURCE MTM_INFO_FILE - { - mtm_type_uid = 0x10009ED5; - technology_type_uid = 0x10009ED6; - components = - { - MTM_COMPONENT_V2 - { - human_readable_name = qtn_query_send_via_bt; - component_uid = KUidMtmServerComponentVal; - entry_point = 1; - version = VERSION_V2 {}; - filename = "BtsMtm.dll"; - }, - MTM_COMPONENT_V2 - { - human_readable_name = qtn_query_send_via_bt; - component_uid = KUidMtmClientComponentVal; - entry_point = 1; - version = VERSION_V2 {}; - filename = "BtcMtm.dll"; - }, - MTM_COMPONENT_V2 - { - human_readable_name = qtn_query_send_via_bt; - component_uid = KUidMtmUiComponentVal; - entry_point = 2; - version = VERSION_V2 {}; - filename = "BtMtmUi.dll"; - }, - MTM_COMPONENT_V2 - { - human_readable_name = qtn_query_send_via_bt; - component_uid = KUidMtmUiDataComponentVal; - entry_point = 1; - version = VERSION_V2 {}; - filename = "BtMtmUi.dll"; - } - }; - } - - -RESOURCE MTM_CAPABILITIES - { - send_capability = 1; - body_capability = 1; - } - -RESOURCE MTM_SECURITY_CAPABILITY_SET - { - capabilities = { ECapabilityLocalServices }; - } - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuibluetooth/eabi/btmtmuiU.DEF --- a/localconnectivityservice/obexreceiveservices/mtmuibluetooth/eabi/btmtmuiU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -EXPORTS - _Z20NewBtMtmUiDataLayerLR17CRegisteredMtmDll @ 1 NONAME - _Z11NewBtMtmUiLR8CBaseMtmR17CRegisteredMtmDll @ 2 NONAME - _ZTI12CBtMtmUiData @ 3 NONAME ; ## - _ZTI8CBtMtmUi @ 4 NONAME ; ## - _ZTV12CBtMtmUiData @ 5 NONAME ; ## - _ZTV8CBtMtmUi @ 6 NONAME ; ## - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuibluetooth/group/BtRegistry.mk --- a/localconnectivityservice/obexreceiveservices/mtmuibluetooth/group/BtRegistry.mk Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -# -# Copyright (c) 2009 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 resource files -# - -SOURCEDIR=..\group -LANGUAGE=sc - -# -# Target directory -# - -ifeq (WINS,$(findstring WINS, $(PLATFORM))) -TARGETDIR=$(EPOCROOT)Epoc32\Release\$(PLATFORM)\$(CFG)\Z\System\Mtm -else -TARGETDIR=$(EPOCROOT)Epoc32\Data\Z\System\Mtm -endif - -$(TARGETDIR) : - @perl $(EPOCROOT)epoc32\tools\emkdir.pl $(TARGETDIR) - -# -# Build the mtm resource files -# - -PROJECT=BTMTMU -SOURCERESOURCE=$(SOURCEDIR)\$(PROJECT)Registry.rss -TARGETRESOURCE=$(TARGETDIR)\$(PROJECT).r$(LANGUAGE) -$(TARGETRESOURCE) : $(TARGETDIR) $(SOURCERESOURCE) - @copy $(SOURCERESOURCE) $(TARGETDIR)\$(PROJECT).rss - @epocrc.bat -u -I. -I%EPOCROOT%s60\btmtmui\group -I%EPOCROOT%epoc32\include $(TARGETDIR)\$(PROJECT).rss -o$(TARGETRESOURCE) - @del $(TARGETDIR)\$(PROJECT).rss - -do_nothing: - rem do nothing - -# -# The targets invoked by abld -# - -MAKMAKE : do_nothing - -RESOURCE : $(TARGETRESOURCE) - -SAVESPACE : BLD - -BLD : do_nothing - -FREEZE : do_nothing - -LIB : do_nothing - -CLEANLIB : do_nothing - -FINAL : do_nothing - -CLEAN : - @erase $(TARGETRESOURCE) - -RELEASABLES : - @echo $(TARGETRESOURCE) diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuibluetooth/group/bld.inf --- a/localconnectivityservice/obexreceiveservices/mtmuibluetooth/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This file provides the information required for building the -* whole of a BTMTMUI. -* -*/ - - -PRJ_PLATFORMS - - -PRJ_EXPORTS - -PRJ_MMPFILES -../group/btmtmui.mmp - - - - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuibluetooth/group/btmtmui.mmp --- a/localconnectivityservice/obexreceiveservices/mtmuibluetooth/group/btmtmui.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This is project specification file for the BtMtmUi. -* -* -*/ - - -#include -#include - -TARGET btmtmui.dll -TARGETTYPE dll -TARGETPATH SHARED_LIB_DIR -UID 0x10004845 0x101F8634 -CAPABILITY CAP_GENERAL_DLL -VENDORID VID_DEFAULT - -SOURCEPATH ../data -START RESOURCE btmtmui.rss -TARGETPATH MTM_INFO_FILE_DIR -HEADER -LANGUAGE_IDS -END - -SOURCEPATH ../src -USERINCLUDE ../inc -SYSTEMINCLUDE ../../../inc ../../../../inc -APP_LAYER_SYSTEMINCLUDE - -SOURCE btmtmuidll.cpp -SOURCE btmtmuidata.cpp -SOURCE btmtmui.cpp - -LIBRARY obexutils.lib -LIBRARY euser.lib -LIBRARY msgs.lib -LIBRARY mtur.lib -LIBRARY muiu.lib -LIBRARY bluetooth.lib -LIBRARY btdevice.lib -LIBRARY btengdiscovery.lib -DEBUGLIBRARY flogger.lib - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuibluetooth/inc/btmtmui.h --- a/localconnectivityservice/obexreceiveservices/mtmuibluetooth/inc/btmtmui.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,448 +0,0 @@ -/* -* Copyright (c) 2002 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: -* Contains Bluetooth MTM Ui part. -* -* -*/ - - -#ifndef CBTMTMUI_H -#define CBTMTMUI_H - -// INCLUDES -#include -#include -#include - -#include - -const TUint KBTSdpObjectPush = 0x1105; - -// FORWARD DECLARATIONS -class CClientMtmRegistry; - -/** -* CBtMtmUi -* Bluetooth messaging UI Module. -*/ -class CBtMtmUi : public CBaseMtmUi, public MBTEngSdpResultReceiver - { - public: // Constructors and destructor - /** - * Two-phased constructor. - */ - static CBtMtmUi* NewL( CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll ); - - /** - * Destructor. - */ - virtual ~CBtMtmUi(); - - - public: // Functions from base classes - - /** - * From CBaseMtmUi Entry Creation. - * @param aEntry reference to entry - * @param aParent parent entry - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* CreateL( - const TMsvEntry& aEntry, - CMsvEntry& aParent, - TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Open entry. - * @param aStatus Status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* OpenL( TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Close entry. - * @param aStatus Status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* CloseL( TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Launches editor/settings dialog as appropriate. - * @param aStatus Status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* EditL( TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Launches viewer/settings dialog as appropriate - * @param aStatus Status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* ViewL( TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Deletes selection from current context - * Deletes entries from the current context, - * which must be a folder or service of the relevant MTM - * @param aSelection reference to entry. - * @param aStatus Status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* DeleteFromL( - const CMsvEntrySelection& aSelection, - TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Deletes service, which need not - * be the current context. - * @param aService reference to entry. - * @param aStatus Status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* DeleteServiceL( - const TMsvEntry& aService, - TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Remove remaining message of deleted service. - * @param aChildren reference to entry selection. - * @return None. - */ - void DeleteRecursivelyL( CMsvEntrySelection& aChildren ); - - // - // --- Message responding --- - // --- Default implementation calls CBaseMtm::ReplyL() or ForwardL(), - // followed by EditL() --- - // --- Takes ownership of the passed entry - // (which the context is switched to) --- - - /** - * From CBaseMtmUi Reply entry - * @param aDestination id for msv. - * @param aPartlist partlist id. - * @param aCompletionStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* ReplyL( - TMsvId aDestination, - TMsvPartList aPartlist, - TRequestStatus& aCompletionStatus ); - - - /** - * From CBaseMtmUi forward entry - * @param aDestination id for msv. - * @param aPartlist partlist id. - * @param aCompletionStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* ForwardL( - TMsvId aDestination, - TMsvPartList aPartList, - TRequestStatus& aCompletionStatus ); - - // - // Actions upon message selections --- - // Selections must be in same folder and all of the correct MTM type - // Context may change after calling these functions - - /** - * From CBaseMtmUi Open entry - * @param aStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* OpenL( - TRequestStatus& aStatus, - const CMsvEntrySelection& aSelection ); - - /** - * From CBaseMtmUi Close entry - * @param aStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* CloseL( - TRequestStatus& aStatus, - const CMsvEntrySelection& aSelection ); - - /** - * From CBaseMtmUi Handles sending. - * @param aStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* EditL( - TRequestStatus& aStatus, - const CMsvEntrySelection& aSelection ); - - /** - * From CBaseMtmUi Launches viewer/settings dialog as appropriate - * @param aStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* ViewL( - TRequestStatus& aStatus, - const CMsvEntrySelection& aSelection ); - - // - // Copy and move functions: - // Context should be set to folder or entry of this MTM - // Default implementations imply call the relevant CMsvEntry functions - - /** - * From CBaseMtmUi Context should be MTM folder/service to copy to - * @param aStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* CopyToL( - const CMsvEntrySelection& aSelection, - TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Context should be MTM folder/service to Move to - * @param aStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* MoveToL( - const CMsvEntrySelection& aSelection, - TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Context should be MTM folder/service to copy from - * @param aStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* CopyFromL( - const CMsvEntrySelection& aSelection, - TMsvId aTargetId, - TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Context should be MTM folder/service to move from - * @param aStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* MoveFromL( - const CMsvEntrySelection& aSelection, - TMsvId aTargetId, - TRequestStatus& aStatus ); - - // Interpret transfer progress - - /** - * From CBaseMtmUi Display progress summary. - * @param aProgress reference to summary text. - * @return TInt error code. - */ - TInt DisplayProgressSummary( const TDesC8& aProgress ) const; - - /** - * From CBaseMtmUi return progress status. - * @param aProgress reference to progress packet. - * @param aReturnString returned progress text. - * @param aTotalEntryCount entry count. - * @param aEntriesDone completed entries. - * @param aCurrentEntrySize size of the entry. - * @param aCurrentBytesTrans transferred bytes. - * @return TInt error code. - */ - virtual TInt GetProgress( - const TDesC8& aProgress, - TBuf& aReturnString, - TInt& aTotalEntryCount, - TInt& aEntriesDone, - TInt& aCurrentEntrySize, - TInt& aCurrentBytesTrans ) const; - - // - // --- RTTI functions --- - - /** - * From CBaseMtmUi Return capability. - * @param aCapability UID for capability. - * @return TInt error code. - */ - virtual TInt QueryCapability( TUid aCapability, TInt& aResponse ); - - /** - * From CBaseMtmUi Synchronous MTM function operation. - * @param aFunctionId Function ID. - * @param CMsvEntrySelection entry reference. - * @param aParam parameter for function. - * @return None. - */ - virtual void InvokeSyncFunctionL( - TInt aFunctionId, - const CMsvEntrySelection& aSelection, - TDes8& aParameter ); - - /** - * From CBaseMtmUi Cancel sending. - * @param aStatus Async status for operation. - * @param CMsvEntrySelection entry reference. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* CancelL( - TRequestStatus& aStatus, - const CMsvEntrySelection& aSelection ); - - - /** - * Provides notification of the result of a service search that matches - * the requested UUID (through CBTEngDiscovery::RemoteSdpQuery). - * This method indicates that the search has completed, and returns - * all the results to the caller at once. - * - * @since S60 v3.2 - * @param aResult Array of record handles that match the requested UUID. - * Note: the array will not be available anymore after - * this method returns. - * @param aTotalRecordsCount The total number of records returned. - * @param aErr Error code of the service search operation; KErrNone if - * sucessful, KErrEof if no record matched the requested UUID, - * KErrCouldNotConnect and KErrCouldDisconnected in case of - * Bluetooth connection errors; otherwise one of the - * system-wide error codes. - */ - void ServiceSearchComplete( const RSdpRecHandleArray& aResult, - TUint aTotalRecordsCount, TInt aErr ); - - /** - * Provides notification of the result of an attribute search that matches - * the requested attribute (through CBTEngDiscovery::RemoteSdpQuery). - * This method indicates that the search has completed, and returns - * all the results to the caller at once. - * - * @since S60 v3.2 - * @param aHandle Record handle of the service record containing the result. - * @param aAttr Array containing the attribute that matches the - * requested attribute. - * Note: the array will not be available anymore after - * this method returns. - * @param aErr Error code of the service search operation; KErrNone if - * sucessful, KErrEof if the requested attribute was not - * contained in the specified service record, - * KErrCouldNotConnect and KErrCouldDisconnected in case of - * Bluetooth connection errors; otherwise one of the - * system-wide error codes. - */ - void AttributeSearchComplete( TSdpServRecordHandle aHandle, - const RSdpResultArray& aAttr, - TInt aErr ); - - /** - * Provides notification of the result of an combination of a service - * and attribute search (through CBTEngDiscovery::RemoteSdpQuery). - * This method is called for each service and attribute combination for - * which a match was found. The last result (which could be empty if no - * match was found) contain error code KErrEof to indicate that the - * search has completed. - * - * @since S60 v3.2 - * @param aHandle Record handle of the service record containing the result. - * @param aAttr Array containing the attribute that matches the - * requested attribute. - * Note: the array will not be available anymore after - * this method returns. - * @param aErr Error code of the service search operation; KErrNone if - * sucessful and more results follow, KErrEof indicates that - * this is the last result (which could be empty if no match - * was found), KErrCouldNotConnect and KErrCouldDisconnected - * in case of Bluetooth connection errors; otherwise one of - * the system-wide error codes. - */ - void ServiceAttributeSearchComplete( TSdpServRecordHandle aHandle, - const RSdpResultArray& aAttr, - TInt aErr ); - - /** - * Provides notification of the result of the discovery of nearby - * Bluetooth devices. - * - * @since S60 v3.2 - * @param aDevice The data structure encapsulates all information - * about the selected device. Ownership of the data - * structure has not been transfered and is still with - * the API client. - * @param aErr Error code of the device search operation; KErrNone if - * sucessful, KErrCancel if the user cancelled the - * dialog, KErrAbort if CBTEngDiscovery::CancelSearchRemoteDevice - * was called; otherwise one of the system-wide error codes. - */ - void DeviceSearchComplete( CBTDevice* aDevice, TInt aErr ); - - protected: - - /** - * C++ default constructor. - */ - CBtMtmUi( CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll ); - - /** - * By default Symbian OS constructor is private. - */ - void ConstructL(); - - protected: // Functions from base classes - - /** - * From CBaseMtmUi return resource filename. - * @param aProgress reference to summary text. - * @return TInt error code. - */ - void GetResourceFileName( TFileName& aFileName ) const; - - /** - * From CBaseMtmUi Launch viewer for received message. - * @param aStatus Async status for operation. - * @param aSession session reference. - * @return CMsvOperation pointer to Msg operation. - */ - CMsvOperation* LaunchEditorApplicationL( - TRequestStatus& aStatus, - CMsvSession& aSession ); - - protected: // New functions - - /** - * Register MTM. - * @param aMtmType MTM UID. - * @return CBaseMtm pointer. - */ - CBaseMtm* GetClientMtmLC( TUid aMtmType ); - - /** - * Display progress summary. - * @param aProgress reference to summary text. - * @return TInt error code. - */ - TInt DisplayProgressSummaryL( const TDesC8& aProgress ) const; - - protected: // data - - CClientMtmRegistry* iClientRegistry; // pointer to registration. - - private: - TBTDeviceName iBTDeviceName; // Bluetooth device name. - CBTDevice* iDevice; - CBTEngDiscovery* iDiscovery; - CActiveSchedulerWait iWaiter; - TInt iClientChannel; - TInt iState; - - }; - -#endif // CBTMTMUI_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuibluetooth/inc/btmtmuidata.h --- a/localconnectivityservice/obexreceiveservices/mtmuibluetooth/inc/btmtmuidata.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,247 +0,0 @@ -/* -* Copyright (c) 2002 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: -* Bluetooth Mtm Ui data part. -* -* -*/ - - -#ifndef CBTMTMUIDATA_H -#define CBTMTMUIDATA_H - -// INCLUDES -#include -#include - -// FORWARD DECLARATIONS - - -// CLASS DECLARATION - -/** -* CBtMtmUiData - -* contains Bluetooth specific MTM UI data. -*/ -class CBtMtmUiData : public CBaseMtmUiData - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CBtMtmUiData* NewL(CRegisteredMtmDll& aRegisteredDll); - - /** - * Destructor. - */ - virtual ~CBtMtmUiData(); - - /** - * Constructor - */ - void ConstructL(); - - public: // Functions from base classes - - /** - * From CBaseMtmUiData function query. - * @param aOperationId Id for function. - * @param aContext messaging store entry. - * @return TInt error code. - */ - virtual TInt OperationSupportedL( - TInt aOperationId, - const TMsvEntry& aContext) const; - - /** - * From CBaseMtmUiData MTM capability check. - * @param aCapability Uid for message type. - * @param aResponse response for capability check. - * @return TInt error code. - */ - virtual TInt QueryCapability( - TUid aCapability, - TInt& aResponse) const; - - /** - * From CBaseMtmUiData MTM related context icons. - * @param aContext Messaging entry refence. - * @param aStateFlags Flags for icon. - * @return TInt error code. - */ - virtual const CBitmapArray& ContextIcon( - const TMsvEntry& aContext, - TInt aStateFlags) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aParent Messaging entry refence. - * @param aNewEntry Messaging entry refence(created entry). - * @param aReasonResourceId ResourceID. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanCreateEntryL( - const TMsvEntry& aParent, - TMsvEntry& aNewEntry, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanReplyToEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanForwardEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanEditEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanViewEntryL(const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanOpenEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanCloseEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanDeleteFromEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanDeleteServiceL( - const TMsvEntry& aService, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanCopyMoveToEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanCopyMoveFromEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanCancelL(const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @return HBufC* Statustext for sending. - */ - virtual HBufC* StatusTextL(const TMsvEntry& aContext) const; - - protected: // Functions from base classes - - /** - * From CBaseMtmUiData Populate icon array - */ - virtual void PopulateArraysL(); - - /** - * From CBaseMtmUiData gets resource filename. - */ - virtual void GetResourceFileName(TFileName& aFileName) const; - - protected: - - /** - * C++ default constructor. - */ - CBtMtmUiData(CRegisteredMtmDll& aRegisteredDll); - - protected: // New functions - - /** - * Checks is the entry valid. - * @param aContext reference to the entry. - * @return TBool - */ - TBool CheckEntry(const TMsvEntry& aContext) const; - - }; - - -#endif // CBTMTMUIDATA_H -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuibluetooth/inc/btmtmuidebug.h --- a/localconnectivityservice/obexreceiveservices/mtmuibluetooth/inc/btmtmuidebug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* Copyright (c) 2002 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: This file defines logging macros for BTMTMUI -* -*/ - - -#ifndef BTMTMUI_DEBUG_H -#define BTMTMUI_DEBUG_H - - -#ifdef _DEBUG - -#include -#include -#include -#include - -_LIT(KLogFile,"btmtmui.txt"); -_LIT(KLogDirFullName,"c:\\logs\\mtm\\"); -_LIT(KLogDir,"mtm"); - -// Declare the FPrint function -inline void FPrint(const TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); - } - -// =========================================================================== -#ifdef __WINS__ // File logging for WINS -// =========================================================================== -#define FLOG(a) { FPrint(a); } -#define FTRACE(a) { a; } -// =========================================================================== -#else // RDebug logging for target HW -// =========================================================================== -#define FLOG(a) { RDebug::Print(a); } -#define FTRACE(a) { a; } -#endif //__WINS__ - -// =========================================================================== -#else // // No loggings --> Reduced binary size -// =========================================================================== -#define FLOG(a) -#define FTRACE(a) - -#endif // _DEBUG - - -#endif // BTMTMUI_DEBUG_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuibluetooth/src/btmtmui.cpp --- a/localconnectivityservice/obexreceiveservices/mtmuibluetooth/src/btmtmui.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,780 +0,0 @@ -/* -* Copyright (c) 2002 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: -* CBtMtmUi class -* -*/ - - -// INCLUDE FILES -#include "btmtmui.h" -#include "btmtmuidebug.h" - -//#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -// CONSTANTS -const TInt KBtMtmUiToFromFieldBuffer = 80; -const TInt KBtMtmUiConnectionTimeout = 20000000; -const TInt KBtMtmUiConnectionPutTimeout = 0; -const TInt KBtMtmUiObexPort = 1; -const TInt KBtMtmUiAddressMaxLength = 3; - -// ENUMS -enum TBtMtmAsyncCmds - { - EBtMtmCmdSend - }; - -// ================= MEMBER FUNCTIONS ======================= - -// C++ default constructor can NOT contain any code, that -// might leave. -// -CBtMtmUi::CBtMtmUi( CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll ) - : CBaseMtmUi( aBaseMtm, aRegisteredMtmDll ) - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi: CBtMtmUi\t" ) ); - } - -// Two-phased constructor. -CBtMtmUi* CBtMtmUi::NewL( CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll ) - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi: NewL\t" ) ); - CBtMtmUi* self = new( ELeave ) CBtMtmUi( aBaseMtm, aRegisteredMtmDll ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// Destructor -CBtMtmUi::~CBtMtmUi() - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi: ~CBtMtmUi\t" ) ); - delete iClientRegistry; - } - -// Symbian OS default constructor can leave. -void CBtMtmUi::ConstructL() - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi: ConstructL\t" ) ); - CBaseMtmUi::ConstructL(); - } - -// --------------------------------------------------------- -// GetResourceFileName(...) -// return progress status. -// --------------------------------------------------------- -// -void CBtMtmUi::GetResourceFileName( TFileName& aFileName ) const - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi: GetResourceFileName\t" ) ); - aFileName = KObexUtilsFileDrive; - aFileName += KDC_RESOURCE_FILES_DIR; - aFileName += KObexUtilsResourceFileName; - } - -// --------------------------------------------------------- -// QueryCapability(TUid aCapability, TInt& aResponse) -// return capability of mtm. -// --------------------------------------------------------- -// -TInt CBtMtmUi::QueryCapability(TUid aCapability, TInt& aResponse) - { - // Querying of menu availablility is done in syni. - FLOG( _L( "[CBtMtmUi] CBtMtmUi: QueryCapability\t" ) ); - if( aCapability.iUid == KUidMsvMtmUiQueryCanPrintMsgValue ) - { - aResponse = ETrue; - return KErrNone; - } - return CBaseMtmUi::QueryCapability( aCapability, aResponse ); - } - -// --------------------------------------------------------- -// InvokeSyncFunctionL(...) -// Invoke sync -function from BaseMTM. -// --------------------------------------------------------- -// -void CBtMtmUi::InvokeSyncFunctionL( TInt aFunctionId, - const CMsvEntrySelection& aSelection, - TDes8& aParameter ) - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi: InvokeSyncFunctionL\t" ) ); - CBaseMtmUi::InvokeSyncFunctionL( aFunctionId, aSelection, aParameter ); - } - - -// --------------------------------------------------------- -// CreateL(...) -// Entry creation forbidden. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::CreateL( const TMsvEntry& /*aEntry*/, - CMsvEntry& /*aParent*/, - TRequestStatus& /*aStatus*/ ) - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi: CreateL\t" ) ); - // Entries created through utility functions. - User::Leave( KErrNotSupported ); - // Return value is needed for removing compilation errors - return NULL; - } - -// --------------------------------------------------------- -// OpenL(TRequestStatus& aStatus) -// handles opening entry. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::OpenL( TRequestStatus& aStatus ) - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi: OpenL\t" ) ); - const TMsvEntry& context = iBaseMtm.Entry().Entry(); - const TUid type( context.iType ); - if( ( type == KUidMsvMessageEntry ) && - ( ( context.Parent() == KMsvSentEntryIdValue ) - ||( context.Parent() == KMsvGlobalInBoxIndexEntryIdValue ) ) ) - { - // Message is in the sent folder, so can't be edited - return ViewL( aStatus ); - } - return EditL( aStatus ); - } - -// --------------------------------------------------------- -// OpenL(...) -// handles opening entry using selection. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::OpenL( TRequestStatus& aStatus, - const CMsvEntrySelection& aSelection ) - { - iBaseMtm.Entry().SetEntryL( aSelection.At(0) ); - return OpenL( aStatus ); - } - -// --------------------------------------------------------- -// CloseL(TRequestStatus& aStatus) -// Closes entry. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::CloseL( TRequestStatus& aStatus ) - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi: CloseL\t" ) ); - CMsvCompletedOperation* op = CMsvCompletedOperation::NewL( Session(), - Type(), - KNullDesC8, - KMsvLocalServiceIndexEntryId, - aStatus); - return op; - } - -// --------------------------------------------------------- -// CloseL(TRequestStatus& aStatus) -// Closes entry using selection. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::CloseL( - TRequestStatus& aStatus, - const CMsvEntrySelection& aSelection) - { - iBaseMtm.Entry().SetEntryL( aSelection.At(0) ); - return CloseL( aStatus ); - } - -// --------------------------------------------------------- -// EditL(...) -// Handles message sending using selection. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::EditL( TRequestStatus& aStatus, const CMsvEntrySelection& aSelection ) - { - FLOG( _L( "[BtMtmUi] CBtMtmUi: EditL 1 \t" ) ); - iBaseMtm.Entry().SetEntryL( aSelection.At(0) ); - return EditL( aStatus ); - } - -// --------------------------------------------------------- -// EditL(TRequestStatus& aStatus) -// Handles message sending over Bluetooth. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::EditL( TRequestStatus& aStatus ) - { - FLOG( _L( "[BtMtmUi] CBtMtmUi: EditL 2 \t" ) ); - TInt resourceId; - TInt retVal=0; - switch( iBaseMtm.Entry().Entry().iType.iUid ) - { - case KUidMsvMessageEntryValue: - { - if( iBaseMtm.Entry().Entry().Parent() != KMsvDraftEntryId && - iBaseMtm.Entry().Entry().Parent() != KMsvGlobalOutBoxIndexEntryId ) - { - // Edit/"use" entries in the Inbox - return LaunchEditorApplicationL( aStatus, iBaseMtm.Entry().Session() ); - } - else - { - HBufC* password = HBufC::NewL(1); - CleanupStack::PushL( password ); // 1st push - BaseMtm().LoadMessageL(); - - TBTDevAddr address; - - CBtClientMtm::SBtcCmdSendParams sendparams; - sendparams.iTimeouts.iConnectTimeout = KBtMtmUiConnectionTimeout; - sendparams.iTimeouts.iPutTimeout = KBtMtmUiConnectionPutTimeout; - sendparams.iRemoteObexPort = KBtMtmUiObexPort; - sendparams.iConnectPassword = password; - - iDiscovery = CBTEngDiscovery::NewL(this); - CBTDevice* iDevice = CBTDevice::NewL( ); - - - if ( iDiscovery->SearchRemoteDevice( iDevice ) == KErrNone ) - { - iWaiter.Start(); - - if ( iState ==KErrNone) - { - address = iDevice->BDAddr(); - FLOG( _L( "[BtMtmUi] CBtMtmUi:SearchRemoteChannelL \t" ) ); - retVal = iDiscovery->RemoteProtocolChannelQuery(address, TUUID(KBTSdpObjectPush)); - if(retVal == KErrNone) - { - iWaiter.Start(); - } - } - if ( retVal != KErrNone ||iState != KErrNone ) - { - resourceId = R_BT_DEV_NOT_AVAIL; - TObexUtilsUiLayer::ShowInformationNoteL( resourceId ); - CleanupStack::PopAndDestroy(3); // BtDevice, BtConnection, password - return CMsvCompletedOperation::NewL( - Session(), - Type(), - KNullDesC8, - KMsvLocalServiceIndexEntryId, - aStatus ); - } - sendparams.iRemoteObexPort = iClientChannel; - - TPtrC8 ptr8 = address.Des(); - TBuf16 convertedaddress16;//48 bits - // Bt address conversion - TInt i; - for( i=0; i<3; i++ ) - { - TUint16 word = ptr8[( i*2 )+1]; - word = ( TUint16 )( word << 8 ); - word = ( TUint16 )( word + ptr8[i*2] ); - convertedaddress16.Append( &word, 1 ); - } - - BaseMtm().AddAddresseeL( convertedaddress16 ); - } - else - { - CleanupStack::PopAndDestroy(3); // BtDevice, BTConnection, password - FLOG( _L( "[BTMTMUI] CBtMtmUi:CMsvCompletedOperation NewL\t" ) ); - return CMsvCompletedOperation::NewL( - Session(), - Type(), - KNullDesC8, - KMsvLocalServiceIndexEntryId, - aStatus ); - } - - CMsvEntrySelection* sel = new( ELeave ) CMsvEntrySelection(); - CleanupStack::PushL( sel ); // 4th push - sel->AppendL( BaseMtm().Entry().EntryId() ); - - CMsvOperationWait* waiter = CMsvOperationWait::NewLC(); // 5th push - - TBuf toFrom; - resourceId = R_BT_SEND_OUTBOX_SENDING; - TObexUtilsUiLayer::ReadResourceL( toFrom, resourceId ); - - BaseMtm().SaveMessageL(); - - TMsvEntry newTEntry( iBaseMtm.Entry().Entry() ); - newTEntry.iDetails.Set( toFrom ); - newTEntry.SetVisible( ETrue ); - newTEntry.SetInPreparation( ETrue ); - - iBaseMtm.Entry().ChangeL( newTEntry ); - - CMsvEntry* entry = - BaseMtm().Session().GetEntryL( KMsvDraftEntryId ); - - CleanupStack::PushL( entry ); // 6th push - - CMsvOperation* moveOp = entry->MoveL( - *sel, - KMsvGlobalOutBoxIndexEntryId, - waiter->iStatus ); - - CleanupStack::PopAndDestroy( entry ); - - waiter->Start(); - CActiveScheduler::Start(); - delete moveOp; - - CMsvProgressReporterOperation* reporter - = CMsvProgressReporterOperation::NewL( Session(), aStatus ); - CleanupStack::PushL( reporter ); // 6th push - - TPckgBuf paramBuf( sendparams ); - - CMsvOperation* op = BaseMtm().InvokeAsyncFunctionL( - EBtMtmCmdSend, - *sel, - paramBuf, - reporter->RequestStatus() ); - - // ownership of op transfered to reporter - reporter->SetOperationL( op ); - - aStatus = KRequestPending; - - CleanupStack::Pop( reporter ); - CleanupStack::PopAndDestroy(3); // waiter, sel, password - return reporter; - } - } - case KUidMsvServiceEntryValue: - case KUidMsvAttachmentEntryValue: - case KUidMsvFolderEntryValue: - { - User::Leave( KErrNotSupported ); - } - default: - { - break; - } - } - - CMsvCompletedOperation* op = CMsvCompletedOperation::NewL( - Session(), - Type(), - KNullDesC8, - KMsvLocalServiceIndexEntryId, - aStatus ); - aStatus = KRequestPending; - return op; - } - -// --------------------------------------------------------- -// ViewL(TRequestStatus& aStatus) -// Handles viewing of received object. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::ViewL( TRequestStatus& aStatus ) - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi: ViewL\t" ) ); - return LaunchEditorApplicationL( aStatus, iBaseMtm.Entry().Session() ); - } - -// --------------------------------------------------------- -// ViewL(...) -// Handles viewing of received object using selection. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::ViewL( TRequestStatus& aStatus, - const CMsvEntrySelection& aSelection ) - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi: ViewL 1\t" ) ); - iBaseMtm.Entry().SetEntryL( aSelection.At(0) ); - return ViewL( aStatus ); - } - -// --------------------------------------------------------- -// CopyFromL(...) -// Not supported. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::CopyFromL( const CMsvEntrySelection& /*aSelection*/, - TMsvId /*aTargetId*/, - TRequestStatus& /*aStatus*/ ) - { - User::Leave( KErrNotSupported ); - // Return value is needed for removing compilation errors - return NULL; - } - -// --------------------------------------------------------- -// MoveFromL(...) -// Not supported. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::MoveFromL( const CMsvEntrySelection& /*aSelection*/, - TMsvId /*aTargetId*/, - TRequestStatus& /*aStatus*/ ) - { - User::Leave( KErrNotSupported ); - // Return value is needed for removing compilation errors - return NULL; - } - -// --------------------------------------------------------- -// MoveToL(...) -// Not supported. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::MoveToL( const CMsvEntrySelection& /*aSelection*/, - TRequestStatus& /*aStatus*/) - { - User::Leave( KErrNotSupported ); - // Return value is needed for removing compilation errors - return NULL; - } - -// --------------------------------------------------------- -// CopyToL(...) -// Not supported. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::CopyToL( const CMsvEntrySelection& /*aSelection*/, - TRequestStatus& /*aStatus*/) - { - User::Leave( KErrNotSupported ); - // Return value is needed for removing compilation errors - return NULL; - } - -// --------------------------------------------------------- -// DisplayProgressSummary(const TDesC8& aProgress) const -// calls leaving DisplayProgressSummaryL -function and -// traps the error. -// --------------------------------------------------------- -// -TInt CBtMtmUi::DisplayProgressSummary( const TDesC8& aProgress ) const - { - TInt retVal = KErrNone; - TRAP( retVal, retVal = DisplayProgressSummaryL( aProgress ) ); - return retVal; - } - -// --------------------------------------------------------- -// DisplayProgressSummary(const TDesC8& aProgress) const -// calls leaving DisplayProgressSummaryL -function and -// traps the error. -// --------------------------------------------------------- -// -TInt CBtMtmUi::DisplayProgressSummaryL( const TDesC8& aProgress ) const - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi:DisplayProgressSummaryL\t" ) ); - TInt resourceId; - if( ( !aProgress.Length() ) || ( aProgress.Size() == sizeof( TMsvLocalOperationProgress ) ) ) - { - // Probably a CMsvCompletedOperation - return KErrCancel; - } - TPckgBuf paramPack; - paramPack.Copy( aProgress ); - TObexMtmProgress& progress = paramPack(); - - const TObexMtmProgress::TSendState progressType = progress.iSendState; - const TInt error = progress.iError; - if ( error == KErrInUse ) - { - resourceId = R_BT_DEV_NOT_AVAIL; - TObexUtilsUiLayer::ShowInformationNoteL( resourceId ); - return KErrNone; - } - - switch( progressType ) - { - case TObexMtmProgress::EDisconnected: - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi:DisplayProgressSummaryL: EDisconnected\t" ) ); - // Allowed to send again. - resourceId = R_BT_DATA_SENT; - TObexUtilsUiLayer::ShowInformationNoteL( resourceId ); - break; - } - case TObexMtmProgress::ESendError: - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi:DisplayProgressSummaryL: ESendError\t" ) ); - if( error == KErrIrObexClientNoDevicesFound ) - { - resourceId = R_BT_DEV_NOT_AVAIL; - TObexUtilsUiLayer::ShowInformationNoteL( resourceId ); - } - else - { - resourceId = R_BT_FAILED_TO_SEND; - TObexUtilsUiLayer::ShowErrorNoteL( resourceId ); - } - break; - } - case TObexMtmProgress::ESendComplete: - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi:DisplayProgressSummaryL: ESendComplete\t" ) ); - break; - } - case TObexMtmProgress::EInitialise: - case TObexMtmProgress::EConnect: - case TObexMtmProgress::EConnectAttemptComplete: - case TObexMtmProgress::ESendObject: - case TObexMtmProgress::ESendNextObject: - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi:DisplayProgressSummaryL: ESendObject\t" ) ); - return KErrCancel; - } - case TObexMtmProgress::EUserCancelled: - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi:DisplayProgressSummaryL: EUserCancelled\t" ) ); - return KErrCancel; - } - default: - { - FTRACE( FPrint(_L( "[CBtMtmUi] CBtMtmUi:DisplayProgressSummaryL: Default\t %d" ), progressType ) ); - return KErrCancel; - } - } - return KErrNone; - } - - -// --------------------------------------------------------- -// GetProgress(...) -// return progress status. -// --------------------------------------------------------- -// -TInt CBtMtmUi::GetProgress( const TDesC8& aProgress, - TBuf& aReturnString, - TInt& aTotalEntryCount, - TInt& aEntriesDone, - TInt& aCurrentEntrySize, - TInt& aCurrentBytesTrans ) const - { - TInt resourceId; - FLOG( _L( "[CBtMtmUi] CBtMtmUi: GetProgress\t" ) ); - TPckgBuf paramPack; - paramPack.Copy( aProgress ); - TObexMtmProgress& progress = paramPack(); - const TObexMtmProgress::TSendState progressType = progress.iSendState; - aTotalEntryCount = progress.iTotalEntryCount; - aEntriesDone = progress.iEntriesDone; - aCurrentEntrySize = progress.iCurrentEntrySize; - aCurrentBytesTrans = progress.iCurrentBytesTrans; - - if( aTotalEntryCount > 1 ) // This is for progress bar multisending - { - aCurrentEntrySize = 0; - } - - switch( progressType ) - { - case TObexMtmProgress::ENullOp: - case TObexMtmProgress::ESendError: - { - aReturnString = KNullDesC; - break; - } - case TObexMtmProgress::EInitialise: - case TObexMtmProgress::EConnect: - case TObexMtmProgress::EConnectAttemptComplete: - { - resourceId = R_BT_CONNECTING; - TRAPD( retVal, TObexUtilsUiLayer::ReadResourceL( aReturnString, resourceId ) ); - retVal=retVal; //avoid warning - // Leave causes progress note to be empty. Not fatal - break; - } - case TObexMtmProgress::ESendObject: - case TObexMtmProgress::ESendNextObject: - case TObexMtmProgress::ESendComplete: - { - resourceId = R_BT_SENDING_DATA; - TRAPD( retVal, TObexUtilsUiLayer::ReadResourceL( aReturnString, resourceId ) ); - // Leave causes progress note to be empty. Not fatal - retVal=retVal; //avoid warning - break; - } - case TObexMtmProgress::EDisconnected: - { - break; - } - default: - { - return KErrCancel; - } - } - FLOG( _L( "[CBtMtmUi] CBtMtmUi: GetProgress Done\t" ) ); - return KErrNone; - } - -// --------------------------------------------------------- -// LaunchEditorApplicationL(...) -// Launch viewer for selected object. The first is object's -// recognition(document handler). -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::LaunchEditorApplicationL( TRequestStatus& aStatus, - CMsvSession& aSession) - { - FLOG( _L( "[CommonMtmUi] CBtMtmUi: LaunchEditorApplicationL\t" ) ); - CMsvEntry* message; - message = &iBaseMtm.Entry(); - return TObexUtilsUiLayer::LaunchEditorApplicationOperationL( aSession, message, aStatus ); - } - -// --------------------------------------------------------- -// GetClientMtmLC(TUid aMtmType) -// Handles MTM registration. -// --------------------------------------------------------- -// -CBaseMtm* CBtMtmUi::GetClientMtmLC( TUid aMtmType ) - { - FLOG( _L( "[CBtMtmUi] CBtMtmUi: GetClientMtmLC\t" ) ); - if( !iClientRegistry ) - { - iClientRegistry = CClientMtmRegistry::NewL( Session() ); - } - CBaseMtm* mtm = iClientRegistry->NewMtmL( aMtmType ); - CleanupStack::PushL( mtm ); - return mtm; - } - -// --------------------------------------------------------- -// DeleteFromL(TUid aMtmType) -// passes entry selection to Base for deletion. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::DeleteFromL( const CMsvEntrySelection& aSelection, - TRequestStatus& aStatus ) - { - return CBaseMtmUi::DeleteFromL( aSelection, aStatus ); - } - -// --------------------------------------------------------- -// DeleteServiceL(...) -// has no service, just complete it. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::DeleteServiceL( const TMsvEntry& /*aService*/, - TRequestStatus& aStatus) - { - return CMsvCompletedOperation::NewL( - Session(), - Type(), - KNullDesC8, - KMsvLocalServiceIndexEntryId, - aStatus); - } - -// --------------------------------------------------------- -// ReplyL(...) -// Reply is forbidden. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::ReplyL( TMsvId /*aDestination*/, - TMsvPartList /*aPartlist*/, - TRequestStatus& /*aCompletionStatus*/ ) - { - User::Leave( KErrNotSupported ); - // Return value is needed for removing compilation errors - return NULL; - } - -// --------------------------------------------------------- -// ForwardL(...) -// Forward is forbidden. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::ForwardL( TMsvId /*aDestination*/, - TMsvPartList /*aPartList*/, - TRequestStatus& /*aCompletionStatus*/ ) - { - User::Leave( KErrNotSupported ); - // Return value is needed for removing compilation errors - return NULL; - } - -// --------------------------------------------------------- -// CancelL(...) -// No MS way of sending a message from the outbox, so no need to cancel. -// Just complete it. -// --------------------------------------------------------- -// -CMsvOperation* CBtMtmUi::CancelL( TRequestStatus& aStatus, - const CMsvEntrySelection& /*aSelection*/) - { - return CMsvCompletedOperation::NewL( - Session(), - Type(), - KNullDesC8, - KMsvLocalServiceIndexEntryId, - aStatus, - KErrNone); - } - -// ----------------------------------------------------------------------------- -// CBtMtmUi::ServiceSearchComplete -// ----------------------------------------------------------------------------- -// -void CBtMtmUi::ServiceSearchComplete( const RSdpRecHandleArray& /*aResult*/, - TUint /*aTotalRecordsCount*/, TInt /*aErr */) - { - } - -// ----------------------------------------------------------------------------- -// CBtMtmUi::AttributeSearchComplete( -// ----------------------------------------------------------------------------- -// -void CBtMtmUi::AttributeSearchComplete( TSdpServRecordHandle /*aHandle*/, - const RSdpResultArray& aAttr, - TInt aErr ) - { - iState=aErr; - if (aErr==KErrNone) - { - RSdpResultArray results=aAttr; - iDiscovery->ParseRfcommChannel(results,iClientChannel); - } - iWaiter.AsyncStop(); - } -// ----------------------------------------------------------------------------- -// CBtMtmUi::ServiceAttributeSearchComplete -// ----------------------------------------------------------------------------- -// -void CBtMtmUi::ServiceAttributeSearchComplete( TSdpServRecordHandle /*aHandle*/, - const RSdpResultArray& /*aAttr*/, - TInt /*aErr*/ ) - { - } -// ----------------------------------------------------------------------------- -// CBtMtmUi::DeviceSearchComplete -// ----------------------------------------------------------------------------- -// -void CBtMtmUi::DeviceSearchComplete( CBTDevice* /*aDevice*/, TInt aErr ) - { - iState=aErr; - iWaiter.AsyncStop(); - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuibluetooth/src/btmtmuidata.cpp --- a/localconnectivityservice/obexreceiveservices/mtmuibluetooth/src/btmtmuidata.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,389 +0,0 @@ -/* -* Copyright (c) 2002 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: -* Class CBtMtmUiData -* -*/ - - -// INCLUDE FILES -#include "btmtmuidata.h" -#include "btmtmuidebug.h" -#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS -#include //kuidmtmquerymaxbodysizevalue etc -#else -#include //kuidmtmquerymaxbodysizevalue etc -#include //kuidmtmquerymaxbodysizevalue etc -#endif -#include -#include -#include - - -const TInt KBtMtmUiNfcContext = 2; - -// ================= MEMBER FUNCTIONS ======================= - -// Two-phased constructor. -CBtMtmUiData* CBtMtmUiData::NewL( CRegisteredMtmDll& aRegisteredDll ) - { - FLOG( _L( " CBtMtmUiData: CBtMtmUiData\t" ) ); - CBtMtmUiData* self = new(ELeave) CBtMtmUiData( aRegisteredDll ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// Symbian OS default constructor can leave. -void CBtMtmUiData::ConstructL() - { - FLOG( _L( " CBtMtmUiData: ConstructL\t" ) ); - CBaseMtmUiData::ConstructL(); - TObexUtilsMessageHandler::CreateDefaultMtmServiceL(KUidMsgTypeBt); - FLOG( _L( " CBtMtmUiData: ConstructL done\t" ) ); - } - -// C++ default constructor can NOT contain any code, that -// might leave. -// -CBtMtmUiData::CBtMtmUiData(CRegisteredMtmDll& aRegisteredDll) - : CBaseMtmUiData(aRegisteredDll) - { - FLOG( _L( " CBtMtmUiData: CBtMtmUiData\t" ) ); - } - -// Destructor -CBtMtmUiData::~CBtMtmUiData() - { - FLOG( _L( " CBtMtmUiData: ~CBtMtmUiData\t" ) ); - } - -// --------------------------------------------------------- -// OperationSupportedL(...) -// -// --------------------------------------------------------- -// -TInt CBtMtmUiData::OperationSupportedL( TInt /*aOperationId*/, - const TMsvEntry& /*aContext*/) const - { - FLOG( _L( " CBtMtmUiData: OperationSupportedL\t" ) ); - return TObexUtilsUiLayer::OperationNotSupported(); - } - -// --------------------------------------------------------- -// QueryCapability(...) -// MTM query capability -// --------------------------------------------------------- -// -TInt CBtMtmUiData::QueryCapability( TUid aCapability, - TInt& aResponse ) const - { - FLOG( _L( " CBtMtmUiData: QueryCapability\t" ) ); - switch( aCapability.iUid ) - { - // --- Supported valued capabilities --- - case KUidMtmQueryMaxBodySizeValue: - { - aResponse = KMaxTInt; - break; - } - case KUidMtmQueryMaxTotalMsgSizeValue: - { - aResponse = KMaxTInt; - break; - } - case KUidMsvMtmQueryEditorUidValue: - { - aResponse = 0; - break; - } - case KUidMtmQuerySupportAttachmentsValue: - case KUidMtmQueryCanSendMsgValue: - { - break; - } - case KUidMtmQuerySupportedBodyValue: - default: - { - return KErrNotSupported; - } - } - return KErrNone; - } - -// --------------------------------------------------------- -// CBitmapArray& CBtMtmUiData::ContextIcon(...) -// Handles received msg icon. -// --------------------------------------------------------- -// -const CBaseMtmUiData::CBitmapArray& CBtMtmUiData::ContextIcon( const TMsvEntry& aContext, - TInt /*aStateFlags*/) const - { - // Check if NFC context - TInt icon = 0; - if ( aContext.MtmData1() == KBtMtmUiNfcContext ) - { - icon = TObexUtilsUiLayer::ContextIcon( aContext, ENfc ); - } - else - { - icon = TObexUtilsUiLayer::ContextIcon( aContext, EBluetooth ); - } - - return *iIconArrays->At( icon/2 ); - } - -// --------------------------------------------------------- -// PopulateArraysL() -// Populates bitmap array -// --------------------------------------------------------- -// -void CBtMtmUiData::PopulateArraysL() - { - FLOG( _L( " CBtMtmUiData: PopulateArraysL\t" ) ); - TObexUtilsUiLayer::CreateIconsL( KUidMsgTypeBt, iIconArrays ); - } - -// --------------------------------------------------------- -// GetResourceFileName(TFileName& aFileName) const -// Gives resource filename. -// --------------------------------------------------------- -// -void CBtMtmUiData::GetResourceFileName( TFileName& aFileName ) const - { - FLOG( _L( " CBtMtmUiData: GetResourceFileName\t" ) ); - aFileName = KObexUtilsFileDrive; - aFileName += KDC_RESOURCE_FILES_DIR; - aFileName += KObexUtilsResourceFileName; - } - -// --------------------------------------------------------- -// CanCreateEntryL(...) -// Checks if it is possible to create entry. -// --------------------------------------------------------- -// -TBool CBtMtmUiData::CanCreateEntryL( const TMsvEntry& aParent, - TMsvEntry& aNewEntry, - TInt& aReasonResourceId ) const - { - FLOG( _L( " CBtMtmUiData: CanCreateEntryL\t" ) ); - aReasonResourceId = 0; - if( CheckEntry( aNewEntry ) ) - { - // --- Can create messages in local folders --- - return ( aParent.iMtm.iUid == KMsvLocalServiceIndexEntryIdValue ); - } - // --- Can't create other types --- - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// CanOpenEntryL(...) -// Checks if it is possible to open entry. -// --------------------------------------------------------- -// -TBool CBtMtmUiData::CanOpenEntryL( const TMsvEntry& aContext, - TInt& aReasonResourceId ) const - { - FLOG( _L( " CBtMtmUiData: CanOpenEntryL\t" ) ); - if( CheckEntry( aContext ) ) - { - if( aContext.iType.iUid == KUidMsvMessageEntryValue ) - { - aReasonResourceId = 0; - return ETrue; - } - } - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// CanCloseEntryL(...) -// Checks if it is possible to close entry. -// --------------------------------------------------------- -// -TBool CBtMtmUiData::CanCloseEntryL( const TMsvEntry& aContext, - TInt& aReasonResourceId ) const - { - FLOG( _L( " CBtMtmUiData: CanCloseEntryL\t" ) ); - if( CheckEntry( aContext ) ) - { - if( aContext.iType.iUid == KUidMsvServiceEntryValue ) - { - aReasonResourceId = 0; - return ETrue; - } - } - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// CanViewEntryL(...) -// Checks if it is possible to view entry. -// --------------------------------------------------------- -// -TBool CBtMtmUiData::CanViewEntryL( const TMsvEntry& aContext, - TInt& aReasonResourceId ) const - { - FLOG( _L( " CBtMtmUiData: CanViewEntryL\t" ) ); - if( CheckEntry( aContext ) ) - { - if( aContext.iType.iUid == KUidMsvMessageEntryValue ) - { - aReasonResourceId = 0; - return ETrue; - } - } - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// CanEditEntryL(...) -// Checks if it is possible to edit entry. -// --------------------------------------------------------- -// -TBool CBtMtmUiData::CanEditEntryL( const TMsvEntry& aContext, - TInt& aReasonResourceId ) const - { - FLOG( _L( " CBtMtmUiData: CanEditEntryL\t" ) ); - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - if( CheckEntry( aContext ) ) - { - if ( ( aContext.iType.iUid == KUidMsvMessageEntryValue ) || - ( aContext.iType.iUid == KUidMsvFolderEntryValue ) ) - { - aReasonResourceId=0; - return ETrue; - } - } - return EFalse; - } - -// --------------------------------------------------------- -// CanDeleteServiceL(...) -// Checks if it is possible to delete service. -// --------------------------------------------------------- -// -TBool CBtMtmUiData::CanDeleteServiceL( const TMsvEntry& /*aService*/, - TInt& aReasonResourceId ) const - { - FLOG( _L( " CBtMtmUiData: CanDeleteServiceL\t" ) ); - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// CanDeleteFromEntryL(...) -// Checks if it is possible to delete from entry. -// --------------------------------------------------------- -// -TBool CBtMtmUiData::CanDeleteFromEntryL( const TMsvEntry& /*aContext*/, - TInt& aReasonResourceId ) const - { - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// CanCopyMoveToEntryL(...) -// Checks if it is possible to move to entry. -// --------------------------------------------------------- -// -TBool CBtMtmUiData::CanCopyMoveToEntryL( const TMsvEntry& /*aContext*/, - TInt& aReasonResourceId ) const - { - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// CanCopyMoveFromEntryL(...) -// Checks if it is possible to move from entry. -// --------------------------------------------------------- -// -TBool CBtMtmUiData::CanCopyMoveFromEntryL( const TMsvEntry& /*aContext*/, - TInt& aReasonResourceId ) const - { - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// CanReplyToEntryL(...) -// Checks if it is possible to reply to entry. -// --------------------------------------------------------- -// -TBool CBtMtmUiData::CanReplyToEntryL( const TMsvEntry& /*aContext*/, - TInt& aReasonResourceId ) const - { - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; // Not Ok to do - } - -// --------------------------------------------------------- -// CanForwardEntryL(...) -// Checks if it is possible to forward entry. -// --------------------------------------------------------- -// -TBool CBtMtmUiData::CanForwardEntryL( const TMsvEntry& /*aContext*/, - TInt& aReasonResourceId ) const - { - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; // Not Ok to do - } - -// --------------------------------------------------------- -// CheckEntry(...) -// Checks is the entry valid. -// --------------------------------------------------------- -// -TBool CBtMtmUiData::CheckEntry( const TMsvEntry& /*aContext*/ ) const - { - FLOG( _L( " CBtMtmUiData: CheckEntry\t" ) ); - return EFalse; - } - -// --------------------------------------------------------- -// CanCancelL(...) -// Checks if it is possible to cancel entry. -// --------------------------------------------------------- -// -TBool CBtMtmUiData::CanCancelL( const TMsvEntry& /*aContext*/, - TInt& aReasonResourceId ) const - { - // No way of sending a message from the outbox, so no need to cancel. - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// StatusTextL(...) -// Returns status text when sending message(outbox). -// --------------------------------------------------------- -// -HBufC* CBtMtmUiData::StatusTextL( const TMsvEntry& /*aContext*/ ) const - { - FLOG( _L( " CBtMtmUiData: StatusTextL\t" ) ); - TBuf<80> buffer; - TInt resourceId = R_BT_SEND_PROGRESS_SENDING; - TObexUtilsUiLayer::ReadResourceL( buffer, resourceId ); - return buffer.AllocL(); - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuibluetooth/src/btmtmuidll.cpp --- a/localconnectivityservice/obexreceiveservices/mtmuibluetooth/src/btmtmuidll.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2002 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: -* DLL interface -* -*/ - - -// INCLUDE FILES - -#include "btmtmuidata.h" -#include "btmtmui.h" -#include "btmtmuidebug.h" - -// ================= OTHER EXPORTED FUNCTIONS ============== - -// --------------------------------------------------------- -// NewBtMtmUiL Creates new MTM UI (BT) -// Returns: CBaseMtmUi pointer to created mtm -// --------------------------------------------------------- -// -EXPORT_C CBaseMtmUi* NewBtMtmUiL( CBaseMtm& aMtm, CRegisteredMtmDll& aRegisteredDll ) - { - FLOG( _L( "CBtMtmUi: NewBtMtmUiL\t" ) ); - return CBtMtmUi::NewL( aMtm, aRegisteredDll ); - } - -// --------------------------------------------------------- -// NewBtMtmUiDataLayerL Creates new MTM UI data layer (BT) -// Returns: CBaseMtmUiData pointer to created mtm -// --------------------------------------------------------- -// -EXPORT_C CBaseMtmUiData* NewBtMtmUiDataLayerL( CRegisteredMtmDll& aRegisteredDll ) - { - FLOG( _L( "CBtMtmUi: NewBtMtmUiDataLayerL\t" ) ); - return CBtMtmUiData::NewL( aRegisteredDll ); - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuiinfrared/bmarm/IRMTMUIU.DEF --- a/localconnectivityservice/obexreceiveservices/mtmuiinfrared/bmarm/IRMTMUIU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -EXPORTS - NewMtmUiDataLayerL__FR17CRegisteredMtmDll @ 1 NONAME R3UNUSED ; NewMtmUiDataLayerL(CRegisteredMtmDll &) - NewMtmUiL__FR8CBaseMtmR17CRegisteredMtmDll @ 2 NONAME R3UNUSED ; NewMtmUiL(CBaseMtm &, CRegisteredMtmDll &) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuiinfrared/bwins/IRMTMUIU.DEF --- a/localconnectivityservice/obexreceiveservices/mtmuiinfrared/bwins/IRMTMUIU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -EXPORTS - ?NewMtmUiDataLayerL@@YAPAVCBaseMtmUiData@@AAVCRegisteredMtmDll@@@Z @ 1 NONAME ; class CBaseMtmUiData * __cdecl NewMtmUiDataLayerL(class CRegisteredMtmDll &) - ?NewMtmUiL@@YAPAVCBaseMtmUi@@AAVCBaseMtm@@AAVCRegisteredMtmDll@@@Z @ 2 NONAME ; class CBaseMtmUi * __cdecl NewMtmUiL(class CBaseMtm &,class CRegisteredMtmDll &) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuiinfrared/data/irmtmui.rss --- a/localconnectivityservice/obexreceiveservices/mtmuiinfrared/data/irmtmui.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This file contains infrared MTM info resource. Entry points to Mtm Ui. -* -* -*/ - - -// INCLUDES -#include -#include - - - -#include - -RESOURCE MTM_INFO_FILE - { - mtm_type_uid = 0x100053A4; - technology_type_uid = 0x1000539F; - components = - { - MTM_COMPONENT_V2 - { - human_readable_name = qtn_query_send_via_ir; - component_uid = KUidMtmServerComponentVal; - entry_point = 1; - version = VERSION_V2 {}; - filename = "irs.dll"; - }, - MTM_COMPONENT_V2 - { - human_readable_name = qtn_query_send_via_ir; - component_uid = KUidMtmClientComponentVal; - entry_point = 1; - version = VERSION_V2 {}; - filename = "irc.dll"; - }, - MTM_COMPONENT_V2 - { - human_readable_name = qtn_query_send_via_ir; - component_uid = KUidMtmUiComponentVal; - entry_point = 2; - version = VERSION_V2 {}; - filename = "irmtmui.dll"; - }, - MTM_COMPONENT_V2 - { - human_readable_name = qtn_query_send_via_ir; - component_uid = KUidMtmUiDataComponentVal; - entry_point = 1; - version = VERSION_V2 {}; - filename = "irmtmui.dll"; - } - }; - } - - -RESOURCE MTM_CAPABILITIES - { - send_capability = 1; - body_capability = 1; - } - -RESOURCE MTM_SECURITY_CAPABILITY_SET - { - capabilities = { ECapabilityLocalServices }; - } - - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuiinfrared/eabi/irmtmuiU.DEF --- a/localconnectivityservice/obexreceiveservices/mtmuiinfrared/eabi/irmtmuiU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -EXPORTS - _Z18NewMtmUiDataLayerLR17CRegisteredMtmDll @ 1 NONAME - _Z9NewMtmUiLR8CBaseMtmR17CRegisteredMtmDll @ 2 NONAME - _ZTI12CIrMtmUiData @ 3 NONAME ; ## - _ZTI8CIrMtmUi @ 4 NONAME ; ## - _ZTV12CIrMtmUiData @ 5 NONAME ; ## - _ZTV8CIrMtmUi @ 6 NONAME ; ## - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuiinfrared/group/IRmtmuiRegistry.mk --- a/localconnectivityservice/obexreceiveservices/mtmuiinfrared/group/IRmtmuiRegistry.mk Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -# -# Copyright (c) 2009 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 resource files -# - -SOURCEDIR=..\group -LANGUAGE=sc - -# -# Target directory -# - -ifeq (WINS,$(findstring WINS, $(PLATFORM))) -TARGETDIR=$(EPOCROOT)Epoc32\Release\$(PLATFORM)\$(CFG)\Z\System\Mtm -else -TARGETDIR=$(EPOCROOT)Epoc32\Data\Z\System\Mtm -endif - -$(TARGETDIR) : - @perl $(EPOCROOT)epoc32\tools\emkdir.pl $(TARGETDIR) - -# -# Build the mtm resource files -# - -PROJECT=IRMTMU -SOURCERESOURCE=$(SOURCEDIR)\$(PROJECT)Registry.rss -TARGETRESOURCE=$(TARGETDIR)\$(PROJECT).r$(LANGUAGE) -$(TARGETRESOURCE) : $(TARGETDIR) $(SOURCERESOURCE) - @copy $(SOURCERESOURCE) $(TARGETDIR)\$(PROJECT).rss - @epocrc.bat -u -I. -I%EPOCROOT%s60\irmtmui\group -I%EPOCROOT%epoc32\include $(TARGETDIR)\$(PROJECT).rss -o$(TARGETRESOURCE) - @del $(TARGETDIR)\$(PROJECT).rss - -do_nothing: - rem do nothing - -# -# The targets invoked by abld -# - -MAKMAKE : do_nothing - -RESOURCE : $(TARGETRESOURCE) - -SAVESPACE : BLD - -BLD : do_nothing - -FREEZE : do_nothing - -LIB : do_nothing - -CLEANLIB : do_nothing - -FINAL : do_nothing - -CLEAN : - @erase $(TARGETRESOURCE) - -RELEASABLES : - @echo $(TARGETRESOURCE) diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuiinfrared/group/bld.inf --- a/localconnectivityservice/obexreceiveservices/mtmuiinfrared/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This file provides the information required for building the -* whole of a MtmUiInfrared. -* -*/ - - -PRJ_PLATFORMS - - -PRJ_EXPORTS - -PRJ_MMPFILES -../group/irmtmui.mmp - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuiinfrared/group/irmtmui.mmp --- a/localconnectivityservice/obexreceiveservices/mtmuiinfrared/group/irmtmui.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This is project specification file for the IrMtmUi. -* -* -*/ - - -#include -#include - -TARGET irmtmui.dll -TARGETTYPE dll -TARGETPATH SHARED_LIB_DIR -UID 0x10004845 0x101F8635 -CAPABILITY CAP_GENERAL_DLL -VENDORID VID_DEFAULT - -SOURCEPATH ../data -START RESOURCE irmtmui.rss -TARGETPATH MTM_INFO_FILE_DIR -HEADER -LANGUAGE_IDS -END - -SOURCEPATH ../src -USERINCLUDE ../inc -SYSTEMINCLUDE ../../../inc ../../../../inc -APP_LAYER_SYSTEMINCLUDE - -SOURCE irmtmui.cpp -SOURCE irmtmuidata.cpp -SOURCE irmtmuidll.cpp - -LIBRARY obexutils.lib -LIBRARY euser.lib -LIBRARY msgs.lib -LIBRARY mtur.lib -LIBRARY muiu.lib -LIBRARY featmgr.lib -DEBUGLIBRARY flogger.lib - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuiinfrared/inc/debug.h --- a/localconnectivityservice/obexreceiveservices/mtmuiinfrared/inc/debug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* Copyright (c) 2002 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: This file defines logging macros for IrMTMUI -* -*/ - - -#ifndef IRMTMUI_DEBUG_H -#define IRMTMUI_DEBUG_H - - -#ifdef _DEBUG - -#include -#include -#include -#include - -_LIT(KLogFile,"irmtmui.txt"); -_LIT(KLogDirFullName,"c:\\logs\\mtm\\"); -_LIT(KLogDir,"mtm"); - -// Declare the FPrint function -inline void FPrint(const TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); - } - -// =========================================================================== -#ifdef __WINS__ // File logging for WINS -// =========================================================================== -#define FLOG(a) { FPrint(a); } -#define FTRACE(a) { a; } -// =========================================================================== -#else // RDebug logging for target HW -// =========================================================================== -#define FLOG(a) { RDebug::Print(a); } -#define FTRACE(a) { a; } -#endif //__WINS__ - -// =========================================================================== -#else // // No loggings --> Reduced binary size -// =========================================================================== -#define FLOG(a) -#define FTRACE(a) - -#endif // _DEBUG - - -#endif // IRMTMUI_DEBUG_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuiinfrared/inc/irmtmui.h --- a/localconnectivityservice/obexreceiveservices/mtmuiinfrared/inc/irmtmui.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,340 +0,0 @@ -/* -* Copyright (c) 2002 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: -* Infrared Mtm Ui part. -* -* -*/ - - -#ifndef CIRMTMUI_H -#define CIRMTMUI_H - -// INCLUDES -#include -#include -// CLASS DECLARATION - -// FORWARD DECLARATIONS -class CClientMtmRegistry; -class CMtmUiLayer; - - - -/** -* CCommonMtmUi -*/ -class CIrMtmUi : public CBaseMtmUi - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CIrMtmUi* NewL( - CBaseMtm& aBaseMtm, - CRegisteredMtmDll& aRegisteredMtmDll ); - - /** - * Destructor. - */ - virtual ~CIrMtmUi(); - - public: // Functions from base classes - - /** - * From CBaseMtmUi Entry Creation. - * @param aEntry reference to entry - * @param aParent parent entry - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* CreateL( - const TMsvEntry& aEntry, - CMsvEntry& aParent, - TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Open entry. - * @param aStatus Status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* OpenL( TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Close entry. - * @param aStatus Status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* CloseL( TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Launches editor/settings dialog as appropriate. - * @param aStatus Status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* EditL( TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Launches viewer/settings dialog as appropriate - * @param aStatus Status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* ViewL( TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Deletes selection from current context - * Deletes entries from the current context, - * which must be a folder or service of the relevant MTM - * @param aSelection reference to entry. - * @param aStatus Status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* DeleteFromL( - const CMsvEntrySelection& aSelection, - TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Deletes service, which need not - * be the current context. - * @param aService reference to entry. - * @param aStatus Status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* DeleteServiceL( - const TMsvEntry& aService, - TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Remove remaining message of deleted service. - * @param aChildren reference to entry selection. - * @return None. - */ - void DeleteRecursivelyL( CMsvEntrySelection& aChildren ); - - - /** - * From CBaseMtmUi Reply entry - * @param aDestination id for msv. - * @param aPartlist partlist id. - * @param aCompletionStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* ReplyL( - TMsvId aDestination, - TMsvPartList aPartlist, - TRequestStatus& aCompletionStatus ); - - - /** - * From CBaseMtmUi forward entry - * @param aDestination id for msv. - * @param aPartlist partlist id. - * @param aCompletionStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* ForwardL( - TMsvId aDestination, - TMsvPartList aPartList, - TRequestStatus& aCompletionStatus ); - - - /** - * From CBaseMtmUi Open entry - * @param aStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* OpenL( - TRequestStatus& aStatus, - const CMsvEntrySelection& aSelection ); - - /** - * From CBaseMtmUi Close entry - * @param aStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* CloseL( - TRequestStatus& aStatus, - const CMsvEntrySelection& aSelection ); - - /** - * From CBaseMtmUi Handles sending. - * @param aStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* EditL( - TRequestStatus& aStatus, - const CMsvEntrySelection& aSelection ); - - /** - * From CBaseMtmUi Launches viewer/settings dialog as appropriate - * @param aStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* ViewL( - TRequestStatus& aStatus, - const CMsvEntrySelection& aSelection ); - - - /** - * From CBaseMtmUi Context should be MTM folder/service to copy to - * @param aStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* CopyToL( - const CMsvEntrySelection& aSelection, - TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Context should be MTM folder/service to Move to - * @param aStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* MoveToL( - const CMsvEntrySelection& aSelection, - TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Context should be MTM folder/service to copy from - * @param aStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* CopyFromL( - const CMsvEntrySelection& aSelection, - TMsvId aTargetId, - TRequestStatus& aStatus ); - - /** - * From CBaseMtmUi Context should be MTM folder/service to move from - * @param aStatus status for operation. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* MoveFromL( - const CMsvEntrySelection& aSelection, - TMsvId aTargetId, - TRequestStatus& aStatus ); - - - - /** - * From CBaseMtmUi Display progress summary. - * @param aProgress reference to summary text. - * @return TInt error code. - */ - TInt DisplayProgressSummary( const TDesC8& aProgress ) const; - - /** - * From CBaseMtmUi return progress status. - * @param aProgress reference to progress packet. - * @param aReturnString returned progress text. - * @param aTotalEntryCount entry count. - * @param aEntriesDone completed entries. - * @param aCurrentEntrySize size of the entry. - * @param aCurrentBytesTrans transferred bytes. - * @return TInt error code. - */ - virtual TInt GetProgress( - const TDesC8& aProgress, - TBuf& aReturnString, - TInt& aTotalEntryCount, - TInt& aEntriesDone, - TInt& aCurrentEntrySize, - TInt& aCurrentBytesTrans ) const; - - - /** - * From CBaseMtmUi Return capability. - * @param aCapability UID for capability. - * @return TInt error code. - */ - virtual TInt QueryCapability( TUid aCapability, TInt& aResponse ); - - /** - * From CBaseMtmUi Synchronous MTM function operation. - * @param aFunctionId Function ID. - * @param CMsvEntrySelection entry reference. - * @param aParam parameter for function. - * @return None. - */ - virtual void InvokeSyncFunctionL( - TInt aFunctionId, - const CMsvEntrySelection& aSelection, - TDes8& aParameter ); - - /** - * From CBaseMtmUi Cancel sending. - * @param aStatus Async status for operation. - * @param CMsvEntrySelection entry reference. - * @return CMsvOperation pointer to Msg operation. - */ - virtual CMsvOperation* CancelL( - TRequestStatus& aStatus, - const CMsvEntrySelection& aSelection ); - - protected: - - /** - * C++ default constructor. - */ - CIrMtmUi( CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll ); - - /** - * By default Symbian OS constructor is private. - */ - virtual void ConstructL(); - - protected: // Functions from base classes - - /** - * From CBaseMtmUi return resource filename. - * @param aProgress reference to summary text. - * @return TInt error code. - */ - virtual void GetResourceFileName( TFileName& aFileName ) const; - - /** - * From CBaseMtmUi Launch viewer for received message. - * @param aStatus Async status for operation. - * @param aSession session reference. - * @return CMsvOperation pointer to Msg operation. - */ - CMsvOperation* LaunchEditorApplicationL( - TRequestStatus& aStatus, - CMsvSession& aSession ); - - protected: // New functions - - /** - * Register MTM. - * @param aMtmType MTM UID. - * @return CBaseMtm pointer. - */ - CBaseMtm* GetClientMtmLC( TUid aMtmType ); - - /** - * Display progress summary. - * @param aProgress reference to summary text. - * @return TInt error code. - */ - TInt DisplayProgressSummaryL( const TDesC8& aProgress ) const; - - protected: // data - TBuf iConnectingText; - TBuf iSendingText; - CClientMtmRegistry* iClientRegistry; // pointer to registration. - TBool iCurrentlySending; // Sending state - }; - -#endif // CIRMTMUI_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuiinfrared/inc/irmtmuidata.h --- a/localconnectivityservice/obexreceiveservices/mtmuiinfrared/inc/irmtmuidata.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,245 +0,0 @@ -/* -* Copyright (c) 2002 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: -* Message type module UI data part. -* -* -*/ - - -#ifndef CIRMTMUIDATA_H -#define CIRMTMUIDATA_H - -// INCLUDES -#include -#include - -// FORWARD DECLARATIONS - - -// CLASS DECLARATION -/** -* CIrMtmUiData -* -*/ -class CIrMtmUiData : public CBaseMtmUiData - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CIrMtmUiData* NewL(CRegisteredMtmDll& aRegisteredDll); - - /** - * Destructor. - */ - virtual ~CIrMtmUiData(); - - /** - * By default Symbian OS constructor is private. - */ - void ConstructL(); - - public: // Functions from base classes - - /** - * From CBaseMtmUiData function query. - * @param aOperationId Id for function. - * @param aContext messaging store entry. - * @return TInt error code. - */ - virtual TInt OperationSupportedL( - TInt aOperationId, - const TMsvEntry& aContext) const; - - /** - * From CBaseMtmUiData MTM capability check. - * @param aCapability Uid for message type. - * @param aResponse response for capability check. - * @return TInt error code. - */ - virtual TInt QueryCapability( - TUid aCapability, - TInt& aResponse) const; - - /** - * From CBaseMtmUiData MTM related context icons. - * @param aContext Messaging entry refence. - * @param aStateFlags Flags for icon. - * @return TInt error code. - */ - virtual const CBitmapArray& ContextIcon( - const TMsvEntry& aContext, - TInt aStateFlags) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aParent Messaging entry refence. - * @param aNewEntry Messaging entry refence(created entry). - * @param aReasonResourceId ResourceID. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanCreateEntryL( - const TMsvEntry& aParent, - TMsvEntry& aNewEntry, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanReplyToEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanForwardEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanEditEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanViewEntryL(const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanOpenEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanCloseEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanDeleteFromEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanDeleteServiceL( - const TMsvEntry& aService, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanCopyMoveToEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanCopyMoveFromEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @param aReasonResourceId Resource id. - * @return TBool inform that mtm can provice function or not. - */ - virtual TBool CanCancelL(const TMsvEntry& aContext, - TInt& aReasonResourceId) const; - - /** - * From CBaseMtmUiData Provide context-specific function information. - * @param aContext Messaging entry refence. - * @return HBufC* Statustext for sending. - */ - virtual HBufC* StatusTextL(const TMsvEntry& aContext) const; - - protected: // Functions from base classes - - /** - * From CBaseMtmUiData Populate icon array - */ - virtual void PopulateArraysL(); - - /** - * From CBaseMtmUiData gets resource filename. - */ - virtual void GetResourceFileName(TFileName& aFileName) const; - - protected: - - /** - * C++ default constructor. - */ - CIrMtmUiData(CRegisteredMtmDll& aRegisteredDll); - - protected: // New functions - - /** - * Checks is the entry valid. - * @param aContext reference to the entry. - * @return TBool - */ - TBool CheckEntry(const TMsvEntry& aContext) const; - - }; - -#endif // CIRMTMUIDATA_H -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuiinfrared/src/irmtmui.cpp --- a/localconnectivityservice/obexreceiveservices/mtmuiinfrared/src/irmtmui.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,678 +0,0 @@ -/* -* Copyright (c) 2002 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: -* CIrMtmui class -* -* -*/ - - -// INCLUDE FILES -#include "irmtmui.h" -#include "debug.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // Notifier UID's -#include //For notifier -#include -#include - -const TInt KIrMtmUiConnectionTimeout = 20000000; -const TInt KIrMtmUiReceiveTimeout = 0; - -// ================= MEMBER FUNCTIONS ======================= - -// C++ default constructor can NOT contain any code, that -// might leave. -// -CIrMtmUi::CIrMtmUi(CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll) - : CBaseMtmUi(aBaseMtm, aRegisteredMtmDll) - { - } - -// Two-phased constructor. -CIrMtmUi* CIrMtmUi::NewL( - CBaseMtm& aBaseMtm, - CRegisteredMtmDll& aRegisteredMtmDll) - { - CIrMtmUi* self=new(ELeave) CIrMtmUi(aBaseMtm, aRegisteredMtmDll); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// Destructor -CIrMtmUi::~CIrMtmUi() - { - delete iClientRegistry; - } - - -// Symbian OS default constructor can leave. -void CIrMtmUi::ConstructL() - { - // --- Make sure base class correctly constructed --- - CBaseMtmUi::ConstructL(); - TObexUtilsUiLayer::ReadResourceL( iConnectingText, R_IR_CONNECTING ); - TObexUtilsUiLayer::ReadResourceL( iSendingText, R_IR_SENDING_DATA ); - iCurrentlySending = EFalse; - } - -// --------------------------------------------------------- -// GetResourceFileName(...) -// return progress status. -// --------------------------------------------------------- -// -void CIrMtmUi::GetResourceFileName( TFileName& aFileName ) const - { - FLOG( _L( "[CIrMtmUi] CIrMtmUi: GetResourceFileName\t" ) ); - aFileName = KObexUtilsFileDrive; - aFileName += KDC_RESOURCE_FILES_DIR; - aFileName += KObexUtilsResourceFileName; - } - -// --------------------------------------------------------- -// QueryCapability(TUid aCapability, TInt& aResponse) -// return capability of mtm. -// --------------------------------------------------------- -// -TInt CIrMtmUi::QueryCapability(TUid aCapability, TInt& aResponse) - { // Querying of menu availablility is done in syni. - FLOG( _L( "[IRU] CIrMtmUi: QueryCapability\t" ) ); - if (aCapability.iUid == KUidMsvMtmUiQueryCanPrintMsgValue) - { - aResponse=ETrue; - return KErrNone; - } - return CBaseMtmUi::QueryCapability(aCapability, aResponse); - } - -// --------------------------------------------------------- -// InvokeSyncFunctionL(...) -// Invoke sync -function from BaseMTM. -// --------------------------------------------------------- -// -void CIrMtmUi::InvokeSyncFunctionL( - TInt aFunctionId, - const CMsvEntrySelection& aSelection, - TDes8& aParameter) - { - FLOG( _L( "[IRU] CIrMtmUi: InvokeSyncFunctionL\t" ) ); - CBaseMtmUi::InvokeSyncFunctionL(aFunctionId, aSelection, aParameter); - } - - -// --------------------------------------------------------- -// CreateL(...) -// Entry creation forbidden. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::CreateL( - const TMsvEntry& /*aEntry*/, - CMsvEntry& /*aParent*/, - TRequestStatus& /*aStatus*/) - { - // Entries created through utility functions. - User::Leave(KErrNotSupported); - return NULL; - } - - -// --------------------------------------------------------- -// OpenL(TRequestStatus& aStatus) -// handles opening entry. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::OpenL(TRequestStatus& aStatus) - { - FLOG( _L( "[IRU] CIrMtmUi: OpenL\t" ) ); - const TMsvEntry& context=iBaseMtm.Entry().Entry(); - const TUid type(context.iType); - - if ( (type==KUidMsvMessageEntry) && - ((context.Parent()==KMsvSentEntryIdValue) - ||(context.Parent()==KMsvGlobalInBoxIndexEntryIdValue)) - ) - { - // Message is in the sent folder, so can't be edited - return ViewL(aStatus); - } - - return EditL(aStatus); - } - -// --------------------------------------------------------- -// OpenL(...) -// handles opening entry using selection. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::OpenL( - TRequestStatus& aStatus, - const CMsvEntrySelection& aSelection) - { - iBaseMtm.Entry().SetEntryL(aSelection.At(0)); - return OpenL(aStatus); - } - -// --------------------------------------------------------- -// CloseL(TRequestStatus& aStatus) -// Closes entry. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::CloseL(TRequestStatus& aStatus) - { - FLOG( _L( "[IRU] CIrMtmUi: CloseL\t" ) ); - CMsvCompletedOperation* op=CMsvCompletedOperation::NewL( - Session(), - Type(), - KNullDesC8, - KMsvLocalServiceIndexEntryId, - aStatus); - return op; - } - -// --------------------------------------------------------- -// CloseL(TRequestStatus& aStatus) -// Closes entry using selection. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::CloseL( - TRequestStatus& aStatus, - const CMsvEntrySelection& aSelection) - { - iBaseMtm.Entry().SetEntryL(aSelection.At(0)); - return CloseL(aStatus); - } - -// --------------------------------------------------------- -// EditL(TRequestStatus& aStatus) -// Handles message sending. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::EditL(TRequestStatus& aStatus) - { - FLOG( _L( "[IRU] CIrMtmUi: EditL\t" ) ); - switch( iBaseMtm.Entry().Entry().iType.iUid ) - { - case KUidMsvMessageEntryValue: - { - if( iBaseMtm.Entry().Entry().Parent() != KMsvDraftEntryId && - iBaseMtm.Entry().Entry().Parent() != KMsvGlobalOutBoxIndexEntryId ) - { - // Edit/"use" entries in the Inbox - return LaunchEditorApplicationL( aStatus, iBaseMtm.Entry().Session() ); - } - else - { - FeatureManager::InitializeLibL(); - if(!FeatureManager::FeatureSupported(KFeatureIdIrda)) - { - FLOG(_L("[IRSS]\t FeatMgr doesn't find IrDA, show not_supported ")); - RNotifier notifier; - User::LeaveIfError( notifier.Connect() ); - TBTGenericInfoNotiferParamsPckg paramsPckg; - paramsPckg().iMessageType=EIRNotSupported; - TInt status = notifier.StartNotifier(KBTGenericInfoNotifierUid, paramsPckg); - if ( status != KErrNone ) - { - FTRACE(FPrint(_L("[IRSS]\t void CIrMtmUi::EditL() ERROR: StartNotifier() failed. Code: %d "), status)); - } - notifier.Close(); - User::Leave(KErrNone); - } - FeatureManager::UnInitializeLib(); - CIrClientMtm::STimeouts timeouts; - timeouts.iConnectTimeout = KIrMtmUiConnectionTimeout; - timeouts.iPutTimeout = KIrMtmUiReceiveTimeout; - - TPckgBuf timeoutBuf( timeouts ); - - CMsvEntrySelection* sel = new( ELeave ) CMsvEntrySelection(); - CleanupStack::PushL( sel ); - - sel->AppendL( BaseMtm().Entry().EntryId() ); - - CMsvOperationWait* waiter = CMsvOperationWait::NewLC(); - - TBuf toFrom; - TInt resourceId = R_IR_SEND_OUTBOX_SENDING; - TObexUtilsUiLayer::ReadResourceL( toFrom, resourceId ); - - TMsvEntry newTEntry( iBaseMtm.Entry().Entry() ); - newTEntry.iDetails.Set( toFrom ); - newTEntry.SetVisible( ETrue ); - newTEntry.SetInPreparation( ETrue ); - - iBaseMtm.Entry().ChangeL( newTEntry ); - - CMsvEntry* entry = - BaseMtm().Session().GetEntryL( KMsvDraftEntryId ); - - CleanupStack::PushL( entry ); - - CMsvOperation* moveOp = entry->MoveL( - *sel, - KMsvGlobalOutBoxIndexEntryId, - waiter->iStatus ); - - CleanupStack::PopAndDestroy(entry); - - waiter->Start(); - CActiveScheduler::Start(); - delete moveOp; - - CleanupStack::PopAndDestroy(waiter); - - TInt dialogIndex =((R_IR_SENDING_DATA & KResourceNumberMask) - KFirstResourceOffset) + KEnumStart; - CMsvProgressReporterOperation* reporter = - CMsvProgressReporterOperation::NewL( Session(), aStatus, dialogIndex, KObexUtilsCategory); - CleanupStack::PushL( reporter ); - - CMsvOperation* op = BaseMtm().InvokeAsyncFunctionL( - CIrClientMtm::EIrcCmdSend, - *sel, - timeoutBuf, - reporter->RequestStatus() ); - - // ownership of op transfered to reporter - reporter->SetOperationL( op ); - reporter->SetTitleL(iConnectingText); - aStatus = KRequestPending; - - CleanupStack::Pop(reporter); - CleanupStack::PopAndDestroy(sel); - // ownership of reporter transfered to caller - return reporter; - } - } - case KUidMsvServiceEntryValue: - case KUidMsvAttachmentEntryValue: - case KUidMsvFolderEntryValue: - { - User::Leave( KErrNotSupported ); - break; - } - default: - { - break; - } - } - - CMsvCompletedOperation* op = CMsvCompletedOperation::NewL( - Session(), - Type(), - KNullDesC8, - KMsvLocalServiceIndexEntryId, - aStatus ); - FLOG( _L( "[IrMtmUi] CIrMtmUi: EditL Done\t" ) ); - - aStatus = KRequestPending; - return op; - } - -// --------------------------------------------------------- -// EditL(...) -// Handles message sending using selection. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::EditL( TRequestStatus& aStatus, - const CMsvEntrySelection& aSelection) - { - iBaseMtm.Entry().SetEntryL( aSelection.At(0) ); - return EditL( aStatus ); - } - -// --------------------------------------------------------- -// ViewL(TRequestStatus& aStatus) -// Handles viewing of received object. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::ViewL( TRequestStatus& aStatus ) - { - FLOG( _L( "[IRU] CIrMtmUi: ViewL\t" ) ); - return LaunchEditorApplicationL(aStatus, iBaseMtm.Entry().Session()); - } - -// --------------------------------------------------------- -// ViewL(...) -// Handles viewing of received object using selection. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::ViewL( TRequestStatus& aStatus, - const CMsvEntrySelection& aSelection ) - { - iBaseMtm.Entry().SetEntryL(aSelection.At(0)); - return ViewL(aStatus); - } - -// --------------------------------------------------------- -// CopyFromL(...) -// Not supported. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::CopyFromL( const CMsvEntrySelection& /*aSelection*/, - TMsvId /*aTargetId*/, - TRequestStatus& /*aStatus*/) - { - User::Leave(KErrNotSupported); - return NULL; - } - -// --------------------------------------------------------- -// MoveFromL(...) -// Not supported. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::MoveFromL( const CMsvEntrySelection& /*aSelection*/, - TMsvId /*aTargetId*/, - TRequestStatus& /*aStatus*/) - { - User::Leave(KErrNotSupported); - return NULL; - } - -// --------------------------------------------------------- -// MoveToL(...) -// Not supported. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::MoveToL( const CMsvEntrySelection& /*aSelection*/, - TRequestStatus& /*aStatus*/) - { - User::Leave(KErrNotSupported); - return NULL; - } - -// --------------------------------------------------------- -// CopyToL(...) -// Not supported. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::CopyToL( const CMsvEntrySelection& /*aSelection*/, - TRequestStatus& /*aStatus*/ ) - { - User::Leave(KErrNotSupported); - return NULL; - } - -// --------------------------------------------------------- -// DisplayProgressSummary(const TDesC8& aProgress) const -// calls leaving DisplayProgressSummaryL -function and -// traps the error. -// --------------------------------------------------------- -// -TInt CIrMtmUi::DisplayProgressSummary( const TDesC8& aProgress ) const - { - FLOG( _L( "[IRU] CIrMtmUi: DisplayProgressSummary\t" ) ); - TInt retVal = KErrNone; - TRAP( retVal, retVal = DisplayProgressSummaryL( aProgress ) ); - return retVal; - } - -// --------------------------------------------------------- -// TInt CIrMtmUi::DisplayProgressSummaryL(const TDesC8& aProgress) const -// Shows connection summary. -// --------------------------------------------------------- -// -TInt CIrMtmUi::DisplayProgressSummaryL( const TDesC8& aProgress ) const - { - FLOG( _L( "[IRU] CIrMtmUi: DisplayProgressSummaryL\t" ) ); - TInt resourceId; - if( ( !aProgress.Length() ) || - ( aProgress.Size() == sizeof( TMsvLocalOperationProgress ) ) ) - { - // Probably a CMsvCompletedOperation - return KErrCancel; - } - TPckgBuf paramPack; - paramPack.Copy( aProgress ); - TObexMtmProgress& progress = paramPack(); - - const TObexMtmProgress::TSendState progressType = progress.iSendState; - const TInt error = progress.iError; - - if( error == KErrInUse ) - { - resourceId = R_IR_CANNOT_ESTABLISH; - TObexUtilsUiLayer::ShowInformationNoteL( resourceId ); - return KErrNone; - } - - switch( progressType ) - { - case TObexMtmProgress::EDisconnected: - { - // Allowed to send again. - CONST_CAST( CIrMtmUi*, this )->iCurrentlySending = EFalse; - resourceId = R_IR_DATA_SENT; - TObexUtilsUiLayer::ShowInformationNoteL( resourceId ); - break; - } - case TObexMtmProgress::ESendError: - { - if( error == KErrIrObexClientNoDevicesFound ) - { - resourceId = R_IR_CANNOT_ESTABLISH; - TObexUtilsUiLayer::ShowInformationNoteL( resourceId ); - } - else - { - resourceId = R_IR_SENDING_FAILED; - TObexUtilsUiLayer::ShowErrorNoteL( resourceId ); - } - break; - } - case TObexMtmProgress::ESendComplete: - { - break; - } - case TObexMtmProgress::EInitialise: - case TObexMtmProgress::EConnect: - case TObexMtmProgress::EConnectAttemptComplete: - case TObexMtmProgress::ESendObject: - case TObexMtmProgress::ESendNextObject: - { - return KErrCancel; - } - case TObexMtmProgress::EUserCancelled: - { - return KErrCancel; - } - default: - { - return KErrCancel; - } - } - FLOG( _L( "[IRU] CIrMtmUi: DisplayProgressSummaryL Done\t" ) ); - return KErrNone; - } - -// --------------------------------------------------------- -// GetProgress(...) -// return progress status. -// --------------------------------------------------------- -// -TInt CIrMtmUi::GetProgress( const TDesC8& aProgress, - TBuf& aReturnString, - TInt& aTotalEntryCount, - TInt& aEntriesDone, - TInt& aCurrentEntrySize, - TInt& aCurrentBytesTrans ) const - { - FLOG( _L( "[CIrMtmUi] CIrMtmUi: GetProgress\t" ) ); - TPckgBuf paramPack; - paramPack.Copy( aProgress ); - TObexMtmProgress& progress = paramPack(); - const TObexMtmProgress::TSendState progressType = progress.iSendState; - aTotalEntryCount = progress.iTotalEntryCount; - aEntriesDone = progress.iEntriesDone; - aCurrentEntrySize = progress.iCurrentEntrySize; - aCurrentBytesTrans = progress.iCurrentBytesTrans; - - if( aTotalEntryCount > 1 ) // This is for progress bar multisending - { - aCurrentEntrySize = 0; - } - switch( progressType ) - { - case TObexMtmProgress::ENullOp: - case TObexMtmProgress::ESendError: - { - aReturnString = KNullDesC; - break; - } - case TObexMtmProgress::EInitialise: - case TObexMtmProgress::EConnect: - case TObexMtmProgress::EConnectAttemptComplete: - { - aReturnString = iConnectingText; - break; - } - case TObexMtmProgress::ESendObject: - case TObexMtmProgress::ESendNextObject: - case TObexMtmProgress::ESendComplete: - { - aReturnString = iSendingText; - break; - } - case TObexMtmProgress::EDisconnected: - { - break; - } - default: - { - return KErrCancel; - } - } - FLOG( _L( "[CBtMtmUi] CBtMtmUi: GetProgress Done\t" ) ); - return KErrNone; - } - -// --------------------------------------------------------- -// LaunchEditorApplicationL(...) -// Launch viewer for selected object. The first is object's -// recognition(document handler). -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::LaunchEditorApplicationL( TRequestStatus& aStatus, - CMsvSession& aSession) - { - FLOG( _L( "[CIrMtmUi] CIrMtmUi: LaunchEditorApplicationL\t" ) ); - CMsvEntry* message; - message = &iBaseMtm.Entry(); - return TObexUtilsUiLayer::LaunchEditorApplicationOperationL( aSession, message, aStatus ); - } - - -// --------------------------------------------------------- -// GetClientMtmLC(TUid aMtmType) -// Handles MTM registration. -// --------------------------------------------------------- -// -CBaseMtm* CIrMtmUi::GetClientMtmLC( TUid aMtmType ) - { - if (!iClientRegistry) - { - iClientRegistry = CClientMtmRegistry::NewL( Session() ); - } - CBaseMtm* mtm=iClientRegistry->NewMtmL( aMtmType ); - CleanupStack::PushL( mtm ); - return mtm; - } - -// --------------------------------------------------------- -// DeleteFromL(TUid aMtmType) -// passes entry selection to Base for deletion. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::DeleteFromL( const CMsvEntrySelection& aSelection, - TRequestStatus& aStatus) - - { - return CBaseMtmUi::DeleteFromL(aSelection, aStatus); - } - -// --------------------------------------------------------- -// DeleteServiceL(...) -// IR has no service, just complete it. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::DeleteServiceL( const TMsvEntry& /*aService*/, - TRequestStatus& aStatus) - - { - return CMsvCompletedOperation::NewL( - Session(), - Type(), - KNullDesC8, - KMsvLocalServiceIndexEntryId, - aStatus); - } - -// --------------------------------------------------------- -// ReplyL(...) -// Reply is forbidden. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::ReplyL( TMsvId /*aDestination*/, - TMsvPartList /*aPartlist*/, - TRequestStatus& /*aCompletionStatus*/) - { - User::Leave(KErrNotSupported); - // Return value is needed for removing compilation errors - return NULL; - } - -// --------------------------------------------------------- -// ForwardL(...) -// Forward is forbidden. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::ForwardL( TMsvId /*aDestination*/, - TMsvPartList /*aPartList*/, - TRequestStatus& /*aCompletionStatus*/ ) - { - User::Leave(KErrNotSupported); - // Return value is needed for removing compilation errors - return NULL; - } - -// --------------------------------------------------------- -// CancelL(...) -// No MS way of sending a message from the outbox, so no need to cancel. -// Just complete it. -// --------------------------------------------------------- -// -CMsvOperation* CIrMtmUi::CancelL( TRequestStatus& aStatus, - const CMsvEntrySelection& /*aSelection*/ ) - { - return CMsvCompletedOperation::NewL( - Session(), - Type(), - KNullDesC8, - KMsvLocalServiceIndexEntryId, - aStatus, - KErrNone); - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuiinfrared/src/irmtmuidata.cpp --- a/localconnectivityservice/obexreceiveservices/mtmuiinfrared/src/irmtmuidata.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,408 +0,0 @@ -/* -* Copyright (c) 2002 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: -* Class CIrMtmUiData -* -*/ - - -// INCLUDE FILES -#include "irmtmuidata.h" -#include "irmtmui.h" -#include -#include -#include -#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS -#include //kuidmtmquerymaxbodysizevalue etc -#else -#include //kuidmtmquerymaxbodysizevalue etc -#include //kuidmtmquerymaxbodysizevalue etc -#endif -#include -#include -#include -#include "debug.h" - -//CONSTANTS -const TInt KIrMtmUiDataMsgEditorAppValue = 0x00000000; - -// ================= MEMBER FUNCTIONS ======================= - -// Two-phased constructor. -CIrMtmUiData* CIrMtmUiData::NewL(CRegisteredMtmDll& aRegisteredDll) - { - FLOG( _L( "[CIrMtmUiData] CIrMtmUiData: CIrMtmUiData\t" ) ); - CIrMtmUiData* self=new(ELeave) CIrMtmUiData(aRegisteredDll); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// Symbian OS default constructor can leave. -void CIrMtmUiData::ConstructL() - { - FLOG( _L( "[CIrMtmUiData] CIrMtmUiData: ConstructL\t" ) ); - CBaseMtmUiData::ConstructL(); - TObexUtilsMessageHandler::CreateDefaultMtmServiceL(KUidMsgTypeIrUID); - FLOG( _L( "[CIrMtmUiData] CIrMtmUiData: ConstructL done\t" ) ); - } - -// C++ default constructor can NOT contain any code, that -// might leave. -// -CIrMtmUiData::CIrMtmUiData(CRegisteredMtmDll& aRegisteredDll) - : CBaseMtmUiData(aRegisteredDll) - { - } - - -// Destructor -CIrMtmUiData::~CIrMtmUiData() - { - FLOG( _L( "[CIrMtmUiData] CIrMtmUiData: ~CIrMtmUiData\t" ) ); - } - - -// --------------------------------------------------------- -// OperationSupportedL(...) -// No Ir-specific operations added to MS menu. -// --------------------------------------------------------- -// -TInt CIrMtmUiData::OperationSupportedL( - TInt /*aOperationId*/, - const TMsvEntry& /*aContext*/) const - { - FLOG( _L( "[CIrMtmUiData] CIrMtmUiData: OperationSupportedL\t" ) ); - return TObexUtilsUiLayer::OperationNotSupported(); - } - -// --------------------------------------------------------- -// QueryCapability(...) -// MTM query capability -// --------------------------------------------------------- -// -TInt CIrMtmUiData::QueryCapability( - TUid aCapability, - TInt& aResponse ) const - { - FLOG( _L( "[CIrMtmUiData] CIrMtmUiData: QueryCapability\t" ) ); - switch( aCapability.iUid ) - { - // --- Supported valued capabilities --- - case KUidMtmQueryMaxBodySizeValue: - { - aResponse = KMaxTInt; - break; - } - case KUidMtmQueryMaxTotalMsgSizeValue: - { - aResponse = KMaxTInt; - break; - } - case KUidMsvMtmQueryEditorUidValue: - { - aResponse = KIrMtmUiDataMsgEditorAppValue; - break; - } - case KUidMsvMtmQuerySupportLinks: - { - aResponse = ETrue; - break; - } - case KUidMtmQuerySupportAttachmentsValue: - case KUidMtmQueryCanSendMsgValue: - { - break; - } - case KUidMtmQuerySupportedBodyValue: - default: - { - return KErrNotSupported; - } - } - return KErrNone; - } - -// --------------------------------------------------------- -// CBaseMtmUiData::CBitmapArray& CIrMtmUiData::ContextIcon(...) -// Handles received msg icon. -// --------------------------------------------------------- -// -const CBaseMtmUiData::CBitmapArray& CIrMtmUiData::ContextIcon( - const TMsvEntry& aContext, - TInt /*aStateFlags*/) const - - { - TInt icon = TObexUtilsUiLayer::ContextIcon( aContext, EInfrared ); - return *iIconArrays->At( icon/2 ); - } - -// --------------------------------------------------------- -// PopulateArraysL() -// Populates bitmap array -// --------------------------------------------------------- -// -void CIrMtmUiData::PopulateArraysL() - { - FLOG( _L( "[CIrMtmUiData] CIrMtmUiData: PopulateArraysL\t" ) ); - - TObexUtilsUiLayer::CreateIconsL( KUidMsgTypeIrUID, iIconArrays ); - } - -// --------------------------------------------------------- -// GetResourceFileName(TFileName& aFileName) const -// Gives resource filename. -// --------------------------------------------------------- -// -void CIrMtmUiData::GetResourceFileName(TFileName& aFileName) const - { - FLOG( _L( "[CIrMtmUiData] CIrMtmUiData: GetResourceFileName\t" ) ); - aFileName = KObexUtilsFileDrive; - aFileName += KDC_RESOURCE_FILES_DIR; - aFileName += KObexUtilsResourceFileName; - } - -// --------------------------------------------------------- -// CanCreateEntryL(...) -// Checks if it is possible to create entry. -// --------------------------------------------------------- -// -TBool CIrMtmUiData::CanCreateEntryL( - const TMsvEntry& aParent, - TMsvEntry& aNewEntry, - TInt& aReasonResourceId ) const - { - FLOG( _L( "[CIrMtmUiData] CIrMtmUiData: CanCreateEntryL\t" ) ); - aReasonResourceId = 0; - if( CheckEntry( aNewEntry ) ) - { - // --- Can create messages in local folders --- - return ( aParent.iMtm.iUid == KMsvLocalServiceIndexEntryIdValue ); - } - // --- Can't create other types --- - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// CanOpenEntryL(...) -// Checks if it is possible to open entry. -// --------------------------------------------------------- -// -TBool CIrMtmUiData::CanOpenEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId ) const - { - FLOG( _L( "[CIrMtmUiData] CIrMtmUiData: CanOpenEntryL\t" ) ); - if( CheckEntry( aContext ) ) - { - if( aContext.iType.iUid == KUidMsvMessageEntryValue ) - { - aReasonResourceId = 0; - return ETrue; - } - } - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// CanCloseEntryL(...) -// Checks if it is possible to close entry. -// --------------------------------------------------------- -// -TBool CIrMtmUiData::CanCloseEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId ) const - { - FLOG( _L( "[CIrMtmUiData] CIrMtmUiData: CanCloseEntryL\t" ) ); - if( CheckEntry( aContext ) ) - { - if( aContext.iType.iUid == KUidMsvServiceEntryValue ) - { - aReasonResourceId = 0; - return ETrue; - } - } - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// CanViewEntryL(...) -// Checks if it is possible to view entry. -// --------------------------------------------------------- -// -TBool CIrMtmUiData::CanViewEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId ) const - { - FLOG( _L( "[CIrMtmUiData] CIrMtmUiData: CanViewEntryL\t" ) ); - if( CheckEntry( aContext ) ) - { - if( aContext.iType.iUid == KUidMsvMessageEntryValue ) - { - aReasonResourceId = 0; - return ETrue; - } - } - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// CanEditEntryL(...) -// Checks if it is possible to edit entry. -// --------------------------------------------------------- -// -TBool CIrMtmUiData::CanEditEntryL( - const TMsvEntry& aContext, - TInt& aReasonResourceId ) const - { - FLOG( _L( "[CIrMtmUiData] CIrMtmUiData: CanEditEntryL\t" ) ); - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - if( CheckEntry( aContext ) ) - { - if ( ( aContext.iType.iUid == KUidMsvMessageEntryValue ) || - ( aContext.iType.iUid == KUidMsvFolderEntryValue ) ) - { - aReasonResourceId=0; - return ETrue; - } - } - return EFalse; - } - -// --------------------------------------------------------- -// CanDeleteServiceL(...) -// Checks if it is possible to delete service. -// --------------------------------------------------------- -// -TBool CIrMtmUiData::CanDeleteServiceL( - const TMsvEntry& /*aService*/, - TInt& aReasonResourceId ) const - { - FLOG( _L( "[CIrMtmUiData] CIrMtmUiData: CanDeleteServiceL\t" ) ); - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// CanDeleteFromEntryL(...) -// Checks if it is possible to delete from entry. -// --------------------------------------------------------- -// -TBool CIrMtmUiData::CanDeleteFromEntryL( - const TMsvEntry& /*aContext*/, - TInt& aReasonResourceId ) const - { - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// CanCopyMoveToEntryL(...) -// Checks if it is possible to move to entry. -// --------------------------------------------------------- -// -TBool CIrMtmUiData::CanCopyMoveToEntryL( - const TMsvEntry& /*aContext*/, - TInt& aReasonResourceId ) const - { - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// CanCopyMoveFromEntryL(...) -// Checks if it is possible to move from entry. -// --------------------------------------------------------- -// -TBool CIrMtmUiData::CanCopyMoveFromEntryL( - const TMsvEntry& /*aContext*/, - TInt& aReasonResourceId ) const - { - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// CanReplyToEntryL(...) -// Checks if it is possible to reply to entry. -// --------------------------------------------------------- -// -TBool CIrMtmUiData::CanReplyToEntryL( - const TMsvEntry& /*aContext*/, - TInt& aReasonResourceId ) const - { - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; // Not Ok to do - } - -// --------------------------------------------------------- -// CanForwardEntryL(...) -// Checks if it is possible to forward entry. -// --------------------------------------------------------- -// -TBool CIrMtmUiData::CanForwardEntryL( - const TMsvEntry& /*aContext*/, - TInt& aReasonResourceId ) const - { - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; // Not Ok to do - } - -// --------------------------------------------------------- -// CheckEntry(...) -// Checks is the entry valid. -// --------------------------------------------------------- -// -TBool CIrMtmUiData::CheckEntry(const TMsvEntry& aContext) const - { - FLOG( _L( "[CIrMtmUiData] CIrMtmUiData: CheckEntry\t" ) ); - return( ( aContext.iType.iUid == KUidMsvMessageEntryValue ) && - ( aContext.iMtm == KUidMsgTypeIrUID ) ); - } - -// --------------------------------------------------------- -// CanCancelL(...) -// Checks if it is possible to cancel entry. -// --------------------------------------------------------- -// -TBool CIrMtmUiData::CanCancelL( - const TMsvEntry& /*aContext*/, TInt& aReasonResourceId ) const - { - // No way of sending a message from the outbox, so no need to cancel. - aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); - return EFalse; - } - -// --------------------------------------------------------- -// StatusTextL(...) -// Returns status text when sending message(outbox). -// --------------------------------------------------------- -// -HBufC* CIrMtmUiData::StatusTextL( const TMsvEntry& /*aContext*/ ) const - { - FLOG( _L( "[CIrMtmUiData] CIrMtmUiData: StatusTextL\t" ) ); - TBuf<80> buffer; - TInt resourceId = R_IR_SEND_PROGRESS_SENDING; - TObexUtilsUiLayer::ReadResourceL( buffer, resourceId ); - HBufC* ptr; - ptr = buffer.AllocL(); - return ptr; - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/mtmuiinfrared/src/irmtmuidll.cpp --- a/localconnectivityservice/obexreceiveservices/mtmuiinfrared/src/irmtmuidll.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2002 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: -* DLL interface -* -*/ - - -// INCLUDE FILES - -#include "irmtmuidata.h" -#include "irmtmui.h" -#include "debug.h" - -// ================= OTHER EXPORTED FUNCTIONS ============== - -// -// --------------------------------------------------------- -// NewMtmUiL Creates new MTM UI -// Returns: CBaseMtmUi pointer to created mtm -// -EXPORT_C CBaseMtmUi* NewMtmUiL( CBaseMtm& aMtm, CRegisteredMtmDll& aRegisteredDll ) - { - FLOG( _L( "CBaseMtmUi* NewMtmUiL\t" )); - return CIrMtmUi::NewL( aMtm, aRegisteredDll ); - } - -// -// --------------------------------------------------------- -// NewMtmUiL Creates new MTM UI Data layer -// Returns: CBaseMtmUiData pointer to created mtm -// -EXPORT_C CBaseMtmUiData* NewMtmUiDataLayerL( CRegisteredMtmDll& aRegisteredDll ) - { - FLOG( _L( "CBaseMtmUiData* NewMtmUiDataLayerL\t" )); - return CIrMtmUiData::NewL( aRegisteredDll ); - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/opp/data/101F8636.rss --- a/localconnectivityservice/obexreceiveservices/opp/data/101F8636.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* -* Copyright (c) 2005 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: PC Connectivity Plug-in resource file -* -*/ - - -#include "registryinfo.rh" - -// Declares info for two implementations -RESOURCE REGISTRY_INFO theInfo - { - // UID for the DLL - dll_uid = 0x101F8636; - // Declare array of interface info - interfaces = - { - INTERFACE_INFO - { - // UID of interface that is implemented - interface_uid = 0x101F7C8C; - implementations = - { - // Info for CSConPCConnplugin - IMPLEMENTATION_INFO - { - implementation_uid = 0x101F8636; - version_no = 1; - display_name = "Obex Services"; - default_data = "OBEX/BT||OBEX/IrDA"; - - // - // opaque_data contains parameters used by following API calls in SRCS: - // 1. Setup USB interface string descriptor in Unicode; - // 2. TInt CObex::SetLocalWho(const TDesC8& aInfo); - // 3. TInt CBTConnection::RegisterSecuritySettingsL( TUint aService, - // TInt aProtocol, - // TInt aChannel, - // TBool aAuthenticate, - // TBool aAuthorise, - // TBool aEncrypt ); - // opaque_data = "@0||@1||@2||@3||@4||@5||@6" - // @0 aStrDesc e.g. "PC Connectivity" - // @1 aInfo e.g. KFolderBrowsingID, "\xF9\xEC\x7B\xC4\x95\x3C\x11\xd2\x98\x4E\x52\x54\x00\xDC\x9E\x09" - // @2 aService e.g. KBTSecurityUidFileTransfer, 0x1106 - // @3 aProtocol e.g. KSolBtRFCOMM, 0x1013 - // @4 aAuthenticate e.g. EFalse, 0 - // @5 aAuthorise e.g. EFalse, 0 - // @6 aEncrypt e.g. EFalse, 0 - // - opaque_data = "OBEX|"\ - "||"\ - "|0x1105|"\ - "|0x1013|"\ - "|0|"\ - "|1|"\ - "|0|"\ - "|0xfffe|"\ - "|0xfffe"; - } - }; - } - }; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/opp/group/bld.inf --- a/localconnectivityservice/obexreceiveservices/opp/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This file provides the information required for building the -* whole of a MtmUiServerBluetooth. -* -*/ - - -PRJ_PLATFORMS - - -PRJ_MMPFILES -obexserviceopp.mmp - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/opp/group/obexserviceopp.mmp --- a/localconnectivityservice/obexreceiveservices/opp/group/obexserviceopp.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This is project specification file for the mtmuiserverbluetooth. -* -* -*/ - -#include - - -TARGET obexserviceopp.dll -CAPABILITY CAP_GENERAL_DLL -TARGETTYPE PLUGIN -UID 0x10009d8d 0x101F8636 -VENDORID VID_DEFAULT - -SOURCEPATH ../src -SOURCE obexserviceopp.cpp -SOURCE oppcontroller.cpp - -START RESOURCE ../data/101F8636.rss - TARGET obexserviceopp.rsc -END - - -USERINCLUDE ../inc -SYSTEMINCLUDE ../../../inc ../../../../inc /epoc32/include/ecom -MW_LAYER_SYSTEMINCLUDE - -LIBRARY obexutils.lib -LIBRARY euser.lib -LIBRARY efsrv.lib -LIBRARY servicehandler.lib -LIBRARY avkon.lib -LIBRARY irobex.lib // For Object exchange -LIBRARY imageconversion.lib -LIBRARY bafl.lib -LIBRARY ecom.lib -LIBRARY sysutil.lib -LIBRARY esock.lib -LIBRARY charconv.lib aknnotify.lib eiksrv.lib -LIBRARY platformenv.lib -LIBRARY bluetooth.lib // Bluetooth libraries -LIBRARY btdevice.lib // Bluetooth library -LIBRARY btmanclient.lib - -//Bteng APIs -LIBRARY btengdevman.lib //btengdevman.dll -LIBRARY btengsettings.lib //btengsettings.dll -LIBRARY btengconnman.lib //btengconnman.dll - -DEBUGLIBRARY flogger.lib diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/opp/inc/debug.h --- a/localconnectivityservice/obexreceiveservices/opp/inc/debug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,180 +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: Logging definition -* -*/ - - -#ifndef PRJ_LOGGING_H -#define PRJ_LOGGING_H - -#include "debugconfig.h" - -#ifdef PRJ_ENABLE_TRACE - -#ifdef PRJ_FILE_TRACE -#include -#else -#include -#endif - -const TInt KMaxLogLineLength = 512; - -#define KPRINTERROR 0x00000001 // Tracing level: error -#define KPRINTINFO 0x00000002 // Tracing level: function trace -#define KPRINTSTATE 0x00000004 // Tracing level: state machine info -#define KPRINTWARNING 0x00000008 // Tracing level: warning - -const TInt KTraceMask = KPRINTERROR | KPRINTINFO | KPRINTSTATE | KPRINTWARNING; - -NONSHARABLE_CLASS(TOverflowTruncate16) : public TDes16Overflow - { -public: - void Overflow(TDes16& /*aDes*/) {} - }; - -NONSHARABLE_CLASS(TOverflowTruncate8) : public TDes8Overflow - { -public: - void Overflow(TDes8& /*aDes*/) {} - }; - -inline void Trace(TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); -#ifdef PRJ_FILE_TRACE - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); -#else - TBuf16 theFinalString; - theFinalString.Append(KTracePrefix16); - TOverflowTruncate16 overflow; - theFinalString.AppendFormatList(aFmt,list,&overflow); - RDebug::Print(theFinalString); -#endif - } - -inline void Trace(TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list, aFmt); -#ifdef PRJ_FILE_TRACE - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); -#else - TOverflowTruncate8 overflow; - TBuf8 buf8; - buf8.Append(KTracePrefix8); - buf8.AppendFormatList(aFmt, list, &overflow); - TBuf16 buf16(buf8.Length()); - buf16.Copy(buf8); - TRefByValue tmpFmt(_L("%S")); - RDebug::Print(tmpFmt, &buf16); -#endif - } - -inline void TracePanic( - char* aFile, - TInt aLine, - TInt aPanicCode, - const TDesC& aPanicCategory) - { - TPtrC8 fullFileName((const TUint8*)aFile); - TPtrC8 fileName(fullFileName.Ptr()+fullFileName.LocateReverse('\\')+1); - TBuf8 buf; - buf.Append(KPanicPrefix8); - buf.AppendFormat(_L8("%d at line %d in file %S"), aPanicCode, aLine, &fileName); - Trace(buf); - User::Panic(aPanicCategory, aPanicCode); - } - -inline void TraceLeave(char* aFile, TInt aLine, TInt aReason) - { - TPtrC8 fullFileName((const TUint8*)aFile); - TPtrC8 fileName(fullFileName.Ptr()+fullFileName.LocateReverse('\\')+1); - TBuf8 buf; - buf.Append(KLeavePrefix8); - buf.AppendFormat(_L8("%d at line %d in file %S"), aReason, aLine, &fileName); - Trace(buf); - User::LeaveIfError(aReason); - } - -#define TRACE_INFO(p) {if(KTraceMask & KPRINTINFO) Trace p;} - -#define TRACE_ERROR(p) {if(KTraceMask & KPRINTERROR) Trace p;} - -#define TRACE_STATE(p) {if(KTraceMask & KPRINTSTATE) Trace p;} - -#define TRACE_WARNING(p) {if(KTraceMask & KPRINTWARNING) Trace p;} - -#define TRACE_INFO_SEG(p) {if(KTraceMask & KPRINTINFO) p;} - -#define TRACE_ASSERT(GUARD, CODE) {if (!(GUARD)) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory);} - -#define PANIC(CODE) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory) - -#define LEAVE_IF_ERROR(REASON) {if (REASON) TraceLeave(__FILE__, __LINE__, REASON);} - -#define LEAVE(REASON) {TraceLeave(__FILE__, __LINE__, REASON);} - -#define TRACE_FUNC_ENTRY {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryFormat8, &ptr8);}} - -#define TRACE_FUNC_ENTRY_THIS {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryThisFormat8, &ptr8, this);}} - -#define TRACE_FUNC_EXIT {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncExitFormat8, &ptr8);}} - -#define TRACE_FUNC {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncFormat8, &ptr8);}} - -#define TRACE_FUNC_THIS {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncThisFormat8, &ptr8, this);}} - -#define RETURN_IF_ERR(ERR) {if(ERR) {TPtrC8 ptr8((TUint8*)__FILE__); Trace(_L8(" RETURN %d at file %S line %d"), ERR, &ptr8, __LINE__); return ERR;}} - -#define TRACE_ONLY(p) p - -#else // PRJ_ENABLE_TRACE not defined - -#define TRACE_INFO(p) - -#define TRACE_ERROR(p) - -#define TRACE_STATE(p) - -#define TRACE_WARNING(p) - -#define TRACE_INFO_SEG(p) - -#define TRACE_ASSERT(GUARD, CODE) - -#define PANIC(CODE) {User::Panic(KPanicCategory, CODE);} - -#define LEAVE_IF_ERROR(REASON) {static_cast(User::LeaveIfError(REASON));} - -#define LEAVE(REASON) {static_cast(User::Leave(REASON));} - -#define TRACE_FUNC_ENTRY - -#define TRACE_FUNC_ENTRY_THIS - -#define TRACE_FUNC_EXIT - -#define TRACE_FUNC - -#define TRACE_FUNC_THIS - -#define RETURN_IF_ERR(ERR) {if(ERR) return ERR;} - -#define TRACE_ONLY(p) - -#endif // PRJ_ENABLE_TRACE - -#endif // PRJ_LOGGING_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/opp/inc/debugconfig.h --- a/localconnectivityservice/obexreceiveservices/opp/inc/debugconfig.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +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: Project configure file. -* -*/ - - -#ifndef OBEXSM_DEBUGCONFIG_H -#define OBEXSM_DEBUGCONFIG_H - -#include "prjconfig.h" - - -/** - * Custom logging variations. - */ -#ifdef PRJ_FILE_TRACE -_LIT(KLogFile,"oppreceiveservice.txt"); -_LIT(KLogDir,"locod"); -#endif - -#ifdef PRJ_ENABLE_TRACE -_LIT(KTracePrefix16, "[OPP] "); -_LIT8(KTracePrefix8, "[OPP] "); -_LIT8(KFuncFormat8, "><%S"); -_LIT8(KFuncThisFormat8, "><%S, [0x%08X]"); -_LIT8(KFuncEntryFormat8, ">%S"); -_LIT8(KFuncEntryThisFormat8, ">%S, [0x%08X]"); -_LIT8(KFuncExitFormat8, "<%S"); - -_LIT(KPanicCategory, "OPP"); -_LIT8(KPanicPrefix8, "PANIC code "); -_LIT8(KLeavePrefix8, "LEAVE code "); -#endif - -#endif // OBEXSM_DEBUGCONFIG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/opp/inc/oppcontroller.h --- a/localconnectivityservice/obexreceiveservices/opp/inc/oppcontroller.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ -/* -* Copyright (c) 2004 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: -* Class handles Bluetooth OPP reception. -* -* -*/ - - -#ifndef OPPCONTROLLER_H -#define OPPCONTROLLER_H - -// INCLUDES - - -#include -#include -#include -#include "obexutilspropertynotifier.h" -#include -#include "btengdevman.h" - -#include -#include - -#include // The AIW service handler - -_LIT( KUniqueTransportName, "RFCOMM" ); -const TInt KBtStartReserveChannel = 9; -const TInt KBtEndReserveChannel = 30; - -/** -* CBtListenActive -* Class to implement IrObex permanent listen -*/ -class COPPController : public CSrcsInterface, public MObexServerNotify, - public MObexUtilsPropertyNotifyHandler, - public MGlobalProgressCallback, public MGlobalNoteCallback, - public MBTEngDevManObserver - { -public: - static COPPController* NewL(); - ~COPPController(); - -private: // from CSrcsInterface - TBool IsOBEXActive(); - void SetMediaType(TSrcsMediaType aMediaType); - TInt SetObexServer(CObexServer* aServer); - -private: // from MObexServerNotify - void ErrorIndication(TInt aError); - void TransportUpIndication(); - void TransportDownIndication(); - TInt ObexConnectIndication(const TObexConnectInfo& aRemoteInfo, const TDesC8& aInfo); - void ObexDisconnectIndication(const TDesC8& aInfo); - CObexBufObject* PutRequestIndication(); - TInt PutPacketIndication(); - TInt PutCompleteIndication(); - CObexBufObject* GetRequestIndication(CObexBaseObject* aRequiredObject); - TInt GetPacketIndication(); - TInt GetCompleteIndication(); - TInt SetPathIndication(const CObex::TSetPathInfo& aPathInfo, const TDesC8& aInfo); - void AbortIndication(); - -private: // from MObexUtilsPropertyNotifyHandler - void HandleNotifyL(TMemoryPropertyCheckType aCheckType); - -private: // from MGlobalProgressCallback - void HandleGlobalProgressDialogL(TInt aSoftkey); - -private: // from MGlobalNoteCallback - void HandleGlobalNoteDialogL(TInt aSoftkey); - -private: // from MBTEngDevManObserver - void HandleGetDevicesComplete(TInt aErr, CBTDeviceArray* aDeviceArray); - -private: - COPPController(); - void ConstructL(); - - void CancelTransfer(); - void HandlePutRequestL(); - TInt HandlePutCompleteIndication(); - void HandleError(TBool aAbort); - - TBool CheckCapacityL(); - void LaunchReceivingIndicatorL(); - inline TBool ReceivingIndicatorActive() const { return (iProgressDialog || iWaitDialog); } - void UpdateReceivingIndicator(); - void CloseReceivingIndicator(TBool aResetDisplayedState = ETrue); - TInt GetDriveWithMaximumFreeSpaceL(); - -private: - enum TObexTransferState - { - ETransferIdle, - ETransferPut, - ETransferPutDiskError, - ETransferPutInitError, - ETransferPutCancel, - }; - -private: - CObexServer* iObexServer; - TObexTransferState iObexTransferState; - CObexBufObject* iObexObject; - TInt iDrive; - TBool iListening; - CObexUtilsPropertyNotifier* iLowMemoryActiveCDrive; - CObexUtilsPropertyNotifier* iLowMemoryActiveMMC; - TMsvId iMsvIdParent; - TMsvId iMsvIdAttach; - TFileName iFullPathFilename; - TFileName iDefaultFolder; - TFileName iPreviousDefaultFolder; - TFileName iCenRepFolder; - RFs iFs; - RFile iFile; - CBufFlat* iBuf; - TBool iLengthHeaderReceived; - TSrcsMediaType iMediaType; - TInt iTotalSizeByte; - TFileName iReceivingFileName; - CGlobalProgressDialog* iProgressDialog; - CGlobalDialog* iWaitDialog; - TBool iNoteDisplayed; - CBTEngDevMan* iDevMan; - CBTDeviceArray* iResultArray; - TBTDeviceName iRemoteDeviceName; - }; - -#endif // OPPCONTROLLER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/opp/inc/prjconfig.h --- a/localconnectivityservice/obexreceiveservices/opp/inc/prjconfig.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +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: Project configure file. -* -*/ - - -#ifndef OBEXSM_PRJCONFIG_H -#define OBEXSM_PRJCONFIG_H - -/** - * Traces are enabled via RDebug::Print() in UDEB build, by default. - */ -#ifdef _DEBUG -#define PRJ_ENABLE_TRACE -#endif - -/** - * Traces will be written to file if this is defined. - */ -//#define PRJ_FILE_TRACE - - -/** - * build the project for module test purpose if this is defined - */ -//#define PRJ_MODULETEST_BUILD - -/** - * build the project using stubs to replace the dependencies if this is defined - */ -//#define PRJ_USE_STUB - -#endif // OBEXSM_PRJCONFIG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/opp/src/obexserviceopp.cpp --- a/localconnectivityservice/obexreceiveservices/opp/src/obexserviceopp.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +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: Export ECom interface implementations -* -*/ - - -#include //ECom header file -#include "oppcontroller.h" - -// --------------------------------------------------------------------------- -// An array of TImplementationProxy objects which onnect each -// implemeation with its instantiation function -// --------------------------------------------------------------------------- -// -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY(0x101F8636 , COPPController::NewL ) - }; - -// --------------------------------------------------------------------------- -// Exported proxy function to resolve instantiation methods for an Ecom plug-in DLL -// --------------------------------------------------------------------------- -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt & aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - return ImplementationTable; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/opp/src/oppcontroller.cpp --- a/localconnectivityservice/obexreceiveservices/opp/src/oppcontroller.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,865 +0,0 @@ -/* -* Copyright (c) 2004 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: Implementation of CBtListenActive -* -*/ - - -// INCLUDE FILES -#include // AVKON components -#include "oppcontroller.h" -#include "btengdevman.h" -#include -#include "debug.h" -#include -#include -#include -#include -#include -#include // The AIW service handler -#include -#include -#include -#include -#include -#include - -// CONSTANTS - -const TInt KBufferSize = 0x10000; // 64 kB - -// ================= MEMBER FUNCTIONS ======================= - - -COPPController* COPPController::NewL() - { - COPPController* self = new ( ELeave ) COPPController(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -COPPController::COPPController() - { - TRACE_FUNC - } - -void COPPController::ConstructL() - { - TRACE_FUNC - iObexTransferState = ETransferIdle; - iLowMemoryActiveCDrive = CObexUtilsPropertyNotifier::NewL(this, ECheckPhoneMemory); - iLowMemoryActiveMMC = CObexUtilsPropertyNotifier::NewL(this, ECheckMMCMemory); - iDevMan=CBTEngDevMan::NewL(this); - iResultArray = new (ELeave) CBTDeviceArray(1); - // Get default folder from CenRep - TObexUtilsMessageHandler::GetCenRepKeyStringValueL(KCRUidBluetoothEngine, - KLCReceiveFolder, - iCenRepFolder); - } - -COPPController::~COPPController() - { - TRACE_FUNC - delete iObexObject; - delete iBuf; - delete iLowMemoryActiveCDrive; - delete iLowMemoryActiveMMC; - delete iProgressDialog; - delete iWaitDialog; - delete iDevMan; - if (iResultArray) - { - iResultArray->ResetAndDestroy(); - delete iResultArray; - } - iFs.Close(); - } - -// --------------------------------------------------------- -// ErrorIndication() -// --------------------------------------------------------- -// -void COPPController::ErrorIndication( TInt TRACE_ONLY(aError) ) - { - TRACE_FUNC - TRACE_ERROR((_L( "[oppreceiveservice] COPPController: ErrorIndication error:\t %d" ),aError)); - HandleError(EFalse); // false because not explicit abort - } - -// --------------------------------------------------------- -// AbortIndication() -// --------------------------------------------------------- -// -void COPPController::AbortIndication() - { - TRACE_FUNC - HandleError(EFalse); // false because note about receiving failed should appear - } - -void COPPController::HandleError(TBool aAbort) - { - TRACE_ERROR((_L( "[oppreceiveservice] COPPController:HandleError" ))); - if( iObexTransferState == ETransferPut || iObexTransferState == ETransferPutDiskError ) - { - if(iObexObject) - { - iObexObject->Reset(); - } - CancelTransfer(); - if(!aAbort) - { - if(iMediaType == ESrcsMediaBT) - { - TRAP_IGNORE( TObexUtilsUiLayer::ShowGlobalConfirmationQueryL( R_BT_FAILED_TO_RECEIVE ) ); - } - TRACE_ASSERT(iMediaType != ESrcsMediaIrDA, KErrNotSupported) - } - } - delete iBuf; - iBuf = NULL; - iObexTransferState = ETransferIdle; - TRAP_IGNORE(TObexUtilsMessageHandler::RemoveInboxEntriesL(iObexObject, iMsvIdParent)); - TRAP_IGNORE(TObexUtilsMessageHandler::RemoveTemporaryRFileL (iFullPathFilename)); - } - -// --------------------------------------------------------- -// TransportUpIndication() -// --------------------------------------------------------- -// -void COPPController::TransportUpIndication() - { - TRACE_FUNC - iObexTransferState = ETransferIdle; - - if ( !iFs.Handle() ) - { - TRACE_INFO( (_L( "[oppreceiveservice] TransportUpIndication iFs.Connect()" )) ); - if ( iFs.Connect() ) // error value not preserved, iFs.Handle() checked one more time before first useage - { - TRACE_INFO( (_L( "[oppreceiveservice] TransportUpIndication iFs.Connect() failed" )) ); - } - } - - iFile = RFile(); - iFullPathFilename.Zero(); - } - -// --------------------------------------------------------- -// ObexConnectIndication() -// --------------------------------------------------------- -// -TInt COPPController::ObexConnectIndication( const TObexConnectInfo& /*aRemoteInfo*/, - const TDesC8& /*aInfo*/) - { - TRACE_FUNC - if ( iMediaType == ESrcsMediaBT ) - { - TRACE_INFO( _L( "[oppreceiveservice] ObexConnectIndication: BT media \t" ) ); - - // Get remote device socket address and bluetooth name - // Remote bluetooth name will be displayed in the new message in inbox. - // - TSockAddr addr; - iObexServer->RemoteAddr(addr); - TBTDevAddr tBTDevAddr = static_cast(addr).BTAddr(); - - TBTRegistrySearch nameSearch; - nameSearch.FindAddress(tBTDevAddr); - - iResultArray->Reset(); - // ignore any errors here, if we don't get the name, we don't get the name - static_cast(iDevMan->GetDevices(nameSearch, iResultArray)); - } - - return KErrNone; - } - -// --------------------------------------------------------- -// ObexDisconnectIndication( -// --------------------------------------------------------- -// -void COPPController::ObexDisconnectIndication(const TDesC8& /*aInfo*/) - { - TRACE_FUNC - - } - -// --------------------------------------------------------- -// TransportDownIndication() -// --------------------------------------------------------- -// -void COPPController::TransportDownIndication() - { - TRACE_FUNC - // Remove receiving buffer and files used during file receiving. - // - delete iObexObject; - iObexObject = NULL; - TRAP_IGNORE(TObexUtilsMessageHandler::RemoveTemporaryRFileL (iFullPathFilename)); - iFs.Close(); - } - -// --------------------------------------------------------- -// PutRequestIndication() -// --------------------------------------------------------- -// -CObexBufObject* COPPController::PutRequestIndication() - { - TRACE_FUNC - iLengthHeaderReceived = EFalse; // New put request so clear header based state - iObexTransferState = ETransferPut; - - // Checking if backup is running now - if backup process is active, then we - // need to cancel transfer - otherwise phone will freeze during receiving - // data - if ( TObexUtilsUiLayer::IsBackupRunning() ) - { - TRACE_INFO ( _L ("Backup in progress! Canceling incoming transfer.")); - iObexTransferState = ETransferPutInitError; - return NULL; - } - - TRAPD(err, HandlePutRequestL()); - if(err == KErrNone) - { - return iObexObject; - } - TRACE_INFO( _L( "[oppreceiveservice] COPPController: PutRequestIndication end\t" ) ); - if (iObexTransferState != ETransferPutInitError) - { - iObexTransferState = ETransferPutDiskError; - } - return NULL; - } - -// --------------------------------------------------------- -// PutPacketIndication() -// --------------------------------------------------------- -// -TInt COPPController::PutPacketIndication() - { - TRACE_FUNC - if(iObexTransferState == ETransferPutCancel) - { - // User cancelled the put request, so error the next packet to terminate the put request. - // BIP considers the Unauthorized error response suitable for this... - HandleError(ETrue); // reset state and clear up - return KErrIrObexRespUnauthorized; - } - - iTotalSizeByte = iObexObject->Length(); // get size of receiving file - - if(iObexObject->Name().Length() > KMaxFileName) - { - TRACE_INFO( _L( "[oppreceiveservice] COPPController: PutPacketIndication truncating name of file being received\t" ) ); - TRAPD(err, iObexObject->SetNameL(iObexObject->Name().Left(KMaxFileName))); - if(err != KErrNone) - { - return KErrAccessDenied; - } - } - - iReceivingFileName = iObexObject->Name(); // get name of receiving file - - // Check that capacity is suitable as soon as possible - if(!iLengthHeaderReceived && iTotalSizeByte > 0) - { - iLengthHeaderReceived = ETrue; // total size value is from length header - TBool capacity = ETrue; - TRAPD(retTrap, capacity = CheckCapacityL()); - if(retTrap != KErrNone) - { - return KErrGeneral; - } - if(!capacity) - { - TRAP_IGNORE(TObexUtilsUiLayer::ShowGlobalConfirmationQueryL(R_OUT_OF_MEMORY)); - return KErrDiskFull; - } - } - - if(iObexTransferState == ETransferPutDiskError) - { - return KErrDiskFull; - } - // successfully received put packet if we reached here - iObexTransferState = ETransferPut; - - // Now we need to either create (in the first instance) or update the dialog on the UI. - if(ReceivingIndicatorActive()) - { - UpdateReceivingIndicator(); - } - else if(!iNoteDisplayed) - { - // No note launched yet, so try to launch - TRAPD(err, LaunchReceivingIndicatorL()); - iNoteDisplayed = (err == KErrNone); - } - - return KErrNone; - } - -// --------------------------------------------------------- -// PutCompleteIndication() -// --------------------------------------------------------- -// -TInt COPPController::PutCompleteIndication() - { - TRACE_FUNC - TInt retVal = KErrNone; - if(iObexTransferState == ETransferPutCancel) - { - retVal = KErrIrObexRespUnauthorized; - HandleError(ETrue); - } - else - { - retVal = HandlePutCompleteIndication(); - iObexTransferState = ETransferIdle; - CloseReceivingIndicator(); - } - TRACE_FUNC_EXIT - return retVal; - } - -// --------------------------------------------------------- -// GetRequestIndication() -// --------------------------------------------------------- -// -CObexBufObject* COPPController::GetRequestIndication( CObexBaseObject* /*aRequiredObject*/) - { - TRACE_FUNC - return NULL; - } - -// --------------------------------------------------------- -// GetPacketIndication() -// --------------------------------------------------------- -// -TInt COPPController::GetPacketIndication() - { - TRACE_FUNC - return KErrNone; - } - -// --------------------------------------------------------- -// GetCompleteIndication() -// --------------------------------------------------------- -// -TInt COPPController::GetCompleteIndication() - { - TRACE_FUNC - return KErrNone; - } - -// --------------------------------------------------------- -// SetPathIndication() -// --------------------------------------------------------- -// -TInt COPPController::SetPathIndication( const CObex::TSetPathInfo& /*aPathInfo*/, - const TDesC8& /*aInfo*/) - { - TRACE_FUNC - // SetPath is not implemented in OPP - so following IrOBEX guidance, return - // the Forbidden response code. - return KErrIrObexRespForbidden; - } - - - -// --------------------------------------------------------- -// HandleNotifyL() -// --------------------------------------------------------- -// -void COPPController::HandleNotifyL( TMemoryPropertyCheckType aCheckType ) - { - TRACE_FUNC - - // Only interested on this notification if we are receiving something - if ( iObexTransferState == ETransferPut ) - { - // Check the keys, what has been changed. - TRACE_INFO( _L( "[oppreceiveservice] COPPController::HandleNotifyL\t" ) ); - if ( aCheckType == ECheckPhoneMemory ) - { - if ( SysUtil::FFSSpaceBelowCriticalLevelL( NULL, 0 ) ) - { - TRACE_INFO( _L( "[oppreceiveservice] COPPController: Obex Server error diskfull\t" ) ); - iObexTransferState = ETransferPutDiskError; - } - } - else if ( aCheckType == ECheckMMCMemory ) - { - if ( SysUtil::MMCSpaceBelowCriticalLevelL( NULL, 0 ) ) - { - TRACE_INFO( _L( "[oppreceiveservice] COPPController: Obex Server error diskfull\t" ) ); - iObexTransferState = ETransferPutDiskError; - } - } - } - } -// --------------------------------------------------------- -// HandlePutRequestL() -// --------------------------------------------------------- -// -void COPPController::HandlePutRequestL() - { - TRACE_FUNC - - delete iObexObject; - iObexObject = NULL; - - iFile = RFile(); - - if ( !iFs.Handle() ) - { - User::Leave(KErrGeneral); - } - - // Assign an initial value to iDrive - iDrive = GetDriveWithMaximumFreeSpaceL(); - - // If iDrive is at critical space level, we immediately show out_of_memory. - // - if (SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, 0, iDrive )) - { - TRAP_IGNORE(TObexUtilsUiLayer::ShowGlobalConfirmationQueryL(R_OUT_OF_MEMORY)); - User::Leave(KErrGeneral); - } - - TRACE_INFO( (_L( "[oppreceiveservice] HandlePutRequestL %d\t" ),iDrive ) ); - - iObexObject = CObexBufObject::NewL( NULL ); - - delete iBuf; - iBuf = NULL; - - TRACE_ASSERT(iMediaType != ESrcsMediaIrDA, KErrNotSupported); - if ( iMediaType == ESrcsMediaBT ) - { - TChar driveLetter; - iDefaultFolder.Zero(); - iFs.DriveToChar(iDrive, driveLetter); - iDefaultFolder.Append(driveLetter); - if ( iDrive == EDriveC ) - { - iDefaultFolder.Append(_L(":\\data\\")); - } - else - { - iDefaultFolder.Append(_L(":\\")); - } - iDefaultFolder.Append(iCenRepFolder); - - iFile = RFile(); - iFullPathFilename.Zero(); - TRAPD(err, TObexUtilsMessageHandler::CreateReceiveBufferAndRFileL(iFile, - iDefaultFolder, - iFullPathFilename, - iBuf, - KBufferSize)); - if(err != KErrNone) - { - iObexTransferState = ETransferPutInitError; - User::Leave(KErrGeneral); - } - } - else - { - iObexTransferState = ETransferPutInitError; - User::Leave(KErrGeneral); - } - - User::LeaveIfError(iFile.Open(iFs,iFullPathFilename,EFileWrite|EFileShareReadersOrWriters)); - TObexRFileBackedBuffer bufferdetails(*iBuf,iFile,CObexBufObject::EDoubleBuffering); - - TRAPD(err, iObexObject->SetDataBufL( bufferdetails) ); - if (err != KErrNone) - { - iObexTransferState = ETransferPutInitError; - User::Leave(KErrGeneral); // set to != KErrNone - } - - TRACE_INFO( _L( "[oppreceiveservice] COPPController: HandlePutRequestL completed\t" ) ); - } - - -// --------------------------------------------------------- -// HandlePutCompleteIndication() -// --------------------------------------------------------- -// -TInt COPPController::HandlePutCompleteIndication() - { - TRACE_FUNC - TInt retVal = KErrNone; - - TChar driveLetter; - iDefaultFolder.Zero(); - iFs.DriveToChar(iDrive, driveLetter); - iDefaultFolder.Append(driveLetter); - if ( iDrive == EDriveC ) - { - iDefaultFolder.Append(_L(":\\data\\")); - } - else - { - iDefaultFolder.Append(_L(":\\")); - } - iDefaultFolder.Append(iCenRepFolder); - iFullPathFilename.Zero(); - iFullPathFilename.Append(iDefaultFolder); - - - TRACE_INFO( (_L( "[oppreceiveservice] HandlePutCompleteIndication %d\t" ),iDrive ) ); - - if (iMediaType==ESrcsMediaBT) - { - TRAP ( retVal, TObexUtilsMessageHandler::SaveFileToFileSystemL(iObexObject, - KUidMsgTypeBt, - iMsvIdParent, - iFullPathFilename, - iFile, - iRemoteDeviceName)); - } - TRACE_ASSERT( iMediaType!=ESrcsMediaIrDA, KErrNotSupported); - if ( retVal == KErrNone) - { - TRAP (retVal, TObexUtilsMessageHandler::AddEntryToInboxL(iMsvIdParent, iFullPathFilename)); - - if( retVal != KErrNone ) - { - TRACE_INFO( (_L( "[oppreceiveservice] HandlePutCompleteIndication AddEntryToInboxL() failed %d \t" ),retVal ) ); - TRAP_IGNORE(TObexUtilsMessageHandler::RemoveInboxEntriesL(iObexObject, iMsvIdParent)); - } - } - else - { - TRACE_INFO( (_L( "[oppreceiveservice] HandlePutCompleteIndication failed %d \t" ),retVal ) ); - } - - - delete iObexObject; - iObexObject = NULL; - - delete iBuf; - iBuf = NULL; - - iPreviousDefaultFolder = iDefaultFolder; // save the last file path where file is successfully saved to file system. - iMsvIdParent = KMsvNullIndexEntryId; - TRACE_INFO( _L( "[oppreceiveservice] HandlePutCompleteIndication Done\t" ) ); - return retVal; - } - - -// --------------------------------------------------------- -// CheckCapacity() -// --------------------------------------------------------- -// -TBool COPPController::CheckCapacityL() - { - TRACE_FUNC_ENTRY - - iDrive = EDriveZ; // Intialize iDrive to Z - TInt filesize = iObexObject->Length(); - - RFs rfs ; - User::LeaveIfError(rfs.Connect()); - - TInt mmcDrive = KDefaultDrive; // External memroy card - TInt imsDrive = KDefaultDrive; // Internal mass storage - - User::LeaveIfError(DriveInfo::GetDefaultDrive(DriveInfo::EDefaultMassStorage, imsDrive)); - User::LeaveIfError(DriveInfo::GetDefaultDrive(DriveInfo::EDefaultRemovableMassStorage, mmcDrive)); - - TRACE_INFO( (_L( "[oppreceiveservice] CheckCapacityL imsDrive=%d; mmcDrive=%d\t" ),imsDrive, mmcDrive ) ); - - TVolumeInfo volumeInfo; - TInt err = rfs.Volume(volumeInfo, imsDrive); - - // If err != KErrNone, Drive is not available. - // - if ( !err ) - { - // Check capacity on Internal mass storage - TRACE_INFO( (_L( "[oppreceiveservice] CheckCapacityL Internal mass storage\t" )) ); - if ( !SysUtil::DiskSpaceBelowCriticalLevelL( &rfs, filesize, imsDrive ) ) - { - iDrive = imsDrive; - } - } - - if ( iDrive == EDriveZ) - { - err = rfs.Volume(volumeInfo, mmcDrive); - if ( !err ) - { - // Check capacity on Internal mass storage - TRACE_INFO( (_L( "[oppreceiveservice] CheckCapacityL Checking memory card\t" )) ); - if ( !SysUtil::DiskSpaceBelowCriticalLevelL( &rfs, filesize, mmcDrive ) ) - { - iDrive = mmcDrive; - } - } - } - if ( iDrive == EDriveZ ) - { - TRACE_INFO( (_L( "[oppreceiveservice] CheckCapacityL Checking phone memory\t" )) ); - // Phone memory - if( !SysUtil::DiskSpaceBelowCriticalLevelL( &rfs, filesize, EDriveC )) - { - iDrive = EDriveC; - } - } - rfs.Close(); - TRACE_INFO( (_L( "[oppreceiveservice] CheckCapacityL iDrive = %d\t" ),iDrive ) ); - TRACE_FUNC_EXIT - if (iDrive == EDriveZ) - { - // If there is no free space for receiving file, we need to set iPreviousDefaultFolder back to iDefaultFolder. - // In order to show the file receveing dialog correctly. - iDefaultFolder = iPreviousDefaultFolder; - return EFalse; - } - return ETrue; - } - -// --------------------------------------------------------- -// IsOBEXActive() -// --------------------------------------------------------- -// -TBool COPPController::IsOBEXActive() - { - TRACE_FUNC - return ETrue; - } - -// --------------------------------------------------------- -// SetMediaType() -// --------------------------------------------------------- -// -void COPPController::SetMediaType( TSrcsMediaType aMediaType ) - { - TRACE_FUNC - iMediaType=aMediaType; - } - -// --------------------------------------------------------- -// SetObexServer() -// --------------------------------------------------------- -// -TInt COPPController::SetObexServer( CObexServer* aServer) - { - TInt retVal=KErrNone; - - if (aServer) - { - iObexServer = aServer; - retVal=aServer->Start(this); - } - return retVal; - } - -// --------------------------------------------------------- -// CancelTransfer() -// --------------------------------------------------------- -// -void COPPController::CancelTransfer() - { - TRACE_FUNC - CloseReceivingIndicator(); - if(iObexTransferState == ETransferPut) - { - iObexTransferState = ETransferPutCancel; - } - else // go to idle for all other states - { - iObexTransferState = ETransferIdle; - } - } - -void COPPController::LaunchReceivingIndicatorL() - { - if(ReceivingIndicatorActive()) - { - return; - } - - if(iTotalSizeByte > 0) - { - iProgressDialog = CGlobalProgressDialog::NewL(this); - if(iReceivingFileName.Length() > 0) - { - iProgressDialog->ShowProgressDialogNameSizeL(iReceivingFileName, iTotalSizeByte); - } - else - { - if(iMediaType == ESrcsMediaBT) - { - iProgressDialog->ShowProgressDialogL(R_BT_RECEIVING_DATA); - } - TRACE_ASSERT(iMediaType != ESrcsMediaIrDA, KErrNotSupported); - } - } - else - { - iWaitDialog = CGlobalDialog::NewL(this); - if(iMediaType == ESrcsMediaBT) - { - iWaitDialog->ShowNoteDialogL(R_BT_RECEIVING_DATA, ETrue); - } - TRACE_ASSERT(iMediaType != ESrcsMediaIrDA, KErrNotSupported); - } - } - -void COPPController::UpdateReceivingIndicator() - { - if(iProgressDialog) - { - iProgressDialog->UpdateProgressDialog(iObexObject->BytesReceived(), iTotalSizeByte); - } - // else we are using a wait note, so no "need" to update - } - -void COPPController::HandleGlobalProgressDialogL( TInt aSoftkey ) - { - TRACE_FUNC - - if(aSoftkey == EAknSoftkeyCancel) - { - CancelTransfer(); - } - else if(aSoftkey == EAknSoftkeyHide) - { - CloseReceivingIndicator(EFalse); // Don't reset state as only hiding - } - } - -void COPPController::HandleGlobalNoteDialogL( TInt aSoftkey ) - { - TRACE_FUNC - - if(aSoftkey == EAknSoftkeyCancel) - { - CancelTransfer(); - } - else if(aSoftkey == EAknSoftkeyHide) - { - CloseReceivingIndicator(EFalse); // Don't reset state as only hiding - } - } - -void COPPController::CloseReceivingIndicator(TBool aResetDisplayedState) - { - TRACE_FUNC - if(aResetDisplayedState) - { - iNoteDisplayed = EFalse; - } - if(iProgressDialog) - { - iProgressDialog->ProcessFinished(); - delete iProgressDialog; - iProgressDialog = NULL; - } - if(iWaitDialog) - { - iWaitDialog->ProcessFinished(); - delete iWaitDialog; - iWaitDialog = NULL; - } - } - - // --------------------------------------------------------- - // GetDriveWithMaximumFreeSpace() - // --------------------------------------------------------- - // - TInt COPPController::GetDriveWithMaximumFreeSpaceL() - { - // Get drive with maximum freespace among phone memory, MMC, internal mass storage. - // - TRACE_FUNC - TVolumeInfo volumeInfoC; - TVolumeInfo volumeInfoE; - TVolumeInfo volumeInfoF; - TInt64 max = 0; - TInt drive = 0; - - TInt err = iFs.Volume(volumeInfoC, EDriveC); - - if ( !err ) - { - // set initial values to max and drive. - max = volumeInfoC.iFree; - drive = EDriveC; - } - - err = iFs.Volume(volumeInfoE, EDriveE); - if ( !err ) - { - if (volumeInfoE.iFree >= max) - { - max = volumeInfoE.iFree; - drive = EDriveE; - } - - } - - err = iFs.Volume(volumeInfoF, EDriveF); - if ( !err ) - { - if (volumeInfoF.iFree >= max) - { - max = volumeInfoF.iFree; - drive = EDriveF; - } - } - - max = 0; - return drive; - } - - - // ---------------------------------------------------------- - // COPPController::HandleGetDevicesComplete - // Callback from devman - // ---------------------------------------------------------- - // - void COPPController::HandleGetDevicesComplete(TInt aErr, CBTDeviceArray* /*aDeviceArray*/) - { - TRACE_INFO( _L( "[oppreceiveservice] HandleGetDevicesComplete: enter \t" ) ); - if ( aErr == KErrNone ) - { - if ( iResultArray->Count()) - { - iRemoteDeviceName.Zero(); - if ( iResultArray->At(0)->FriendlyName().Length() > 0 ) - { - TRACE_INFO( _L( "[oppreceiveservice] HandleGetDevicesComplete: got friendly name \t" ) ); - iRemoteDeviceName.Copy(iResultArray->At(0)->FriendlyName()); - } - else - { - TRACE_INFO( _L( "[oppreceiveservice] HandleGetDevicesComplete: got devciename name \t" )); - TRAP_IGNORE(iRemoteDeviceName.Copy( BTDeviceNameConverter::ToUnicodeL(iResultArray->At(0)->DeviceName()))); - } - } - } - } - -//////////////////////////// Global part //////////////////////////// - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/rom/mtmuibluetooth.iby --- a/localconnectivityservice/obexreceiveservices/rom/mtmuibluetooth.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ - -#ifndef __MTMUIBLUETOOTH_IBY__ -#define __MTMUIBLUETOOTH_IBY__ - -#ifdef __BT -file=ABI_DIR\BUILD_DIR\btmtmui.dll SHARED_LIB_DIR\btmtmui.dll -#endif - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/rom/mtmuibluetoothresources.iby --- a/localconnectivityservice/obexreceiveservices/rom/mtmuibluetoothresources.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ - -#ifndef __MTMUIBLUETOOTHRESOURCES_IBY__ -#define __MTMUIBLUETOOTHRESOURCES_IBY__ - -#ifdef __BT -data=DATAZ_\resource\messaging\mtm\btmtmui.rsc resource\messaging\mtm\btmtmui.rsc -#endif - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/rom/mtmuiinfrared.iby --- a/localconnectivityservice/obexreceiveservices/rom/mtmuiinfrared.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ - -#ifndef __MTMUIINFRARED_IBY__ -#define __MTMUIINFRARED_IBY__ - -#ifdef __IRDA -file=ABI_DIR\BUILD_DIR\irmtmui.dll SHARED_LIB_DIR\irmtmui.dll -#endif - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/rom/mtmuiinfraredResources.iby --- a/localconnectivityservice/obexreceiveservices/rom/mtmuiinfraredResources.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ - -#ifndef __MTMUIINFRAREDRESOURCES_IBY__ -#define __MTMUIINFRAREDRESOURCES_IBY__ - -#ifdef __IRDA - -data=DATAZ_\resource\messaging\mtm\irmtmui.rsc resource\messaging\mtm\irmtmui.rsc - -#endif - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/rom/obexservicebip.iby --- a/localconnectivityservice/obexreceiveservices/rom/obexservicebip.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ - -#ifndef __OBEXSERVICEBIP_IBY__ -#define __OBEXSERVICEBIP_IBY__ - -#ifdef __BT -#ifdef __BT_IMAGING_PROFILE -ECOM_PLUGIN(obexservicebip.dll,101F8671.rsc) -#endif -#endif - - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexreceiveservices/rom/obexserviceopp.iby --- a/localconnectivityservice/obexreceiveservices/rom/obexserviceopp.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ - -#ifndef __OBEXSERVICEOPP_IBY__ -#define __OBEXSERVICEOPP_IBY__ - -#ifdef __BT -ECOM_PLUGIN(obexserviceopp.dll,101F8636.rsc) -#endif - - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/BWINS/obexservicesendutilsU.DEF --- a/localconnectivityservice/obexsendservices/BWINS/obexservicesendutilsU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -EXPORTS - ?AddImageL@CBTServiceParameterList@@QAEXABVTDesC16@@@Z @ 1 NONAME ; void CBTServiceParameterList::AddImageL(class TDesC16 const &) - ?AddImageL@CBTServiceParameterList@@QAEXVRFile@@@Z @ 2 NONAME ; void CBTServiceParameterList::AddImageL(class RFile) - ?AddObjectL@CBTServiceParameterList@@QAEXABVTDesC16@@@Z @ 3 NONAME ; void CBTServiceParameterList::AddObjectL(class TDesC16 const &) - ?AddObjectL@CBTServiceParameterList@@QAEXVRFile@@@Z @ 4 NONAME ; void CBTServiceParameterList::AddObjectL(class RFile) - ?AddXhtmlL@CBTServiceParameterList@@QAEXABVTDesC16@@@Z @ 5 NONAME ; void CBTServiceParameterList::AddXhtmlL(class TDesC16 const &) - ?NewL@CBTServiceAPI@@SAPAV1@XZ @ 6 NONAME ; class CBTServiceAPI * CBTServiceAPI::NewL(void) - ?NewL@CBTServiceParameterList@@SAPAV1@XZ @ 7 NONAME ; class CBTServiceParameterList * CBTServiceParameterList::NewL(void) - ?NewLC@CBTServiceParameterList@@SAPAV1@XZ @ 8 NONAME ; class CBTServiceParameterList * CBTServiceParameterList::NewLC(void) - ?StartServiceL@CBTServiceAPI@@QAEXW4TBTServiceType@@PAVCBTServiceParameterList@@@Z @ 9 NONAME ; void CBTServiceAPI::StartServiceL(enum TBTServiceType, class CBTServiceParameterList *) - ?StartSynchronousServiceL@CBTServiceAPI@@QAEXW4TBTServiceType@@PAVCBTServiceParameterList@@@Z @ 10 NONAME ; void CBTServiceAPI::StartSynchronousServiceL(enum TBTServiceType, class CBTServiceParameterList *) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/eabi/obexservicesendutilsu.DEF --- a/localconnectivityservice/obexsendservices/eabi/obexservicesendutilsu.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -EXPORTS - _ZN13CBTServiceAPI13StartServiceLE14TBTServiceTypeP23CBTServiceParameterList @ 1 NONAME - _ZN13CBTServiceAPI24StartSynchronousServiceLE14TBTServiceTypeP23CBTServiceParameterList @ 2 NONAME - _ZN13CBTServiceAPI4NewLEv @ 3 NONAME - _ZN23CBTServiceParameterList10AddObjectLE5RFile @ 4 NONAME - _ZN23CBTServiceParameterList10AddObjectLERK7TDesC16 @ 5 NONAME - _ZN23CBTServiceParameterList4NewLEv @ 6 NONAME - _ZN23CBTServiceParameterList5NewLCEv @ 7 NONAME - _ZN23CBTServiceParameterList9AddImageLE5RFile @ 8 NONAME - _ZN23CBTServiceParameterList9AddImageLERK7TDesC16 @ 9 NONAME - _ZN23CBTServiceParameterList9AddXhtmlLERK7TDesC16 @ 10 NONAME - _ZTI13CBTServiceAPI @ 11 NONAME - _ZTI23CBTServiceParameterList @ 12 NONAME - _ZTV13CBTServiceAPI @ 13 NONAME - _ZTV23CBTServiceParameterList @ 14 NONAME - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/group/bld.inf --- a/localconnectivityservice/obexsendservices/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2002 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: This file provides the information required for building the -* whole of ObexSendService -* -*/ - - -#include - -PRJ_PLATFORMS - - -PRJ_EXPORTS -../obexservicesendutils/inc/BTServiceAPI.h |../../inc/btserviceapi.h -../obexservicesendutils/inc/BTServiceParameterList.h |../../inc/BTServiceParameterList.h -../rom/obexservicebtsend.iby CORE_MW_LAYER_IBY_EXPORT_PATH(obexservicebtsend.iby) -../rom/obexserviceirsend.iby CORE_MW_LAYER_IBY_EXPORT_PATH(obexserviceirsend.iby) -../rom/obexservicesendutils.iby CORE_MW_LAYER_IBY_EXPORT_PATH(obexservicesendutils.iby) - -PRJ_MMPFILES -../group/sendutils.mmp -../group/obexservicebtsend.mmp -../group/obexserviceirsend.mmp - -PRJ_TESTMMPFILES - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/group/obexservicebtsend.mmp --- a/localconnectivityservice/obexsendservices/group/obexservicebtsend.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* -* Copyright (c) 2002 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: ?Description -* -*/ - -#include -#include "../obexservicebtsend/inc/BTSendingServiceUIDS.hrh" - -#include - -TARGET obexservicebtsend.dll -TARGETTYPE PLUGIN -UID 0x10009D8D KBTSendingServiceDllUid - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - - -SOURCEPATH ../obexservicebtsend/src -SOURCE BTSendingService.cpp -SOURCE BTSSProvider.cpp -SOURCE btsssendlisthandler.cpp -// Plugin resources are placed in z:/system/libs/plugins -// -SOURCEPATH ../obexservicebtsend/data -START RESOURCE 101F86A2.rss -TARGET obexservicebtsend.rsc -END - -SOURCEPATH ../obexservicebtsend/data -START RESOURCE BtSSMenu.rss -TARGETPATH RESOURCE_FILES_DIR -HEADER -LANGUAGE_IDS -END - -USERINCLUDE ../obexservicebtsend/inc -SYSTEMINCLUDE ../../inc ../../../inc /epoc32/include/ecom -MW_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib // Base library -LIBRARY servicehandler.lib // Application InterWorking -LIBRARY obexservicesendutils.lib // Tools for bt sending -LIBRARY btfeatures.lib - -DEBUGLIBRARY flogger.lib // File logging services - -// End of File - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/group/obexserviceirsend.mmp --- a/localconnectivityservice/obexsendservices/group/obexserviceirsend.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* -* Copyright (c) 2002 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: ?Description -* -*/ - -#include -#include "../obexserviceirsend/inc/IrSendingServiceUIDS.hrh" - -#include - -TARGET obexserviceirsend.dll -TARGETTYPE PLUGIN -UID 0x10009d8d KIRSendingServiceDllUid - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - - -SOURCEPATH ../obexserviceirsend/src -SOURCE IRClient.cpp -SOURCE IRSendingService.cpp -SOURCE IRSSProvider.cpp - -// Plugin resources are placed in z:/system/libs/plugins -// -SOURCEPATH ../obexserviceirsend/data -START RESOURCE 001F86A2.rss -#ifdef SYMBIAN_SECURE_ECOM -TARGET obexserviceirsend.rsc -#endif -END - -SOURCEPATH ../obexserviceirsend/data -START RESOURCE irssmenu.rss -TARGETPATH RESOURCE_FILES_DIR -HEADER -LANGUAGE_IDS -END - - -USERINCLUDE ../obexserviceirsend/inc -SYSTEMINCLUDE ../../inc ../../../inc /epoc32/include/ecom -MW_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib // Base library -LIBRARY servicehandler.lib // Application InterWorking -LIBRARY obexutils.lib // Tools for bt sending -LIBRARY irobex.lib -LIBRARY irda.lib -LIBRARY efsrv.lib -LIBRARY featmgr.lib -DEBUGLIBRARY flogger.lib // File logging services - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/group/sendutils.mmp --- a/localconnectivityservice/obexsendservices/group/sendutils.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* Copyright (c) 2002 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: This is project specification file for the BtServiceUtils -* -*/ - -#include - - -TARGET obexservicesendutils.dll -TARGETTYPE dll -UID 0x1000008D 0x101F86B6 -CAPABILITY CAP_GENERAL_DLL -VENDORID VID_DEFAULT - -SOURCEPATH ../obexservicesendutils/src -SOURCE BTServiceAPI.cpp -SOURCE BTServiceClient.cpp -SOURCE BTServiceUtils.cpp -SOURCE BTServiceStarter.cpp -SOURCE BTServiceParameterList.cpp -SOURCE BTServiceDelayedDestroyer.cpp - -SOURCE BTSOPPController.cpp -SOURCE BTSBIPController.cpp -SOURCE BTSBPPController.cpp -SOURCE BTSBPPObjectRequest.cpp -SOURCE BTSBPPObjectServer.cpp -SOURCE BTSBPPServerWait.cpp - -SOURCE BTSUCapabilityResolver.cpp -SOURCE BTSUDataConverter.cpp -SOURCE BTSUImageConverter.cpp -SOURCE BTSUPassKeyRequest.cpp -SOURCE BTSURefObjectResolver.cpp -SOURCE BTSUXmlParser.cpp -SOURCE BTConnectionTimer.cpp -SOURCE BTSController.cpp - -USERINCLUDE ../obexservicesendutils/inc -SYSTEMINCLUDE ../../inc ../../../inc /epoc32/include/libc -MW_LAYER_SYSTEMINCLUDE - -LIBRARY apgrfx.lib // App Arch Session -LIBRARY apmime.lib // App Arch Mime Recognizers -LIBRARY bafl.lib // Basic Application Framework Library -LIBRARY bitmaptransforms.lib // Bitmap transfomration library -LIBRARY bluetooth.lib // Bluetooth Sockets -LIBRARY btdevice.lib // Bluetooth Device -LIBRARY btengdiscovery.lib // Bluetooth Discovery -LIBRARY btengsettings.lib // Bluetooth Settings -LIBRARY charconv.lib // Character conversion -LIBRARY efsrv.lib // File Server -LIBRARY esock.lib // Socket Connections -LIBRARY estor.lib // Write and Read streams -LIBRARY euser.lib // Base library -LIBRARY fbscli.lib // Bitmap utils -LIBRARY imageconversion.lib // Image conversion library -LIBRARY irobex.lib // Object Exchange -LIBRARY obexutils.lib // Object Exchange UI services -//LIBRARY xmlinterface.lib // XML parser interface -LIBRARY caf.lib // DRM common -LIBRARY xmlframework.lib // XML Framework -LIBRARY featmgr.lib // Inquire supported static feature -DEBUGLIBRARY flogger.lib // File logging services - - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicebtsend/data/101F86A2.rss --- a/localconnectivityservice/obexsendservices/obexservicebtsend/data/101F86A2.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* Copyright (c) 2002 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: -* -* -* -*/ - - -#include -#include "registryinfov2.rh" -#include -#include - -#include "BTSendingService.hrh" -#include "BTSendingServiceUIDS.hrh" - -RESOURCE REGISTRY_INFO theInfo - { - resource_format_version = RESOURCE_FORMAT_VERSION_2; - dll_uid = KBTSendingServiceDllUid; - interfaces = - { - INTERFACE_INFO - { - interface_uid = KAiwClassMenu; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KBTSendingServiceMenuImplUid; - version_no = 1; - display_name = ""; - default_data = "*"; - opaque_data = KAiwCmdSendStr; - } - }; - }, - INTERFACE_INFO - { - interface_uid = KBTSendingServiceIfaceUid; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KBTSendingServiceBaseImplUid; - version_no = 1; - display_name = "Bluetooth Sending Service"; - default_data = "*"; - opaque_data = KAiwCmdSendStr; - } - }; - } - }; - } - - - -// End of file - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicebtsend/data/BtSSMenu.rss --- a/localconnectivityservice/obexsendservices/obexservicebtsend/data/BtSSMenu.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ - -#include -#include "registryinfov2.rh" -#include -#include - -#include "BTSendingService.hrh" -#include "BTSendingServiceUIDS.hrh" - -RESOURCE MENU_PANE r_send_via_bt_menu - { - items= - { - MENU_ITEM - { - command = ESendBT; - txt = qtn_query_send_via_bt; - } - }; - } - - -// End of file - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicebtsend/inc/BTSSProvider.h --- a/localconnectivityservice/obexsendservices/obexservicebtsend/inc/BTSSProvider.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ -/* -* Copyright (c) 2002 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: -* -*/ - - - -#ifndef BT_SENDING_SERVICE_PROVIDER_H -#define BT_SENDING_SERVICE_PROVIDER_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class CBTServiceParameterList; -class CBTServiceAPI; -class CBTSSSendListHandler; - -// CLASS DECLARATION - -/** -* Provides BT sending services -* -*/ -class CBTSSProvider : public CAiwServiceIfMenu - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CBTSSProvider* NewL(); - - /** - * Destructor. - */ - virtual ~CBTSSProvider(); - - - public: // Functions from base classes - - /** - * From CAiwServiceIfBase Not used - * @since 2.6 - * @param aFrameworkCallback Not used - * @param aInterest Not used - * @return None - */ - virtual void InitialiseL( MAiwNotifyCallback& aFrameworkCallback, - const RCriteriaArray& aInterest ); - - /** - * From CAiwServiceIfBase Processes service command - * and starts bt sending - * @since 2.6 - * @param aCmdId Command id - * @param aInParamList Not used - * @param aOutParamList List of files - * @param aCmdOptions Not used - * @param aCallback Not used - * @return None - */ - virtual void HandleServiceCmdL( const TInt& aCmdId, - const CAiwGenericParamList& aInParamList, - CAiwGenericParamList& aOutParamList, - TUint aCmdOptions, - const MAiwNotifyCallback* aCallback ); - - /** - * From CAiwServiceIfBase Processes service command - * and starts bt sending - * @since 2.6 - * @param aCmdId Command id - * @param aInParamList Not used - * @param aOutParamList List of files - * @param aCmdOptions Not used - * @param aCallback Not used - * @return None - */ - virtual void HandleMenuCmdL(TInt aMenuCmdId, - const CAiwGenericParamList& aInParamList, - CAiwGenericParamList& aOutParamList, - TUint aCmdOptions, - const MAiwNotifyCallback* aCallback ); - - - - virtual void InitializeMenuPaneL( CAiwMenuPane& aMenuPane, - TInt aIndex, - TInt /* aCascadeId */, - const CAiwGenericParamList& aInParamList ); - - private: - - /** - * C++ default constructor. - */ - CBTSSProvider(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - private: // Data - - CBTServiceAPI* iBTSendingService; - - CBTSSSendListHandler* iConverter; - }; - -#endif // BT_SENDING_SERVICE_PROVIDER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicebtsend/inc/BTSSSendListHandler.h --- a/localconnectivityservice/obexsendservices/obexservicebtsend/inc/BTSSSendListHandler.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -/* -* Copyright (c) 2007 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: Converter class for converting AIW paramerer list to -* bt send parameter list -* -*/ - - -#ifndef BTSSSENDLISTHANDLER_H -#define BTSSSENDLISTHANDLER_H - -#include -#include -#include -#include - -class CBTServiceParameterList; - -/** - * BTSSend list handler - * Converts AIW list to bt sending object list - * - * @since S60 v3.2 - */ -class CBTSSSendListHandler : public CActive - { - -public: - - static CBTSSSendListHandler* NewL(); - static CBTSSSendListHandler* NewLC(); - - /** - * Destructor. - */ - virtual ~CBTSSSendListHandler(); - - /** - * ConvertList - * - * @since S60 v3.2 - * @param aOutParamList AIW parameter list - * @param aList bt sending parameter list - * @return error code - */ - TInt ConvertList(const CAiwGenericParamList* aOutParamList, CBTServiceParameterList* aList ); - - - -// from base class CActive - - /** - * From CActive. - * RunL - * - * @since S60 v3.2 - */ - void RunL(); - - /** - * From CActive. - * DoCancel - * - * @since S60 v3.2 - */ - void DoCancel(); - - -private: - CBTSSSendListHandler(); - - void ConstructL(); - - /** - * Add object - * - * @since S60 v3.2 - */ - void AddObject(); - - /** - * Add object - * - * @since S60 v3.2 - */ - void DoAddObjectL(); - -private: // data - - /** - * BT sending parameter list - * Not own. - */ - CBTServiceParameterList* iList; - - /** - * AIW parameter list - * Not own. - */ - const CAiwGenericParamList* iOutParamList; - - /** - * List index - */ - TInt iListIndex; - - /** - * Sync waiter object - */ - CActiveSchedulerWait iSyncWaiter; - }; - -#endif // BTSSSENDLISTHANDLER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicebtsend/inc/BTSendingService.hrh --- a/localconnectivityservice/obexsendservices/obexservicebtsend/inc/BTSendingService.hrh Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2002 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: ?Description -* -*/ - - -#ifndef BT_SENDING_SERVICE_HRH -#define BT_SENDING_SERVICE_HRH - -enum -{ - ESendBT=0, - ESendIR -}; - -#endif - - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicebtsend/inc/BTSendingServiceDebug.h --- a/localconnectivityservice/obexsendservices/obexservicebtsend/inc/BTSendingServiceDebug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2002 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: This file defines logging macros for BTSS. -* -*/ - - -#ifndef BT_SENDING_SERVICE_DEBUG_H -#define BT_SENDING_SERVICE_DEBUG_H - - -#ifdef _DEBUG -// =========================================================================== -#ifdef __WINS__ // File logging for WINS -// =========================================================================== -#include -#include -#include - -_LIT(KLogFile,"btss.log"); -_LIT(KLogDirFullName,"c:\\logs\\"); -_LIT(KLogDir,"btss"); - -#define FLOG(a) { FPrint(a); } -#define FTRACE(a) { a; } - -// Declare the FPrint function -// -inline void FPrint(const TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); - } - -// =========================================================================== -#else // RDebug logging for target HW -// =========================================================================== -#include - -#define FLOG(a) { RDebug::Print(a); } -#define FTRACE(a) { a; } - -// Declare the FPrint function -// -inline void FPrint(const TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); - TInt tmpInt = VA_ARG(list, TInt); - TInt tmpInt2 = VA_ARG(list, TInt); - TInt tmpInt3 = VA_ARG(list, TInt); - VA_END(list); - RDebug::Print(aFmt, tmpInt, tmpInt2, tmpInt3); - } - -#endif //__WINS__ - -// =========================================================================== -#else // // No loggings --> Reduced binary size -// =========================================================================== -#define FLOG(a) -#define FTRACE(a) - -#endif // _DEBUG - - -#endif // BT_SENDING_SERVICE_DEBUG_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicebtsend/inc/BTSendingServiceUIDS.hrh --- a/localconnectivityservice/obexsendservices/obexservicebtsend/inc/BTSendingServiceUIDS.hrh Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* -* Copyright (c) 2002 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: ?Description -* -*/ - - -#ifndef BT_SENDING_SERVICE_UIDS_HRH -#define BT_SENDING_SERVICE_UIDS_HRH - -#define KBTSendingServiceDllUid 0x101F86A2 -#define KBTSendingServiceIfaceUid 0x101F8650 // KAiwClassBase -#define KBTSendingServiceBaseImplUid 0x101F86A3 -#define KBTSendingServiceMenuImplUid 0x20002777 - -#endif - - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicebtsend/src/BTSSProvider.cpp --- a/localconnectivityservice/obexsendservices/obexservicebtsend/src/BTSSProvider.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,208 +0,0 @@ -/* -* Copyright (c) 2002 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: ?Description -* -*/ - - -// INCLUDE FILES - -#include -#include -#include -#include -#include -#include -#include // For Enterprise security settings -#include // For Enterprise security notifier -#include -#include - -#include "BTSSProvider.h" -#include "BTSendingServiceDebug.h" -#include "BTSSSendListHandler.h" - -_LIT( KBTSendingServiceFileDrive, "z:"); -_LIT( KBTSSResFileName,"BtSSMenu.rsc"); - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CBTSSProvider::CBTSSProvider -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CBTSSProvider::CBTSSProvider(): iConverter(NULL) - { - } - -// ----------------------------------------------------------------------------- -// CBTSSProvider::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CBTSSProvider::ConstructL() - { - FLOG(_L("[BTSS]\t CBTSSProvider::ConstructL()")); - } - -// ----------------------------------------------------------------------------- -// CBTSSProvider::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBTSSProvider* CBTSSProvider::NewL() - { - CBTSSProvider* self = new( ELeave ) CBTSSProvider; - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -CBTSSProvider::~CBTSSProvider() - { - FLOG(_L("[BTSS]\t CBTSSProvider::destructor")); - - if( iBTSendingService ) - { - delete iBTSendingService; - } - - delete iConverter; - iConverter = NULL; - } - -// ----------------------------------------------------------------------------- -// CBTSSProvider::InitialiseL -// ----------------------------------------------------------------------------- -// -void CBTSSProvider::InitialiseL(MAiwNotifyCallback& /*aFrameworkCallback*/, - const RCriteriaArray& /*aInterest*/) - { - // Not needed. - } - -// ----------------------------------------------------------------------------- -// CBTSSProvider::HandleServiceCmdL -// ----------------------------------------------------------------------------- -// -void CBTSSProvider::HandleServiceCmdL(const TInt& aCmdId, - const CAiwGenericParamList& aInParamList, - CAiwGenericParamList& /*aOutParamList*/, - TUint /*aCmdOptions*/, - const MAiwNotifyCallback* aCallback ) - { - FLOG(_L("[BTSS]\t CBTSSProvider::HandleServiceCmdL()")); - - if ( &aInParamList == NULL || aInParamList.Count() <= 0 ) - { - FLOG(_L("[BTSS]\t CBTSSProvider::HandleServiceCmdL() aOutParamList check failed: Leave")); - User::Leave( KErrArgument ); - } - - if ( aCallback ) - { - FLOG(_L("[BTSS]\t CBTSSProvider::HandleServiceCmdL() aCallback exists: Leave")); - User::Leave( KErrNotSupported ); - } - - switch ( aCmdId ) - { - case KAiwCmdSend: - { - // Check features setting - if not completely enabled with enterprise settings then we are not allowed to send anything. - // Fail here at the first fence, otherwise there are a number of other areas that need to be considered. - if(BluetoothFeatures::EnterpriseEnablementL() != BluetoothFeatures::EEnabled) - { - RNotifier notifier; - User::LeaveIfError(notifier.Connect()); - CleanupClosePushL(notifier); - User::LeaveIfError(notifier.StartNotifier(KBTEnterpriseItSecurityInfoNotifierUid, KNullDesC8)); - CleanupStack::PopAndDestroy(¬ifier); - // Don't leave as we have already commuicated (through the security notifier) why we failed. - break; - } - - if ( !iBTSendingService ) - { - // Create the controller when needed - // - iBTSendingService = CBTServiceAPI::NewL(); - } - CBTServiceParameterList* parameterList = CBTServiceParameterList::NewLC(); - - iConverter = CBTSSSendListHandler::NewL(); - User::LeaveIfError(iConverter->ConvertList( &aInParamList, parameterList)); - - delete iConverter; - iConverter = NULL; - - // Start sending files. This function returns when all of the files are sent - // or some error has occured. - // - - CleanupStack::Pop(parameterList); - iBTSendingService->StartSynchronousServiceL( EBTSendingService, parameterList ); - - break; - } - default: - { - FLOG(_L("[BTSS]\t CBTSSProvider::HandleServiceCmdL() wrong command id: Leave")); - User::Leave( KErrNotSupported ); - break; - } - } - - FLOG(_L("[BTSS]\t CBTSSProvider::HandleServiceCmdL() completed")); - } - - - void CBTSSProvider::HandleMenuCmdL(TInt aMenuCmdId, - const CAiwGenericParamList& aInParamList, - CAiwGenericParamList& aOutParamList, - TUint aCmdOptions, - const MAiwNotifyCallback* aCallback ) - { - HandleServiceCmdL(aMenuCmdId,aInParamList, aOutParamList, aCmdOptions, aCallback); - } - - void CBTSSProvider::InitializeMenuPaneL( CAiwMenuPane& aMenuPane, - TInt aIndex, - TInt /* aCascadeId */, - const CAiwGenericParamList& /*aInParamList*/ ) - { - TFileName resourceFile; - TInt resId; - - resourceFile += KBTSendingServiceFileDrive; - resourceFile += KDC_RESOURCE_FILES_DIR; - resourceFile += KBTSSResFileName; - resId=R_SEND_VIA_BT_MENU; - - aMenuPane.AddMenuItemsL( - resourceFile, - resId, - KAiwCmdSend, - aIndex); - - } - -// End of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicebtsend/src/BTSendingService.cpp --- a/localconnectivityservice/obexsendservices/obexservicebtsend/src/BTSendingService.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* Copyright (c) 2002 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: Defines the DLL entry point and ECom initialization. -* and a panic function used in BTSS. -* -*/ - - -// INCLUDE FILES -#include "BTSSProvider.h" -#include "BTSendingServiceUIDS.hrh" -#include -#include - -// ============================= LOCAL FUNCTIONS =============================== -// - -// ----------------------------------------------------------------------------- -// ImplementationTable -// ECom init: Maps the interface UIDs to implementation factory functions. -// Returns: A table of implementation UIDs and their constructors. -// ----------------------------------------------------------------------------- -// -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY(KBTSendingServiceMenuImplUid, CBTSSProvider::NewL), - IMPLEMENTATION_PROXY_ENTRY(KBTSendingServiceBaseImplUid, CBTSSProvider::NewL) - }; - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - - - -// ----------------------------------------------------------------------------- -// ImplementationGroupProxy -// ECom init: Exported proxy for instantiation method resolution. -// Returns: Pointer to the proxy and number of implementations in it. -// ----------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) - { - aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); - return ImplementationTable; - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicebtsend/src/btsssendlisthandler.cpp --- a/localconnectivityservice/obexsendservices/obexservicebtsend/src/btsssendlisthandler.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,204 +0,0 @@ -/* -* Copyright (c) 2009 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: Converter class implementation for converting AIW paramerer -* list to bt send parameter list -* -*/ - - -#include - -#include "BTSSSendListHandler.h" -#include "BTServiceParameterList.h" -#include "BTSendingServiceDebug.h" - - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CBTSSSendListHandler() -// --------------------------------------------------------------------------- -// -CBTSSSendListHandler::CBTSSSendListHandler(): CActive( EPriorityNormal ) - { - CActiveScheduler::Add(this); - } - -// --------------------------------------------------------------------------- -// ConstructL() -// --------------------------------------------------------------------------- -// -void CBTSSSendListHandler::ConstructL() - { - } - - -// --------------------------------------------------------------------------- -// NewL() -// --------------------------------------------------------------------------- -// -CBTSSSendListHandler* CBTSSSendListHandler::NewL() - { - CBTSSSendListHandler* self = CBTSSSendListHandler::NewLC(); - CleanupStack::Pop( self ); - return self; - } - - -// --------------------------------------------------------------------------- -// NewLC() -// --------------------------------------------------------------------------- -// -CBTSSSendListHandler* CBTSSSendListHandler::NewLC() - { - CBTSSSendListHandler* self = new( ELeave ) CBTSSSendListHandler(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - -// --------------------------------------------------------------------------- -// CBTSSSendListHandler -// --------------------------------------------------------------------------- -// -CBTSSSendListHandler::~CBTSSSendListHandler() - { - FLOG(_L("[BTSS]\t CBTSSSendListHandler::Destructor")); - Cancel(); - } - -// --------------------------------------------------------------------------- -// ConvertList() -// --------------------------------------------------------------------------- -// -TInt CBTSSSendListHandler::ConvertList( const CAiwGenericParamList* aOutParamList, - CBTServiceParameterList* aList) - { - FLOG(_L("[BTSS]\t CBTSSSendListHandler::ConvertList")); - iListIndex = 0; - iOutParamList = aOutParamList; - iList = aList; - iStatus = KRequestPending; - AddObject(); - SetActive(); - - iSyncWaiter.Start(); - FLOG(_L("[BTSS]\t CBTSSSendListHandler::ConvertList done")); - return iStatus.Int(); - } - -// --------------------------------------------------------------------------- -// AddObject() -// --------------------------------------------------------------------------- -// -void CBTSSSendListHandler::AddObject() - { - FLOG(_L("[BTSS]\t CBTSSSendListHandler::AddObjectL()")); - TRAPD(error, DoAddObjectL()); - if (error != KErrNone ) - { - //Complete request - TRequestStatus* status = &iStatus; - User::RequestComplete(status, error); - } - FLOG(_L("[BTSS]\t CBTSSSendListHandler::AddObjectL() Done")); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// RunL() -// --------------------------------------------------------------------------- -// -void CBTSSSendListHandler::DoAddObjectL() - { - FLOG(_L("[BTSS]\t CBTSSSendListHandler::DoAddObjectL()")); - - const TAiwGenericParam* param=&(*iOutParamList)[iListIndex]; - - if ( param->SemanticId() != EGenericParamFile ) - { - FLOG(_L("[BTSS]\t CBTSSSendListHandler::DoAddObjectL() wrong semantic Id: Leave")); - } - // Try to add file as an image - // - if( param->Value().TypeId()== EVariantTypeFileHandle) - { - TRAPD( retVal, iList->AddImageL( param->Value().AsFileHandle() )); - FLOG(_L("[BTSS]\t CBTSSSendListHandler::DoAddObjectL AddImage")); - if( retVal != KErrNone ) - { - // File was not an image. We can not use BIP - // so add rest of the files as objects - // - FLOG(_L("[BTSS]\t CBTSSSendListHandler::DoAddObjectL AddImage filed try object")); - iList->AddObjectL( param->Value().AsFileHandle() ); - } - } - else - { - TRAPD( retVal, iList->AddImageL( param->Value().AsDes() ) ); - if( retVal != KErrNone ) - { - // File was not an image. We can not use BIP - // so add rest of the files as objects - // - iList->AddObjectL( param->Value().AsDes() ); - } - } - //Complete request - TRequestStatus* status = &iStatus; - User::RequestComplete(status, KErrNone); - - FLOG(_L("[BTSS]\t CBTSSSendListHandler::DoAddObjectL() completed")); - } -// --------------------------------------------------------------------------- -// From class CActive. -// RunL() -// --------------------------------------------------------------------------- -// -void CBTSSSendListHandler::RunL() - { - FLOG(_L("[BTSS]\t CBTSSSendListHandler::DoAddObjectL()")); - iListIndex++; - if ( iOutParamList->Count() > iListIndex && iStatus.Int() == KErrNone ) - { - iStatus = KRequestPending; - AddObject(); - SetActive(); - } - else - { - if ( iSyncWaiter.IsStarted() ) - { - iSyncWaiter.AsyncStop(); - } - } - FLOG(_L("[BTSS]\t CBTSSSendListHandler::DoAddObjectL() Done")); - } -// --------------------------------------------------------------------------- -// From class CActive. -// DoCancel() -// --------------------------------------------------------------------------- -// -void CBTSSSendListHandler::DoCancel() - { - FLOG(_L("[BTSS]\t CBTSSSendListHandler::DoCancel()")); - if ( iSyncWaiter.IsStarted() ) - { - iSyncWaiter.AsyncStop(); - } - FLOG(_L("[BTSS]\t CBTSSSendListHandler::DoCancel() done")); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexserviceirsend/data/001F86A2.rss --- a/localconnectivityservice/obexsendservices/obexserviceirsend/data/001F86A2.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2002 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: -* -* -* -*/ - - -#include -#include "registryinfov2.rh" -#include "IrSendingServiceUIDS.hrh" -#include - -RESOURCE REGISTRY_INFO theInfo - { - resource_format_version = RESOURCE_FORMAT_VERSION_2; - dll_uid = KIRSendingServiceDllUid; - interfaces = - { - INTERFACE_INFO - { - interface_uid = KAiwClassMenu; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KIRSendingServiceImplUid; - version_no = 1; - display_name = ""; - default_data = "*"; - opaque_data = KAiwCmdSendStr; - rom_only = 1; - } - }; - } - }; - } - -// End of file - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexserviceirsend/data/irssmenu.rss --- a/localconnectivityservice/obexsendservices/obexserviceirsend/data/irssmenu.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2002 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: -* -* -* -*/ - - -#include -#include "registryinfov2.rh" -#include "IRSendingService.hrh" -#include -#include - -RESOURCE MENU_PANE r_send_via_ir_menu - { - items= - { - MENU_ITEM - { - command = ESendIR; - txt = qtn_query_send_via_ir; - } - }; - } - - - -// End of file - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexserviceirsend/inc/IRClient.h --- a/localconnectivityservice/obexsendservices/obexserviceirsend/inc/IRClient.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +0,0 @@ -/* -* Copyright (c) 2002 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 client -* -*/ - - - -#ifndef IR_SERVICE_CLIENT_H -#define IR_SERVICE_CLIENT_H - -// INCLUDES - - -#include -#include -#include - - -// FORWARD DECLARATION - - -// CLASS DECLARATION - -// CLASS DECLARATION - -/** -* An active object managing the Obex client. -*/ -class CIRClient : public CActive, - MObexUtilsProgressObserver, - MObexUtilsDialogObserver - - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @return None. - */ - static CIRClient* NewL(); - - /** - * Destructor. - */ - virtual ~CIRClient(); - - public: // New functions - - - /** - * Issues an Obex Put-request. - * @param aHeaderList The headers to be associated with the object. - * @param aFileName A filename of the Put Object. - * @return None. - */ - void PutObjectL( ); - - /** - * Closes Obex Client connection. - * @param None. - * @return None. - */ - void CloseClientConnection(); - - - void StartSendL( const CAiwGenericParamList& aOutParamList ); - - private: // Functions from base classes - - /** - * From MBTServiceProgressGetter Returns the progess status. - * @return The number of bytes sent. - */ - TInt GetProgressStatus(); - - void DialogDismissed( TInt aButtonId ); - - void PutCompleted(); - - - private: // Functions from base classes - - - /** - * From CActive Get's called when a request is cancelled. - * @param None. - * @return None. - */ - void DoCancel(); - - /** - * From CActive Get's called when a request is completed. - * @param None. - * @return None. - */ - void RunL(); - - void AddFileHandleL(RFile aFile); - - void AddFileL(const TDesC& aFilePath); - - void SendL(); - - TInt FileListsize(); - - void ShowNote(); - - private: // Data definitions - - enum TIRServiceClientState - { - EIRCliConnecting, - EIRCliPutting, - EIRCliGetting, - EIRCliDisconnected - }; - - private: - - /** - * C++ default constructor. - */ - CIRClient( ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - private: // Data - - TIRServiceClientState iClientState; - - CObexClient* iClient; - CBufFlat* iObjectBuffer; - CObexBufObject* iPutBufObject; - CObexNullObject* iConnectObject; - TInt iTotalBytesSent; - TInt iObjectIndex; - RArray iFileArray; - RFs iFileSession; - CBufFlat* iBuffer; - CObexUtilsDialog* iDialog; - - - // Not owned - // - - }; - -#endif // BT_SERVICE_CLIENT_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexserviceirsend/inc/IRSendingService.hrh --- a/localconnectivityservice/obexsendservices/obexserviceirsend/inc/IRSendingService.hrh Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2002 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: ?Description -* -*/ - - -#ifndef BT_SENDING_SERVICE_HRH -#define BT_SENDING_SERVICE_HRH - -enum -{ - ESendBT=0, - ESendIR -}; - -#endif - - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexserviceirsend/inc/IrSSProvider.h --- a/localconnectivityservice/obexsendservices/obexserviceirsend/inc/IrSSProvider.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -/* -* Copyright (c) 2002 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: -* -*/ - - - -#ifndef IR_SENDING_SERVICE_PROVIDER_H -#define IR_SENDING_SERVICE_PROVIDER_H - -// INCLUDES -#include - - -#include "IRClient.h" - -// FORWARD DECLARATIONS - - - -// CLASS DECLARATION - -/** -* Provides BT sending services -* -*/ -class CIRSSProvider : public CAiwServiceIfMenu - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CIRSSProvider* NewL(); - - /** - * Destructor. - */ - virtual ~CIRSSProvider(); - - - public: // Functions from base classes - - /** - * From CAiwServiceIfMenu Not used - * @since 2.6 - * @param aFrameworkCallback Not used - * @param aInterest Not used - * @return None - */ - virtual void InitialiseL( MAiwNotifyCallback& aFrameworkCallback, - const RCriteriaArray& aInterest ); - - /** - * From CAiwServiceIfMenu Processes service command - * and starts bt sending - * @since 2.6 - * @param aCmdId Command id - * @param aInParamList Not used - * @param aOutParamList List of files - * @param aCmdOptions Not used - * @param aCallback Not used - * @return None - */ - virtual void HandleServiceCmdL( const TInt& aCmdId, - const CAiwGenericParamList& aInParamList, - CAiwGenericParamList& aOutParamList, - TUint aCmdOptions, - const MAiwNotifyCallback* aCallback ); - - - virtual void InitializeMenuPaneL( CAiwMenuPane& aMenuPane, - TInt aIndex, - TInt /* aCascadeId */, - const CAiwGenericParamList& aInParamList ); - /** - * From CAiwServiceIfBase Processes service command - * and starts bt sending - * @since 2.6 - * @param aCmdId Command id - * @param aInParamList Not used - * @param aOutParamList List of files - * @param aCmdOptions Not used - * @param aCallback Not used - * @return None - */ - virtual void HandleMenuCmdL(TInt aMenuCmdId, - const CAiwGenericParamList& aInParamList, - CAiwGenericParamList& aOutParamList, - TUint aCmdOptions, - const MAiwNotifyCallback* aCallback ); - - - - - - - private: - - - - - private: - - /** - * C++ default constructor. - */ - CIRSSProvider(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - private: // Data - - CIRClient* iIRClient; - }; - -#endif // BT_SENDING_SERVICE_PROVIDER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexserviceirsend/inc/IrSendingServiceDebug.h --- a/localconnectivityservice/obexsendservices/obexserviceirsend/inc/IrSendingServiceDebug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2002 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: This file defines logging macros for BTSS. -* -*/ - - -#ifndef BT_SENDING_SERVICE_DEBUG_H -#define BT_SENDING_SERVICE_DEBUG_H - - -#ifdef _DEBUG -// =========================================================================== -#ifdef __WINS__ // File logging for WINS -// =========================================================================== -#include -#include -#include - -_LIT(KLogFile,"btss.log"); -_LIT(KLogDirFullName,"c:\\logs\\"); -_LIT(KLogDir,"btss"); - -#define FLOG(a) { FPrint(a); } -#define FTRACE(a) { a; } - -// Declare the FPrint function -// -inline void FPrint(const TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); - } - -// =========================================================================== -#else // RDebug logging for target HW -// =========================================================================== -#include - -#define FLOG(a) { RDebug::Print(a); } -#define FTRACE(a) { a; } - -// Declare the FPrint function -// -inline void FPrint(const TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); - TInt tmpInt = VA_ARG(list, TInt); - TInt tmpInt2 = VA_ARG(list, TInt); - TInt tmpInt3 = VA_ARG(list, TInt); - VA_END(list); - RDebug::Print(aFmt, tmpInt, tmpInt2, tmpInt3); - } - -#endif //__WINS__ - -// =========================================================================== -#else // // No loggings --> Reduced binary size -// =========================================================================== -#define FLOG(a) -#define FTRACE(a) - -#endif // _DEBUG - - -#endif // BT_SENDING_SERVICE_DEBUG_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexserviceirsend/inc/IrSendingServiceUIDS.hrh --- a/localconnectivityservice/obexsendservices/obexserviceirsend/inc/IrSendingServiceUIDS.hrh Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2002 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: ?Description -* -*/ - - -#ifndef IR_SENDING_SERVICE_UIDS_HRH -#define IR_SENDING_SERVICE_UIDS_HRH - -#define KIRSendingServiceDllUid 0x001F86A2 -#define KIRSendingServiceIfaceUid 0x101F8650 // KAiwClassBase -#define KIRSendingServiceImplUid 0x001F86A3 - -#endif - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexserviceirsend/src/IRClient.cpp --- a/localconnectivityservice/obexsendservices/obexserviceirsend/src/IRClient.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,462 +0,0 @@ -/* -* Copyright (c) 2002 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 client implementation -* -*/ - - - -// INCLUDE FILES -#include -#include -#include - -#include "IRClient.h" -#include "IrSendingServiceDebug.h" - - -const TUint KIRProgressInterval = 1000000; - -_LIT( KTransportTinyTp, "IrTinyTP" ); -_LIT8( KClassNameObex, "OBEX" ); -_LIT8( KAttName, "IrDA:TinyTP:LsapSel" ); - -// CONSTANTS - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CBTServiceClient::CBTServiceClient -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIRClient::CIRClient( ) - : CActive( EPriorityStandard ), - iClientState( EIRCliDisconnected), - iObjectIndex( 0 ) - { - CActiveScheduler::Add( this ); - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CIRClient::ConstructL( ) - { - FLOG(_L("[BTSU]\t CBTServiceClient::ConstructL()")); - - User::LeaveIfError( iFileSession.Connect() ); - - iDialog = CObexUtilsDialog::NewL( this ); - iTotalBytesSent = 0; - // Create Obex Client - // - TObexIrProtocolInfo info; - //info.iTransport = KObexIrTTPProtocol; - - // info.iAddr.SetPort( KDefaultObexPort );//default obex server for now - info.iTransport = KTransportTinyTp; - info.iClassName = KClassNameObex; - info.iAttributeName = KAttName; - - - iClient = CObexClient::NewL( info ); - - - // Create Connect-object - // - iConnectObject = CObexNullObject::NewL(); - - //Show note - // - iDialog->LaunchWaitDialogL( R_IR_CONNECTING_WAIT_NOTE); - - // Establish client connection - // - iClient->Connect( /**iConnectObject,*/ iStatus ); - SetActive(); - iClientState = EIRCliConnecting; - - FLOG(_L("[BTSU]\t CBTServiceClient::ConstructL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIRClient* CIRClient::NewL() - { - CIRClient* self = new( ELeave ) CIRClient( ); - CleanupStack::PushL( self ); - self->ConstructL( ); - CleanupStack::Pop(); - return self; - } - - -// Destructor -CIRClient::~CIRClient() - { - - Cancel(); - if(iClient) - { - delete iClient; - iClient = NULL; - } - - iFileSession.Close(); - delete iConnectObject; - - for (TInt index = 0; index < iFileArray.Count(); index++ ) - { - if(iFileArray[index].SubSessionHandle()) - { - iFileArray[index].Close(); - } - } - - iFileArray.Close(); - - if ( iPutBufObject ) - { - delete iPutBufObject; - iPutBufObject = NULL; - } - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::PutObjectL -// ----------------------------------------------------------------------------- -// -void CIRClient::PutObjectL( ) - { - FLOG(_L("[BTSU]\t CBTServiceClient::PutObjectL()")); - - if ( iPutBufObject ) - { - delete iPutBufObject; - iPutBufObject = NULL; - } - - // Create object - // - iPutBufObject = CObexBufObject::NewL(NULL); - - RFile file; - file.Duplicate(iFileArray[iObjectIndex]); - - iBuffer = CBufFlat::NewL(1000); - iBuffer ->ResizeL(1000); - TObexRFileBackedBuffer bufferdetails(*iBuffer,file,CObexBufObject::ESingleBuffering); - iPutBufObject->SetDataBufL(bufferdetails); - - - TFileName filename; - file.Name(filename); - - TInt size; - file.Size(size); - iPutBufObject->SetLengthL(size); - - iPutBufObject->SetNameL(filename); - TTime time; - if(file.Modified(time) == KErrNone) - iPutBufObject->SetTimeL(time); - - - - - // Send object - // - iClient->Put( *iPutBufObject, iStatus ); - SetActive(); - iClientState = EIRCliPutting; - - FLOG(_L("[BTSU]\t CBTServiceClient::PutObjectL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::CloseClientConnection -// ----------------------------------------------------------------------------- -// -void CIRClient::CloseClientConnection() - { - - iClient->Disconnect( iStatus ); - SetActive(); - iClientState = EIRCliDisconnected; - - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::GetProgressStatus -// ----------------------------------------------------------------------------- -// -TInt CIRClient::GetProgressStatus() - { - - TInt bytesSent = 0; - if ( iPutBufObject ) - { - bytesSent = iPutBufObject->BytesSent(); - } - - return iTotalBytesSent + bytesSent; - } - - -// ----------------------------------------------------------------------------- -// CBTServiceClient::DoCancel -// ----------------------------------------------------------------------------- -// -void CIRClient::DoCancel() - { - FLOG(_L("[BTSU]\t CBTServiceClient::DoCancel()")); - - // Sending an error to Obex is the only way to cancel active requests - // - if(iClient) - { - delete iClient; - iClient = NULL; - } - - - FLOG(_L("[BTSU]\t CBTServiceClient::DoCancel() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::RunL -// ----------------------------------------------------------------------------- -// -void CIRClient::RunL() - { - - - switch ( iClientState ) - { - case EIRCliConnecting: - { - - if ( iPutBufObject ) - { - delete iPutBufObject; - iPutBufObject = NULL; - } - iObjectIndex=0; - iDialog->CancelWaitDialogL(); - iDialog->LaunchProgressDialogL( this, FileListsize(), - R_IR_SENDING_DATA, KIRProgressInterval ); - TRAPD(error,SendL()); - error=error; - - - break; - } - - case EIRCliPutting: - { - - if ( iPutBufObject ) - { - delete iPutBufObject; - iPutBufObject = NULL; - } - if(iBuffer) - { - delete iBuffer; - iBuffer=NULL; - } - iObjectIndex++; - TRAPD(error,SendL()); - error=error; - - break; - } - - case EIRCliDisconnected: - { - break; - } - default: - { - - break; - } - } - - FLOG(_L("[BTSU]\t CBTServiceClient::RunL() completed")); - } - - // ----------------------------------------------------------------------------- -// CBTServiceClient::DialogDismissed -// ----------------------------------------------------------------------------- -// - void CIRClient::DialogDismissed( TInt aButtonId ) - { - - if( aButtonId == EAknSoftkeyCancel ) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::DialogDissmissed(), cancelled by user")); - Cancel(); - - // Cancelled by user, stop service - // - iClientState = EIRCliDisconnected; - TRequestStatus* temp = &iStatus; - User::RequestComplete( temp, KErrNone ); - SetActive(); - } - } - - -// ----------------------------------------------------------------------------- -// CBTServiceClient::StartSendL -// ----------------------------------------------------------------------------- -// - void CIRClient::StartSendL(const CAiwGenericParamList& aOutParamList ) - { - - if ( iDialog ) - { - iDialog->CancelWaitDialogL(); - } - - for( TInt index = 0; index < aOutParamList.Count(); index++ ) - { - if ( aOutParamList[index].SemanticId() != EGenericParamFile ) - { - FLOG(_L("[BTSS]\t CBTSSProvider::AddParametersL() wrong semantic Id: Leave")); - User::Leave( KErrArgument ); - } - // Try to add file as an image - // - - - if(aOutParamList[index].Value().TypeId()== EVariantTypeFileHandle) - { - AddFileHandleL( aOutParamList[index].Value().AsFileHandle() ); - - } - else - { - AddFileL( aOutParamList[index].Value().AsDes() ); - } - - } - - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::SendL -// ----------------------------------------------------------------------------- -// - void CIRClient::SendL() - { - if(iObjectIndexCancelProgressDialogL(); - iClient->Disconnect( iStatus ); - SetActive(); - iClientState=EIRCliDisconnected; - - } - - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::AddFileHandleL -// ----------------------------------------------------------------------------- -// - - - void CIRClient::AddFileHandleL(RFile aFile) - { - if(!aFile.SubSessionHandle()) - { - User::Leave( KErrArgument ); - } - RFile file; - - file.Duplicate(aFile); - - iFileArray.AppendL( file ); - - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::AddFileL -// ----------------------------------------------------------------------------- -// - - void CIRClient::AddFileL(const TDesC& aFilePath) - { - if ( &aFilePath == NULL || - aFilePath.Length() == 0 || - aFilePath.Length() > KMaxFileName ) - { - User::Leave( KErrArgument ); - } - RFile file; - User::LeaveIfError( file.Open( iFileSession, aFilePath, EFileShareReadersOnly) ); - AddFileHandleL(file); - - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::FileListsize -// ----------------------------------------------------------------------------- -// - TInt CIRClient::FileListsize() - { - - TInt totalFileSize = 0; - for ( TInt index = 0; index < iFileArray.Count(); index++ ) - { - TInt fileSize = 0; - iFileArray[index].Size( fileSize ); - totalFileSize += fileSize; - } - return totalFileSize; - - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::ShowNote -// ----------------------------------------------------------------------------- -// -void CIRClient::ShowNote() - { - if(iObjectIndex==iFileArray.Count() && iStatus==KErrNone) - { - TRAPD(error,TObexUtilsUiLayer::ShowInformationNoteL(R_IR_DATA_SENT)); - error=error; - } - else - { - TRAPD(error,TObexUtilsUiLayer::ShowInformationNoteL(R_IR_SENDING_FAILED)); - error=error; - } - } -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexserviceirsend/src/IRSSProvider.cpp --- a/localconnectivityservice/obexsendservices/obexserviceirsend/src/IRSSProvider.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,170 +0,0 @@ -/* -* Copyright (c) 2002 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: ?Description -* -*/ - - -// INCLUDE FILES - -#include - -#include -#include -#include // Notifier UID's -#include //For notifier -#include -#include "IrSSProvider.h" -#include "IrSendingServiceDebug.h" -#include "IRClient.h" - -#include - -_LIT( KIRSendingServiceFileDrive, "z:"); -_LIT( KIRSSResFileName,"IRSSMenu.rsc"); - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CIRSSProvider::CIRSSProvider -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIRSSProvider::CIRSSProvider() - { - } - -// ----------------------------------------------------------------------------- -// CIRSSProvider::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CIRSSProvider::ConstructL() - { - - } - -// ----------------------------------------------------------------------------- -// CIRSSProvider::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIRSSProvider* CIRSSProvider::NewL() - { - CIRSSProvider* self = new( ELeave ) CIRSSProvider; - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -CIRSSProvider::~CIRSSProvider() - { - - } - -// ----------------------------------------------------------------------------- -// CIRSSProvider::InitialiseL -// ----------------------------------------------------------------------------- -// -void CIRSSProvider::InitialiseL(MAiwNotifyCallback& /*aFrameworkCallback*/, - const RCriteriaArray& /*aInterest*/) - { - // Not needed. - } - -// ----------------------------------------------------------------------------- -// CIRSSProvider::HandleMenuCmdL -// ----------------------------------------------------------------------------- -// - -void CIRSSProvider::HandleMenuCmdL( TInt aCmdId, - const CAiwGenericParamList& aInParamList, - CAiwGenericParamList& /*aOutParamList*/, - TUint /*aCmdOptions*/, - const MAiwNotifyCallback* /*aCallback*/ ) - { - FeatureManager::InitializeLibL(); - if(!FeatureManager::FeatureSupported(KFeatureIdIrda)) - { - FLOG(_L("[IRSS]\t FeatMgr doesn't find IrDA, show not_supported ")); - RNotifier notifier; - User::LeaveIfError( notifier.Connect() ); - TBTGenericInfoNotiferParamsPckg paramsPckg; - paramsPckg().iMessageType=EIRNotSupported; - TInt status = notifier.StartNotifier(KBTGenericInfoNotifierUid, paramsPckg); - if ( status != KErrNone ) - { - FTRACE(FPrint(_L("[IRSS]\t void CIRSSProvider::HandleMenuCmdL() ERROR: StartNotifier() failed. Code: %d "), status)); - } - notifier.Close(); - User::Leave(KErrNone); - } - FeatureManager::UnInitializeLib(); - - if ( &aInParamList == NULL || aInParamList.Count() <= 0 ) - { - FLOG(_L("[IRSS]\t CIRSSProvider::HandleServiceCmdL() aOutParamList check failed: Leave")); - User::Leave( KErrArgument ); - } - - if ( !iIRClient ) - { - iIRClient = CIRClient::NewL(); - } - iIRClient->StartSendL( aInParamList ); - - FLOG(_L("[BTSS]\t CBTSSProvider::HandleServiceCmdL() completed")); - } - - // ----------------------------------------------------------------------------- -// CIRSSProvider::InitializeMenuPaneL -// ----------------------------------------------------------------------------- -// - - void CIRSSProvider::InitializeMenuPaneL( CAiwMenuPane& aMenuPane, - TInt aIndex, - TInt /* aCascadeId */, - const CAiwGenericParamList& /*aInParamList*/ ) - { - TFileName resourceFile; - TInt resId; - - resourceFile += KIRSendingServiceFileDrive; - resourceFile += KDC_RESOURCE_FILES_DIR; - resourceFile += KIRSSResFileName; - resId=R_SEND_VIA_IR_MENU; - - aMenuPane.AddMenuItemsL( - resourceFile, - resId, - KAiwCmdSend, - aIndex); - } - - void CIRSSProvider::HandleServiceCmdL( const TInt& aCmdId, - const CAiwGenericParamList& aInParamList, - CAiwGenericParamList& aOutParamList, - TUint aCmdOptions, - const MAiwNotifyCallback* aCallback ) - { - HandleMenuCmdL(aCmdId,aInParamList,aOutParamList,aCmdOptions,aCallback); - } - -// End of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexserviceirsend/src/IRSendingService.cpp --- a/localconnectivityservice/obexsendservices/obexserviceirsend/src/IRSendingService.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* Copyright (c) 2002 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: Defines the DLL entry point and ECom initialization. -* and a panic function used in BTSS. -* -*/ - - -// INCLUDE FILES -#include "IrSSProvider.h" -#include "IRSendingService.hrh" -#include "IrSendingServiceUIDS.hrh" -#include -#include - -// ============================= LOCAL FUNCTIONS =============================== -// - -// ----------------------------------------------------------------------------- -// ImplementationTable -// ECom init: Maps the interface UIDs to implementation factory functions. -// Returns: A table of implementation UIDs and their constructors. -// ----------------------------------------------------------------------------- -// -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY(KIRSendingServiceImplUid, CIRSSProvider::NewL) - }; - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// E32Dll -// DLL entry point. -// Returns: Symbian OS errorcode. -// ----------------------------------------------------------------------------- -// -#ifndef EKA2 -GLDEF_C TInt E32Dll( TDllReason /*aReason*/ ) - { - return KErrNone; - } -#endif - -// ----------------------------------------------------------------------------- -// ImplementationGroupProxy -// ECom init: Exported proxy for instantiation method resolution. -// Returns: Pointer to the proxy and number of implementations in it. -// ----------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) - { - aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); - return ImplementationTable; - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/bmarm/BTSERVICEUTILSU.DEF --- a/localconnectivityservice/obexsendservices/obexservicesendutils/bmarm/BTSERVICEUTILSU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -EXPORTS - StartSynchronousServiceL__13CBTServiceAPI14TBTServiceTypeP23CBTServiceParameterList @ 1 NONAME R3UNUSED ; CBTServiceAPI::StartSynchronousServiceL(TBTServiceType, CBTServiceParameterList *) - AddObjectL__23CBTServiceParameterListRC7TDesC16 @ 2 NONAME R3UNUSED ; CBTServiceParameterList::AddObjectL(TDesC16 const &) - AddXhtmlL__23CBTServiceParameterListRC7TDesC16 @ 3 NONAME R3UNUSED ; CBTServiceParameterList::AddXhtmlL(TDesC16 const &) - NewLC__23CBTServiceParameterList @ 4 NONAME R3UNUSED ; CBTServiceParameterList::NewLC(void) - NewL__13CBTServiceAPI @ 5 NONAME R3UNUSED ; CBTServiceAPI::NewL(void) - NewL__23CBTServiceParameterList @ 6 NONAME R3UNUSED ; CBTServiceParameterList::NewL(void) - StartServiceL__13CBTServiceAPI14TBTServiceTypeP23CBTServiceParameterList @ 7 NONAME R3UNUSED ; CBTServiceAPI::StartServiceL(TBTServiceType, CBTServiceParameterList *) - AddImageL__23CBTServiceParameterListRC7TDesC16 @ 8 NONAME R3UNUSED ; CBTServiceParameterList::AddImageL(TDesC16 const &) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/bwins/BTSERVICEUTILSU.DEF --- a/localconnectivityservice/obexsendservices/obexservicesendutils/bwins/BTSERVICEUTILSU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -EXPORTS - ?AddImageL@CBTServiceParameterList@@QAEXABVTDesC16@@@Z @ 1 NONAME ; void CBTServiceParameterList::AddImageL(class TDesC16 const &) - ?AddImageL@CBTServiceParameterList@@QAEXVRFile@@@Z @ 2 NONAME ; void CBTServiceParameterList::AddImageL(class RFile) - ?AddObjectL@CBTServiceParameterList@@QAEXABVTDesC16@@@Z @ 3 NONAME ; void CBTServiceParameterList::AddObjectL(class TDesC16 const &) - ?AddObjectL@CBTServiceParameterList@@QAEXVRFile@@@Z @ 4 NONAME ; void CBTServiceParameterList::AddObjectL(class RFile) - ?AddXhtmlL@CBTServiceParameterList@@QAEXABVTDesC16@@@Z @ 5 NONAME ; void CBTServiceParameterList::AddXhtmlL(class TDesC16 const &) - ?NewL@CBTServiceAPI@@SAPAV1@XZ @ 6 NONAME ; class CBTServiceAPI * CBTServiceAPI::NewL(void) - ?NewL@CBTServiceParameterList@@SAPAV1@XZ @ 7 NONAME ; class CBTServiceParameterList * CBTServiceParameterList::NewL(void) - ?NewLC@CBTServiceParameterList@@SAPAV1@XZ @ 8 NONAME ; class CBTServiceParameterList * CBTServiceParameterList::NewLC(void) - ?StartServiceL@CBTServiceAPI@@QAEXW4TBTServiceType@@PAVCBTServiceParameterList@@@Z @ 9 NONAME ; void CBTServiceAPI::StartServiceL(enum TBTServiceType, class CBTServiceParameterList *) - ?StartSynchronousServiceL@CBTServiceAPI@@QAEXW4TBTServiceType@@PAVCBTServiceParameterList@@@Z @ 10 NONAME ; void CBTServiceAPI::StartSynchronousServiceL(enum TBTServiceType, class CBTServiceParameterList *) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/eabi/BtServiceUtilsU.DEF --- a/localconnectivityservice/obexsendservices/obexservicesendutils/eabi/BtServiceUtilsU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -EXPORTS - _ZN13CBTServiceAPI13StartServiceLE14TBTServiceTypeP23CBTServiceParameterList @ 1 NONAME - _ZN13CBTServiceAPI24StartSynchronousServiceLE14TBTServiceTypeP23CBTServiceParameterList @ 2 NONAME - _ZN13CBTServiceAPI4NewLEv @ 3 NONAME - _ZN23CBTServiceParameterList10AddObjectLE5RFile @ 4 NONAME - _ZN23CBTServiceParameterList10AddObjectLERK7TDesC16 @ 5 NONAME - _ZN23CBTServiceParameterList4NewLEv @ 6 NONAME - _ZN23CBTServiceParameterList5NewLCEv @ 7 NONAME - _ZN23CBTServiceParameterList9AddImageLE5RFile @ 8 NONAME - _ZN23CBTServiceParameterList9AddImageLERK7TDesC16 @ 9 NONAME - _ZN23CBTServiceParameterList9AddXhtmlLERK7TDesC16 @ 10 NONAME - _ZTI13CBTServiceAPI @ 11 NONAME ; ## - _ZTI23CBTServiceParameterList @ 12 NONAME ; ## - _ZTV13CBTServiceAPI @ 13 NONAME ; ## - _ZTV23CBTServiceParameterList @ 14 NONAME ; ## - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTConnectionTimer.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTConnectionTimer.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +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: Waiter class -* -*/ - - - -#ifndef BTCONNECTION_TIMER_H -#define BTCONNECTION_TIMER_H - -// INCLUDES -#include // CTimer -#include "BTServiceClient.h" - -// CLASS DECLARATION - - - -// CLASS DECLARATION - -/** -* A timer object for waiting server connections. -*/ -NONSHARABLE_CLASS (CBTConnectionTimer) : public CTimer - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CBTConnectionTimer* NewL( MBTConTimeObserver* aObserver ); - - /** - * Destructor. - */ - virtual ~CBTConnectionTimer(); - - private: // Functions from base classes - - /** - * From CActive Get's called when the timer expires. - * @param None. - * @return None. - */ - void RunL(); - - private: - - /** - * C++ default constructor. - */ - CBTConnectionTimer( MBTConTimeObserver* aObserver ); - - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - public: - /** - * Set timeout value - * @aTimeOutValue timeout value - * @return None. - */ - void SetTimeOut(TTimeIntervalMicroSeconds32 aTimeOutValue); - - /** - * Start - * @aTimeOutValue timeout value - * @return None. - */ - void Start(); - - private: // Data - - // Not owned - // - MBTConTimeObserver* iObserver; - TTimeIntervalMicroSeconds32 iTimeOutValue; - }; - -#endif // BTCONNECTION_TIMER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSBIPController.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSBIPController.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,179 +0,0 @@ -/* -* Copyright (c) 2002 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: Image push controller -* -*/ - - - -#ifndef BT_BIP_CONTROLLER_H -#define BT_BIP_CONTROLLER_H - -// INCLUDES -#include "BTServiceClient.h" -#include "BTServiceStarter.h" -#include "BTSController.h" - -// CLASS DECLARATION - -/** -* Control class for the Image sending -*/ -NONSHARABLE_CLASS (CBTSBIPController) : public CBTSController, - public MBTServiceClientObserver - - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CBTSBIPController* NewL( MBTServiceObserver* aObserver, - const TUint aRemotePort, - const TBTDevAddr& aRemoteDevice, - CBTServiceParameterList* aList ); - - /** - * Destructor. - */ - virtual ~CBTSBIPController(); - - private: // Functions from base classes - - /** - * From MBTServiceClientObserver A Connect operation has been completed. - * @param aStatus The status of the operation. - * @return None. - */ - void ConnectCompleted( TInt aStatus ); - - /** - * From MBTServiceClientObserver The client connection has been closed. - * @param None. - * @return None. - */ - void ClientConnectionClosed(); - - /** - * From MBTServiceClientObserver A Put operation has been completed. - * @param aStatus The status of the operation. - * @param aPutResponse Response packet from remote device. - * @return None. - */ - void PutCompleted( TInt aStatus, const CObexHeaderSet* aPutResponse ); - - /** - * From MBTServiceClientObserver A Get operation has been completed. - * @param aStatus The status of the operation. - * @param aGetResponse Response packet from remote device. - * @return None. - */ - void GetCompleted( TInt aStatus, CObexBufObject* aGetResponse ); - - /** - * From MBTServiceClientObserver A Connect operation is timed out. - * @return None. - */ - void ConnectTimedOut(); - - - private: - - /** - * C++ default constructor. - */ - CBTSBIPController( MBTServiceObserver* aObserver, - CBTServiceParameterList* aList ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL( const TUint aRemotePort, - const TBTDevAddr& aRemoteDeviceAddr ); - - private: - - /** - * Send image - * @param None. - * @return None. - */ - void SendL(); - - /** - * Send thumbnail image - * @param aPutResponse Response packet containing the image handle - * @return None. - */ - void SendThumbnailL( const CObexHeaderSet* aPutResponse ); - - /** - * Get capabilities object from remote device - * @param None. - * @return None. - */ - void GetL(); - - /** - * Create temp file - * @param aFileName Name of the file that was created - * @return None. - */ - void CreateTempFileL( TFileName& aFileName ); - - /** - * Generate a temp file name - * @param aFileName File name that was created. - * @return None. - */ - void GenerateTempFileNameL( TFileName& aFileName ); - - /** - * Delete a temp file - * @param aFileName Name of the file. - * @return None. - */ - void DeleteTempFile( TFileName& aFileName ); - - /** - * Create image descriptor - * @param None. - * @return HBufC8*. - */ - HBufC8* CreateImageDescriptorL(); - - /** - * Handle GetCompleteIndication - * @param aGetResponse Get response packet from remote device - * @return None. - */ - void HandleGetCompleteIndicationL( CObexBufObject* aGetResponse ); - - private: // Data - - TInt iFileIndex; - TFileName iThumbnailFileName; - TFileName iTempFileName; - - - // Not owned - // - CBTServiceParameterList* iListPtr; - MBTServiceObserver* iObserverPtr; - - }; - -#endif // BT_BIP_CONTROLLER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSBPPController.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSBPPController.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,184 +0,0 @@ -/* -* Copyright (c) 2002 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: Basic printing controller -* -*/ - - - -#ifndef BT_SERVICE_BPP_CONTROLLER_H -#define BT_SERVICE_BPP_CONTROLLER_H - -// INCLUDES -#include -#include "BTServiceStarter.h" -#include "BTServiceParameterList.h" -#include "BTServiceClient.h" -#include "BTSBPPObjectServer.h" -#include "BTSBPPServerWait.h" -#include "BTSController.h" - - - - -// CLASS DECLARATION - -/** -* A class controlling printing service using Basic Printing Profile. -*/ -NONSHARABLE_CLASS (CBTSBPPController) : public CBTSController, - public MBTServiceClientObserver, - public MBTSBPPObjectServerObserver, - public MBTSBPPServerWaitObserver - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CBTSBPPController* NewL( MBTServiceObserver* aObserver, - const TUint aRemotePort, - const TBTDevAddr& aRemoteDevice, - const CBTServiceParameterList* aList, - CBTEngDiscovery* aBTEngDiscoveryPtr ); - - /** - * Destructor. - */ - virtual ~CBTSBPPController(); - - - private: // Functions from base classes - - /** - * From MBTServiceClientObserver A Connect operation has been completed. - * @param aStatus The status of the operation. - * @return None. - */ - void ConnectCompleted( TInt aStatus ); - - /** - * From MBTServiceClientObserver A Put operation has been completed. - * @param aStatus The status of the operation. - * @param aPutResponse The response object. - * @return None. - */ - void PutCompleted( TInt aStatus,const CObexHeaderSet* aPutResponse ); - - /** - * From MBTServiceClientObserver A Get operation has been completed. - * @param aStatus The status of the operation. - * @param aGetResponse The response object. - * @return None. - */ - void GetCompleted( TInt aStatus, CObexBufObject* aGetResponse ); - - /** - * From MBTServiceClientObserver The client connection has been closed. - * @return None. - */ - void ClientConnectionClosed(); - - /** - * From MBTServiceClientObserver A filehandle can be reseted. - * @return None. - */ - void ResetFileHandleL(); - /** - * From MBTPSServerObserver An error in server has occurred. - * @param aError The error. - * @return None. - */ - void ServerError( TInt aError ); - - /** - * From MBTPSServerObserver The server connection has been established. - * @param None. - * @return None. - */ - void ServerConnectionEstablished(); - - /** - * From MBTPSServerObserver The server connection has been closed. - * @param None. - * @return None. - */ - void ServerConnectionClosed(); - - /** - * From MBTPSServerWaitObserver The server wait has completed. - * @param None. - * @return None. - */ - void WaitComplete(); - - /** - * From MBTServiceClientObserver A Connect operation is timed out. - * @return None. - */ - void ConnectTimedOut(); - - private: - - /** - * C++ default constructor. - */ - CBTSBPPController( MBTServiceObserver* aObserver, - const CBTServiceParameterList* aList ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL( const TBTDevAddr& aRemoteDevice, - const TUint aRemotePort, - CBTEngDiscovery* aBTEngDiscoveryPtr ); - - /** - * Selects the next document to send and issues a send request - * to Obex client. - * @return None. - */ - void SelectAndSendL(); - - private: // Data definitions - - enum TBTSBPPObjectServerState - { - EBTSBPPSrvIdle, - EBTSBPPSrvServing, - EBTSBPPSrvDone - }; - - private: // Data - - // Owned - // - CBTSBPPObjectServer* iServer; - CBTSBPPServerWait* iServerWait; - - TInt iSendIndex; - TUint iClientChannel; - TBTSBPPObjectServerState iServerState; - TBool iClientDone; - - // Not owned - // - MBTServiceObserver* iObserverPtr; - const CBTServiceParameterList* iListPtr; - - }; - -#endif // BT_SERVICE_BPP_CONTROLLER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSBPPObjectRequest.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSBPPObjectRequest.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -/* -* Copyright (c) 2002 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: GetReferencedObjects -operation controller -* -*/ - - - -#ifndef BTSBPP_OBJECT_REQUEST_H -#define BTSBPP_OBJECT_REQUEST_H - -// INCLUDES -#include // Obex -#include // CDesCArray - -// CLASS DECLARATION -/** -* A class handling GetReferencedObjects -operation. -*/ -NONSHARABLE_CLASS (CBTSBPPObjectRequest) : public CBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CBTSBPPObjectRequest* NewL( CObexBaseObject* aGetOperation, - const CDesCArray* aRefObjectList ); - - /** - * Destructor. - */ - virtual ~CBTSBPPObjectRequest(); - - public: // Functions from base classes - - /** - * Returns the requested Object. - * @param None. - * @return A pointer to the requested object. NULL if the request - * cannot be fullfilled. - */ - CObexBufObject* GetResponse(); - - private: - - /** - * C++ default constructor. - */ - CBTSBPPObjectRequest( CObexBaseObject* aGetOperation, - const CDesCArray* aRefObjectList ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - // CHECK REQUEST ------------------------------------------------------ - - /** - * Checks the validity of the Get-operation and it's parameters. - * @return None. - */ - void CheckGetRequestL(); - - /** - * Checks the existence, validity and contents of Type header. - * @return None. - */ - void CheckTypeHeaderL(); - - /** - * Checks the existence, validity and contents of Name header. - * @return None. - */ - void CheckNameHeaderL(); - - /** - * Checks the existence, validity and contents of - * Application Parameters header. - * @return None. - */ - void CheckAppParamsHeaderL(); - - - // EXECUTE REQUEST ---------------------------------------------------- - - /** - * Executes any tasks needed and creates the requested object. - * @return None. - */ - void ExecuteGetRequestL(); - - /** - * Resolves the actual part of data that is requested. - * @return None. - */ - void ResolveGetRequestL(); - - /** - * Reads the requested part of a file into a buffer. - * @return None. - */ - void ReadFileToBufferL(); - - /** - * Creates the response object with correct data and headers. - * @return None. - */ - void CreateResponseObjectL(); - - private: // Data definitions - - struct TBTSBPPObjectParams - { - const TDesC* iName; // The name of the object. - TInt iFileSize; // The total size of the object. - TInt iOffset; // The offset to the the object (starting point). - TInt iCount; // The number of bytes to be sent. - }; - - private: // Data - - RFs iFileSession; - TBTSBPPObjectParams iRequestParams; - CObexBufObject* iResponse; - CBufFlat* iResponseBuffer; - - // Not owned - // - CObexBaseObject* iRequest; - const CDesCArray* iObjectList; - }; - -#endif // BTSBPP_OBJECT_REQUEST_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSBPPObjectServer.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSBPPObjectServer.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,240 +0,0 @@ -/* -* Copyright (c) 2002 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: Server part of basic printing profile -* -*/ - - - -#ifndef BTSBPP_OBJECT_SERVER_H -#define BTSBPP_OBJECT_SERVER_H - -// INCLUDES -//#include "BTSBPPPasskeyRequest.h" - -#include // Obex -#include // CDesCArray -#include -#include "BTServiceStarter.h" - -// FORWARD DECLARATIONS -class CBTSBPPObjectRequest; - -// CLASS DECLARATION - -/** -* An interface used to inform about CBTSBPPObjectServer events. -*/ -class MBTSBPPObjectServerObserver - { - public: - - /** - * Informs the observer that an error has been occurred. - * @param aError The error. - * @return None. - */ - virtual void ServerError( TInt aError ) = 0; - - /** - * Informs the observer that the server connection has been established. - * @param None. - * @return None. - */ - virtual void ServerConnectionEstablished() = 0; - - /** - * Informs the observer that the server connection has been closed. - * @param None. - * @return None. - */ - virtual void ServerConnectionClosed() = 0; - }; - -// CLASS DECLARATION - -/** -* A class managing the Obex Server. -*/ -NONSHARABLE_CLASS (CBTSBPPObjectServer) : public CBase, - public MObexServerNotify, - public MObexAuthChallengeHandler - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CBTSBPPObjectServer* NewL( MBTSBPPObjectServerObserver* aObserver, - CBTEngDiscovery* aBTEngDiscoveryPtr, - const TBTDevAddr& aExpectedClient ); - - /** - * Destructor. - */ - virtual ~CBTSBPPObjectServer(); - - public: // New functions - - /** - * Gives the server a list of referenced objects that can be requested. - * by the printer. This method should be called always before sending - * any documents. - * @param aRefObjectList A pointer to the list. - * @return None. - */ - void SetReferencedObjectList( const CDesCArray* aRefObjectList ); - - /** - * Tells whether the current referenced object list has any items. - * @param aRefObjectList A pointer to the list. - * @return None. - */ - TBool HasReferencedObjects(); - - private: // Functions from base classes - - /** - * From MObexAuthChallengeHandler Get's called when Obex Password is - * requested. - * @param aRealm The realm/challenge specified by the unit forcing - * the authentication. - * @return None. - */ - void GetUserPasswordL( const TDesC& aRealm ); - - private: // Functions from MObexServerNotify - - /** - * Informs about an error in Obex connection. - * @param aError The occurred error. - * @return None. - */ - void ErrorIndication( TInt aError ); - - /** - * Informs that Obex transport layer is up. - * @return None. - */ - void TransportUpIndication(); - - /** - * Informs that Obex transport layer is down. - * @return None. - */ - void TransportDownIndication(); - - /** - * Informs about Obex connect request. - * @param aRemoteInfo Information about the remote party. - * @param aInfo Information about the connection request. - * @return Symbian OS error code. - */ - TInt ObexConnectIndication( const TObexConnectInfo& aRemoteInfo, - const TDesC8& aInfo ); - - /** - * Informs about Obex disconnect request. - * @param aInfo Information about the disconnect request. - * @return None. - */ - void ObexDisconnectIndication( const TDesC8& aInfo ); - - /** - * Informs about Obex put request. - * @return The requested object or NULL; - */ - CObexBufObject* PutRequestIndication(); - - /** - * Informs that part of the put object is sent. - * @return Symbian OS error code. - */ - TInt PutPacketIndication(); - - /** - * Informs that the put request is completed. - * @return Symbian OS error code. - */ - TInt PutCompleteIndication(); - - /** - * Informs about Obex put request. - * @param aRequiredObject The Get request object. - * @return The response object or NULL; - */ - CObexBufObject* GetRequestIndication( - CObexBaseObject* aRequiredObject ); - - /** - * Informs that part of the get response object is sent. - * @return Symbian OS error code. - */ - TInt GetPacketIndication(); - - /** - * Informs that the get request is completed. - * @return Symbian OS error code. - */ - TInt GetCompleteIndication(); - - /** - * Informs about Obex Set Path request. - * @param aPathInfo Information about the path. - * @param aInfo Information about the Set Path request. - * @return Symbian OS error code. - */ - TInt SetPathIndication( const CObex::TSetPathInfo& aPathInfo, - const TDesC8& aInfo ); - - /** - * Informs about Obex Abort operation. - * @return None. - */ - void AbortIndication(); - - private: - - /** - * C++ default constructor. - */ - CBTSBPPObjectServer( MBTSBPPObjectServerObserver* aObserver, - CBTEngDiscovery* aBTEngDiscoveryPtr, - const TBTDevAddr& aExpectedClient ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - private: // Data - - TInt iObjectChannel; - TSdpServRecordHandle iSDPHandle; - - CObexServer* iServer; - CBTSBPPObjectRequest* iObjectRequest; - //CBTSBPPPasskeyRequest* iPasskeyRequest; - - // Not owned - // - const CDesCArray* iObjectListPtr; - const TBTDevAddr* iExpectedClientPtr; - CBTEngDiscovery* iBTEngDiscoveryPtr; - MBTSBPPObjectServerObserver* iObserverPtr; - }; - -#endif // BTSBPP_OBJECT_SERVER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSBPPServerWait.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSBPPServerWait.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2002 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: Waiter class -* -*/ - - - -#ifndef BTSBPP_SERVER_WAIT_H -#define BTSBPP_SERVER_WAIT_H - -// INCLUDES -#include // CTimer - -// CLASS DECLARATION - -/** -* An interface used to inform about CBTSBPPServerWait completion. -*/ -class MBTSBPPServerWaitObserver - { - public: - - /** - * Informs the observer that the waiting has been completed. - * @param None. - * @return None. - */ - virtual void WaitComplete() = 0; - }; - -// CLASS DECLARATION - -/** -* A timer object for waiting server connections. -*/ -NONSHARABLE_CLASS (CBTSBPPServerWait) : public CTimer - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CBTSBPPServerWait* NewL( MBTSBPPServerWaitObserver* aObserver ); - - /** - * Destructor. - */ - virtual ~CBTSBPPServerWait(); - - private: // Functions from base classes - - /** - * From CActive Get's called when the timer expires. - * @param None. - * @return None. - */ - void RunL(); - - private: - - /** - * C++ default constructor. - */ - CBTSBPPServerWait( MBTSBPPServerWaitObserver* aObserver ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - private: // Data - - // Not owned - // - MBTSBPPServerWaitObserver* iObserver; - }; - -#endif // BTSBPP_SERVER_WAIT_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSController.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSController.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -/* -* Copyright (c) 2007-2007 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: Profile controller interface -* -*/ - - - -#ifndef C_BTPROFILECONTROLLER_H -#define C_BTPROFILECONTROLLER_H - - -#include - -#include "BTServiceClient.h" - - -class CBTServiceClient; - -/** - * ProfileControllerIntreface definition - * - * @endcode - * - * @lib ?library - * @since S60 v.3.2 - */ -NONSHARABLE_CLASS (CBTSController) : public CBase - { - -public: - - CBTSController(); - /** - * Destructor. - */ - virtual ~CBTSController(); - - /** - * Abort command to client - * - * @since S60 v.3.2 - * @return None - */ - void Abort( ); - -protected: - - /** - * Create client - * - * @since S60 v.3.2 - * @return None - */ - void CreateClientL(MBTServiceClientObserver* aObserver, - const TBTDevAddr& aRemoteDevice, - const TUint aRemotePort, - RArray aHeaderList ); - - -protected: // data - - /** - * Service client - * Not own. - */ - CBTServiceClient* iClient; - - }; - - -#endif // C_BTPROFILECONTROLLER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSOPPController.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSOPPController.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -/* -* Copyright (c) 2002 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: Object push controller -* -*/ - - - -#ifndef BT_OPP_CONTROLLER_H -#define BT_OPP_CONTROLLER_H - -// INCLUDES -#include "BTServiceClient.h" -#include "BTServiceStarter.h" -#include "BTSController.h" - -// FORWARD DECLARATIONS - -// CLASS DECLARATION - -/** -* Control class for the Object sending -*/ -NONSHARABLE_CLASS (CBTSOPPController) : public CBTSController, - public MBTServiceClientObserver - - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CBTSOPPController* NewL( MBTServiceObserver* aObserver, - const TUint aRemotePort, - const TBTDevAddr& aRemoteDevice, - CBTServiceParameterList* aList ); - - /** - * Destructor. - */ - virtual ~CBTSOPPController(); - - private: // Functions from base classes - - /** - * From MBTServiceClientObserver A Connect operation has been completed. - * @param aStatus The status of the operation. - * @return None. - */ - void ConnectCompleted( TInt aStatus ); - - /** - * From MBTServiceClientObserver The client connection has been closed. - * @param None. - * @return None. - */ - void ClientConnectionClosed(); - - /** - * From MBTServiceClientObserver A Put operation has been completed. - * @param aStatus The status of the operation. - * @param aPutResponse Response packet from remote device. - * @return None. - */ - void PutCompleted( TInt aStatus, const CObexHeaderSet* aPutResponse ); - - /** - * From MBTServiceClientObserver A Get operation has been completed. - * @param aStatus The status of the operation. - * @param aGetResponse Response packet from remote device. - * @return None. - */ - void GetCompleted( TInt aStatus, CObexBufObject* aGetResponse ); - - /** - * From MBTServiceClientObserver A Connect operation is timed out. - * @return None. - */ - void ConnectTimedOut(); - - - private: - - /** - * C++ default constructor. - */ - CBTSOPPController( MBTServiceObserver* aObserver, - CBTServiceParameterList* aList ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL( const TUint aRemotePort, - const TBTDevAddr& aRemoteDeviceAddr ); - - private: - - /** - * Send file - * @param None. - * @return None. - */ - void Send(); - - /** - * Handle Connection indication - * @param None. - * @return None. - */ - void HandleConnectCompleteIndicationL(); - - private: // Data - - TInt iFileIndex; - // Not owned - // - CBTServiceParameterList* iListPtr; - MBTServiceObserver* iObserverPtr; - }; - -#endif // BT_OPP_CONTROLLER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSUCapabilityResolver.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSUCapabilityResolver.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,204 +0,0 @@ -/* -* Copyright (c) 2002 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: Capability resolver -* -*/ - - -#ifndef BTSU_CAPABILITY_RESOLVER_H -#define BTSU_CAPABILITY_RESOLVER_H - -// INCLUDES -//#include -// new headers -#include -#include - - -#include - -// CLASS DECLARATION - -/** -* A content handler class implementing MXMLContentHandler interface. -* Listens notifications and appends found capabilities to a given list. -*/ -NONSHARABLE_CLASS (CBTSUCapabilityResolver) :public CBase, - public Xml::MContentHandler - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CBTSUCapabilityResolver* NewL( CDesCArrayFlat* aCapabilityList ); - - - static CBTSUCapabilityResolver* NewL( RArray* aCapabilityList ); - - /** - * Destructor. - */ - virtual ~CBTSUCapabilityResolver(); - - /** - * Return capability object resolving status - * @return A boolean according to status. - */ - TBool IsCompleted(); - - private: - - /** - * From MContentHandler A notification telling about the beginning - * of a document. - * @param aDocParam Specifies the various parameters of the document. - * @param aErrorCode is the error code. - */ - void OnStartDocumentL(const Xml::RDocumentParameters& aDocParam, TInt aErrorCode); - - /** - * From MContentHandler A notification telling about the end - * of a document. - * @param aErrorCode is the error code. - If this is not KErrNone then special action may be required. - */ - void OnEndDocumentL(TInt aErrorCode); - - /** - * From MContentHandler A notification telling about the beginning - * of an element. - * @param aElement is a handle to the element's details. - * @param aAttributes contains the attributes for the element. - * @param aErrorCode is the error code. - * @return A boolean according to success. - */ - void OnStartElementL(const Xml::RTagInfo& aElement, const Xml::RAttributeArray& aAttributes, - TInt aErrorCode); - - /** - This method is a callback to indicate the end of the element has been reached. - @param aElement is a handle to the element's details. - @param aErrorCode is the error code. - If this is not KErrNone then special action may be required. - */ - void OnEndElementL(const Xml::RTagInfo& aElement, TInt aErrorCode); - - /** - This method is a callback that sends the content of the element. - Not all the content may be returned in one go. The data may be sent in chunks. - When an OnEndElementL is received this means there is no more content to be sent. - @param aBytes is the raw content data for the element. - The client is responsible for converting the data to the - required character set if necessary. - In some instances the content may be binary and must not be converted. - @param aErrorCode is the error code. - If this is not KErrNone then special action may be required. - */ - void OnContentL(const TDesC8& aBytes, TInt aErrorCode); - /** - This method is a notification of the beginning of the scope of a prefix-URI Namespace mapping. - This method is always called before the corresponding OnStartElementL method. - @param aPrefix is the Namespace prefix being declared. - @param aUri is the Namespace URI the prefix is mapped to. - @param aErrorCode is the error code. - If this is not KErrNone then special action may be required. - */ - void OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri, - TInt aErrorCode); - - /** - This method is a notification of the end of the scope of a prefix-URI mapping. - This method is called after the corresponding DoEndElementL method. - @param aPrefix is the Namespace prefix that was mapped. - @param aErrorCode is the error code. - If this is not KErrNone then special action may be required. - */ - void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode); - - - /** - This method is a notification of ignorable whitespace in element content. - @param aBytes are the ignored bytes from the document being parsed. - @param aErrorCode is the error code. - If this is not KErrNone then special action may be required. - */ - void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode); - - - /** - This method is a notification of a skipped entity. If the parser encounters an - external entity it does not need to expand it - it can return the entity as aName - for the client to deal with. - @param aName is the name of the skipped entity. - @param aErrorCode is the error code. - If this is not KErrNone then special action may be required. - */ - void OnSkippedEntityL(const RString& aName, TInt aErrorCode); - - - /** - This method is a receive notification of a processing instruction. - @param aTarget is the processing instruction target. - @param aData is the processing instruction data. If empty none was supplied. - @param aErrorCode is the error code. - If this is not KErrNone then special action may be required. - */ - void OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData, - TInt aErrorCode); - - - /** - This method indicates an error has occurred. - @param aError is the error code - */ - void OnError(TInt aErrorCode); - - - /** - This method obtains the interface matching the specified uid. - @return 0 if no interface matching the uid is found. - Otherwise, the this pointer cast to that interface. - @param aUid the uid identifying the required interface. - */ - TAny* GetExtendedInterface(const TInt32 aUid); - - /** - * C++ default constructor. - */ - CBTSUCapabilityResolver( CDesCArrayFlat* aCapabilityList ); - - /** - * C++ default constructor. - */ - CBTSUCapabilityResolver( RArray* aCapabilityList ); - - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - - private: // Data - - // Not owned. - // - RArray* iCapabilityList; - TBool iCompleted; - }; - -#endif // BTSU_CAPABILITY_RESOLVER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSUDataConverter.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSUDataConverter.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* -* Copyright (c) 2002 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: A data conversion class. -* -*/ - - -#ifndef BTSU_DATA_CONVERTER_H -#define BTSU_DATA_CONVERTER_H - -// INCLUDES -#include - -// CONSTANTS - -// DATA TYPES - -// CLASS DECLARATION - -/** -* A class for executing data conversion -*/ -class TBTSUDataConverter - { - public: - - /** - * Converts the given data as integer. - * @param aData The data to be converted. - * @return The data converted as TUint8 - */ - static TUint8 ConvertByteL( const TPtrC8& aData ); - - /** - * Converts the given data as signed integer. - * @param aData The data to be converted. - * @return The data converted as TInt32. - */ - static TInt32 ConvertDataSignedL( const TPtrC8& aData ); - - /** - * Converts the given data as unsigned integer. - * @param aData The data to be converted. - * @return The data converted as TUint32. - */ - static TUint32 ConvertDataUnsignedL( const TPtrC8& aData ); - }; - -#endif // BTSU_DATA_CONVERTER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSUDebug.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSUDebug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2002 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: This file defines logging macros for BTSU. -* -*/ - - -#ifndef BT_SERVICE_UTILS_DEBUG_H -#define BT_SERVICE_UTILS_DEBUG_H - - -#ifdef _DEBUG -// =========================================================================== -#ifdef __WINS__ // File logging for WINS -// =========================================================================== -#include -#include -#include - -_LIT(KLogFile,"btsuLog.txt"); -_LIT(KLogDirFullName,"c:\\logs\\btsu\\"); -_LIT(KLogDir,"btsu"); - -#define FLOG(a) { FPrint(a); } -#define FTRACE(a) { a; } - -// Declare the FPrint function -// -inline void FPrint(const TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); - } - -// =========================================================================== -#else // RDebug logging for target HW -// =========================================================================== -#include - -#define FLOG(a) { RDebug::Print(a); } -#define FTRACE(a) { a; } - -// Declare the FPrint function -// -inline void FPrint(const TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); - TInt tmpInt = VA_ARG(list, TInt); - TInt tmpInt2 = VA_ARG(list, TInt); - TInt tmpInt3 = VA_ARG(list, TInt); - VA_END(list); - RDebug::Print(aFmt, tmpInt, tmpInt2, tmpInt3); - } - -#endif //__WINS__ - -// =========================================================================== -#else // // No loggings --> Reduced binary size -// =========================================================================== -#define FLOG(a) -#define FTRACE(a) - -#endif // _DEBUG - - -#endif // BT_SERVICE_UTILS_DEBUG_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSUImageConverter.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSUImageConverter.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* -* Copyright (c) 2002 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: Image conversion class -* -*/ - - -#ifndef BTSU_IMAGE_CONVERTER_H -#define BTSU_IMAGE_CONVERTER_H - -// INCLUDES -#include -#include - -// CONSTANTS - -// FORWARD DECLARATIONS -class CImageDecoder; -class CImageEncoder; -class CFrameImageData; -class CBitmapScaler; -class CFbsBitmap; - -// CLASS DECLARATION - -/** -* A class for executing simple image conversion tasks. -*/ -NONSHARABLE_CLASS (CBTSUImageConverter) : public CActive - { - - public: // Constructor and destructor - - /** - * Two-phased constructor. - * @param None. - */ - static CBTSUImageConverter* NewL(); - - /** - * Destructor. - */ - ~CBTSUImageConverter(); - - public: // New functions - - /** - * Returns the pixel size of the given image. - * @param aImageFile A file handle of image file. - * @return The pixel size. - */ - TSize GetImageSizeL( RFile& aImageFile ); - - /** - * Create a thumbnail version of the source image. - * @param aSourceFile A filehandle of sourcefile. - * @param aDestFile Full path for the destination file. - * @return None. - */ - void CreateThumbnailL( RFile& aSourceFile, - const TDesC& aDestFile ); - - /** - * Finds a display name for the given mime type. - * @param aMimeType Mime type - * @return A pointer to the name. - */ - static HBufC* GetDisplayNameL( const TDesC8& aMimeType ); - - private: // Functions from base classes - - /** - * From CActive Get's called when a request is cancelled. - * @return None. - */ - void DoCancel(); - - /** - * From CActive Get's called when a request is completed. - * @return None. - */ - void RunL(); - - private: - - /** - * C++ default constructor. - */ - CBTSUImageConverter(); - - /** - * Symbian 2nd phase constructor. - */ - void ConstructL(); - - /** - * Decode image. - * @param aSourceFile A filehandle of source file. - * @return None - */ - void DecodeImageL( RFile& aSourceFile ); - - /** - * Encode image. - * @param aDestFile Full path for the destination file. - * @param aThumbnail ETrue enables thumbnail creation - * @return None - */ - void EncodeImageL( const TDesC& aDestFile, - const TBool& aThumbnail = EFalse ); - - /** - * Scale image. - * @return None - */ - void ScaleImageL(); - - /** - * Reset internal state. - * @return None. - */ - void Reset(); - - private: // Data - - CImageDecoder* iDecoder; - CImageEncoder* iEncoder; - CBitmapScaler* iScaler; - - CFrameImageData* iFrameImageData; - CFbsBitmap* iFrameBitmap; - CFbsBitmap* iScaledBitmap; - RFs iFileSession; - - CActiveSchedulerWait iWait; - }; - - -#endif // BTSU_IMAGE_CONVERTER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSUPassKeyRequest.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSUPassKeyRequest.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* Copyright (c) 2002 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: CBTSUPasskeyRequest Header definitions -* -*/ - - -#ifndef BTSU_PASSKEY_REQUEST_H -#define BTSU_PASSKEY_REQUEST_H - -// INCLUDES -#include -#include -#include - -// CLASS DECLARATION - -/** -* Class to handle BT Obex Passkey events -*/ -NONSHARABLE_CLASS (CBTSUPasskeyRequest) : public CActive - { - - public: // Constructors and destructor - - /** - * C++ default constructor. - */ - CBTSUPasskeyRequest(); - - /** - * Destructor. - * Closes RNotifier - */ - ~CBTSUPasskeyRequest(); - - public: // New functions - /** - * Starts BT ObexPasskey notifier - * @param aObexServer OBEX server - */ - void StartPassKeyRequestL( CObexClient* aObexclient ); - - private: // Functions from base classes - /** - * From CActive Get's called when a request is cancelled. - * @param None. - * @return None. - */ - void DoCancel(); - - /** - * From CActive Get's called when a request is completed. - * @param None. - * @return None. - */ - void RunL(); - - /** - * From CActive A leave occurred in RunL. - * @param aError The leave error. - * @return Symbian OS error code. - */ - TInt RunError(); - - private: // Data - - RNotifier iNotif; // For Obex passkey notifier - TObexPasskeyBuf iObexPasskey; // Obex passkey - CObexClient* iObexClient; // Obex client - }; - -#endif - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSURefObjectResolver.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSURefObjectResolver.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,189 +0,0 @@ -/* -* Copyright (c) 2002 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: Reference object resolver -* -*/ - - -#ifndef BTSU_REF_OBJECT_RESOLVER_H -#define BTSU_REF_OBJECT_RESOLVER_H - -// INCLUDES -// new headers -#include -#include - - -#include - -// CLASS DECLARATION - -class Xml::RTagInfo; -/** -* A content handler class implementing MContentHandler interface. -* Listens notifications and appends found objects to a given list. -*/ -NONSHARABLE_CLASS (CBTSURefObjectResolver) : public Xml::MContentHandler - { - public: // Constructors and destructor - - - /** - * Two-phased constructor. - */ - static CBTSURefObjectResolver* NewL( CDesCArrayFlat* aCapabilityList ); - - /** - * Destructor. - */ - virtual ~CBTSURefObjectResolver(); - - private: - - /** - * From MContentHandler A notification telling about the beginning - * of a document. - * @param aDocParam Specifies the various parameters of the document. - * @param aErrorCode is the error code. - */ - void OnStartDocumentL(const Xml::RDocumentParameters& aDocParam, TInt aErrorCode); - - /** - * From MContentHandler A notification telling about the end - * of a document. - * @param aErrorCode is the error code. - If this is not KErrNone then special action may be required. - */ - void OnEndDocumentL(TInt aErrorCode); - - /** - * From MContentHandler A notification telling about the beginning - * of an element. - * @param aElement is a handle to the element's details. - * @param aAttributes contains the attributes for the element. - * @param aErrorCode is the error code. - * @return A boolean according to success. - */ - void OnStartElementL(const Xml::RTagInfo& aElement, const Xml::RAttributeArray& aAttributes, - TInt aErrorCode); - - /** - This method is a callback to indicate the end of the element has been reached. - @param aElement is a handle to the element's details. - @param aErrorCode is the error code. - If this is not KErrNone then special action may be required. - */ - void OnEndElementL(const Xml::RTagInfo& aElement, TInt aErrorCode); - - /** - This method is a callback that sends the content of the element. - Not all the content may be returned in one go. The data may be sent in chunks. - When an OnEndElementL is received this means there is no more content to be sent. - @param aBytes is the raw content data for the element. - The client is responsible for converting the data to the - required character set if necessary. - In some instances the content may be binary and must not be converted. - @param aErrorCode is the error code. - If this is not KErrNone then special action may be required. - */ - void OnContentL(const TDesC8& aBytes, TInt aErrorCode); - /** - This method is a notification of the beginning of the scope of a prefix-URI Namespace mapping. - This method is always called before the corresponding OnStartElementL method. - @param aPrefix is the Namespace prefix being declared. - @param aUri is the Namespace URI the prefix is mapped to. - @param aErrorCode is the error code. - If this is not KErrNone then special action may be required. - */ - void OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri, - TInt aErrorCode); - - /** - This method is a notification of the end of the scope of a prefix-URI mapping. - This method is called after the corresponding DoEndElementL method. - @param aPrefix is the Namespace prefix that was mapped. - @param aErrorCode is the error code. - If this is not KErrNone then special action may be required. - */ - void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode); - - - /** - This method is a notification of ignorable whitespace in element content. - @param aBytes are the ignored bytes from the document being parsed. - @param aErrorCode is the error code. - If this is not KErrNone then special action may be required. - */ - void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode); - - - /** - This method is a notification of a skipped entity. If the parser encounters an - external entity it does not need to expand it - it can return the entity as aName - for the client to deal with. - @param aName is the name of the skipped entity. - @param aErrorCode is the error code. - If this is not KErrNone then special action may be required. - */ - void OnSkippedEntityL(const RString& aName, TInt aErrorCode); - - - /** - This method is a receive notification of a processing instruction. - @param aTarget is the processing instruction target. - @param aData is the processing instruction data. If empty none was supplied. - @param aErrorCode is the error code. - If this is not KErrNone then special action may be required. - */ - void OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData, - TInt aErrorCode); - - - /** - This method indicates an error has occurred. - @param aError is the error code - */ - void OnError(TInt aErrorCode); - - - /** - This method obtains the interface matching the specified uid. - @return 0 if no interface matching the uid is found. - Otherwise, the this pointer cast to that interface. - @param aUid the uid identifying the required interface. - */ - TAny* GetExtendedInterface(const TInt32 aUid); - - - /** - * C++ default constructor. - */ - CBTSURefObjectResolver( CDesCArrayFlat* aCapabilityList ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - - private: // Data - - // Not owned. - // - CDesCArrayFlat* iObjectList; - }; - -#endif // BTSU_REF_OBJECT_RESOLVER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSUXmlParser.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSUXmlParser.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2002 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: XML parser -* -*/ - - -#ifndef BTSU_XML_PARSER_H -#define BTSU_XML_PARSER_H - -// INCLUDES -#include -#include -#include -//#include -#include -#include - -#include "BTServiceUtils.h" - -// CLASS DECLARATION - -/** -* A class for executing simple predetermined xml parsing tasks. -*/ -NONSHARABLE_CLASS (CBTSUXmlParser) : public CBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CBTSUXmlParser* NewL(); - - /** - * Destructor. - */ - virtual ~CBTSUXmlParser(); - - public: // New functions - - /** - * Finds and collects image capabilites from the file. - * @param aFileName The name of the file to be parsed. - * @return A pointer to the list. - */ - CDesCArrayFlat* GetCapabilityListL( const TDesC& aFileName ); - - - /** - * Finds and collects image capabilites from the file. - * @param aFileName The name of the file to be parsed. - * @return A pointer to the list. - */ - RArray* GetImgCapabilityListL( const TDesC& aFileName ); - - /** - * Finds and collects paths to objects referenced in the file. - * @param aFileName The name of the file to be parsed. - * @return A pointer to the list. - */ - CDesCArrayFlat* GetRefObjectListL( const TDesC& aFileName ); - - private: - - /** - * C++ default constructor. - */ - CBTSUXmlParser(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - private: // Data - - RFs iFileSession; - }; - -#endif // BTSU_XML_PARSER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTServiceAPI.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTServiceAPI.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -/* -* Copyright (c) 2002 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: API for sending services -* -*/ - - - -#ifndef BT_SERVICE_API_H -#define BT_SERVICE_API_H - -// INCLUDES -#include "BTServiceParameterList.h" - -// CONSTANTS - -// DATA TYPES - -enum TBTServiceType - { - EBTSendingService, - EBTPrintingService, - EBTObjectPushService // use this if support for only OPP is wanted - }; - -// FORWARD DECLARATIONS -class CBTServiceStarter; - -// CLASS DECLARATION - -/** -* An API for starting Bluetooth services. -* -* @lib BtServiceUtils.lib -* @since Series 60 2.6 -*/ -class CBTServiceAPI : public CBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - IMPORT_C static CBTServiceAPI* NewL(); - - /** - * Destructor. - */ - virtual ~CBTServiceAPI(); - - public: // New functions - - /** - * Starts the given service. - * Returns when service is started. - * @since Series 60 2.6 - * @param aService The service to be started. - * @param aList Parameters for the service. - * @return None. - */ - IMPORT_C void StartServiceL( TBTServiceType aService, - CBTServiceParameterList* aList ); - - /** - * Starts the given service. - * Returns when service is completed. - * @since Series 60 2.6 - * @param aService The service to be started. - * @param aList Parameters for the service. - * @return None. - */ - IMPORT_C void StartSynchronousServiceL( TBTServiceType aService, - CBTServiceParameterList* aList ); - private: - - /** - * C++ default constructor. - */ - CBTServiceAPI(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - private: // Data - - CBTServiceStarter* iStarter; - CActiveSchedulerWait iSyncWaiter; - }; - -#endif // BT_SERVICE_API_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTServiceClient.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTServiceClient.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,271 +0,0 @@ -/* -* Copyright (c) 2002 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 client -* -*/ - - - -#ifndef BT_SERVICE_CLIENT_H -#define BT_SERVICE_CLIENT_H - -// INCLUDES -#include "BTSUPassKeyRequest.h" - -#include -#include - - -// FORWARD DECLARATION -class CBTSUPasskeyRequest; -class CBTConnectionTimer; - -// CLASS DECLARATION - -/** -* An interface used to inform about BT service client events. -*/ -class MBTServiceClientObserver - { - public: - - /** - * Informs the observer that a Connect operation has been completed. - * @param aStatus The status of the operation. - * @return None. - */ - virtual void ConnectCompleted( TInt aStatus ) = 0; - - /** - * Informs the observer that a Put operation has been completed. - * @param aStatus The status of the operation. - * @param aPutResponse The response object. - * @return None. - */ - virtual void PutCompleted( TInt aStatus,const CObexHeaderSet* aPutResponse ) = 0; - - /** - * Informs the observer that a Get operation has been completed. - * @param aStatus The status of the operation. - * @param aGetResponse The response object. - * @return None. - */ - virtual void GetCompleted( TInt aStatus, CObexBufObject* aGetResponse ) = 0; - - /** - * Informs the observer that the client connection has been closed. - * @return None. - */ - virtual void ClientConnectionClosed() = 0; - - /** - * Informs the observer that the client connect is timed out. - * @return None. - */ - virtual void ConnectTimedOut() = 0; - - - }; - -/** -* An interface used to inform about BT Connection timeout -*/ -class MBTConTimeObserver - { - public: - /** - * Informs the observer that the client connec is timeouted - * @return None. - */ - virtual void ConnectionTimedOut()=0; - }; - - -// CLASS DECLARATION - -/** -* An interface used to ask client's progress status. -*/ -class MBTServiceProgressGetter - { - public: - - /** - * Returns the progess status of the service client. - * @return The number of bytes sent. - */ - virtual TInt GetProgressStatus() = 0; - }; - -// CLASS DECLARATION - -/** -* An active object managing the Obex client. -*/ -NONSHARABLE_CLASS (CBTServiceClient) : public CActive, - public MBTServiceProgressGetter, - public MObexAuthChallengeHandler, - public MBTConTimeObserver - - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aObserver A pointer to the client observer. - * @param aRemoteDevice The address of the remote device. - * @param aRemotePort The port of the remote device. - * @param aHeaderList The headers to be associated with connect object. - * @return None. - */ - static CBTServiceClient* NewL( MBTServiceClientObserver* aObserver, - const TBTDevAddr& aRemoteDevice, - const TUint aRemotePort, - RArray aHeaderList ); - - /** - * Destructor. - */ - virtual ~CBTServiceClient(); - - public: // New functions - - /** - * Issues an Obex Get-request. - * @param aHeaderList The headers to be associated with the object. - * @param aFileName A filename of the Get Object. - * @return None. - */ - void GetObjectL( RArray& aHeaderList, - const TDesC& aFileName = KNullDesC ); - - /** - * Issues an Obex Put-request. - * @param aHeaderList The headers to be associated with the object. - * @param aFileName A filename of the Put Object. - * @return None. - */ - void PutObjectL( RArray& aHeaderList, - const TDesC& aFileName ); - - /** - * Issues an Obex Put-request. - * @param aHeaderList The headers to be associated with the object. - * @param aFile A filehandle of the Put Object. - * @return None. - */ - void PutObjectL( RArray& aHeaderList, - RFile& ); - - /** - * Closes Obex Client connection. - * @param None. - * @return None. - */ - void CloseClientConnection(); - - /** - * Send abort command to remote device - * @param None. - * @return None. - */ - void Abort(); - - private: // Functions from base classes - - /** - * From MBTServiceProgressGetter Returns the progess status. - * @return The number of bytes sent. - */ - TInt GetProgressStatus(); - - - private: // Functions from base classes - - /** - * From MObexAuthChallengeHandler The Obex Passkey is requested. - * @param aRealm The realm/challenge specified by the unit forcing - * the authentication. - * @return None. - */ - void GetUserPasswordL( const TDesC& aRealm ); - - /** - * From CActive Get's called when a request is cancelled. - * @param None. - * @return None. - */ - void DoCancel(); - - /** - * From CActive Get's called when a request is completed. - * @param None. - * @return None. - */ - void RunL(); - - /** - * From MBTConTimeObserver Get's called if bt connection is timed out. - * @param None. - * @return None. - */ - void ConnectionTimedOut(); - - private: // Data definitions - - enum TBTServiceClientState - { - EBTSCliIdle, - EBTSCliConnecting, - EBTSCliPutting, - EBTSCliGetting, - EBTSCliDisconnecting - }; - - private: - - /** - * C++ default constructor. - */ - CBTServiceClient( MBTServiceClientObserver* aObserver ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL( const TBTDevAddr& aRemoteDevice, - const TUint aRemotePort, - RArray aHeaderList ); - - private: // Data - - TBTServiceClientState iClientState; - - CObexClient* iClient; - CBufFlat* iObjectBuffer; - CObexBufObject* iGetObject; - CObexFileObject* iPutObject; - CObexNullObject* iConnectObject; - TInt iTotalBytesSent; - CBTSUPasskeyRequest* iPasskeyRequest; - CBufFlat *iBuffer; - CObexBufObject* iPutBufObject; - CBTConnectionTimer* iConnectionTimer; - // Not owned - // - MBTServiceClientObserver* iObserver; - }; - -#endif // BT_SERVICE_CLIENT_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTServiceDelayedDestroyer.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTServiceDelayedDestroyer.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2005-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: The base active object declaration -* -*/ - - -#ifndef BT_SERVICE_DELAYED_DESTROYER_H -#define BT_SERVICE_DELAYED_DESTROYER_H - -// INCLUDES -#include -#include - -NONSHARABLE_CLASS (CBTServiceDelayedDestroyer) : public CActive - { - -public: - - static CBTServiceDelayedDestroyer* NewL(CActive::TPriority aPriority); - - static CBTServiceDelayedDestroyer* NewLC(CActive::TPriority aPriority); - - virtual ~CBTServiceDelayedDestroyer(); - -public: - - /** - * Calls SetActive(). - */ - void GoActive(); - - // Sets the pointer which will be destroyed. - // Must be called with GoActive, they are pairs, first - // call SetDestructPointer and then GoActive. - void SetDestructPointer(CBTEngDiscovery* aPtr); - -private: - - /** - * From CActive. - * cancels the outstanding request. - */ - virtual void DoCancel(); - - /** - * From CActive. - * Handles the request completion event. - * Deletes CBTEngDiscovery object which is passed via SetDestructPointer method. - */ - virtual void RunL(); - - /** - * From CActive. - * Handles the leave from RunL(). - * @param aError the leave code in RunL() - * @return the error code to Active Scheduler - */ - virtual TInt RunError(TInt aError); - -private: - - CBTServiceDelayedDestroyer(CActive::TPriority aPriority); - -private: - TRequestStatus iStatus; - CBTEngDiscovery* iPtr; - }; - -#endif // BT_SERVICE_DELAYED_DESTROYER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTServiceParameterList.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTServiceParameterList.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,239 +0,0 @@ -/* -* Copyright (c) 2002 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: Parameter list -* -*/ - - -#ifndef BT_SERVICE_PARAMETER_LIST_H -#define BT_SERVICE_PARAMETER_LIST_H - -// INCLUDES -#include -#include // CDesCArray -#include - -// CONSTANTS - -// DATA TYPES - -struct TBTSUXhtmlParam - { - TDesC* iFileName; - CDesCArray* iRefObjectList; - }; - -struct TBTSUImageParam - { - RFile iFile; - TDesC* iDisplayName; - TDesC8* iMimeType; - TSize iPixelSize; - TInt iFileSize; - TBool iSend; - - }; - - -// CLASS DECLARATION - -/** -* A class holding paths to different types of files. -* -* In case of an XHTML file the list collects paths -* to objects referenced in the file. -* -* In case of an image the list resolves the MIME types and -* displayable names of the images. -* -* @lib BtServiceUtils.lib -* @since Series 60 2.6 -*/ -class CBTServiceParameterList : public CBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - IMPORT_C static CBTServiceParameterList* NewL(); - IMPORT_C static CBTServiceParameterList* NewLC(); - - /** - * Destructor. - */ - virtual ~CBTServiceParameterList(); - - public: // New functions - - /** - * Adds an xhtml file path to the list. - * @since Series 60 2.6 - * @param aFilePath A full path and file name. - * @return None. - */ - IMPORT_C void AddXhtmlL( const TDesC& aFilePath ); - - /** - * Adds an image file path to the list. - * @since Series 60 2.6 - * @param aFilePath A full path and file name. - * @return None. - */ - IMPORT_C void AddImageL( const TDesC& aFilePath ); - - /** - * Adds an image file path to the list. - * @since Series 60 2.6 - * @param aFile file handle to be send. - * @return None. - */ - IMPORT_C void AddImageL( RFile aFile ); - - /** - * Adds an object file path to the list. - * @since Series 60 2.6 - * @param aFilePath A full path and file name. - * @return None. - */ - IMPORT_C void AddObjectL( const TDesC& aFilePath ); - - /** - * Adds an object file path to the list. - * @since Series 60 2.6 - * @param aFile file handle to be send . - * @return None. - */ - IMPORT_C void AddObjectL( RFile aFile ); - - public: // New functions (not exported) - - /** - * Return the number of xhtml file paths in the list. - * @return The count. - */ - TInt XhtmlCount() const; - - /** - * Return the number of image file paths in the list. - * @return The count. - */ - TInt ImageCount() const; - - /** - * Return the number of object file paths in the list. - * @return The count. - */ - TInt ObjectCount() const; - - /** - * Returns a copy of an element of the list from the given index. - * @param aIndex The index. - * @return The element. - */ - TBTSUXhtmlParam XhtmlAt( TInt aIndex ) const; - - /** - * Returns a copy of an element of the list from the given index. - * @param aIndex The index. - * @return The element. - */ - TBTSUImageParam ImageAtL( TInt aIndex ) const; - - /** - * Returns a copy of an element of the list from the given index. - * @param aIndex The index. - * @return The element. - */ - RFile& ObjectAtL( TInt aIndex ); - - /** - * Checks whether the list has any xhtml-files with referenced objects. - * @return A boolean according to result. - */ - TBool HasAnyReferencedObjects() const; - - /** - * Return the size of objects in the list. - * @return The count. - */ - TInt ObjectListSizeL() const; - - /** - * Return the size of images in the list. - * @return The count. - */ - - TInt ImageListSize() const; - - /** - * Remove image from list. - * @param aIndex The index. - * @return None. - */ - void RemoveImageL(TInt aIndex); - - /** - * Return count of removed image - * @return The count of removed images. - */ - TInt RemovedImageCount(); - - /** - * Reset image filehandle - * @param aIndex The index. - * @return None. - */ - void ResetImageHandleL(TInt aIndex); - - /** - * Reset object filehandle - * @param aIndex The index. - * @return None. - */ - void ResetObjectHandleL(TInt aIndex); - - - /** - * Reset image filehandle - * @param aIndex The index. - * @return None. - */ - void MarkAsSendL(TInt aIndex); - - - private: - - /** - * C++ default constructor. - */ - CBTServiceParameterList(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - private: // Data - - RArray iXhtmlList; - RArray iImageList; - RArray iObjectList; - RFs iFileSession; - TInt iRemovedImageCount; - }; - -#endif // BT_SERVICE_PARAMETER_LIST_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTServiceStarter.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTServiceStarter.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,448 +0,0 @@ -/* -* Copyright (c) 2002 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: Service starter -* -*/ - - - -#ifndef BT_SERVICE_STARTER_H -#define BT_SERVICE_STARTER_H - -// INCLUDES -#include "BTServiceAPI.h" -#include "BTServiceUtils.h" -#include "BTServiceParameterList.h" -#include "BTServiceDelayedDestroyer.h" - -#include -#include -#include -#include - -// DATA TYPES - -enum TBTServiceProfile - { - EBTSNone, - EBTSBPP, - EBTSOPP, - EBTSBIP - }; - -enum TBTActiveNotifier - { - ENoneQuery = 0, - EOfflineQuery, - ENameQuery - }; - -// FORWARD DECLARATIONS -class CObexUtilsUiLayer; -class MBTServiceProgressGetter; -class CBTSController; - - -const TUint KBTSdpObjectPush = 0x1105; -const TUint KBTSdpBasicImaging = 0x111b; -const TUint KBTSdpBasicPrinting = 0x1120; - - -// CLASS DECLARATION - -/** -* An observer interface for service controllers. -*/ -class MBTServiceObserver - { - public: // New functions - - /** - * Informs the observer that the handler has completed its tasks. - * @param aStatus The the completion status of the handler. - * @return None. - */ - virtual void ControllerComplete( TInt aStatus ) = 0; - - /** - * Informs the observer that a progress note should be shown. - * @param aGetter A pointer to a progess status getter object. - * @return None. - */ - virtual void LaunchProgressNoteL( MBTServiceProgressGetter* aGetter, TInt aTotalSize ) = 0; - - /** - * Informs the observer that a confirmation query for sending - * should be shouwn for BIP sendign - * @return - */ - virtual TInt LaunchConfirmationQuery(TInt aResouceId)=0; - - /** - * Informs the observer that a connect is timedout - * @return - */ - virtual void ConnectTimedOut()=0; - - }; - - -/** -* A starter class for Bluetooth services. -*/ -NONSHARABLE_CLASS (CBTServiceStarter) : public CActive, - public MBTServiceObserver, - public MObexUtilsDialogObserver, - public MObexUtilsProgressObserver, - public MBTEngSdpResultReceiver, - public MBTEngSettingsObserver - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CBTServiceStarter* NewL(); - - /** - * Destructor. - */ - virtual ~CBTServiceStarter(); - - public: // New functions - - /** - * Starts the given service. - * @param aService The service to be started. - * @param aList Parameters for the service. - * @param aWaiter A pointer to a waiter object. - * @return None. - */ - void StartServiceL( TBTServiceType aService, - CBTServiceParameterList* aList, - CActiveSchedulerWait* aWaiter = NULL ); - - private: // Functions from base classes - - - - /** - * From MBTServiceObserver A controller has completed. - * @param aStatus The completion status of the controller. - * @return None. - */ - void ControllerComplete( TInt aStatus ); - - /** - * From MBTServiceObserver A progress note should be shown. - * @param aGetter A pointer to a progess status getter object. - * @param aTotalSize Max size of the progress bar. - * @return None. - */ - void LaunchProgressNoteL( MBTServiceProgressGetter* aGetter, TInt aTotalSize ); - - /** - * From MObexUtilsWaitDialogObserver The wait note has been dismissed. - * @param aButtonId The button id that was used to dismiss the dialog. - * @return None. - */ - void DialogDismissed( TInt aButtonId ); - - /** - * From MObexUtilsProgressObserver request for number of bytes sent - * @Param None. - * @return Number of bytes sent. - */ - TInt GetProgressStatus(); - - /** - * From MBTServiceObserver A confirmation query for BIP - * profile should be shown. - * @return key - */ - TInt LaunchConfirmationQuery(TInt aResourceId); - - /** - * From MBTServiceObserver a connect request is timedout - * @return - */ - void ConnectTimedOut(); - - - /** - * Provides notification of the result of a service search that matches - * the requested UUID (through CBTEngDiscovery::RemoteSdpQuery). - * This method indicates that the search has completed, and returns - * all the results to the caller at once. - * - * @since S60 v3.2 - * @param aResult Array of record handles that match the requested UUID. - * Note: the array will not be available anymore after - * this method returns. - * @param aTotalRecordsCount The total number of records returned. - * @param aErr Error code of the service search operation; KErrNone if - * sucessful, KErrEof if no record matched the requested UUID, - * KErrCouldNotConnect and KErrCouldDisconnected in case of - * Bluetooth connection errors; otherwise one of the - * system-wide error codes. - */ - void ServiceSearchComplete( const RSdpRecHandleArray& aResult, - TUint aTotalRecordsCount, TInt aErr ); - - /** - * Provides notification of the result of an attribute search that matches - * the requested attribute (through CBTEngDiscovery::RemoteSdpQuery). - * This method indicates that the search has completed, and returns - * all the results to the caller at once. - * - * @since S60 v3.2 - * @param aHandle Record handle of the service record containing the result. - * @param aAttr Array containing the attribute that matches the - * requested attribute. - * Note: the array will not be available anymore after - * this method returns. - * @param aErr Error code of the service search operation; KErrNone if - * sucessful, KErrEof if the requested attribute was not - * contained in the specified service record, - * KErrCouldNotConnect and KErrCouldDisconnected in case of - * Bluetooth connection errors; otherwise one of the - * system-wide error codes. - */ - void AttributeSearchComplete( TSdpServRecordHandle aHandle, - const RSdpResultArray& aAttr, - TInt aErr ); - - /** - * Provides notification of the result of an combination of a service - * and attribute search (through CBTEngDiscovery::RemoteSdpQuery). - * This method is called for each service and attribute combination for - * which a match was found. The last result (which could be empty if no - * match was found) contain error code KErrEof to indicate that the - * search has completed. - * - * @since S60 v3.2 - * @param aHandle Record handle of the service record containing the result. - * @param aAttr Array containing the attribute that matches the - * requested attribute. - * Note: the array will not be available anymore after - * this method returns. - * @param aErr Error code of the service search operation; KErrNone if - * sucessful and more results follow, KErrEof indicates that - * this is the last result (which could be empty if no match - * was found), KErrCouldNotConnect and KErrCouldDisconnected - * in case of Bluetooth connection errors; otherwise one of - * the system-wide error codes. - */ - void ServiceAttributeSearchComplete( TSdpServRecordHandle aHandle, - const RSdpResultArray& aAttr, - TInt aErr ); - - /** - * Provides notification of the result of the discovery of nearby - * Bluetooth devices. - * - * @since S60 v3.2 - * @param aDevice The data structure encapsulates all information - * about the selected device. Ownership of the data - * structure has not been transfered and is still with - * the API client. - * @param aErr Error code of the device search operation; KErrNone if - * sucessful, KErrCancel if the user cancelled the - * dialog, KErrCancel if CBTEngDiscovery::CancelSearchRemoteDevice - * was called; otherwise one of the system-wide error codes. - */ - void DeviceSearchComplete( CBTDevice* aDevice, TInt aErr ); - - /** - * From MBTEngSettingsObserver. - * Provides notification of changes in the power state - * of the Bluetooth hardware. - * - * @since S60 v3.2 - * @param aState EBTPowerOff if the BT hardware has been turned off, - * EBTPowerOn if it has been turned off. - */ - void PowerStateChanged( TBTPowerStateValue aState ); - - /** - * From MBTEngSettingsObserver. - * Provides notification of changes in the discoverability - * mode of the Bluetooth hardware. - * - * @since S60 v3.2 - * @param aState EBTDiscModeHidden if the BT hardware is in hidden mode, - * EBTDiscModeGeneral if it is in visible mode. - */ - void VisibilityModeChanged( TBTVisibilityMode aState ); - - /** - * From CActive. - * Called by the active scheduler when the request has been cancelled. - * - * @since S60 v3.2 - */ - void DoCancel(); - - /** - * From CActive. - * Called by the active scheduler when the request has been completed. - * - * @since S60 v3.2 - */ - void RunL(); - - /** - * From CActive. - * Called by the active scheduler when an error in RunL has occurred. - * - * @since S60 v3.2 - */ - TInt RunError( TInt aError ); - - private: - - /** - * C++ default constructor. - */ - CBTServiceStarter(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - /** - * Check that the parameters are valid for a given service. - * @param aService The requested service. - * @param aList Parameters for the service. - * @return None. - */ - TBool ValidParameters( TBTServiceType aService, - const CBTServiceParameterList* aList) const; - - /** - * Starts finding a Bluetooth profile suitable for requested service. - * @param aService The requested service. - * @return None. - */ - void StartProfileSelectL( TBTServiceType aService ); - - /** - * Start a controller for the given Bluetooth profile. - * @param aProfile The profile to be started. - * @return None. - */ - void StartProfileL( TBTServiceProfile aProfile ); - - /** - * Launches a connecting wait note - * @param None. - * @return None. - */ - void LaunchWaitNoteL(); - - /** - * Cancel connecting wait note - * @param None. - * @return None. - */ - void CancelWaitNote(); - - /** - * Show a note with given error value - * @param aReason Error value - * @return None. - */ - void ShowNote( TInt aReason ) const; - - /** - * Cancel progress note - * @param None. - * @return None. - */ - void CancelProgressNote(); - - /** - * StopTransfer and show information note - * @param aError Error code if error exist. - * @return None. - */ - void StopTransfer( TInt aError ); - - /** - * Check if phone is in offline mode, and ask the user if it is.. - * @return ETrue if the phone is in offline mode, otherwise EFalse. - */ - TBool CheckOfflineModeL(); - - /** - * Start BT device discovery. - * @return None. - */ - void StartDiscoveryL(); - - /** - * Turn BT power on. - * @param aState The current BT power state. - * @return None. - */ - void TurnBTPowerOnL( const TBTPowerStateValue aState ); - private: // Data definitions - - enum TBTServiceStarterState - { - EBTSStarterIdle, - EBTSStarterFindingBPP, - EBTSStarterFindingOPP, - EBTSStarterFindingBIP, - EBTSStarterStoppingService - }; - - private: // Data - - CBTDevice* iDevice; - CBTEngDiscovery* iBTEngDiscovery; - CBTServiceParameterList* iList; - CObexUtilsDialog* iDialog; - CBTSController* iController; - - TBTServiceType iService; - TInt iClientChannel; - TBTServiceStarterState iState; - TBool iServiceStarted; - TMsvId iMessageServerIndex; - - MBTServiceProgressGetter* iProgressGetter; - CActiveSchedulerWait* iWaiter; - TBool iAllSend; - TInt iBytesSendWithBIP; - TBool iProgressDialogActive; - TBool iUserCancel; - CBTEngSettings* iBTEngSettings; - TBool iWaitingForBTPower; - RNotifier iNotifier; // Handle to the generic notifier. - TPckgBuf iOffline; - TPckgBuf iName; - TBool iSendToBIPOnlyDevice; - TBTActiveNotifier iActiveNotifier; - TBool iFeatureManagerInitialized; - TBool iTriedBIP; - TBool iTriedOPP; - CBTServiceDelayedDestroyer* iDelayedDestroyer; - }; - -#endif // BT_SERVICE_CONTROLLER_H - -// End of File - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTServiceUtils.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTServiceUtils.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -/* -* Copyright (c) 2002 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: Contains BTSU wide definitions. -* -*/ - - -#ifndef BT_SERVICE_UTILS_H -#define BT_SERVICE_UTILS_H - -// INCLUDES -#include - -// CONSTANTS - -// Name of this component -// -_LIT( KBTSUModuleName, "Bluetooth Service Utils" ); - -const TInt KBTSUArrayGranularity = 1; -const TInt KBTSUMaxStringLength = 255; -const TInt KBTSUTextBufferMaxSize = 512; -const TInt KBTSUDataBufferMaxSize = 102400; // 100K -const TInt KBTSUDataBufferExpandSize = 4; -const TInt KBTSUEqualStrings = 0; // The ok-result of TDesC::Compare - -_LIT( KBTSProtocol, "RFCOMM" ); // The Bluetooth transport layer - -// Obex header HI values -// -const TUint8 KBTSUNameHeader = 0x01; -const TUint8 KBTSUImageHandleHeader = 0x30; -const TUint8 KBTSUTypeHeader = 0x42; -const TUint8 KBTSULengthHeader = 0xC3; -const TUint8 KBTSUTargetHeader = 0x46; -const TUint8 KBTSUAppParamsHeader = 0x4C; -const TUint8 KBTSUImgDescriptorHeader = 0x71; - - -// DATA TYPES - -enum TBTSUPanicCode - { - EBTSUPanicNullPointer = 45000, - EBTSUPanicExistingObject, - EBTSUPanicObjectActive, - EBTSUPanicUnhandledCase, - EBTSUPanicInternalError, - EBTSUPanicOutOfRange, - EBTSUPanicResponseAlreadyPresent, - EBTSUPanicNoBufferEvenThoughCountNotZero - }; - -enum TBTServiceStatus - { - EBTSNoError = 100, - EBTSNoFiles, - EBTSAbort, - EBTSConnectingFailed, - EBTSGettingFailed, - EBTSPuttingFailed, - EBTSNoSuitableProfiles, - EBTSUserCancel, - EBTSBIPOneNotSend, - EBTSBIPSomeSend, - EBTSBIPNoneSend - }; - - struct TBTSUImageCap - { - TDesC* iEncoding; - TSize iMinPixelSize; - TSize iMaxPixelSize; - TInt iMaxByteSize; - }; - - -// FUNCTION PROTOTYPES - -/** -* Calls the Symbian OS Panic function specifying this component's name as the -* panic category and aPanic as the panic code. -* @param aPanic The panic code. -* @return None. -*/ -void BTSUPanic( TBTSUPanicCode aPanic ); - - -// CLASS DECLARATION - -/** -* A cleanup template class for objects that need ResetAndDestroy call. -*/ -template class CleanupResetAndDestroy - { - public: - inline static void PushL( T& aRef ); - private: - static void ResetAndDestroy( TAny *aPtr ); - }; - -template inline void CleanupResetAndDestroyPushL( T& aRef ); - -#include "BTServiceUtils.inl" - -#endif // BT_SERVICE_UTILS_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTServiceUtils.inl --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTServiceUtils.inl Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2002 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: Inline methods for BTSU. -* -*/ - - - -// INCLUDE FILES -#include - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CleanupResetAndDestroy::PushL -// ----------------------------------------------------------------------------- -// -template inline void CleanupResetAndDestroy::PushL( T& aRef ) - { - CleanupStack::PushL( TCleanupItem( &ResetAndDestroy, &aRef ) ); - } - -// ----------------------------------------------------------------------------- -// CleanupResetAndDestroy::ResetAndDestroy -// ----------------------------------------------------------------------------- -// -template void CleanupResetAndDestroy::ResetAndDestroy( TAny *aPtr ) - { - ( STATIC_CAST( T*, aPtr) )->ResetAndDestroy(); - } - -// ----------------------------------------------------------------------------- -// CleanupResetAndDestroyPushL -// ----------------------------------------------------------------------------- -// -template inline void CleanupResetAndDestroyPushL( T& aRef ) - { - CleanupResetAndDestroy::PushL( aRef ); - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTConnectionTimer.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTConnectionTimer.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2002 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: Waiter class implementation -* -*/ - - - -// INCLUDE FILES -#include "BTConnectionTimer.h" -#include "BTServiceUtils.h" -#include "BTSUDebug.h" - -// CONSTANTS - - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CBTSBPPServerWait::CBTSBPPServerWait -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CBTConnectionTimer::CBTConnectionTimer( MBTConTimeObserver* aObserver ) : - CTimer( EPriorityStandard ), iObserver( aObserver ) - - { - - CActiveScheduler::Add( this ); - } - -// ----------------------------------------------------------------------------- -// CBTConnectionTimer::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CBTConnectionTimer::ConstructL() - { - FLOG(_L("[BTSU]\t CBTConnectionTimer::ConstructL()")); - - CTimer::ConstructL(); - - - FLOG(_L("[BTSU]\t CBTConnectionTimer::ConstructL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTConnectionTimer::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBTConnectionTimer* CBTConnectionTimer::NewL( MBTConTimeObserver* aObserver ) - { - CBTConnectionTimer* self = new( ELeave ) CBTConnectionTimer( aObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - - -// Destructor -CBTConnectionTimer::~CBTConnectionTimer() - { - Cancel(); - } - -// ----------------------------------------------------------------------------- -// CBTConnectionTimer::SetTimeOut -// ----------------------------------------------------------------------------- -// -void CBTConnectionTimer::SetTimeOut(TTimeIntervalMicroSeconds32 aTimeOutValue) - { - iTimeOutValue = aTimeOutValue; - } -// ----------------------------------------------------------------------------- -// CBTConnectionTimer::Start -// ----------------------------------------------------------------------------- -// -void CBTConnectionTimer::Start() - { - After( iTimeOutValue ); - } - -// ----------------------------------------------------------------------------- -// CBTConnectionTimer::RunL -// ----------------------------------------------------------------------------- -// -void CBTConnectionTimer::RunL() - { - FTRACE(FPrint(_L("[BTSU]\t CBTConnectionTimer::RunL() status %d"), iStatus.Int() ) ); - - if ( iObserver ) - { - iObserver->ConnectionTimedOut(); - } - - FLOG(_L("[BTSU]\t CBTConnectionTimer::RunL() completed")); - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSBIPController.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSBIPController.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,685 +0,0 @@ -/* -* Copyright (c) 2002 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: Image push implementation -* -*/ - - - -// INCLUDE FILES -#include "BTSBIPController.h" -#include "BTSUDebug.h" -#include "BTSUImageConverter.h" -#include "BTSUXmlParser.h" -#include - - - -// CONSTANTS -// image push target header -_LIT8( KBIPImagePushID, "\xE3\x3D\x95\x45\x83\x74\x4A\xD7\x9E\xC5\xC1\x6B\xE3\x1E\xDE\x8E" ); - -// type headers -_LIT8( KBTSBIPCapabilities, "x-bt/img-capabilities\0"); -_LIT8( KBTSBIPImageType, "x-bt/img-img\0"); -_LIT8( KBTSBIPThmType, "x-bt/img-thm\0"); - -// imageBTS descriptor -_LIT8( KBTSBIPDescriptorStart, "\r" ); -_LIT8( KBTSBIPDescriptorEncoding, "\r" ); - -// temp file path for capabilities object - -//temp file path drive letter -_LIT(KBTSBIPTempPathDrive,"c:"); -const TInt KBTSUMaxPathLenght=256; -const TInt KBTSUMaxPrivatePathLenght=20; - - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CBTSBIPController::CBTSBIPController -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CBTSBIPController::CBTSBIPController( MBTServiceObserver* aObserver, - CBTServiceParameterList* aList ) : - iListPtr( aList ), - iObserverPtr( aObserver ) - - { - } - -// ----------------------------------------------------------------------------- -// CBTSBIPController::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CBTSBIPController::ConstructL( const TUint aRemotePort, - const TBTDevAddr& aRemoteDeviceAddr ) - { - FLOG(_L("[BTSU]\t CBTSBIPController::ConstructL()")); - - // Add image push target header - // - CObexHeader* header = CObexHeader::NewL(); - CleanupStack::PushL( header ); - header->SetByteSeqL( KBTSUTargetHeader, KBIPImagePushID ); - - RArray headerList; - CleanupClosePushL( headerList ); - headerList.Append( header ); - - CreateClientL ( this, aRemoteDeviceAddr, aRemotePort, headerList ); - - CleanupStack::Pop( 2 ); //header, headerlist - headerList.Close(); - - FLOG(_L("[BTSU]\t CBTSBIPController::ConstructL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBIPController::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBTSBIPController* CBTSBIPController::NewL( MBTServiceObserver* aObserver, - const TUint aRemotePort, - const TBTDevAddr& aRemoteDeviceAddr, - CBTServiceParameterList* aList ) - { - CBTSBIPController* self = - new( ELeave ) CBTSBIPController( aObserver, aList ); - CleanupStack::PushL( self ); - self->ConstructL( aRemotePort, aRemoteDeviceAddr ); - CleanupStack::Pop(self); - return self; - } - -// Destructor -CBTSBIPController::~CBTSBIPController() - { - DeleteTempFile( iThumbnailFileName ); - } - -// ----------------------------------------------------------------------------- -// CBTSBIPController::ConnectCompleted -// ----------------------------------------------------------------------------- -// -void CBTSBIPController::ConnectCompleted( TInt aStatus ) - { - FLOG(_L("[BTSU]\t CBTSBIPController::ConnectCompleted()")); - - if ( aStatus == KErrNone ) - { - iFileIndex = 0; - // get remote device capabilities - // - TRAPD( error, GetL() ); - if ( error != KErrNone ) - { - iObserverPtr->ControllerComplete( EBTSGettingFailed ); - } - } - else - { - //Error on Obex level - // - iObserverPtr->ControllerComplete( EBTSConnectingFailed ); - } - - FLOG(_L("[BTSU]\t CBTSBIPController::ConnectCompleted() completed")); - } -// ----------------------------------------------------------------------------- -// CBTSBIPController::ClientConnectionClosed -// ----------------------------------------------------------------------------- -// -void CBTSBIPController::ClientConnectionClosed() - { - FLOG(_L("[BTSU]\t CBTSBIPController::ClientConnectionClosed()")); - - // Everything ready, stop service - // - iObserverPtr->ControllerComplete( EBTSNoError ); - FLOG(_L("[BTSU]\t CBTSBIPController::ClientConnectionClosed() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBIPController::PutCompleted -// ----------------------------------------------------------------------------- -// -void CBTSBIPController::PutCompleted( TInt aStatus, - const CObexHeaderSet* aPutResponse ) - { - FLOG(_L("[BTSU]\t CBTSBIPController::PutCompleted()")); - - // Remove temporary thumbnail file - // - DeleteTempFile( iThumbnailFileName ); - if ( aStatus == KErrNone ) - { - iFileIndex++; - // Send was ok. Start sending next image - // - TRAPD( error, SendL() ); - if ( error ) - { - FTRACE(FPrint(_L("[BTSU]\t CBTSBPPController::Send leaved with %d"), error )); - iObserverPtr->ControllerComplete( EBTSPuttingFailed); - } - } - else if ( aStatus == KErrIrObexRespPartialContent ) - { - // Remote device has requested a thumbnail image - // - TRAPD( error, SendThumbnailL(aPutResponse ) ); - if ( error ) - { - FTRACE(FPrint(_L("[BTSU]\t CBTSBPPController::Send thumbnail leaved with %d"), error )); - iObserverPtr->ControllerComplete( EBTSPuttingFailed ); - } - } - else - { - // Some error on Obex level - // - iObserverPtr->ControllerComplete( EBTSPuttingFailed); - } - - FLOG(_L("[BTSU]\t CBTSBIPController::PutCompleted() done")); - } - -// ----------------------------------------------------------------------------- -// CBTSBIPController::GetCompleted -// ----------------------------------------------------------------------------- -// -void CBTSBIPController::GetCompleted( TInt aStatus, - CObexBufObject* aGetResponse ) - { - FLOG(_L("[BTSU]\t CBTSBIPController::GetCompleted()")); - - if ( aStatus == KErrAbort ) - { - // Connection is cancelled - // - iObserverPtr->ControllerComplete( EBTSGettingFailed ); - } - - else if ( aStatus == KErrNone ) - { - TRAPD( error, HandleGetCompleteIndicationL( aGetResponse ) ); - if ( error != KErrNone ) - { - DeleteTempFile( iTempFileName ); - // Error on capability handling - // - iObserverPtr->ControllerComplete( EBTSGettingFailed ); - } - } - else if( aStatus != KErrAbort && aGetResponse->BytesReceived()==0 ) - { - TRAPD( error,iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ImageListSize() ) ); - error=KErrNone; - TRAP(error, SendL() ); - if ( error != KErrNone ) - { - iObserverPtr->ControllerComplete( EBTSPuttingFailed ); - } - } - else if ( aStatus != KErrNone && aGetResponse->BytesReceived()>0 ) - { - // Error on Obex level - // - iObserverPtr->ControllerComplete( EBTSGettingFailed ); - } - - - FLOG(_L("[BTSU]\t CBTSBIPController::GetCompleted() done")); - } - -// ----------------------------------------------------------------------------- -// CBTSBIPController::SendL -// ----------------------------------------------------------------------------- -// -void CBTSBIPController::SendL() - { - FLOG(_L("[BTSU]\t CBTSBIPController::SendL()")); - - - if ( iListPtr->ImageCount() > 0 && iFileIndex < iListPtr->ImageCount()) - { - - RArray headerList; - CleanupClosePushL( headerList ); - - // Add Type header - // - CObexHeader* typeHeader = CObexHeader::NewL(); - CleanupStack::PushL( typeHeader ); - typeHeader->SetByteSeqL( KBTSUTypeHeader, KBTSBIPImageType ); - headerList.Append( typeHeader ); - - // Add image descriptor - // - HBufC8* imagedescriptor = CreateImageDescriptorL( ); - CleanupStack::PushL( imagedescriptor ); - - CObexHeader* imageDescriptorHeader = CObexHeader::NewL(); - CleanupStack::PushL( imageDescriptorHeader ); - imageDescriptorHeader->SetByteSeqL( KBTSUImgDescriptorHeader, imagedescriptor->Des() ); - headerList.Append( imageDescriptorHeader ); - - // Send image - // - - TBTSUImageParam imageparam = iListPtr->ImageAtL( iFileIndex ); - - - iListPtr->MarkAsSendL(iFileIndex); - - - iClient->PutObjectL( headerList, imageparam.iFile ); - - - CleanupStack::Pop(4); // headerList, imageDescriptorHeader, typeHeader, imagedescriptor - delete imagedescriptor; - headerList.Close(); - } - else - { - FLOG(_L("[BTSU]\t CBTSBIPController::SendL() all images sent, closing connection")); - - // All images sent, close client connection. - // - iClient->CloseClientConnection(); - } - - FLOG(_L("[BTSU]\t CBTSBIPController::SendL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBIPController::GetL -// ----------------------------------------------------------------------------- -// -void CBTSBIPController::GetL() - { - FLOG(_L("[BTSU]\t CBTSBIPController::GetL()")); - - RArray headerList; - CleanupClosePushL(headerList); - - // Add capabilities type header - // - CObexHeader* typeHeader = CObexHeader::NewL(); - CleanupStack::PushL( typeHeader ); - typeHeader->SetByteSeqL( KBTSUTypeHeader, KBTSBIPCapabilities ); - headerList.Append( typeHeader ); - - // Get capabilities object from remote device - // - iClient->GetObjectL( headerList ); - - CleanupStack::Pop(2); // headerList, typeHeader - headerList.Close(); - } - -// ----------------------------------------------------------------------------- -// CBTSBIPController::SendThumbnailL -// ----------------------------------------------------------------------------- -// -void CBTSBIPController::SendThumbnailL( const CObexHeaderSet *aPutResponse ) - { - FLOG(_L("[BTSU]\t CBTSBIPController::SendThumbnail()")); - - // Create thumbnail for sending - // Delete the created thumbnail on PutComplete - // - - // Fill header array - // - - RArray headerList; - CleanupClosePushL(headerList); - - // Add ImageHandle header - // - CObexHeader* imageHandleHeader = CObexHeader::NewL(); - CleanupStack::PushL( imageHandleHeader ); - - aPutResponse->First(); - User::LeaveIfError(aPutResponse->Find(KBTSUImageHandleHeader, - *imageHandleHeader ) ); - headerList.Append( imageHandleHeader ); - - // Add Type header - // - CObexHeader* typeHeader = CObexHeader::NewL(); - CleanupStack::PushL( typeHeader ); - typeHeader->SetByteSeqL( KBTSUTypeHeader, KBTSBIPThmType ); - headerList.Append( typeHeader ); - - - CreateTempFileL( iThumbnailFileName ); - CBTSUImageConverter* imageConverter = CBTSUImageConverter::NewL(); - CleanupStack::PushL( imageConverter ); - - TBTSUImageParam imgparam = iListPtr->ImageAtL( iFileIndex ); - imageConverter->CreateThumbnailL(imgparam.iFile, iThumbnailFileName ); - - CleanupStack::PopAndDestroy(imageConverter); - - // Add Name header - // - TParse parse; - User::LeaveIfError( parse.Set( iThumbnailFileName, NULL, NULL ) ); - CObexHeader* nameHeader = CObexHeader::NewL(); - CleanupStack::PushL( nameHeader ); - nameHeader->SetUnicodeL( KBTSUNameHeader, parse.NameAndExt() ); - headerList.Append( nameHeader ); - - // send thumbnail - // - iClient->PutObjectL( headerList, iThumbnailFileName ); - - // Cleanup - // - CleanupStack::Pop(4); // headerList, imageHandleHeader, typeHeader, nameHeader - headerList.Close(); - } - -// ----------------------------------------------------------------------------- -// CBTSBIPController::CreateTempFileL -// ----------------------------------------------------------------------------- -// -void CBTSBIPController::CreateTempFileL( TFileName& aFileName ) - { - FLOG(_L("[BTSU]\t CBTSBIPController::CreateTempFileL()")); - - RFs fileSession; - RFile file; - - TBuf privatepath; - TBuf tempPath; - - User::LeaveIfError( fileSession.Connect() ); - CleanupClosePushL( fileSession ); - - User::LeaveIfError(fileSession.CreatePrivatePath(EDriveC)); - User::LeaveIfError(fileSession.PrivatePath(privatepath)); - tempPath.Append(KBTSBIPTempPathDrive()); - tempPath.Append(privatepath); - User::LeaveIfError( file.Temp( fileSession, privatepath, - aFileName, EFileWrite ) ); - - file.Flush(); - file.Close(); - CleanupStack::Pop(); // Close fileSession - fileSession.Close(); - } - - -// ----------------------------------------------------------------------------- -// CBTSBIPController::GenerateTempFileNameL -// ----------------------------------------------------------------------------- -// -void CBTSBIPController::GenerateTempFileNameL( TFileName& aFileName ) - { - FLOG(_L("[BTSU]\t CBTSBIPController::GenerateTempFileNameL()")); - - RFs fileSession; - RFile file; - - TBuf privatepath; - TBuf tempPath; - - User::LeaveIfError( fileSession.Connect() ); - CleanupClosePushL( fileSession ); - - User::LeaveIfError(fileSession.CreatePrivatePath(EDriveC)); - User::LeaveIfError(fileSession.PrivatePath(privatepath )); - tempPath.Append(KBTSBIPTempPathDrive()); - tempPath.Append(privatepath); - User::LeaveIfError(file.Temp( fileSession, tempPath, - aFileName, EFileWrite ) ); - - file.Flush(); - file.Close(); - // Delete the file so that only a unique name is created - fileSession.Delete( aFileName ); - CleanupStack::Pop(); // Close fileSession - fileSession.Close(); - } - - -// ----------------------------------------------------------------------------- -// CBTSBIPController::DeleteTempFileL -// ----------------------------------------------------------------------------- -// -void CBTSBIPController::DeleteTempFile( TFileName& aFileName ) - { - FLOG(_L("[BTSU]\t CBTSBIPController::DeleteTempFile()")); - - if ( &aFileName != NULL ) - { - if ( aFileName.Length() > 0 ) - { - RFs fileSession; - TInt retVal = fileSession.Connect(); - if (retVal == KErrNone) - { - fileSession.Delete( aFileName ); - } - fileSession.Close(); - } - } - - FLOG(_L("[BTSU]\t CBTSBIPController::DeleteTempFile() complete")); - } - -// ----------------------------------------------------------------------------- -// CBTSBIPController::CreateImageDescriptorL -// ----------------------------------------------------------------------------- -// -HBufC8* CBTSBIPController::CreateImageDescriptorL() - { - FLOG(_L("[BTSU]\t CBTSBIPController::CreateImageDescriptorL()")); - - // Example image descriptor of an small jpeg picture - // with size 160*120 pixels and a size of 5000 bytes. - // - // - // - // - TBTSUImageParam param = iListPtr->ImageAtL( iFileIndex ); - - // Add start of image description - // - TBuf8 string( KBTSBIPDescriptorStart ); - - // Add image encoding - // - string.Append( KBTSBIPDescriptorEncoding ); - string.Append( *param.iDisplayName ); - - // Add image pixel size - // - string.Append( KBTSBIPDescriptorPixel ); - string.AppendNum( param.iPixelSize.iWidth ); - string.Append( '*' ); - string.AppendNum( param.iPixelSize.iHeight ); - - // Add image size - // - string.Append( KBTSBIPDescriptorSize ); - string.AppendNum( param.iFileSize ); - - // Add end of image description - // - string.Append( KBTSBIPDescriptorEnd ); - - FLOG(_L("[BTSU]\t CBTSBIPController::CreateImageDescriptorL() completed")); - - return string.AllocL(); - } - - -// ----------------------------------------------------------------------------- -// CBTSBIPController::HandleGetCompleteIndicationL -// ----------------------------------------------------------------------------- -// -void CBTSBIPController::HandleGetCompleteIndicationL( CObexBufObject* aGetResponse ) - { - FLOG(_L("[BTSU]\t CBTSBIPController::HandleGetCompleteIndicationL()")); - - TBool found; - TBool allSupported; - TInt picindex,capindex; - TInt confirm=0; - CBTSUXmlParser* xmlParser = CBTSUXmlParser::NewL(); - CleanupStack::PushL( xmlParser ); - GenerateTempFileNameL( iTempFileName ); - aGetResponse->WriteToFile( iTempFileName ); - aGetResponse->Reset(); - - // Parse capability object and create a list of supported image encodings - // - RArray* remoteCapabilityList = - xmlParser->GetImgCapabilityListL( iTempFileName ); - - // Delete the temp file since we dont need it anymore - // - DeleteTempFile( iTempFileName ); - - // Go through all the images on our sending list and check - // if remote device is capable of receiving those. - // - allSupported= ETrue; - for (picindex=0; picindex< iListPtr->ImageCount(); picindex++ ) - { - found=EFalse; - for (capindex=0; capindex < remoteCapabilityList->Count(); capindex++) - { - //Find first is encoding suported - if((iListPtr->ImageAtL( picindex ).iDisplayName->Compare(*(*remoteCapabilityList)[capindex].iEncoding))==0) - { - found=ETrue; - //Check pixel size - if((*remoteCapabilityList)[capindex].iMinPixelSize.iHeight>=0) - { - if(((*remoteCapabilityList)[capindex].iMaxPixelSize.iWidth < iListPtr->ImageAtL( picindex ).iPixelSize.iWidth) || - ((*remoteCapabilityList)[capindex].iMaxPixelSize.iHeight < iListPtr->ImageAtL( picindex ).iPixelSize.iHeight)|| - ((*remoteCapabilityList)[capindex].iMinPixelSize.iHeight > iListPtr->ImageAtL( picindex ).iPixelSize.iHeight)|| - ((*remoteCapabilityList)[capindex].iMinPixelSize.iWidth > iListPtr->ImageAtL( picindex ).iPixelSize.iWidth) - ) - { - found=EFalse; - } - } - - //Check byte size - if((*remoteCapabilityList)[capindex].iMaxByteSize>=0) - { - if((*remoteCapabilityList)[capindex].iMaxByteSizeImageAtL( picindex ).iFileSize) - { - found=EFalse; - } - } - // If file is supported, stop the loop. - // - if ( found ) - break; - } - } - allSupported = found & allSupported; - } - - for (TInt index=0; index < remoteCapabilityList->Count(); index++) - { - if((*remoteCapabilityList)[index].iEncoding) - { - delete ((*remoteCapabilityList)[index].iEncoding); - } - - } - - remoteCapabilityList->Close(); - delete remoteCapabilityList; - CleanupStack::PopAndDestroy( xmlParser ); - - if(!allSupported && iListPtr->ImageCount() > 1) - { - - confirm=iObserverPtr->LaunchConfirmationQuery(R_BT_NOT_SEND_ALL_QUERY_MIXED); - - if(confirm==EAknSoftkeyYes) - { - // Everything went ok. Start sending images - // - iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ImageListSize() ); - - // Start sending images - // - SendL(); - } - - - } - else if ( !allSupported && iListPtr->ImageCount() == 1) - { - // We allow user to choose wheather to send the image file which is not supported on target device - // Original codeline: iObserverPtr->ControllerComplete( EBTSBIPOneNotSend ); - confirm=iObserverPtr->LaunchConfirmationQuery(R_BT_NOT_SEND_ALL_QUERY_SINGLE); - - if(confirm==EAknSoftkeyYes) - { - // Everything went ok. Start sending the images - // - iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ImageListSize() ); - - // Start sending images - // - SendL(); - } - } - else if( allSupported ) - { - iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ImageListSize() + iListPtr->ObjectListSizeL()); - - // Start sending images - // - SendL(); - } - - - FLOG(_L("[BTSU]\t CBTSBIPController::HandleGetCompleteIndicationL() #3")); - } - - -//----------------------------------------------------------------------------- -// void CBTSBIPController::ConnectTimedOut() -// ----------------------------------------------------------------------------- -// -void CBTSBIPController::ConnectTimedOut() - { - iObserverPtr->ConnectTimedOut(); - } - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSBPPController.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSBPPController.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,422 +0,0 @@ -/* -* Copyright (c) 2002 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: Basic printing profile implementation -* -*/ - - - -// INCLUDE FILES -#include "BTServiceUtils.h" -#include "BTSBPPController.h" -#include "BTSUDebug.h" - -#include -#include -#include - -// CONSTANTS -_LIT8( KBTSDirectPrintingUUID, "\x00\x00\x11\x18\x00\x00\x10\x00\x80\x00\x00\x80\x5F\x9B\x34\xFB" ); -_LIT8( KBTSXHTMLPrintType, "application/vnd.pwg-xhtml-print+xml\0" ); - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CBTSBPPController::CBTSBPPController -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CBTSBPPController::CBTSBPPController( MBTServiceObserver* aObserver, - const CBTServiceParameterList* aList ) : - iServerState( EBTSBPPSrvIdle ), - iClientDone( EFalse ), - iObserverPtr( aObserver ), - iListPtr( aList ) - { - } - -// ----------------------------------------------------------------------------- -// CBTSBPPController::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CBTSBPPController::ConstructL( const TBTDevAddr& aRemoteDevice, - const TUint aRemotePort, - CBTEngDiscovery* aBTConnectionPtr ) - { - FLOG(_L("[BTSU]\t CBTSBPPController::ConstructL()")); - - // Create an array of obex headers - // - RArray headers; - CleanupClosePushL( headers ); - - CObexHeader* targetHdr = CObexHeader::NewL(); - CleanupStack::PushL( targetHdr ); - targetHdr->SetByteSeqL( KBTSUTargetHeader, KBTSDirectPrintingUUID ); - headers.Append( targetHdr ); - - // Create obex client - // - CreateClientL ( this, aRemoteDevice, aRemotePort, headers ); - - CleanupStack::Pop( 2 ); // targetHdr, headers - headers.Close(); - - // Start the object server if there were referenced objects - // - if ( iListPtr->HasAnyReferencedObjects() ) - { - iServer = CBTSBPPObjectServer::NewL( this, - aBTConnectionPtr, - aRemoteDevice ); - } - - FLOG(_L("[BTSU]\t CBTSBPPController::ConstructL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPController::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBTSBPPController* CBTSBPPController::NewL( MBTServiceObserver* aObserver, - const TUint aRemotePort, - const TBTDevAddr& aRemoteDevice, - const CBTServiceParameterList* aList, - CBTEngDiscovery* aBTConnectionPtr ) - { - CBTSBPPController* self = new( ELeave ) CBTSBPPController( aObserver, aList ); - CleanupStack::PushL( self ); - self->ConstructL( aRemoteDevice, aRemotePort, aBTConnectionPtr ); - CleanupStack::Pop(self); - return self; - } - - -// Destructor -CBTSBPPController::~CBTSBPPController() - { - if ( iServer ) - { - delete iServer; - iServer = NULL; - } - if ( iServerWait ) - { - delete iServerWait; - iServerWait = NULL; - } - } - - -// ----------------------------------------------------------------------------- -// CBTSBPPController::ConnectCompleted -// ----------------------------------------------------------------------------- -// -void CBTSBPPController::ConnectCompleted( TInt aStatus ) - { - FTRACE(FPrint(_L("[BTSU]\t CBTSBPPController::ConnectCompleted() %d"), aStatus )); - - if ( aStatus ) - { - // The connect operation failed. - // - iObserverPtr->ControllerComplete( EBTSConnectingFailed ); - } - else - { - TRAPD( error, SelectAndSendL() ); - - if ( error ) - { - FTRACE(FPrint(_L("[BTSU]\t CBTSBPPController::SelectAndSendL() leaved with %d"), error )); - iObserverPtr->ControllerComplete( EBTSPuttingFailed ); - } - } - - FLOG(_L("[BTSU]\t CBTSBPPController::ConnectCompleted() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPController::PutCompleted -// ----------------------------------------------------------------------------- -// -void CBTSBPPController::PutCompleted( TInt aStatus, const CObexHeaderSet* /*aPutResponse*/ ) - { - FLOG(_L("[BTSU]\t CBTSBPPController::PutCompleted()")); - - if ( aStatus ) - { - // The put operation failed. - // - iObserverPtr->ControllerComplete( aStatus ); - } - else - { - iClientDone = ETrue; - - if ( iServer == NULL || // Server was not needed at all or - !iServer->HasReferencedObjects() || // no referenced objects in current file or - iServerState == EBTSBPPSrvDone ) // server is done. - { - // Object sent and server done, check if there are - // more files to send. - // - TRAPD( error, SelectAndSendL() ); - - if ( error ) - { - FTRACE(FPrint(_L("[BTSU]\t CBTSBPPController::SelectAndSendL() leaved with %d"), error )); - iObserverPtr->ControllerComplete( EBTSPuttingFailed ); - } - } - else if ( iServerState == EBTSBPPSrvIdle ) - { - __ASSERT_DEBUG( iServerWait == NULL, BTSUPanic( EBTSUPanicExistingObject ) ); - - // Object sent but server isn't serving yet. - // Wait for a connection attempt. - // - - TRAPD(error, iServerWait = CBTSBPPServerWait::NewL( this )); - - if ( error ) - { - FTRACE(FPrint(_L("[BTSU]\t CBTSBPPServerWait::NewL() leaved with %d"), error )); - iObserverPtr->ControllerComplete( EBTSPuttingFailed ); - } - - } - } - - FLOG(_L("[BTSU]\t CBTSBPPController::PutCompleted() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPController::GetCompleted -// ----------------------------------------------------------------------------- -// -void CBTSBPPController::GetCompleted( TInt /*aStatus*/, CObexBufObject* /*aGetResponse*/ ) - { - FLOG(_L("[BTSU]\t CBTSBPPController::GetCompleted() ERROR: unsolicited callback")); - __ASSERT_DEBUG( EFalse, BTSUPanic( EBTSUPanicInternalError ) ); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPController::ClientConnectionClosed -// ----------------------------------------------------------------------------- -// -void CBTSBPPController::ClientConnectionClosed() - { - FLOG(_L("[BTSU]\t CBTSBPPController::ClientConnectionClosed()")); - - // Everything is now ready. - // - iObserverPtr->ControllerComplete( EBTSNoError ); - - FLOG(_L("[BTSU]\t CBTSBPPController::ClientConnectionClosed() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPController::ServerError -// ----------------------------------------------------------------------------- -// -void CBTSBPPController::ServerError( TInt aError ) - { - FTRACE(FPrint(_L("[BTSU]\t CBTSBPPController::ServerError() %d"), aError ) ); - - // Mark server as ready and if client is ready, complete the controller. - // - iServerState = EBTSBPPSrvDone; - - if ( iClientDone ) - { - iObserverPtr->ControllerComplete( aError ); - } - else - { - // Server ready, no need to wait anymore - // - if ( iServerWait ) - { - delete iServerWait; - iServerWait = NULL; - } - } - - FLOG(_L("[BTSU]\t CBTSBPPController::ServerError() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPController::ServerConnectionEstablished -// ----------------------------------------------------------------------------- -// -void CBTSBPPController::ServerConnectionEstablished() - { - FLOG(_L("[BTSU]\t CBTSBPPController::ServerConnectionEstablished()")); - - iServerState = EBTSBPPSrvServing; - - if ( iServerWait ) - { - // The wait for server connection can now be stopped. - // - delete iServerWait; - iServerWait = NULL; - } - - FLOG(_L("[BTSU]\t CBTSBPPController::ServerConnectionEstablished() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPController::ServerConnectionClosed -// ----------------------------------------------------------------------------- -// -void CBTSBPPController::ServerConnectionClosed() - { - FLOG(_L("[BTSU]\t CBTSBPPController::ServerConnectionClosed()")); - - iServerState = EBTSBPPSrvDone; - - if ( iClientDone ) - { - // The client was waiting for server, but now another object - // can be sent. - // - TRAPD( error, SelectAndSendL() ); - - if ( error ) - { - iObserverPtr->ControllerComplete( error ); - } - } - - FLOG(_L("[BTSU]\t CBTSBPPController::ServerConnectionClosed() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPController::WaitComplete -// ----------------------------------------------------------------------------- -// -void CBTSBPPController::WaitComplete() - { - FLOG(_L("[BTSU]\t CBTSBPPController::WaitComplete()")); - - // For some reason the printer didn't establish server connection although - // there were referenced objects - // - if ( iServerWait ) - { - delete iServerWait; - iServerWait = NULL; - } - - // The client was waiting for server, but now another object - // can be sent. - // - TRAPD( error, SelectAndSendL() ); - - if ( error ) - { - FTRACE(FPrint(_L("[BTSU]\t CBTSBPPController::SelectAndSendL() leaved with %d"), error )); - iObserverPtr->ControllerComplete( EBTSPuttingFailed ); - } - - FLOG(_L("[BTSU]\t CBTSBPPController::WaitComplete() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPController::SelectAndSendL -// ----------------------------------------------------------------------------- -// -void CBTSBPPController::SelectAndSendL() - { - FLOG(_L("[BTSU]\t CBTSBPPController::SelectAndSendL()")); - - TBTSUXhtmlParam param; - param.iFileName = NULL; - param.iRefObjectList = NULL; - - if ( iListPtr->XhtmlCount() > 0 && iSendIndex < iListPtr->XhtmlCount() ) - { - // Get next xhtml parameter - // - param = iListPtr->XhtmlAt( iSendIndex ); - iSendIndex++; - } - - if ( param.iFileName != NULL ) - { - FTRACE(FPrint(_L("[BTSU]\t CBTSBPPController::SelectAndSendL() fileName='%S'"), param.iFileName )); - - if ( iServer ) - { - // Pass the list of referenced objects in the file to object server. - // - iServer->SetReferencedObjectList( param.iRefObjectList ); - } - - // Create an array of obex headers - // - RArray headers; - CleanupClosePushL( headers ); - - CObexHeader* typeHdr = CObexHeader::NewL(); - CleanupStack::PushL( typeHdr ); - typeHdr->SetByteSeqL( KBTSUTypeHeader, KBTSXHTMLPrintType ); - headers.Append( typeHdr ); - - // Send object. - // - iClient->PutObjectL( headers, *param.iFileName ); - - CleanupStack::Pop( 2 ); // typeHdr, headers - headers.Close(); - - // A new object is being sent. Reset states. - // - iClientDone = EFalse; - iServerState = EBTSBPPSrvIdle; - } - else - { - FLOG(_L("[BTSU]\t CBTSBPPController::SelectAndSendL() all objects sent, closing connection")); - - // All objects sent, close client connection. - // - iClient->CloseClientConnection(); - } - - FLOG(_L("[BTSU]\t CBTSBPPController::SelectAndSendL() completed")); - } - -//----------------------------------------------------------------------------- -// void CBTSBPPController::ResetFileHandleL -// ----------------------------------------------------------------------------- -// -void CBTSBPPController::ResetFileHandleL() - { - } - -//----------------------------------------------------------------------------- -// void CBTSBPPController::ConnectTimedOut() -// ----------------------------------------------------------------------------- -// -void CBTSBPPController::ConnectTimedOut() - { - iObserverPtr->ConnectTimedOut(); - } -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSBPPObjectRequest.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSBPPObjectRequest.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,481 +0,0 @@ -/* -* Copyright (c) 2002 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: GetReferencedObjects -operation implementation -* -*/ - - - -// INCLUDE FILES -#include "BTServiceUtils.h" -#include "BTSBPPObjectRequest.h" -#include "BTSUDataConverter.h" -#include "BTSUImageConverter.h" -#include "BTSUDebug.h" - -#include // RFile -#include // RBufWriteStream -#include // RFileReadStream - -// CONSTANTS -const TInt KBTSBPPFileSizeNotSet = 0; -const TInt KBTSBPPFileSizeRequested = 1; -const TInt KBTSBPPFileSizeUnknown = -1; -const TInt KBTSBPPRestOfTheFileRequested = -1; - -// The field lengths of Application Parameters -header in bytes -// -const TInt KBTSBPPFieldTag = 1; -const TInt KBTSBPPFieldLength = 1; -const TInt KBTSBPPValue = 4; -const TInt KBTSBPPAppParamLength = KBTSBPPFieldTag + KBTSBPPFieldLength + KBTSBPPValue; - -_LIT8(KBTSBPPRefObjectOper, "x-obex/referencedobject\0"); - -static const TUint8 KBTSBPPFileSizeTag = 0x04; -static const TUint8 KBTSBPPFileSizeLength = 0x04; - -// MODULE DATA STRUCTURES -enum KBTSBPPAppParamTags - { - KBTSBPPTagOffset = 1, - KBTSBPPTagCount, - KBTSBPPTagJobId, // used only in JobBased-printing - KBTSBPPTagFileSize - }; - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectRequest::CBTSBPPObjectRequest -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CBTSBPPObjectRequest::CBTSBPPObjectRequest( CObexBaseObject* aGetOperation, - const CDesCArray* aRefObjectList ) : iRequest( aGetOperation ), - iObjectList( aRefObjectList ) - { - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectRequest::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CBTSBPPObjectRequest::ConstructL() - { - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::ConstructL()")); - - User::LeaveIfError( iFileSession.Connect() ); - - // Check the validity of the operation and it's paramters. - // - CheckGetRequestL(); - - // Execute any tasks needed and create the requested object. - // - ExecuteGetRequestL(); - - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::ConstructL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectRequest::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBTSBPPObjectRequest* CBTSBPPObjectRequest::NewL( CObexBaseObject* aGetOperation, - const CDesCArray* aRefObjectList ) - { - CBTSBPPObjectRequest* self = new( ELeave ) CBTSBPPObjectRequest( aGetOperation, - aRefObjectList ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - - -// Destructor -CBTSBPPObjectRequest::~CBTSBPPObjectRequest() - { - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::~CBTSBPPObjectRequest()")); - iFileSession.Close(); - - delete iResponse; - delete iResponseBuffer; - - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::~CBTSBPPObjectRequest() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectRequest::GetResponse -// ----------------------------------------------------------------------------- -// -CObexBufObject* CBTSBPPObjectRequest::GetResponse() - { - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::GetResponse()")); - return iResponse; - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectRequest::CheckGetRequestL -// ----------------------------------------------------------------------------- -// -void CBTSBPPObjectRequest::CheckGetRequestL() - { - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckGetRequestL()")); - - CheckTypeHeaderL(); - CheckNameHeaderL(); - CheckAppParamsHeaderL(); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectRequest::CheckTypeHeaderL -// ----------------------------------------------------------------------------- -// -void CBTSBPPObjectRequest::CheckTypeHeaderL() - { - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckTypeHeaderL()")); - - __ASSERT_DEBUG( iRequest, BTSUPanic( EBTSUPanicNullPointer ) ); - - const TDesC8& typeHeader = iRequest->Type(); - - if ( typeHeader.Length() == 0 ) - { - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckTypeHeaderL() ERROR, no type header")); - User::Leave( KErrNotFound ); - } - else if ( typeHeader.Length() > KBTSUMaxStringLength ) - { - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckTypeHeaderL() ERROR, type header too long")); - User::Leave( KErrTooBig ); - } - else - { - FTRACE(FPrint(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckTypeHeaderL() type header '%S'"), &typeHeader )); - // The only supported operation is GetReferencedObjects - // - if ( typeHeader != KBTSBPPRefObjectOper() ) - { - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckTypeHeaderL() ERROR, unsupported operation")); - User::Leave( KErrNotSupported ); - } - } - - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckTypeHeaderL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectRequest::CheckNameHeaderL -// ----------------------------------------------------------------------------- -// -void CBTSBPPObjectRequest::CheckNameHeaderL() - { - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckNameHeaderL()")); - - __ASSERT_DEBUG( iRequest, BTSUPanic( EBTSUPanicNullPointer ) ); - - const TDesC& nameHeader = iRequest->Name(); - - if ( nameHeader.Length() == 0 ) - { - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckNameHeaderL() ERROR, no name header")); - User::Leave( KErrNotFound ); - } - else - { - FTRACE(FPrint(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckNameHeaderL() filename '%S'"), &nameHeader )); - - // Check are we allowed to send this file - // - TInt dummy; - if ( iObjectList->Find( nameHeader, dummy ) != KBTSUEqualStrings ) - { - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckNameHeaderL() ERROR, the asked object is not referenced in the document")); - User::Leave( KErrPermissionDenied ); - } - - iRequestParams.iName = &nameHeader; - } - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectRequest::CheckAppParamsHeaderL -// -// This method expects a Tag-Length-Value format. The method is as defensive -// as possible, for example unknown or illegal values are discarded. -// ----------------------------------------------------------------------------- -// -void CBTSBPPObjectRequest::CheckAppParamsHeaderL() - { - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckAppParamsHeaderL()")); - - __ASSERT_DEBUG( iRequest, BTSUPanic( EBTSUPanicNullPointer ) ); - - TPtrC8 header( iRequest->AppParam() ); - - if ( header.Length() == 0 ) - { - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckAppParamsHeaderL() ERROR, no AppParam header")); - User::Leave( KErrNotFound ); - } - else if ( header.Length() < KBTSBPPAppParamLength * 2) - { - // There has to be at least offset and count -parameters. - // - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckAppParamsHeaderL() ERROR, incomplete AppParam header")); - User::Leave( KErrArgument ); - } - else - { - // Parse the header - // - while( header.Length() >= KBTSBPPAppParamLength ) - { - // Extract tag number and remove it from the header - // - TInt tagNumber = TBTSUDataConverter::ConvertByteL( - header.Left( KBTSBPPFieldTag ) ); - header.Set( header.Mid( KBTSBPPFieldTag ) ); - - // Extract value length and remove it from the header - // - TInt valueLength = TBTSUDataConverter::ConvertByteL( - header.Left( KBTSBPPFieldLength ) ); - header.Set( header.Mid( KBTSBPPFieldLength ) ); - - if ( valueLength != KBTSBPPValue ) - { - FTRACE(FPrint(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckAppParamsHeaderL() WARNING, illegal length %d"), valueLength )); - valueLength = KBTSBPPValue; - // This is an interesting choice of what to do, I would argue that for future compatibility you'll probably want to accept the length - // provided as it might be for a new tag that is not yet published. (Checking of the size for known tags is handled by the conversion - // functions anyway). - // So, in summary I wouldn't change valueLength from what it is in the payload. But I've left it in for now in case it was added for - // interoperability reasons with some existing device. - } - - // Extract value... - // - switch ( tagNumber ) - { - case KBTSBPPTagOffset: - { - iRequestParams.iOffset = - TBTSUDataConverter::ConvertDataUnsignedL( - header.Left( valueLength ) ); - - FTRACE(FPrint(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckAppParamsHeaderL() offset '%d'"), iRequestParams.iOffset )); - break; - } - case KBTSBPPTagCount: - { - iRequestParams.iCount = - TBTSUDataConverter::ConvertDataSignedL( - header.Left( valueLength ) ); - - FTRACE(FPrint(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckAppParamsHeaderL() count '%d'"), iRequestParams.iCount )); - break; - } - case KBTSBPPTagFileSize: - { - // The value is not interesting, we just need to know whether - // the parameter was received (and thus requested) - // - iRequestParams.iOffset = KBTSBPPFileSizeRequested; - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::ParseHeadersL() fileSize parameter received")); - break; - } - - case KBTSBPPTagJobId: - default: - { - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckAppParamsHeaderL() WARNING, illegal tag")); - break; - } - } - - // ...and remove it from the header - // - header.Set( header.Mid( valueLength ) ); - } - } - - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::CheckAppParamsHeaderL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectRequest::ExecuteGetRequestL -// ----------------------------------------------------------------------------- -// -void CBTSBPPObjectRequest::ExecuteGetRequestL() - { - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::ExecuteGetRequestL()")); - - // If iCount is 0, an empty body will be sent - // - if ( iRequestParams.iCount != 0 ) - { - ResolveGetRequestL(); - ReadFileToBufferL(); - } - - CreateResponseObjectL(); - - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::ExecuteGetRequestL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectRequest::ResolveGetRequestL -// ----------------------------------------------------------------------------- -// -void CBTSBPPObjectRequest::ResolveGetRequestL() - { - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::ResolveGetRequestL()")); - - // Get the file size - // - RFile file; - TInt size = 0; - User::LeaveIfError( file.Open( iFileSession, *iRequestParams.iName, - EFileShareReadersOnly | EFileStream ) ); - - TInt error = file.Size( size ); - - if ( error ) - { - FTRACE(FPrint(_L("[BTSBPP]\t CBTSBPPObjectRequest::ResolveGetRequestL() error %d in getting the size"), error ) ); - size = KBTSBPPFileSizeUnknown; - } - - file.Close(); - - // Store the file size if it was requested - // - if ( iRequestParams.iFileSize == KBTSBPPFileSizeRequested ) - { - iRequestParams.iFileSize = size; - } - - // Resolve the actual amount of data that needs to be read. - // - TInt dataLeft = size - iRequestParams.iOffset; - - if ( iRequestParams.iCount == KBTSBPPRestOfTheFileRequested ) - { - if ( size == KBTSBPPFileSizeUnknown ) - { - // The size of the file is unknown, so read as much - // as would fit into the buffer - // - iRequestParams.iCount = KBTSUDataBufferMaxSize; - } - else - { - // The rest of the file is requested, so correct the count - // - iRequestParams.iCount = dataLeft; - } - } - else if ( iRequestParams.iCount > dataLeft ) - { - // There is less data left that was requested, so correct the count - // - iRequestParams.iCount = dataLeft; - } - - if ( iRequestParams.iCount > KBTSUDataBufferMaxSize ) - { - // The requested count is too big - // - FTRACE(FPrint(_L("[BTSBPP]\t CBTSBPPObjectRequest::ResolveGetRequestL() iCount too big %d"), iRequestParams.iCount ) ); - User::Leave( KErrTooBig ); - } - - FTRACE(FPrint(_L("[BTSBPP]\t CBTSBPPObjectRequest::ResolveGetRequestL() completed, requested %d bytes"), iRequestParams.iCount ) ); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectRequest::ReadFileToBufferL -// ----------------------------------------------------------------------------- -// -void CBTSBPPObjectRequest::ReadFileToBufferL() - { - __ASSERT_DEBUG( !iResponseBuffer, BTSUPanic( EBTSUPanicExistingObject ) ); - - // Create a buffer for the object and reserve space according to the request - // - iResponseBuffer = CBufFlat::NewL( KBTSUDataBufferExpandSize ); - iResponseBuffer->SetReserveL( iRequestParams.iCount ); - iResponseBuffer->ResizeL( iRequestParams.iCount ); - - // Open the file - // - RFile file; - User::LeaveIfError( file.Open( iFileSession, *iRequestParams.iName, - EFileShareReadersOnly | EFileStream ) ); - CleanupClosePushL( file ); - - // Create a stream for reading from the file - // - RFileReadStream readStream( file, iRequestParams.iOffset ); - - // Create a stream for writing into the buffer - // - RBufWriteStream writeStream( *iResponseBuffer ); - - // Read the data from file to the buffer - // - readStream.ReadL( writeStream, iRequestParams.iCount ); - - FTRACE(FPrint(_L("[BTSBPP]\t CBTSBPPObjectRequest::ReadFileToBufferL() space reserved '%d'"), iRequestParams.iCount )); - FTRACE(FPrint(_L("[BTSBPP]\t CBTSBPPObjectRequest::ReadFileToBufferL() data read '%d'"), iResponseBuffer->Size() )); - - CleanupStack::PopAndDestroy(&file); - } - - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectRequest::CreateResponseObjectL -// ----------------------------------------------------------------------------- -// -void CBTSBPPObjectRequest::CreateResponseObjectL() - { - __ASSERT_DEBUG( iResponseBuffer || (iRequestParams.iCount == 0), BTSUPanic( EBTSUPanicNoBufferEvenThoughCountNotZero ) ); - __ASSERT_DEBUG( !iResponse, BTSUPanic( EBTSUPanicResponseAlreadyPresent ) ); - - // Create the OBEX response object using the buffer already created (or no buffer if appropriate) - // - iResponse = CObexBufObject::NewL( iResponseBuffer ); - - // Generate FileSize parameter if requested - // - if ( iRequestParams.iFileSize != KBTSBPPFileSizeNotSet ) - { - FLOG(_L("[BTSBPP]\t CBTSBPPObjectRequest::CreateResponseObjectL() generate file size param")); - TBuf8 params; - params.SetMax(); - TUint8* ptr = const_cast(params.Ptr()); - *ptr++ = KBTSBPPFileSizeTag; - *ptr++ = KBTSBPPFileSizeLength; - BigEndian::Put32(ptr, *reinterpret_cast(&iRequestParams.iFileSize)); // reinterpret cast to retain signed nature... - iResponse->SetAppParamL( params ); - } - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSBPPObjectServer.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSBPPObjectServer.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,372 +0,0 @@ -/* -* Copyright (c) 2002 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: Server part of basic printing profile -* -*/ - - - -// INCLUDE FILES -#include "BTServiceUtils.h" -#include "BTSBPPObjectServer.h" -#include "BTSBPPObjectRequest.h" -#include "BTSUDebug.h" - -// CONSTANTS -const TInt KBTSBPPObjectChannelStart = 15; // Start looking for free RFCOMM channel -const TInt KBTSBPPObjectChannelStop = 30; // Last free RFCOMM channel - -_LIT8( KBTSBPPReferencedObjectsUUID, "\x00\x00\x11\x20\x00\x00\x10\x00\x80\x00\x00\x80\x5F\x9B\x34\xFB" ); - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::CBTSBPPObjectServer -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CBTSBPPObjectServer::CBTSBPPObjectServer( - MBTSBPPObjectServerObserver* aObserver, CBTEngDiscovery* aBTEngDiscoveryPtr, - const TBTDevAddr& aExpectedClient ) : iExpectedClientPtr( &aExpectedClient ), - iBTEngDiscoveryPtr( aBTEngDiscoveryPtr ), - iObserverPtr( aObserver ) - { - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CBTSBPPObjectServer::ConstructL() - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::ConstructL()")); - - __ASSERT_DEBUG( iObserverPtr != NULL, BTSUPanic( EBTSUPanicNullPointer ) ); - __ASSERT_DEBUG( iBTEngDiscoveryPtr != NULL, BTSUPanic( EBTSUPanicNullPointer ) ); - __ASSERT_DEBUG( iExpectedClientPtr != NULL, BTSUPanic( EBTSUPanicNullPointer ) ); - - TObexBluetoothProtocolInfo info; - info.iTransport = KBTSProtocol; - - iObjectChannel = KBTSBPPObjectChannelStart; - for ( ; iObjectChannel < KBTSBPPObjectChannelStop; iObjectChannel++ ) - { - // Register security settings - // - TBTServiceSecurity sec; - sec.SetAuthentication( EFalse ); - sec.SetAuthorisation( EFalse ); - sec.SetEncryption( EFalse ); - - info.iAddr.SetSecurity( sec ); - info.iAddr.SetPort( iObjectChannel ); - - // Try to start Obex Server on selected channel - // - TRAPD( error, iServer = CObexServer::NewL ( info ) ); - - if ( !error ) - { - error = iServer->Start( this ); - - if ( !error ) - { - // Initialize server - // - iServer->SetCallBack( *this ); - User::LeaveIfError ( iServer->SetLocalWho( KBTSBPPReferencedObjectsUUID ) ); - - // Register SDP settings - // - User::LeaveIfError ( iBTEngDiscoveryPtr->RegisterSdpRecord( - TUUID(KBTSdpBasicPrinting), iObjectChannel, iSDPHandle )); - - FTRACE(FPrint(_L("[BTSU]\t CBTSBPPObjectServer::ConstructL() services running on channel %d"), iObjectChannel )); - break; - } - else - { - // Failed to start Obex server. Delete server and try again - // - delete iServer; - iServer = NULL; - } - } - } - - if ( !iServer ) - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::ConstructL() ERROR, server did not start.")); - User::Leave( KErrGeneral ); - } - - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::ConstructL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBTSBPPObjectServer* CBTSBPPObjectServer::NewL( - MBTSBPPObjectServerObserver* aObserver, CBTEngDiscovery* aBTEngDiscoveryPtr, - const TBTDevAddr& aExpectedClient ) - { - CBTSBPPObjectServer* self = new( ELeave ) - CBTSBPPObjectServer( aObserver, aBTEngDiscoveryPtr, aExpectedClient ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - - -// Destructor -CBTSBPPObjectServer::~CBTSBPPObjectServer() - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::~CBTSBPPObjectServer()")); - - if ( iServer ) - { - iServer->Stop(); - delete iServer; - iServer = NULL; - } - - delete iObjectRequest; - //delete iPasskeyRequest; - - if ( iBTEngDiscoveryPtr ) - { - iBTEngDiscoveryPtr->DeleteSdpRecord( iSDPHandle ); - } - - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::~CBTSBPPObjectServer() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::SetReferencedObjectList -// ----------------------------------------------------------------------------- -// -void CBTSBPPObjectServer::SetReferencedObjectList( const CDesCArray* aRefObjectList ) - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::SetReferencedObjectList()")); - - __ASSERT_DEBUG( aRefObjectList != NULL, BTSUPanic( EBTSUPanicNullPointer ) ); - - iObjectListPtr = aRefObjectList; - - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::SetReferencedObjectList() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::HasReferencedObjects -// ----------------------------------------------------------------------------- -// -TBool CBTSBPPObjectServer::HasReferencedObjects() - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::HasReferencedObjects()")); - __ASSERT_DEBUG( iObjectListPtr != NULL, BTSUPanic( EBTSUPanicNullPointer ) ); - - return iObjectListPtr->MdcaCount() > 0; - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::GetUserPasswordL -// ----------------------------------------------------------------------------- -// -void CBTSBPPObjectServer::GetUserPasswordL( const TDesC& /*aRealm*/ ) - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::GetUserPasswordL() NOT NEEDED")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::ErrorIndication -// ----------------------------------------------------------------------------- -// -void CBTSBPPObjectServer::ErrorIndication( TInt aError ) - { - FTRACE(FPrint(_L("[BTSU]\t CBTSBPPObjectServer::ErrorIndication() error %d"), aError )); - - iObserverPtr->ServerError( aError ); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::TransportUpIndication -// ----------------------------------------------------------------------------- -// -void CBTSBPPObjectServer::TransportUpIndication() - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::TransportUpIndication()")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::TransportDownIndication -// ----------------------------------------------------------------------------- -// -void CBTSBPPObjectServer::TransportDownIndication() - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::TransportDownIndication()")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::ObexConnectIndication -// ----------------------------------------------------------------------------- -// -TInt CBTSBPPObjectServer::ObexConnectIndication( - const TObexConnectInfo& /*aRemoteInfo*/, const TDesC8& /*aInfo*/ ) - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::ObexConnectIndication()")); - - TInt error = KErrAccessDenied; - - // Check that remote device is the expected one. - // - TBTSockAddr remoteAddr; - iServer->RemoteAddr( remoteAddr ); - if ( remoteAddr.BTAddr() == *iExpectedClientPtr ) - { - error = KErrNone; - iObserverPtr->ServerConnectionEstablished(); - } - - FTRACE(FPrint(_L("[BTSU]\t CBTSBPPObjectServer::ObexConnectIndication() completed with %d"), error )); - return error; - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::ObexDisconnectIndication -// ----------------------------------------------------------------------------- -// -void CBTSBPPObjectServer::ObexDisconnectIndication( const TDesC8& /*aInfo*/ ) - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::ObexDisconnectIndication()")); - - iObserverPtr->ServerConnectionClosed(); - - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::ObexDisconnectIndication() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::PutRequestIndication -// ----------------------------------------------------------------------------- -// -CObexBufObject* CBTSBPPObjectServer::PutRequestIndication() - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::PutRequestIndication()")); - - return NULL; - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::PutPacketIndication -// ----------------------------------------------------------------------------- -// -TInt CBTSBPPObjectServer::PutPacketIndication() - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::PutPacketIndication()")); - - return KErrNotSupported; - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::PutCompleteIndication -// ----------------------------------------------------------------------------- -// -TInt CBTSBPPObjectServer::PutCompleteIndication() - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::PutCompleteIndication()")); - - return KErrNotSupported; - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::GetRequestIndication -// ----------------------------------------------------------------------------- -// -CObexBufObject* CBTSBPPObjectServer::GetRequestIndication( - CObexBaseObject* aRequiredObject ) - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::GetRequestIndication()")); - __ASSERT_DEBUG( iObjectRequest == NULL, BTSUPanic( EBTSUPanicExistingObject ) ); - - TInt error = KErrNone; - CObexBufObject* object = NULL; - - TRAP( error, iObjectRequest = CBTSBPPObjectRequest::NewL( aRequiredObject, iObjectListPtr ) ); - - if ( !error ) - { - object = iObjectRequest->GetResponse(); - } - - FTRACE(FPrint(_L("[BTSU]\t CBTSBPPObjectServer::GetRequestIndication() completed with %d"), error ) ); - - return object; - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::GetPacketIndication -// ----------------------------------------------------------------------------- -// -TInt CBTSBPPObjectServer::GetPacketIndication() - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::GetPacketIndication()")); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::GetCompleteIndication -// ----------------------------------------------------------------------------- -// -TInt CBTSBPPObjectServer::GetCompleteIndication() - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::GetCompleteIndication()")); - - delete iObjectRequest; - iObjectRequest = NULL; - - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::GetCompleteIndication() completed")); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::SetPathIndication -// ----------------------------------------------------------------------------- -// -TInt CBTSBPPObjectServer::SetPathIndication( const CObex::TSetPathInfo& /*aPathInfo*/, - const TDesC8& /*aInfo*/ ) - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::SetPathIndication()")); - - return KErrNotSupported; - } - -// ----------------------------------------------------------------------------- -// CBTSBPPObjectServer::AbortIndication -// ----------------------------------------------------------------------------- -// -void CBTSBPPObjectServer::AbortIndication() - { - FLOG(_L("[BTSU]\t CBTSBPPObjectServer::AbortIndication()")); - - iObserverPtr->ServerError( KErrCancel ); - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSBPPServerWait.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSBPPServerWait.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2002 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: Waiter class implementation -* -*/ - - - -// INCLUDE FILES -#include "BTSBPPServerWait.h" -#include "BTServiceUtils.h" -#include "BTSUDebug.h" - -// CONSTANTS -const TInt KBTSBPPWaitTime = 120000000; // 2 minutes - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CBTSBPPServerWait::CBTSBPPServerWait -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CBTSBPPServerWait::CBTSBPPServerWait( MBTSBPPServerWaitObserver* aObserver ) : - CTimer( EPriorityStandard ), iObserver( aObserver ) - - { - CActiveScheduler::Add( this ); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPServerWait::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CBTSBPPServerWait::ConstructL() - { - FLOG(_L("[BTSU]\t CBTSBPPServerWait::ConstructL()")); - - CTimer::ConstructL(); - After( TTimeIntervalMicroSeconds32( KBTSBPPWaitTime ) ); - - FLOG(_L("[BTSU]\t CBTSBPPServerWait::ConstructL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPServerWait::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBTSBPPServerWait* CBTSBPPServerWait::NewL( MBTSBPPServerWaitObserver* aObserver ) - { - CBTSBPPServerWait* self = new( ELeave ) CBTSBPPServerWait( aObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - - -// Destructor -CBTSBPPServerWait::~CBTSBPPServerWait() - { - Cancel(); - } - -// ----------------------------------------------------------------------------- -// CBTSBPPServerWait::RunL -// ----------------------------------------------------------------------------- -// -void CBTSBPPServerWait::RunL() - { - FTRACE(FPrint(_L("[BTSU]\t CBTSBPPServerWait::RunL() status %d"), iStatus.Int() ) ); - __ASSERT_DEBUG( iObserver != NULL, BTSUPanic( EBTSUPanicNullPointer ) ); - - iObserver->WaitComplete(); - - FLOG(_L("[BTSU]\t CBTSBPPServerWait::RunL() completed")); - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSController.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSController.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* Copyright (c) 2007-2007 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: ?Description -* -*/ - - - - -#include "BTSBIPController.h" -#include "BTServiceClient.h" -#include "BTSUDebug.h" - - -// ======== MEMBER FUNCTIONS ======== - - -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// -CBTSController::CBTSController() - { - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CBTSController::~CBTSController() - { - FLOG(_L("[BTSU]\t CBTSController::Destructor()")); - delete iClient; - } - -// --------------------------------------------------------------------------- -// CBTSController::Abort -// --------------------------------------------------------------------------- -// -void CBTSController::Abort() - { - FLOG(_L("[BTSU]\t CBTSController::Abort")); - if ( iClient ) - { - iClient->Abort(); - } - FLOG(_L("[BTSU]\t CBTSController::Abort")); - } - -// --------------------------------------------------------------------------- -// CBTSController::Abort -// --------------------------------------------------------------------------- -// -void CBTSController::CreateClientL(MBTServiceClientObserver* aObserver, - const TBTDevAddr& aRemoteDevice, - const TUint aRemotePort, - RArray aHeaderList ) - { - FLOG(_L("[BTSU]\t CBTSController::CreateClient")); - iClient = CBTServiceClient::NewL( aObserver, aRemoteDevice, aRemotePort, aHeaderList ); - FLOG(_L("[BTSU]\t CBTSController::Abort")); - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSOPPController.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSOPPController.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,222 +0,0 @@ -/* -* Copyright (c) 2002 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: Object push controller implementation -* -*/ - - - -// INCLUDE FILES -#include "BTSOPPController.h" -#include "BTSUDebug.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CBTSOPPController::CBTSOPPController -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CBTSOPPController::CBTSOPPController( MBTServiceObserver* aObserver, - CBTServiceParameterList* aList ) : - iListPtr( aList ), - iObserverPtr( aObserver ) - { - } - -// ----------------------------------------------------------------------------- -// CBTSOPPController::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CBTSOPPController::ConstructL( const TUint aRemotePort, const TBTDevAddr& aRemoteDeviceAddr ) - { - FLOG(_L("[BTSS]\t CBTSOPPController::ConstructL()")); - - RArray headerList; - CleanupClosePushL( headerList ); - CreateClientL ( this, aRemoteDeviceAddr, aRemotePort, headerList ); - CleanupStack::Pop(); - headerList.Close(); - - FLOG(_L("[BTSS]\t CBTSOPPController::ConstructL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSOPPController::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBTSOPPController* CBTSOPPController::NewL( MBTServiceObserver* aObserver, - const TUint aRemotePort, - const TBTDevAddr& aRemoteDeviceAddr, - CBTServiceParameterList* aList ) - { - CBTSOPPController* self = new( ELeave ) CBTSOPPController( aObserver, aList ); - CleanupStack::PushL( self ); - self->ConstructL( aRemotePort, aRemoteDeviceAddr ); - CleanupStack::Pop(); - return self; - } - -// Destructor -CBTSOPPController::~CBTSOPPController() - { - FLOG(_L("[BTSU]\t CBTSOPPController::Destructor()")); - } - -// ----------------------------------------------------------------------------- -// CBTSOPPController::ConnectCompleted -// ----------------------------------------------------------------------------- -// -void CBTSOPPController::ConnectCompleted( TInt aStatus ) - { - FLOG(_L("[BTSS]\t CBTSOPPController::ConnectCompleted()")); - - if ( aStatus == KErrNone ) - { - TRAPD( error, HandleConnectCompleteIndicationL() ); - if ( error != KErrNone ) - { - // Sending initialisation has failed - // - iObserverPtr->ControllerComplete( EBTSConnectingFailed ); - } - } - else - { - //Error on Obex level - // - iObserverPtr->ControllerComplete( EBTSConnectingFailed ); - } - - FLOG(_L("[BTSS]\t CBTSOPPController::ConnectCompleted() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSOPPController::ClientConnectionClosed -// ----------------------------------------------------------------------------- -// -void CBTSOPPController::ClientConnectionClosed() - { - FLOG(_L("[BTSS]\t CBTSOPPController::ClientConnectionClosed()")); - - // Everything ready, stop service - // - iObserverPtr->ControllerComplete( EBTSNoError ); - - FLOG(_L("[BTSS]\t CBTSOPPController::ClientConnectionClosed() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSOPPController::PutCompleted -// ----------------------------------------------------------------------------- -// -void CBTSOPPController::PutCompleted( TInt aStatus, const CObexHeaderSet* aPutResponse ) - { - FLOG(_L("[BTSS]\t CBTSOPPController::PutCompleted()")); - aPutResponse=aPutResponse; - - - if ( aStatus == KErrNone ) - { - iFileIndex++; - Send(); - } - else - { - iObserverPtr->ControllerComplete( EBTSPuttingFailed ); - } - - FLOG(_L("[BTSS]\t CBTSOPPController::PutCompleted() done")); - } - -// ----------------------------------------------------------------------------- -// CBTSOPPController::GetCompleted -// ----------------------------------------------------------------------------- -// -void CBTSOPPController::GetCompleted( TInt /*aStatus*/, CObexBufObject* /*aGetResponse*/ ) - { - FLOG(_L("[BTSS]\t CBTSOPPController::GetCompleted() Not used with OPP")); - } - -// ----------------------------------------------------------------------------- -// CBTSOPPController::Send -// ----------------------------------------------------------------------------- -// -void CBTSOPPController::Send() - { - FLOG(_L("[BTSS]\t CBTSOPPController::Send()")); - - - if ( iListPtr->ObjectCount() > 0 && iFileIndex < iListPtr->ObjectCount() ) - { - RArray headerList; // the array does not need to be closed - TRAPD( error, iClient->PutObjectL( headerList, iListPtr->ObjectAtL( iFileIndex ) )); - - if ( error ) - { - FTRACE(FPrint(_L("[BTSU]\t CBTSOPPController::Send() putting leaved with %d"), error )); - iObserverPtr->ControllerComplete( EBTSPuttingFailed ); - } - } - else - { - FLOG(_L("[BTSU]\t CBTSOPPController::Send() all objects sent, closing connection")); - - // All objects sent, close client connection. - // - iClient->CloseClientConnection(); - } - - FLOG(_L("[BTSS]\t CBTSOPPController::Send() Done")); - } - -//----------------------------------------------------------------------------- -// void CBTSOPPController::ConnectTimedOut() -// ----------------------------------------------------------------------------- -// -void CBTSOPPController::ConnectTimedOut() - { - iObserverPtr->ConnectTimedOut(); - } - -// ----------------------------------------------------------------------------- -// CBTSOPPController::HandleConnectCompleteIndicationL -// ----------------------------------------------------------------------------- -// -void CBTSOPPController::HandleConnectCompleteIndicationL() - { - FLOG(_L("[BTSS]\t CBTSOPPController::HandleConnectCompleteIndicationL()")); - TBTSUImageParam imgparam; - if ( iListPtr->ImageCount() > 0 ) - { - for( TInt index = 0; index < iListPtr->ImageCount(); index++ ) - { - // Copy files from Image list to Object list - // from now on we use only object list. - imgparam = iListPtr->ImageAtL( index ); - if(!imgparam.iSend) - { - iListPtr->AddObjectL( imgparam.iFile); - } - } - } - iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ObjectListSizeL() ); - iFileIndex = 0; - Send(); - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSUCapabilityResolver.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSUCapabilityResolver.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,377 +0,0 @@ -/* -* Copyright (c) 2002 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: Capability resolver implementation -* -*/ - - -// INCLUDE FILES -#include "BTServiceUtils.h" -#include "BTSUCapabilityResolver.h" -#include "BTSUDebug.h" -#include - - -// CONSTANTS - -_LIT8( KBTSUImageTag, "image-formats" ); -_LIT8( KBTSUAttributeEncoding, "encoding" ); -_LIT8( KBTSUAttributePixel, "pixel" ); -_LIT8( KBTSUAttributeMaxSize,"maxsize"); -_LIT(minus,"-"); -_LIT(star,"*"); - - - - -#define INVALIDVALUE -1 -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CBTSBIPController::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBTSUCapabilityResolver* CBTSUCapabilityResolver::NewL(CDesCArrayFlat* aCapabilityList) - { - CBTSUCapabilityResolver* self = new( ELeave ) CBTSUCapabilityResolver( aCapabilityList ); - CleanupStack::PushL( self ); - self->ConstructL( ); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// CBTSBIPController::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBTSUCapabilityResolver* CBTSUCapabilityResolver::NewL(RArray* aCapabilityList) - { - CBTSUCapabilityResolver* self = new( ELeave ) CBTSUCapabilityResolver( aCapabilityList ); - CleanupStack::PushL( self ); - self->ConstructL( ); - CleanupStack::Pop(self); - return self; - } -// ----------------------------------------------------------------------------- -// CBTSUCapabilityResolver::CBTSUCapabilityResolver -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CBTSUCapabilityResolver::CBTSUCapabilityResolver( CDesCArrayFlat* aCapabilityList ) - { - aCapabilityList=aCapabilityList; - } -// ----------------------------------------------------------------------------- -// CBTSUCapabilityResolver::CBTSUCapabilityResolver -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CBTSUCapabilityResolver::CBTSUCapabilityResolver( - RArray* aCapabilityList ) : iCapabilityList( aCapabilityList ) - { - } - -// ----------------------------------------------------------------------------- -// CBTSBIPController::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CBTSUCapabilityResolver::ConstructL () - { - } - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -CBTSUCapabilityResolver::~CBTSUCapabilityResolver() - { - } - -// ----------------------------------------------------------------------------- -// CBTSUCapabilityResolver::StartDocument -// ----------------------------------------------------------------------------- -// -void CBTSUCapabilityResolver::OnStartDocumentL(const Xml::RDocumentParameters& /*aDocParam*/, TInt aErrorCode) - { - FLOG(_L("[BTSU]\t CBTSUCapabilityResolver::OnStartDocumentL()")); - if(aErrorCode!=KErrNone) - { - FLOG(_L("[BTSU]\t Error OnStartDocument")); - } - iCompleted=EFalse; - } - -// ----------------------------------------------------------------------------- -// CBTSUCapabilityResolver::EndDocument -// ----------------------------------------------------------------------------- -// -void CBTSUCapabilityResolver::OnEndDocumentL(TInt aErrorCode) - { - FLOG(_L("[BTSU]\t CBTSUCapabilityResolver::OnEndDocumentL()")); - if(aErrorCode!=KErrNone) - { - FLOG(_L("[BTSU]\t Error EndDocument")); - } - } - -// ----------------------------------------------------------------------------- -// CBTSUCapabilityResolver::StartElement -// ----------------------------------------------------------------------------- -// -void CBTSUCapabilityResolver::OnStartElementL(const Xml::RTagInfo& aElement, const Xml::RAttributeArray& aAttributes, - TInt /*aErrorCode*/) - { - - TBool status = EFalse; - TBTSUImageCap param; - TLex lex; - TPtrC sizemaxwidth; - TPtrC sizemaxheight; - TPtrC sizeminwidth; - TPtrC sizeminheight; - TPtrC sizemin; - TPtrC sizemax; - TInt index; - HBufC* enc; - param.iMaxByteSize=0; - - TBuf conversionBuf; - - if( aElement.LocalName().DesC() != KBTSUImageTag ) - { - return; - } - - - if(aAttributes.Count()>0) - { - - param.iEncoding=NULL; - param.iMaxByteSize=-1; - param.iMinPixelSize.iHeight=INVALIDVALUE; - param.iMinPixelSize.iWidth=INVALIDVALUE; - param.iMaxPixelSize.iWidth=INVALIDVALUE; - param.iMaxPixelSize.iHeight=INVALIDVALUE; - - //Check and add to attribute list if there is encoding - for ( TInt iCounter = 0 ; iCounter < aAttributes.Count() ; iCounter++ ) - { - if ( aAttributes[iCounter].Attribute().LocalName().DesC() == KBTSUAttributeEncoding ) - { - User::LeaveIfError( CnvUtfConverter::ConvertToUnicodeFromUtf8( conversionBuf, aAttributes[iCounter].Value().DesC())); - - if (conversionBuf.Length()>0) - { - enc=conversionBuf.Alloc(); - TPtr rwdata(enc->Des()); - rwdata.Copy(conversionBuf); - param.iEncoding=enc; - if (param.iEncoding!=NULL) - { - status=ETrue; - } - } - } - } - conversionBuf = KNullDesC; - for ( TInt iCounter = 0 ; iCounter < aAttributes.Count() ; iCounter++ ) - { - if ( aAttributes[iCounter].Attribute().LocalName().DesC() == KBTSUAttributePixel ) - { ; - User::LeaveIfError( CnvUtfConverter::ConvertToUnicodeFromUtf8( conversionBuf, aAttributes[iCounter].Value().DesC())); - } - } - - if(conversionBuf.Length()>1) - { - index=conversionBuf.Find(minus); - if(index!=KErrNotFound) //max size is given - { - sizemin.Set(conversionBuf.Left(index)); - sizemax.Set(conversionBuf.Right(conversionBuf.Length()-index-1)); - //solve min size - index=sizemin.Find(star); - if(index!=KErrNotFound) - { - sizeminwidth.Set(sizemin.Left(index)); - sizeminheight.Set(sizemin.Right(sizemin.Length()-index-1)); - - lex.Assign(sizeminwidth); - lex.Val(param.iMinPixelSize.iHeight); - - lex.Assign(sizeminheight); - lex.Val(param.iMinPixelSize.iWidth); - } - //solve max size - index=sizemax.Find(star); - if(index!=KErrNotFound) - { - sizemaxwidth.Set(sizemax.Left(index)); - sizemaxheight.Set(sizemax.Right(sizemax.Length()-index-1)); - - lex.Assign(sizemaxwidth); - lex.Val(param.iMaxPixelSize.iWidth); - - lex.Assign(sizemaxheight); - lex.Val(param.iMaxPixelSize.iHeight); - status=ETrue; - } - } - else //if max size not given - { - index=conversionBuf.Find(star); - if(index!=KErrNotFound) - { - //solve min size - TPtrC sizeminwidth=conversionBuf.Left( index ); - TPtrC sizeminheight=conversionBuf.Right( conversionBuf.Length() - index-1); - - lex.Assign(sizeminwidth); - lex.Val(param.iMinPixelSize.iWidth); - - lex.Assign(sizeminheight); - lex.Val(param.iMinPixelSize.iHeight); - //set max size - param.iMaxPixelSize.iWidth=param.iMinPixelSize.iWidth; - param.iMaxPixelSize.iHeight=param.iMinPixelSize.iHeight; - status=ETrue; - } - } - } - - - //Check and add to attribute list if there is maxsize - TPtrC maxsizevalue; - conversionBuf = KNullDesC; - for ( TInt iCounter = 0 ; iCounter < aAttributes.Count() ; iCounter++ ) - { - if ( aAttributes[iCounter].Attribute().LocalName().DesC() == KBTSUAttributeMaxSize ) - { - User::LeaveIfError( CnvUtfConverter::ConvertToUnicodeFromUtf8( conversionBuf, aAttributes[iCounter].Value().DesC())); - } - } - - - if (conversionBuf.Length()>0) - { - lex.Assign(conversionBuf); - lex.Val(param.iMaxByteSize); - } - - if(status) - { - iCapabilityList->Append(param); //add to list - } - - } - - } - -// ----------------------------------------------------------------------------- -// CBTSUCapabilityResolver::OnEndElementL -// ----------------------------------------------------------------------------- -// -void CBTSUCapabilityResolver::OnEndElementL(const Xml::RTagInfo& /*aElement*/, TInt aErrorCode) - { - FLOG(_L("[BTSU]\t CBTSUCapabilityResolver::EndElement()")); - if(aErrorCode==KErrNone) - { - iCompleted=ETrue; - } - FLOG(_L("[BTSU]\t CBTSUCapabilityResolver::EndElement()")); - - } - -// ----------------------------------------------------------------------------- -// CBTSUCapabilityResolver::OnContentL -// ----------------------------------------------------------------------------- -// -void CBTSUCapabilityResolver::OnContentL(const TDesC8& /*aBytes*/, TInt /*aErrorCode*/) - { - } - -// ----------------------------------------------------------------------------- -// CBTSUCapabilityResolver::OnStartPrefixMappingL -// ----------------------------------------------------------------------------- -// -void CBTSUCapabilityResolver::OnStartPrefixMappingL(const RString& /*aPrefix*/, const RString& /*aUri*/, - TInt /*aErrorCode*/) - { - } - -// ----------------------------------------------------------------------------- -// CBTSUCapabilityResolver::OnEndPrefixMappingL -// ----------------------------------------------------------------------------- -// -void CBTSUCapabilityResolver::OnEndPrefixMappingL(const RString& /*aPrefix*/, TInt /*aErrorCode*/) - { - } - -// ----------------------------------------------------------------------------- -// CBTSUCapabilityResolver::OnIgnorableWhiteSpaceL -// ----------------------------------------------------------------------------- -// -void CBTSUCapabilityResolver::OnIgnorableWhiteSpaceL(const TDesC8& /*aBytes*/, TInt /*aErrorCode*/) - { - } - -// ----------------------------------------------------------------------------- -// CBTSUCapabilityResolver::OnSkippedEntityL -// ----------------------------------------------------------------------------- -// -void CBTSUCapabilityResolver::OnSkippedEntityL(const RString& /*aName*/, TInt /*aErrorCode*/) - { - } - -// ----------------------------------------------------------------------------- -// CBTSUCapabilityResolver::OnProcessingInstructionL -// ----------------------------------------------------------------------------- -// -void CBTSUCapabilityResolver::OnProcessingInstructionL(const TDesC8& /*aTarget*/, const TDesC8& /*aData*/, - TInt /*aErrorCode*/) - { - } - -// ----------------------------------------------------------------------------- -// CBTSUCapabilityResolver::OnError -// ----------------------------------------------------------------------------- -// -void CBTSUCapabilityResolver::OnError(TInt /*aErrorCode*/) - { - } - -// ----------------------------------------------------------------------------- -// CBTSUCapabilityResolver::GetExtendedInterface -// ----------------------------------------------------------------------------- -// -TAny* CBTSUCapabilityResolver::GetExtendedInterface(const TInt32 /*aUid*/) - { - return NULL; - } - -// ----------------------------------------------------------------------------- -// CBTSUCapabilityResolver::IsCompleted -// ----------------------------------------------------------------------------- - -TBool CBTSUCapabilityResolver::IsCompleted() - { - return iCompleted; - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSUDataConverter.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSUDataConverter.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* Copyright (c) 2002 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: Data converter implementation -* -*/ - - -// INCLUDE FILES -#include "BTSUDataConverter.h" -#include // for BigEndian functions -#include "BTSUDebug.h" - -// CONSTANTS - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// TBTSUDataConverter::ConvertByteL -// ----------------------------------------------------------------------------- -// -TUint8 TBTSUDataConverter::ConvertByteL( const TPtrC8& aData ) - { - if ( aData.Length() != sizeof(TUint8) ) - { - User::Leave( KErrArgument ); - } - return *aData.Ptr(); - } - -// ----------------------------------------------------------------------------- -// TBTSUDataConverter::ConvertDataSignedL -// ----------------------------------------------------------------------------- -// -TInt32 TBTSUDataConverter::ConvertDataSignedL( const TPtrC8& aData ) - { - if ( aData.Length() != sizeof(TInt32) ) - { - User::Leave( KErrArgument ); - } - TUint32 rawVal = BigEndian::Get32(aData.Ptr()); - return *reinterpret_cast(&rawVal); // reinterpret cast to extract signed nature "unscathed" - } - -// ----------------------------------------------------------------------------- -// TBTSUDataConverter::ConvertDataUnsignedL -// ----------------------------------------------------------------------------- -// -TUint32 TBTSUDataConverter::ConvertDataUnsignedL( const TPtrC8& aData ) - { - if ( aData.Size() != sizeof(TUint32) ) - { - User::Leave( KErrArgument ); - } - return BigEndian::Get32(aData.Ptr()); - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSUImageConverter.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSUImageConverter.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,349 +0,0 @@ -/* -* Copyright (c) 2002 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: Tools for image conversion. -* -*/ - - -// INCLUDE FILES -#include "BTServiceUtils.h" -#include "BTSUImageConverter.h" -#include "BTSUDebug.h" - -#include -#include - -//CONSTANTS -_LIT8( KBTSUImageTypeJpeg, "image/jpeg" ); -const TInt KBTSUJpegQualityFactor = 90; -const TInt KBTSUImageThumbWidth = 160; -const TInt KBTSUImageThumbHeight = 120; - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CBTSUImageConverter::CBTSUImageConverter -// Constructor. -// ----------------------------------------------------------------------------- -// -CBTSUImageConverter::CBTSUImageConverter(): CActive( EPriorityStandard ) - { - CActiveScheduler::Add( this ); - } - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -CBTSUImageConverter::~CBTSUImageConverter() - { - FLOG(_L("[BTSU]\t CBTSUImageConverter::~CBTSUImageConverter()")); - - Cancel(); - Reset(); - iFileSession.Close(); - - FLOG(_L("[BTSU]\t CBTSUImageConverter::~CBTSUImageConverter() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSUImageConverter::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBTSUImageConverter* CBTSUImageConverter::NewL() - { - CBTSUImageConverter* self = new (ELeave) CBTSUImageConverter; - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - -// ----------------------------------------------------------------------------- -// CBTSUImageConverter::ConstructL -// Symbian 2nd phase constructor. -// ----------------------------------------------------------------------------- -// -void CBTSUImageConverter::ConstructL() - { - FLOG(_L("[BTSU]\t CBTSUImageConverter::ConstructL()")); - - User::LeaveIfError( iFileSession.Connect() ); - iFileSession.ShareProtected(); - - FLOG(_L("[BTSU]\t CBTSUImageConverter::ConstructL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSUImageConverter::GetImageSizeL -// ----------------------------------------------------------------------------- -// -TSize CBTSUImageConverter::GetImageSizeL( RFile& aImageFile ) - { - FLOG(_L("[BTSU]\t CBTSUImageConverter::GetImageSizeL()")); - - CImageDecoder* decoder = CImageDecoder::FileNewL(aImageFile,ContentAccess::EPeek ); - TSize size = decoder->FrameInfo().iOverallSizeInPixels; - delete decoder; - - FTRACE(FPrint(_L("[BTSU]\t CBTSUImageConverter::GetImageSizeL() completed w=%d h=%d"), size.iWidth, size.iHeight )); - - return size; - } - -// ----------------------------------------------------------------------------- -// CBTSUImageConverter::CreateThumbnailL -// ----------------------------------------------------------------------------- -// -void CBTSUImageConverter::CreateThumbnailL( RFile& aSourceFile, - const TDesC& aDestFile ) - { - FLOG(_L("[BTSU]\t CBTSUImageConverter::CreateThumbnailL()")); - - - Reset(); - DecodeImageL( aSourceFile ); - ScaleImageL(); - EncodeImageL( aDestFile, ETrue ); - Reset(); - - FLOG(_L("[BTSU]\t CBTSUImageConverter::CreateThumbnailL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSUImageConverter::GetDisplayNameL -// ----------------------------------------------------------------------------- -// -HBufC* CBTSUImageConverter::GetDisplayNameL( const TDesC8& aMimeType ) - { - FLOG(_L("[BTSU]\t CBTSUImageConverter::GetDisplayNameL()")); - - if ( &aMimeType == NULL || - aMimeType.Length() == 0 || - aMimeType.Length() > KMaxFileName ) - { - User::Leave( KErrArgument ); - } - - HBufC* name = NULL; - - // Get file types from decoder - // - RFileExtensionMIMETypeArray fileTypes; - CleanupResetAndDestroyPushL( fileTypes ); - CImageDecoder::GetFileTypesL( fileTypes ); - - // Find the display name for the mime type - // - for( TInt index = 0; index < fileTypes.Count(); index++ ) - { - if ( fileTypes[index]->MIMEType() == aMimeType ) - { - name = fileTypes[index]->DisplayName().AllocL(); - break; - } - } - - CleanupStack::PopAndDestroy(); // fileTypes - - if ( name == NULL ) - { - // No display name found, so the image type is not supported. - // - User::Leave( KErrNotSupported ); - } - - FLOG(_L("[BTSU]\t CBTSUImageConverter::GetDisplayNameL() completed")); - - return name; - } - - -// ----------------------------------------------------------------------------- -// CBTSUImageConverter::DoCancel -// ----------------------------------------------------------------------------- -// -void CBTSUImageConverter::DoCancel() - { - FLOG(_L("[BTSU]\t CBTSUImageConverter::DoCancel()")); - - if ( iDecoder ) - { - iDecoder->Cancel(); - } - if ( iScaler ) - { - iScaler->Cancel(); - } - if ( iEncoder ) - { - iEncoder->Cancel(); - } - - FLOG(_L("[BTSU]\t CBTSUImageConverter::DoCancel() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSUImageConverter::RunL -// ----------------------------------------------------------------------------- -// -void CBTSUImageConverter::RunL() - { - FTRACE(FPrint(_L("[BTSU]\t CBTSUImageConverter::RunL() %d"), iStatus.Int() )); - - iWait.AsyncStop(); - - FLOG(_L("[BTSU]\t CBTSUImageConverter::RunL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSUImageConverter::DecodeImageL -// ----------------------------------------------------------------------------- -// -void CBTSUImageConverter::DecodeImageL( RFile& aSourceFile ) - { - FLOG(_L("[BTSU]\t CBTSUImageConverter::DecodeImageL( )")); - - __ASSERT_DEBUG( iDecoder == NULL, BTSUPanic( EBTSUPanicExistingObject ) ); - __ASSERT_DEBUG( iFrameBitmap == NULL, BTSUPanic( EBTSUPanicExistingObject ) ); - - // Create decoder - // - iDecoder = CImageDecoder::FileNewL(aSourceFile, ContentAccess::EPeek ); - - // Create a bitmap - // - iFrameBitmap = new ( ELeave ) CFbsBitmap; - User::LeaveIfError( iFrameBitmap->Create( - iDecoder->FrameInfo().iOverallSizeInPixels, - iDecoder->FrameInfo().iFrameDisplayMode ) ); - - // Start decoding - // - iDecoder->Convert( &iStatus, *iFrameBitmap ); - SetActive(); - - iWait.Start(); // Wait here until decoding is completed - User::LeaveIfError( iStatus.Int() ); - - FLOG(_L("[BTSU]\t CBTSUImageConverter::DecodeImageL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSUImageConverter::EncodeImageL -// ----------------------------------------------------------------------------- -// -void CBTSUImageConverter::EncodeImageL( const TDesC& aDestFile, - const TBool& aThumbnail ) - { - FLOG(_L("[BTSU]\t CBTSUImageConverter::EncodeImageL()")); - - __ASSERT_DEBUG( iDecoder != NULL, BTSUPanic( EBTSUPanicNullPointer ) ); - __ASSERT_DEBUG( iEncoder == NULL, BTSUPanic( EBTSUPanicExistingObject ) ); - __ASSERT_DEBUG( iFrameImageData == NULL, BTSUPanic( EBTSUPanicExistingObject ) ); - - // Create encoder - // - iEncoder = CImageEncoder::FileNewL( iFileSession, aDestFile, KBTSUImageTypeJpeg() ); - - // Create frame image data - // - iFrameImageData = CFrameImageData::NewL(); - TJpegImageData* jpegFormat = new ( ELeave ) TJpegImageData; - CleanupStack::PushL( jpegFormat ); - - jpegFormat->iSampleScheme = TJpegImageData::EColor422; - jpegFormat->iQualityFactor = KBTSUJpegQualityFactor; - User::LeaveIfError( iFrameImageData->AppendImageData( jpegFormat ) ); - CleanupStack::Pop( jpegFormat ); - - // Start encoding - // - if ( aThumbnail ) - { - __ASSERT_DEBUG( iScaledBitmap != NULL, BTSUPanic( EBTSUPanicNullPointer ) ); - iEncoder->Convert( &iStatus, *iScaledBitmap, iFrameImageData ); - } - else - { - __ASSERT_DEBUG( iFrameBitmap != NULL, BTSUPanic( EBTSUPanicNullPointer ) ); - iEncoder->Convert( &iStatus, *iFrameBitmap, iFrameImageData ); - } - - SetActive(); - iWait.Start(); // Wait here until encoding is completed - User::LeaveIfError( iStatus.Int() ); - - FLOG(_L("[BTSU]\t CBTSUImageConverter::EncodeImageL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSUImageConverter::ScaleImageL -// ----------------------------------------------------------------------------- -// -void CBTSUImageConverter::ScaleImageL() - { - FLOG(_L("[BTSU]\t CBTSUImageConverter::ScaleImageL( )")); - - __ASSERT_DEBUG( iDecoder != NULL, BTSUPanic( EBTSUPanicNullPointer ) ); - __ASSERT_DEBUG( iFrameBitmap != NULL, BTSUPanic( EBTSUPanicNullPointer ) ); - __ASSERT_DEBUG( iScaler == NULL, BTSUPanic( EBTSUPanicExistingObject ) ); - __ASSERT_DEBUG( iScaledBitmap == NULL, BTSUPanic( EBTSUPanicExistingObject ) ); - - // Create scaler - // - iScaler = CBitmapScaler::NewL(); - - // Create a bitmap - // - iScaledBitmap = new ( ELeave ) CFbsBitmap; - TSize size; - size.iWidth = KBTSUImageThumbWidth; - size.iHeight = KBTSUImageThumbHeight; - User::LeaveIfError( iScaledBitmap->Create( size, - iDecoder->FrameInfo().iFrameDisplayMode ) ); - - // Start scaling - // - iScaler->Scale( &iStatus, *iFrameBitmap, *iScaledBitmap, EFalse ); - SetActive(); - - iWait.Start(); // Wait here until scaling is completed - User::LeaveIfError( iStatus.Int() ); - - FLOG(_L("[BTSU]\t CBTSUImageConverter::ScaleImageL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSUImageConverter::Reset -// ----------------------------------------------------------------------------- -// -void CBTSUImageConverter::Reset() - { - FLOG(_L("[BTSU]\t CBTSUImageConverter::Reset()")); - - delete iDecoder; iDecoder = NULL; - delete iEncoder; iEncoder = NULL; - delete iScaler; iScaler = NULL; - - delete iFrameImageData; iFrameImageData = NULL; - delete iFrameBitmap; iFrameBitmap = NULL; - delete iScaledBitmap; iScaledBitmap = NULL; - - FLOG(_L("[BTSU]\t CBTSUImageConverter::Reset() completed")); - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSUPassKeyRequest.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSUPassKeyRequest.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -/* -* Copyright (c) 2002 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: CBTSUPasskeyRequest implementation -* -*/ - - -// INCLUDE FILES -#include "BTSUPassKeyRequest.h" -#include "BTSUDebug.h" -#include "BTServiceUtils.h" - -#include - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CBTSUPasskeyRequest::CBTSUPasskeyRequest -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CBTSUPasskeyRequest::CBTSUPasskeyRequest() : CActive(EPriorityNormal) - { - CActiveScheduler::Add( this ); - } - -// Destructor -CBTSUPasskeyRequest::~CBTSUPasskeyRequest() - { - FLOG(_L("[BTSU]\t CBTSUPasskeyRequest::~CBTSUPasskeyRequest")); - - Cancel(); // Make sure we're cancelled - iNotif.Close(); - - FLOG(_L("[BTSU]\t CBTSUPasskeyRequest:~CBTSUPasskeyRequest completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSUPasskeyRequest::DoCancel() -// ----------------------------------------------------------------------------- -// -void CBTSUPasskeyRequest::DoCancel() - { - FLOG(_L("[BTSU]\t CBTSUPasskeyRequest::DoCancel")); - - iNotif.CancelNotifier( KBTObexPasskeyQueryNotifierUid ); - iNotif.Close(); - - FLOG(_L("[BTSU]\t CBTSUPasskeyRequest::DoCancel completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSUPasskeyRequest::RunL() -// ----------------------------------------------------------------------------- -// -void CBTSUPasskeyRequest::RunL() - { - FTRACE(FPrint(_L( "[BTSU]\t CBTSUPasskeyRequest::RunL status %d"), iStatus.Int() )); - - if ( iStatus.Int() == KErrNone ) - { - TBuf tempResultBuffer; - CnvUtfConverter::ConvertToUnicodeFromUtf8( tempResultBuffer, iObexPasskey() ); - iObexClient->UserPasswordL( tempResultBuffer ); - - FTRACE(FPrint(_L("[BTSU]\t CBTSUPasskeyRequest::RunL user entered '%S'"), &tempResultBuffer )); - } - else - { - iObexClient->Error( KErrCancel ); - } - - iNotif.CancelNotifier( KBTObexPasskeyQueryNotifierUid ); - iNotif.Close(); - - FLOG(_L("[BTSU]\t CBTSUPasskeyRequest::RunL completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSUPasskeyRequest::RunError() -// ----------------------------------------------------------------------------- -// -TInt CBTSUPasskeyRequest::RunError() - { - FLOG(_L("[BTSU]\t CBTSUPasskeyRequest::RunError")); - - iNotif.CancelNotifier( KBTObexPasskeyQueryNotifierUid ); - iNotif.Close(); - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CBTSUPasskeyRequest::StartPassKeyRequestL() -// ----------------------------------------------------------------------------- -// -void CBTSUPasskeyRequest::StartPassKeyRequestL( CObexClient* aObexClient ) - { - FLOG(_L("[BTSU]\t CBTSUPasskeyRequest::StartPassKeyRequestL")); - __ASSERT_DEBUG( aObexClient != NULL, BTSUPanic( EBTSUPanicNullPointer ) ); - - User::LeaveIfError( iNotif.Connect() ); - TPtrC8 dummy( KNullDesC8 ); - - // Starts notifier and gets the passkey for Obex - iNotif.StartNotifierAndGetResponse( iStatus, KBTObexPasskeyQueryNotifierUid, dummy, iObexPasskey ); - iObexClient = aObexClient; - SetActive(); - - FLOG(_L("[BTSU]\t CBTSUPasskeyRequest::StartPassKeyRequestL completed")); - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSURefObjectResolver.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSURefObjectResolver.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,249 +0,0 @@ -/* -* Copyright (c) 2002 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: Reference object resolver -* -*/ - - -// INCLUDE FILES -#include "BTServiceUtils.h" -#include "BTSURefObjectResolver.h" -#include "BTSUDebug.h" -#include - -// CONSTANTS -_LIT8( KBTSUElementImage, "img" ); -_LIT8( KBTSUElementLink, "link" ); -_LIT8( KBTSUElementObject, "object" ); - -_LIT8( KBTSUAttributeSrc, "src" ); -_LIT8( KBTSUAttributeData, "data" ); -_LIT8( KBTSUAttributeHref, "href" ); - -// ============================ MEMBER FUNCTIONS =============================== - - -// ----------------------------------------------------------------------------- -// CBTSURefObjectResolver::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBTSURefObjectResolver* CBTSURefObjectResolver::NewL(CDesCArrayFlat* aCapabilityList) - { - CBTSURefObjectResolver* self = new( ELeave ) CBTSURefObjectResolver( aCapabilityList ); - CleanupStack::PushL( self ); - self->ConstructL( ); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// CBTSURefObjectResolver::CBTSURefObjectResolver -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CBTSURefObjectResolver::CBTSURefObjectResolver( - CDesCArrayFlat* aObjectList ) : iObjectList( aObjectList ) - { - } - - // ----------------------------------------------------------------------------- -// CBTSURefObjectResolver::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CBTSURefObjectResolver::ConstructL () - { - } - - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -CBTSURefObjectResolver::~CBTSURefObjectResolver() - { - } - -// ----------------------------------------------------------------------------- -// CBTSURefObjectResolver::OnStartDocumentL -// ----------------------------------------------------------------------------- -// -void CBTSURefObjectResolver::OnStartDocumentL(const Xml::RDocumentParameters& /*aDocParam*/, TInt aErrorCode) - { - FLOG(_L("[BTSU]\t CBTSURefObjectResolver::OnStartDocumentL()")); - if(aErrorCode!=KErrNone) - { - FLOG(_L("[BTSU]\t Error OnStartDocument")); - } - - } - -// ----------------------------------------------------------------------------- -// CBTSURefObjectResolver::OnEndDocumentL -// ----------------------------------------------------------------------------- -// -void CBTSURefObjectResolver::OnEndDocumentL(TInt aErrorCode) - { - FLOG(_L("[BTSU]\t CBTSURefObjectResolver::EndDocument()")); - if(aErrorCode!=KErrNone) - { - FLOG(_L("[BTSU]\t Error EndDocument")); - } - } - -// ----------------------------------------------------------------------------- -// CBTSURefObjectResolver::StartElement -// If a certain element has a certain attribute, append the attribute's -// value into the object list. -// ----------------------------------------------------------------------------- -// -void CBTSURefObjectResolver::OnStartElementL(const Xml::RTagInfo& aElement, const Xml::RAttributeArray& aAttributes, - TInt aErrorCode) - { - - if(aErrorCode!=KErrNone) - { - FLOG(_L("[BTSU]\t Error OnStartElementL")); - } - - RString aLocalName = aElement.LocalName(); - - TBuf conversionBuf; - // Images - // - if ( aLocalName.DesC() == KBTSUElementImage /*|| aName == KBTSUElementImage()*/ ) - - { - // Check the attributes - for ( TInt iCounter = 0 ; iCounter < aAttributes.Count() ; iCounter++ ) - { - if ( aAttributes[iCounter].Attribute().LocalName().DesC() == KBTSUAttributeSrc ) - { - User::LeaveIfError( CnvUtfConverter::ConvertToUnicodeFromUtf8( conversionBuf, aAttributes[iCounter].Value().DesC() )); - if(conversionBuf.Length()) - iObjectList->AppendL(conversionBuf ); - } - } - - } - else if ( aLocalName.DesC() == KBTSUElementObject() /*|| aName == KBTSUElementObject() */) - { - for ( TInt iCounter = 0 ; iCounter < aAttributes.Count() ; iCounter++ ) - { - if ( aAttributes[iCounter].Attribute().LocalName().DesC() == KBTSUAttributeData ) - { - User::LeaveIfError( CnvUtfConverter::ConvertToUnicodeFromUtf8( conversionBuf, aAttributes[iCounter].Value().DesC() )); - if(conversionBuf.Length()) - iObjectList->AppendL(conversionBuf ); - } - } - } - - // Other objects - // - else if ( aLocalName.DesC() == KBTSUElementLink() /*|| aName == KBTSUElementLink() */) - { - for ( TInt iCounter = 0 ; iCounter < aAttributes.Count() ; iCounter++ ) - { - if ( aAttributes[iCounter].Attribute().LocalName().DesC() == KBTSUAttributeHref ) - { - User::LeaveIfError( CnvUtfConverter::ConvertToUnicodeFromUtf8( conversionBuf, aAttributes[iCounter].Value().DesC() )); - if(conversionBuf.Length()) - iObjectList->AppendL(conversionBuf ); - - } - } - } - - } - -// ----------------------------------------------------------------------------- -// CBTSURefObjectResolver::OnEndElementL -// ----------------------------------------------------------------------------- -// -void CBTSURefObjectResolver::OnEndElementL(const Xml::RTagInfo& /*aElement*/, TInt /*aErrorCode*/) - { - } - -// ----------------------------------------------------------------------------- -// CBTSURefObjectResolver::OnContentL -// ----------------------------------------------------------------------------- -// -void CBTSURefObjectResolver::OnContentL(const TDesC8& /*aBytes*/, TInt /*aErrorCode*/) - { - } - -// ----------------------------------------------------------------------------- -// CBTSURefObjectResolver::OnStartPrefixMappingL -// ----------------------------------------------------------------------------- -// -void CBTSURefObjectResolver::OnStartPrefixMappingL(const RString& /*aPrefix*/, const RString& /*aUri*/, - TInt /*aErrorCode*/) - { - } - -// ----------------------------------------------------------------------------- -// CBTSURefObjectResolver::OnEndPrefixMappingL -// ----------------------------------------------------------------------------- -// -void CBTSURefObjectResolver::OnEndPrefixMappingL(const RString& /*aPrefix*/, TInt /*aErrorCode*/) - { - } - -// ----------------------------------------------------------------------------- -// CBTSURefObjectResolver::OnIgnorableWhiteSpaceL -// ----------------------------------------------------------------------------- -// -void CBTSURefObjectResolver::OnIgnorableWhiteSpaceL(const TDesC8& /*aBytes*/, TInt /*aErrorCode*/) - { - } - -// ----------------------------------------------------------------------------- -// CBTSURefObjectResolver::OnSkippedEntityL -// ----------------------------------------------------------------------------- -// -void CBTSURefObjectResolver::OnSkippedEntityL(const RString& /*aName*/, TInt /*aErrorCode*/) - { - } - -// ----------------------------------------------------------------------------- -// CBTSURefObjectResolver::OnProcessingInstructionL -// ----------------------------------------------------------------------------- -// -void CBTSURefObjectResolver::OnProcessingInstructionL(const TDesC8& /*aTarget*/, const TDesC8& /*aData*/, - TInt /*aErrorCode*/) - { - } - -// ----------------------------------------------------------------------------- -// CBTSURefObjectResolver::OnError -// ----------------------------------------------------------------------------- -// -void CBTSURefObjectResolver::OnError(TInt /*aErrorCode*/) - { - } - -// ----------------------------------------------------------------------------- -// CBTSURefObjectResolver::GetExtendedInterface -// ----------------------------------------------------------------------------- -// -TAny* CBTSURefObjectResolver::GetExtendedInterface(const TInt32 /*aUid*/) - { - - return NULL; - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSUXmlParser.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSUXmlParser.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,178 +0,0 @@ -/* -* Copyright (c) 2002 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: XML parser implementation -* -*/ - - -// INCLUDE FILES -#include -#include "BTSUXmlParser.h" -#include "BTServiceUtils.h" -#include "BTSUCapabilityResolver.h" -#include "BTSURefObjectResolver.h" -#include "BTSUDebug.h" - - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CBTSUXmlParser::CBTSUXmlParser -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CBTSUXmlParser::CBTSUXmlParser() - { - } - -// ----------------------------------------------------------------------------- -// CBTSUXmlParser::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CBTSUXmlParser::ConstructL() - { - FLOG(_L("[BTSU]\t CBTSUXmlParser::ConstructL()")); - - User::LeaveIfError( iFileSession.Connect() ); - - FLOG(_L("[BTSU]\t CBTSUXmlParser::ConstructL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSUXmlParser::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBTSUXmlParser* CBTSUXmlParser::NewL() - { - CBTSUXmlParser* self = new( ELeave ) CBTSUXmlParser; - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -CBTSUXmlParser::~CBTSUXmlParser() - { - FLOG(_L("[BTSU]\t CBTSUXmlParser::~CBTSUXmlParser()")); - - iFileSession.Close(); - - FLOG(_L("[BTSU]\t CBTSUXmlParser::~CBTSUXmlParser() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTSUXmlParser::GetCapabilityListL -// ----------------------------------------------------------------------------- -// -CDesCArrayFlat* CBTSUXmlParser::GetCapabilityListL( const TDesC& /*aFileName */) - { - return NULL; - } - -// ----------------------------------------------------------------------------- -// CBTSUXmlParser::GetCapabilityListL -// ----------------------------------------------------------------------------- -// -RArray* CBTSUXmlParser::GetImgCapabilityListL( const TDesC& aFileName ) - { - FLOG(_L("[BTSU]\t CBTSUXmlParser::GetCapabilityListL()")); - - if ( &aFileName == NULL || - aFileName.Length() == 0 || - aFileName.Length() > KMaxFileName ) - { - User::Leave( KErrArgument ); - } - - // Create result array - // - RArray* array = new (ELeave) RArray(); - CleanupStack::PushL( array ); - - // Set content handler - // - CBTSUCapabilityResolver *resolver = CBTSUCapabilityResolver::NewL( array ); - CleanupStack::PushL(resolver); - // Create parser - // - Xml::CParser *parser=Xml::CParser::NewL( _L8( "text/xml" ), *resolver ); - CleanupStack::PushL(parser); - // Parse - // - Xml::ParseL(*parser, iFileSession, aFileName); - - if(!resolver->IsCompleted()) - { - User::Leave(KErrCompletion); - } - - - CleanupStack::PopAndDestroy(2); //parser & resolver - CleanupStack::Pop( array ); - - - FLOG(_L("[BTSU]\t CBTSUXmlParser::GetCapabilityListL() completed")); - - return array; - } - -// ----------------------------------------------------------------------------- -// CBTSUXmlParser::GetRefObjectListL -// ----------------------------------------------------------------------------- -// -CDesCArrayFlat* CBTSUXmlParser::GetRefObjectListL( const TDesC& aFileName ) - { - FLOG(_L("[BTSU]\t CBTSUXmlParser::GetRefObjectListL()")); - - if ( &aFileName == NULL || - aFileName.Length() == 0 || - aFileName.Length() > KMaxFileName ) - { - User::Leave( KErrArgument ); - } - - // Create result array - // - CDesCArrayFlat* array = new (ELeave) CDesCArrayFlat( KBTSUArrayGranularity ); - CleanupStack::PushL( array ); - - // Set content handler - // - CBTSURefObjectResolver *resolver = CBTSURefObjectResolver::NewL( array ); - CleanupStack::PushL(resolver); - // Create parser - // - Xml::CParser *parser = Xml::CParser::NewL( _L8( "text/xml" ), *resolver ); - CleanupStack::PushL( parser ); - // Parse - // - Xml::ParseL(*parser, iFileSession, aFileName); - - CleanupStack::PopAndDestroy(2); // parser & resolver - CleanupStack::Pop( array ); - - FLOG(_L("[BTSU]\t CBTSUXmlParser::GetRefObjectListL() completed")); - - return array; - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceAPI.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceAPI.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/* -* Copyright (c) 2002 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: Btserviceutils API implementation -* -*/ - - - -// INCLUDE FILES -#include "BTServiceAPI.h" -#include "BTServiceStarter.h" -#include "BTSUDebug.h" - -// CONSTANTS - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CBTServiceAPI::CBTServiceAPI -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CBTServiceAPI::CBTServiceAPI() - { - } - -// ----------------------------------------------------------------------------- -// CBTServiceAPI::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CBTServiceAPI::ConstructL() - { - FLOG(_L("[BTSU]\t CBTServiceAPI::ConstructL()")); - iStarter = CBTServiceStarter::NewL(); - } - -// ----------------------------------------------------------------------------- -// CBTServiceAPI::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -EXPORT_C CBTServiceAPI* CBTServiceAPI::NewL() - { - CBTServiceAPI* self = new( ELeave ) CBTServiceAPI(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - -// Destructor -CBTServiceAPI::~CBTServiceAPI() - { - FLOG(_L("[BTSU]\t CBTServiceAPI::Destructor()")); - if ( iStarter ) - { - delete iStarter; - } - FLOG(_L("[BTSU]\t CBTServiceAPI::Destructor() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceAPI::StartServiceL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CBTServiceAPI::StartServiceL( TBTServiceType aService, - CBTServiceParameterList* aList ) - { - FLOG(_L("[BTSU]\t CBTServiceAPI::StartServiceL()")); - - iStarter->StartServiceL( aService, aList ); - - FLOG(_L("[BTSU]\t CBTServiceAPI::StartServiceL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceAPI::StartSynchronousServiceL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CBTServiceAPI::StartSynchronousServiceL( TBTServiceType aService, - CBTServiceParameterList* aList ) - { - FLOG(_L("[BTSU]\t CBTServiceAPI::StartSynchronousServiceL()")); - - iStarter->StartServiceL( aService, aList, &iSyncWaiter); - - - FLOG(_L("[BTSU]\t CBTServiceAPI::StartSynchronousServiceL() Wait for completion")) - iSyncWaiter.Start(); - - FLOG(_L("[BTSU]\t CBTServiceAPI::StartSynchronousServiceL() completed")); - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceClient.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceClient.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,600 +0,0 @@ -/* -* 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" -* 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 client implementation -* -*/ - - - -// INCLUDE FILES -#include // RApaLSession - -#include "BTServiceClient.h" -#include "BTServiceUtils.h" -#include "BTConnectionTimer.h" -#include "BTSUDebug.h" - -const TUint16 KMtuSizeReceiv = 0xFFFF; // 64kB - 1 (65535) -const TUint16 KMtuSizeTrans = 0x8000; // 32kB -const TInt KBufferSize = 0x8000; // 32kB - -const TInt KBTConnectionTimeout = 20 * 1000 * 1000; // 20 seconds -const TInt KBTAbortTimeout = 2 * 1000 * 1000; // 2 seconds - -// CONSTANTS - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CBTServiceClient::CBTServiceClient -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CBTServiceClient::CBTServiceClient( MBTServiceClientObserver* aObserver ) - : CActive( EPriorityStandard ), - iClientState( EBTSCliIdle ), - iObserver( aObserver ) - { - CActiveScheduler::Add( this ); - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CBTServiceClient::ConstructL( const TBTDevAddr& aRemoteDevice, - const TUint aRemotePort, - RArray aHeaderList ) - { - FLOG(_L("[BTSU]\t CBTServiceClient::ConstructL()")); - - iTotalBytesSent = 0; - // Create Obex Client - // - TObexBluetoothProtocolInfo info; - info.iTransport = KBTSProtocol; - info.iAddr.SetBTAddr( aRemoteDevice ); - info.iAddr.SetPort( aRemotePort ); - - TObexProtocolPolicy obexProtocolPolicy; - obexProtocolPolicy.SetReceiveMtu( KMtuSizeReceiv ); - obexProtocolPolicy.SetTransmitMtu( KMtuSizeTrans ); - - iClient = CObexClient::NewL( info, obexProtocolPolicy ); - iClient->SetCallBack( *this ); - iPasskeyRequest = new (ELeave) CBTSUPasskeyRequest(); - - // Create Connect-object - // - iConnectObject = CObexNullObject::NewL(); - - if ( aHeaderList.Count() > 0 ) - { - for ( TInt index = 0; index < aHeaderList.Count(); index++ ) - { - iConnectObject->AddHeaderL( *aHeaderList[index] ); - } - } - - // Establish client connection - // - iClient->Connect( *iConnectObject, iStatus ); - SetActive(); - iClientState = EBTSCliConnecting; - iConnectionTimer = CBTConnectionTimer::NewL(this); - iConnectionTimer -> SetTimeOut ( TTimeIntervalMicroSeconds32( KBTConnectionTimeout ) ); - iConnectionTimer -> Start(); - - FLOG(_L("[BTSU]\t CBTServiceClient::ConstructL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBTServiceClient* CBTServiceClient::NewL( MBTServiceClientObserver* aObserver, - const TBTDevAddr& aRemoteDevice, - const TUint aRemotePort, - RArray aHeaderList ) - { - CBTServiceClient* self = new( ELeave ) CBTServiceClient( aObserver ); - CleanupStack::PushL( self ); - self->ConstructL( aRemoteDevice, aRemotePort, aHeaderList ); - CleanupStack::Pop(); - return self; - } - - -// Destructor -CBTServiceClient::~CBTServiceClient() - { - FLOG(_L("[BTSU]\t CBTServiceClient::~CBTServiceClient()")); - - if(iConnectionTimer) - { - iConnectionTimer->Cancel(); - delete iConnectionTimer; - iConnectionTimer=NULL; - } - Cancel(); - if(iClient) - { - delete iClient; - iClient = NULL; - } - delete iPasskeyRequest; - iPasskeyRequest = NULL; - - if ( iConnectObject ) - { - iConnectObject->Reset(); - delete iConnectObject; - iConnectObject = NULL; - } - if ( iObjectBuffer ) - { - iObjectBuffer->Reset(); - delete iObjectBuffer; - iObjectBuffer = NULL; - } - if ( iGetObject ) - { - delete iGetObject; - iGetObject = NULL; - } - if ( iPutObject ) - { - iPutObject->Reset(); - delete iPutObject; - iPutObject = NULL; - } - if ( iPutBufObject ) - { - iPutBufObject->Reset(); - delete iPutBufObject; - iPutBufObject = NULL; - } - - if(iBuffer) - { - delete iBuffer; - iBuffer = NULL; - } - - FLOG(_L("[BTSU]\t CBTServiceClient::~CBTServiceClient() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::GetObjectL -// ----------------------------------------------------------------------------- -// -void CBTServiceClient::GetObjectL( RArray& aHeaderList, - const TDesC& aFileName ) - { - FLOG(_L("[BTSU]\t CBTServiceClient::GetObjectL()")); - - if ( iGetObject ) - { - iGetObject->Reset(); - delete iGetObject; - iGetObject = NULL; - } - - // Create object - // - if ( aFileName == KNullDesC ) - { - iObjectBuffer = CBufFlat::NewL( KBTSUDataBufferExpandSize ); - iGetObject = CObexBufObject::NewL( iObjectBuffer ); - } - else - { - iGetObject = CObexBufObject::NewL( NULL ); - iGetObject->SetDataBufL( aFileName ); - } - - // Set headers - // - if ( aHeaderList.Count() > 0 ) - { - for ( TInt index = 0; index < aHeaderList.Count(); index++ ) - { - iGetObject->AddHeaderL( *aHeaderList[index] ); - } - } - - // Send get request - // - iClient->Get( *iGetObject, iStatus ); - SetActive(); - iClientState = EBTSCliGetting; - - FLOG(_L("[BTSU]\t CBTServiceClient::GetObjectL() completed")); - } - - -// ----------------------------------------------------------------------------- -// CBTServiceClient::PutObjectL -// ----------------------------------------------------------------------------- -// -void CBTServiceClient::PutObjectL( RArray& aHeaderList, - const TDesC& aFileName ) - { - FLOG(_L("[BTSU]\t CBTServiceClient::PutObjectL()")); - - if ( iPutObject ) - { - iPutObject->Reset(); - delete iPutObject; - iPutObject = NULL; - } - - // Create object - // - iPutObject = CObexFileObject::NewL(); - - // Set body - // - - if ( aFileName != KNullDesC ) - { - iPutObject->InitFromFileL ( aFileName ); - } - - // Set headers - // - if ( aHeaderList.Count() > 0 ) - { - for ( TInt index = 0; index < aHeaderList.Count(); index++ ) - { - iPutObject->AddHeaderL( *aHeaderList[index] ); - } - } - - // Send object - // - iClient->Put( *iPutObject, iStatus ); - SetActive(); - iClientState = EBTSCliPutting; - - FLOG(_L("[BTSU]\t CBTServiceClient::PutObjectL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::PutObjectL -// ----------------------------------------------------------------------------- -// -void CBTServiceClient::PutObjectL( RArray& aHeaderList, - RFile& aFile ) - { - FLOG(_L("[BTSU]\t CBTServiceClient::PutObjectL()")); - - if ( iPutObject ) - { - iPutObject->Reset(); - delete iPutObject; - iPutObject = NULL; - } - - if ( iPutBufObject ) - { - iPutBufObject->Reset(); - delete iPutBufObject; - iPutBufObject = NULL; - } - // Create object - // - iPutBufObject = CObexBufObject::NewL(NULL); - - // Resolve MIME type - // - - RApaLsSession session; - HBufC8* mimeType = NULL; - TDataType type; - - TUid uid; - // Set headers - // - if ( aHeaderList.Count() > 0 ) - { - for ( TInt index = 0; index < aHeaderList.Count(); index++ ) - { - iPutBufObject->AddHeaderL( *aHeaderList[index] ); - } - } - - TDesC8 typeheader=iPutBufObject->Type(); - if ( typeheader == KNullDesC8 ) - { - User::LeaveIfError( session.Connect() ); - CleanupClosePushL( session ); - TInt error = session.AppForDocument( aFile, uid, type ); - if ( error == KErrNone ) - { - mimeType = type.Des8().AllocLC(); - iPutBufObject->SetTypeL(*mimeType); - CleanupStack::PopAndDestroy(); - } - CleanupStack::Pop(); // session - session.Close(); - } - - //Set object information - // - TFileName filename; - aFile.Name(filename); - - TInt size; - aFile.Size(size); - iPutBufObject->SetLengthL(size); - iPutBufObject->SetNameL(filename); - - TTime time; - if ( aFile.Modified(time) == KErrNone ) - { - iPutBufObject->SetTimeL(time); - } - - RFile file; - file.Duplicate(aFile); - - iBuffer = CBufFlat::NewL(KBufferSize); - iBuffer ->ResizeL(KBufferSize); - - TObexRFileBackedBuffer bufferdetails(*iBuffer,file,CObexBufObject::ESingleBuffering); - iPutBufObject->SetDataBufL(bufferdetails); - - // Send object - // - iClient->Put( *iPutBufObject, iStatus ); - SetActive(); - iClientState = EBTSCliPutting; - - FLOG(_L("[BTSU]\t CBTServiceClient::PutObjectL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::CloseClientConnection -// ----------------------------------------------------------------------------- -// -void CBTServiceClient::CloseClientConnection() - { - FLOG(_L("[BTSU]\t CBTServiceClient::CloseClientConnection()")); - - iClient->Disconnect( iStatus ); - SetActive(); - iClientState = EBTSCliDisconnecting; - - FLOG(_L("[BTSU]\t CBTServiceClient::CloseClientConnection() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::GetProgressStatus -// ----------------------------------------------------------------------------- -// -TInt CBTServiceClient::GetProgressStatus() - { - FLOG(_L("[BTSU]\t CBTServiceClient::GetProgressStatus()")); - - TInt bytesSent = 0; - if ( iPutBufObject ) - { - bytesSent = iPutBufObject->BytesSent(); - } - if ( iPutObject ) - { - bytesSent = iPutObject->BytesSent(); - } - - FTRACE(FPrint(_L("[BTSU]\t CBTServiceClient::GetProgressStatus() completed, bytes sent %d"), iTotalBytesSent + bytesSent ) ); - - // return iTotalBytesSent + bytesSent; - return bytesSent; - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::GetUserPasswordL -// ----------------------------------------------------------------------------- -// -void CBTServiceClient::GetUserPasswordL( const TDesC& /*aRealm*/ ) - { - FLOG(_L("[BTSU]\t CBTServiceClient::GetUserPasswordL()")); - - iPasskeyRequest->StartPassKeyRequestL( iClient ); - - FLOG(_L("[BTSU]\t CBTServiceClient::GetUserPasswordL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::DoCancel -// ----------------------------------------------------------------------------- -// -void CBTServiceClient::DoCancel() - { - FLOG(_L("[BTSU]\t CBTServiceClient::DoCancel()")); - - if ( iConnectionTimer ) - { - iConnectionTimer->Cancel(); - delete iConnectionTimer; - iConnectionTimer=NULL; - } - // Deleting obexclient is the only way to cancel active requests - // - if ( iClient ) - { - delete iClient; - iClient = NULL; - } - - FLOG(_L("[BTSU]\t CBTServiceClient::DoCancel() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::RunL -// ----------------------------------------------------------------------------- -// -void CBTServiceClient::RunL() - { - FTRACE(FPrint(_L("[BTSU]\t CBTServiceClient::RunL() status %d"), iStatus.Int() ) ); - if ( !iObserver ) - { - return; - } - switch ( iClientState ) - { - case EBTSCliConnecting: - { - FLOG(_L("[BTSU]\t CBTServiceClient::RunL() EBTSCliConnecting")); - iConnectObject->Reset(); - if(iConnectionTimer) - { - iConnectionTimer->Cancel(); - delete iConnectionTimer; - iConnectionTimer=NULL; - } - iObserver->ConnectCompleted( iStatus.Int() ); - break; - } - - case EBTSCliPutting: - { - FLOG(_L("[BTSU]\t CBTServiceClient::RunL() EBTSCliPutting")); - if(iPutBufObject) - { - iTotalBytesSent += iPutBufObject->BytesSent(); - } - else - { - iTotalBytesSent += iPutObject->BytesSent(); - } - - const CObexHeaderSet& response=iClient->GetPutFinalResponseHeaders(); - if ( iPutBufObject ) - { - iPutBufObject->Reset(); - delete iPutBufObject; - iPutBufObject = NULL; - } - - if ( iPutObject ) - { - iPutObject->Reset(); - delete iPutObject; - iPutObject = NULL; - } - if(iBuffer) - { - delete iBuffer; - iBuffer = NULL; - } - //put there call getEnv - iObserver->PutCompleted( iStatus.Int(), &response); - FLOG(_L("[BTSU]\t CBTServiceClient::RunL() EBTSCliPutting done")); - break; - } - - case EBTSCliGetting: - { - iObserver->GetCompleted( iStatus.Int(), iGetObject ); - break; - } - - case EBTSCliDisconnecting: - { - // Any errors are ignored - // - iObserver->ClientConnectionClosed(); - break; - } - - case EBTSCliIdle: - default: - { - FLOG(_L("[BTSU]\t CBTServiceClient::RunL() ERROR, unhandled case")); - break; - } - } - - FLOG(_L("[BTSU]\t CBTServiceClient::RunL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceClient::ConnectionTimedOut -// ----------------------------------------------------------------------------- -// -void CBTServiceClient::ConnectionTimedOut() - { - FLOG(_L("[BTSU]\t CBTServiceClient::ConnectionTimedOut")); - switch ( iClientState ) - { - case EBTSCliConnecting: - { - iObserver->ConnectTimedOut(); - break; - } - case EBTSCliGetting: - { - iObserver->GetCompleted( KErrAbort, iGetObject ); - break; - } - case EBTSCliPutting: - { - const CObexHeaderSet& response=iClient->GetPutFinalResponseHeaders(); - iObserver->PutCompleted( KErrAbort, &response ); - break; - } - default: - FLOG(_L("[BTSU]\t CBTServiceClient::ConnectionTimedOut unhandled client state ")); - } - - FLOG(_L("[BTSU]\t CBTServiceClient::ConnectionTimedOut")); - } -// ----------------------------------------------------------------------------- -// CBTServiceClient::Abort -// ----------------------------------------------------------------------------- -// -void CBTServiceClient::Abort() - { - FLOG(_L("[BTSU]\t CBTServiceClient::Abort")); - if ( iClient && ( iClientState == EBTSCliPutting || iClientState == EBTSCliGetting ) ) - { - if ( iConnectionTimer ) - { - delete iConnectionTimer; - iConnectionTimer = NULL; - } - TRAPD(trapErr, iConnectionTimer = CBTConnectionTimer::NewL(this) ); - if ( trapErr != KErrNone) - { - iObserver->ConnectCompleted( KErrAbort ); - return; - } - iConnectionTimer -> SetTimeOut ( TTimeIntervalMicroSeconds32( KBTAbortTimeout ) ); - iConnectionTimer -> Start(); - iClient->Abort(); - } - else if ( iClient && iClientState == EBTSCliConnecting) - { - iObserver->ConnectCompleted( KErrAbort ); - } - FLOG(_L("[BTSU]\t CBTServiceClient::Abort")); - - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceDelayedDestroyer.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceDelayedDestroyer.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ -/* -* Copyright (c) 2005-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: The base active class definition -* -*/ - - -#include "BTServiceDelayedDestroyer.h" -#include "BTSUDebug.h" - -// ======== MEMBER FUNCTIONS ======== - -// ----------------------------------------------------------------------------- -// CBTServiceDelayedDestroyer::NewL() -// ----------------------------------------------------------------------------- -// -CBTServiceDelayedDestroyer* CBTServiceDelayedDestroyer::NewL(CActive::TPriority aPriority) - { - CBTServiceDelayedDestroyer* self = CBTServiceDelayedDestroyer::NewLC(aPriority); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// CBTServiceDelayedDestroyer::NewLC() -// ----------------------------------------------------------------------------- -// -CBTServiceDelayedDestroyer* CBTServiceDelayedDestroyer::NewLC(CActive::TPriority aPriority) - { - CBTServiceDelayedDestroyer* self = new (ELeave) CBTServiceDelayedDestroyer(aPriority); - CleanupStack::PushL(self); - return self; - } - -// ----------------------------------------------------------------------------- -// CBTServiceDelayedDestroyer::CBTServiceDelayedDestroyer() -// ----------------------------------------------------------------------------- -// -CBTServiceDelayedDestroyer::CBTServiceDelayedDestroyer(CActive::TPriority aPriority) - : CActive(aPriority), iPtr(NULL) - { - FLOG(_L("[BTSU]\t CBTServiceDelayedDestroyer::CBTServiceDelayedDestroyer()")); - CActiveScheduler::Add(this); - } - -// ----------------------------------------------------------------------------- -// CBTServiceDelayedDestroyer::~CBTServiceDelayedDestroyer() -// ----------------------------------------------------------------------------- -// -CBTServiceDelayedDestroyer::~CBTServiceDelayedDestroyer() - { - FLOG(_L("[BTSU]\t CBTServiceDelayedDestroyer::Destructor()")); - if( iPtr ) - { - delete iPtr; - iPtr = NULL; - } - Cancel(); - } - -// ----------------------------------------------------------------------------- -// CBTServiceDelayedDestroyer::GoActive() -// ----------------------------------------------------------------------------- -// -void CBTServiceDelayedDestroyer::GoActive() - { - FLOG(_L("[BTSU]\t CBTServiceDelayedDestroyer::GoActive()")); - if( !IsActive() ) - { - TRequestStatus* status = &iStatus; - iStatus = KRequestPending; - User::RequestComplete(status, KErrNone); - SetActive(); - } - else - { - FLOG(_L("[BTSU]\t CBTServiceDelayedDestroyer::GoActive(), Already active")); - } - } - -// ----------------------------------------------------------------------------- -// CBTServiceDelayedDestroyer::SetDestructPointer() -// Must be called with GoActive, they are pairs, first call SetDestructPointer -// and then GoActive. -// ----------------------------------------------------------------------------- -// -void CBTServiceDelayedDestroyer::SetDestructPointer(CBTEngDiscovery* aPtr) - { - FLOG(_L("[BTSU]\t CBTServiceDelayedDestroyer::SetDestructPointer()")); - if( iPtr ) - { - // If previous is not deleted yet, meaning, RunL is not called yet, - // we can safely delete previous here. - delete iPtr; - } - iPtr = aPtr; - } - -// ----------------------------------------------------------------------------- -// CBTServiceDelayedDestroyer::DoCancel() -// ----------------------------------------------------------------------------- -// -void CBTServiceDelayedDestroyer::DoCancel() - { - FLOG(_L("[BTSU]\t CBTServiceDelayedDestroyer::DoCancel()")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceDelayedDestroyer::RunL() -// ----------------------------------------------------------------------------- -// -void CBTServiceDelayedDestroyer::RunL() - { - FLOG(_L("[BTSU]\t CBTServiceDelayedDestroyer::RunL()")); - delete iPtr; - iPtr = NULL; - } - -// ----------------------------------------------------------------------------- -// CBTServiceDelayedDestroyer::RunError() -// ----------------------------------------------------------------------------- -// -TInt CBTServiceDelayedDestroyer::RunError(TInt aError) - { - FTRACE(FPrint(_L("[BTSU]\t CBTServiceStarter::RunError() aError = %d"), aError) ); - (void) aError; - return KErrNone; - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceParameterList.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceParameterList.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,571 +0,0 @@ -/* -* Copyright (c) 2002 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: parameter list implementation -* -*/ - - -// INCLUDE FILES -#include "BTServiceUtils.h" -#include "BTServiceParameterList.h" -#include "BTSUImageConverter.h" -#include "BTSUXmlParser.h" -#include "BTSUDebug.h" - -#include // RApaLSession -#include // TDataType -#include //´Type solving -#include - -// CONSTANTS - -_LIT( KBIPImageTypes, "JPEGBMPGIFWBMPPNGJPEG2000" ); - - -const TInt KBIPImageTypesLength = 30; - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::CBTServiceParameterList -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CBTServiceParameterList::CBTServiceParameterList() - { - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CBTServiceParameterList::ConstructL() - { - FLOG(_L("[BTSU]\t CBTServiceParameterList::ConstructL()")); - iRemovedImageCount=0; - User::LeaveIfError( iFileSession.Connect() ); - iFileSession.ShareProtected(); - - FLOG(_L("[BTSU]\t CBTServiceParameterList::ConstructL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -EXPORT_C CBTServiceParameterList* CBTServiceParameterList::NewL() - { - CBTServiceParameterList* self = new( ELeave ) CBTServiceParameterList; - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::NewLC -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -EXPORT_C CBTServiceParameterList* CBTServiceParameterList::NewLC() - { - CBTServiceParameterList* self = new( ELeave ) CBTServiceParameterList; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// Destructor -CBTServiceParameterList::~CBTServiceParameterList() - { - FLOG(_L("[BTSU]\t CBTServiceParameterList::~CBTServiceParameterList()")); - - TInt index = 0; - - for ( ; index < iXhtmlList.Count(); index++ ) - { - delete iXhtmlList[index].iFileName; - delete iXhtmlList[index].iRefObjectList; - } - - for ( index = 0; index < iImageList.Count(); index++ ) - { - - delete iImageList[index].iMimeType; - delete iImageList[index].iDisplayName; - if(iImageList[index].iFile.SubSessionHandle()) - { - iImageList[index].iFile.Close(); - } - - } - - for ( index = 0; index < iObjectList.Count(); index++ ) - { - if(iObjectList[index].SubSessionHandle()) - { - iObjectList[index].Close(); - } - } - - iXhtmlList.Close(); - iImageList.Close(); - iObjectList.Close(); - iFileSession.Close(); - - FLOG(_L("[BTSU]\t CBTServiceParameterList::~CBTServiceParameterList() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::AddXhtmlL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CBTServiceParameterList::AddXhtmlL( const TDesC& aFilePath ) - { - FLOG(_L("[BTSU]\t CBTServiceParameterList::AddXhtmlL()")); - - if ( &aFilePath == NULL || - aFilePath.Length() == 0 || - aFilePath.Length() > KMaxFileName ) - { - User::Leave( KErrArgument ); - } - - // Allocate memory for filename - // - HBufC* file = aFilePath.AllocL(); - CleanupStack::PushL( file ); - - // Resolve referenced objects - // - CBTSUXmlParser* parser = CBTSUXmlParser::NewL(); - CleanupStack::PushL( parser ); - - CDesCArrayFlat* list = parser->GetRefObjectListL( aFilePath ); - CleanupStack::PushL( list ); - - // Store parameter into list - // - TBTSUXhtmlParam param; - param.iFileName = file; - param.iRefObjectList = list; - User::LeaveIfError( iXhtmlList.Append( param ) ); - - CleanupStack::Pop( 3 ); // list, parser, file - delete parser; - - FLOG(_L("[BTSU]\t CBTServiceParameterList::AddXhtmlL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::AddImageL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CBTServiceParameterList::AddImageL( const TDesC& aFilePath ) - { - if ( &aFilePath == NULL || - aFilePath.Length() == 0 || - aFilePath.Length() > KMaxFileName ) - { - User::Leave( KErrArgument ); - } - RFile file; - User::LeaveIfError( file.Open( iFileSession, aFilePath, EFileShareReadersOnly) ); - AddImageL(file); - file.Close(); - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::AddImageL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CBTServiceParameterList::AddImageL( RFile aFile ) - { - FLOG(_L("[BTSU]\t CBTServiceParameterList::AddImageL()")); - TBool found; - TInt retVal; - TBool isprotected = EFalse; - - //chekc that file handle is correct - if(!aFile.SubSessionHandle()) - { - User::Leave( KErrArgument ); - } - - //check if files are drm protected - - ContentAccess::CContent* drm = ContentAccess::CContent::NewL(aFile); - drm->GetAttribute(ContentAccess::EIsProtected, isprotected); - delete drm; - - - if(isprotected) - { - User::Leave( KErrNotSupported ); - } - - - CBTSUImageConverter * imageConverter = CBTSUImageConverter::NewL(); - CleanupStack::PushL( imageConverter ); - - // Allocate memory for filename - // - - - // Resolve MIME type - // - RApaLsSession session; - HBufC8* mimeType = NULL; - TDataType type; - - TUid uid; - - User::LeaveIfError( session.Connect() ); - CleanupClosePushL( session ); - - User::LeaveIfError( session.AppForDocument( aFile, uid, type ) ); - mimeType = type.Des8().AllocL(); - - CleanupStack::Pop(); // session - session.Close(); - - CleanupStack::PushL( mimeType ); - - // Resolve Display name - // - HBufC* displayName = imageConverter->GetDisplayNameL( *mimeType ); - CleanupStack::PushL( displayName ); - - RFileExtensionMIMETypeArray fileExtensions; - - //Resolve what format are suported - TRAP( retVal, CImageDecoder::GetFileTypesL( fileExtensions ) ); - if( retVal != KErrNone ) - { - fileExtensions.ResetAndDestroy(); - User::Leave( retVal ); - } - - found=EFalse; - TBuf types = KBIPImageTypes(); - - for( TInt index = 0; index < fileExtensions.Count(); index++ ) - { - retVal=displayName->Compare((*fileExtensions[index]).DisplayName()); - if(retVal==0 && types.Find((*fileExtensions[index]).DisplayName())!=KErrNotFound ) - { - found=ETrue; - } - } - fileExtensions.ResetAndDestroy(); - if(found==EFalse) - { - User::Leave(KErrNotSupported); - } - - - // Resolve file size - // - TInt fileSize = 0; - User::LeaveIfError( aFile.Size( fileSize ) ); - - - // Resolve width and height - // - TSize decodeSize = imageConverter->GetImageSizeL( aFile ); - - - // Store parameter into list - // - TBTSUImageParam param; - - param.iFile.Duplicate(aFile); - param.iMimeType = mimeType; - param.iDisplayName = displayName; - param.iFileSize = fileSize; - param.iPixelSize = decodeSize; - param.iSend=EFalse; - - - User::LeaveIfError( iImageList.Append( param ) ); - - CleanupStack::Pop( 3 ); // displayName, mimeType, imageConverter - delete imageConverter; - - FLOG(_L("[BTSU]\t CBTServiceParameterList::AddImageL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::AddObjectL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CBTServiceParameterList::AddObjectL( const TDesC& aFilePath ) - { - FLOG(_L("[BTSU]\t CBTServiceParameterList::AddObjectL()")); - - if ( &aFilePath == NULL || - aFilePath.Length() == 0 || - aFilePath.Length() > KMaxFileName ) - { - User::Leave( KErrArgument ); - } - - RFile file; - User::LeaveIfError( file.Open( iFileSession, aFilePath, EFileShareReadersOnly) ); - AddObjectL(file); - file.Close(); - FLOG(_L("[BTSU]\t CBTServiceParameterList::AddObjectL() completed")); - } - - // ----------------------------------------------------------------------------- -// CBTServiceParameterList::AddObjectL -// ----------------------------------------------------------------------------- -// - EXPORT_C void CBTServiceParameterList::AddObjectL( RFile aFile ) - { - FLOG(_L("[BTSU]\t CBTServiceParameterList::AddObjectL()")); - - //chekc that file handle is correct - if(!aFile.SubSessionHandle()) - { - User::Leave( KErrArgument ); - } - RFile file; - - file.Duplicate(aFile); - - iObjectList.AppendL( file ); - - FLOG(_L("[BTSU]\t CBTServiceParameterList::AddObjectL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::XhtmlCount -// ----------------------------------------------------------------------------- -// -TInt CBTServiceParameterList::XhtmlCount() const - { - return iXhtmlList.Count(); - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::ImageCount -// ----------------------------------------------------------------------------- -// -TInt CBTServiceParameterList::ImageCount() const - { - return iImageList.Count(); - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::ObjectCount -// ----------------------------------------------------------------------------- -// -TInt CBTServiceParameterList::ObjectCount() const - { - return iObjectList.Count(); - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::XhtmlAt -// ----------------------------------------------------------------------------- -// -TBTSUXhtmlParam CBTServiceParameterList::XhtmlAt( TInt aIndex ) const - { - FLOG(_L("[BTSU]\t CBTServiceParameterList::XhtmlAt()")); - __ASSERT_DEBUG( aIndex >= 0 && aIndex < XhtmlCount(), BTSUPanic( EBTSUPanicOutOfRange ) ); - - TBTSUXhtmlParam param; - param.iFileName = iXhtmlList[ aIndex].iFileName; - param.iRefObjectList = iXhtmlList[ aIndex].iRefObjectList; - - FLOG(_L("[BTSU]\t CBTServiceParameterList::XhtmlAt() completed")); - - return param; - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::ImageAt -// ----------------------------------------------------------------------------- -// -TBTSUImageParam CBTServiceParameterList::ImageAtL( TInt aIndex ) const - { - FLOG(_L("[BTSU]\t CBTServiceParameterList::ImageAt()")); - - TBTSUImageParam param; - - if(aIndex<0 || aIndex> ImageCount() ) - { - User::Leave(KErrGeneral); - } - - param.iFile = iImageList[aIndex].iFile; - param.iMimeType = iImageList[aIndex].iMimeType; - param.iDisplayName = iImageList[aIndex].iDisplayName; - param.iPixelSize = iImageList[aIndex].iPixelSize; - param.iFileSize = iImageList[aIndex].iFileSize; - param.iSend = iImageList[aIndex].iSend; - - - FLOG(_L("[BTSU]\t CBTServiceParameterList::ImageAt() completed")); - - return param; - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::ObjectAt -// ----------------------------------------------------------------------------- -// -RFile& CBTServiceParameterList::ObjectAtL( TInt aIndex ) - { - FLOG(_L("[BTSU]\t CBTServiceParameterList::ObjectAt()")); - - if(aIndex<0 || aIndex> iObjectList.Count() ) - { - User::Leave(KErrGeneral); - } - return iObjectList[aIndex]; - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::HasAnyReferencedObjects -// ----------------------------------------------------------------------------- -// -TBool CBTServiceParameterList::HasAnyReferencedObjects() const - { - FLOG(_L("[BTSU]\t CBTServiceParameterList::HasAnyReferencedObjects()")); - - TBool result = EFalse; - - for ( TInt index = 0; index < iXhtmlList.Count(); index++ ) - { - if ( iXhtmlList[index].iRefObjectList->Count() > 0 ) - { - result = ETrue; - break; - } - } - - FTRACE(FPrint(_L("[BTSU]\t CBTServiceParameterList::HasAnyReferencedObjects() completed with %d"), result )); - - return result; - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::ObjectListSizeL -// ----------------------------------------------------------------------------- -// -TInt CBTServiceParameterList::ObjectListSizeL() const - { - FLOG(_L("[BTSU]\t CBTServiceParameterList::ObjectListSizeL()")); - - TInt totalFileSize = 0; - - for ( TInt index = 0; index < iObjectList.Count(); index++ ) - { - TInt fileSize = 0; - iObjectList[index].Size( fileSize ); - totalFileSize += fileSize; - } - return totalFileSize; - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::ImageListSize -// ----------------------------------------------------------------------------- -// -TInt CBTServiceParameterList::ImageListSize() const - { - FLOG(_L("[BTSU]\t CBTServiceParameterList::ImageListSize()")); - - TInt totalFileSize = 0; - for ( TInt index = 0; index < iImageList.Count(); index++ ) - { - totalFileSize += iImageList[index].iFileSize; - } - - FTRACE(FPrint(_L("[BTSU]\t CBTServiceParameterList::ImageListSize %d"), totalFileSize )); - return totalFileSize; - } -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::RemoveImageL -// ----------------------------------------------------------------------------- -// - - void CBTServiceParameterList::RemoveImageL(TInt aIndex) - { - if(aIndex<0 || aIndex> iImageList.Count() ) - { - User::Leave(KErrGeneral); - } - - delete iImageList[aIndex].iMimeType; - delete iImageList[aIndex].iDisplayName; - iImageList.Remove(aIndex); - iRemovedImageCount++; - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::RemovedImageCount -// ----------------------------------------------------------------------------- -// - TInt CBTServiceParameterList::RemovedImageCount() - { - return iRemovedImageCount; - } - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::ResetImageHandleL -// ----------------------------------------------------------------------------- -// -void CBTServiceParameterList::ResetImageHandleL(TInt aIndex) - { - if(aIndex<0 || aIndex> iImageList.Count() ) - { - User::Leave(KErrGeneral); - } - iImageList[aIndex].iFile=RFile(); - } -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::ResetObjectHandleL -// ----------------------------------------------------------------------------- -// -void CBTServiceParameterList::ResetObjectHandleL(TInt aIndex) - { - if(aIndex<0 || aIndex> iObjectList.Count() ) - { - User::Leave(KErrGeneral); - } - iObjectList[aIndex]=RFile(); - } - - -// ----------------------------------------------------------------------------- -// CBTServiceParameterList::ResetObjectHandleL -// ----------------------------------------------------------------------------- -// -void CBTServiceParameterList::MarkAsSendL(TInt aIndex) - { - if(aIndex<0 || aIndex> iImageList.Count() ) - { - User::Leave(KErrGeneral); - } - iImageList[aIndex].iSend=ETrue; - } - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceStarter.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceStarter.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1026 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: Service starter implementation -* -*/ - - - -// INCLUDE FILES -#include "BTServiceStarter.h" -#include "BTSUDebug.h" -#include "BTSOPPController.h" -#include "BTSBIPController.h" -#include "BTSBPPController.h" - -#include -#include -#include -#include -#include - -// CONSTANTS - -// From BT SIG - Assigned numbers -const TUint KBTServiceOPPSending = 0x1105; -const TUint KBTServiceDirectPrinting = 0x1118; -const TUint KBTServiceImagingResponder = 0x111B; - -const TUint KBTProgressInterval = 1000000; - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::CBTServiceStarter -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CBTServiceStarter::CBTServiceStarter() - : CActive( CActive::EPriorityStandard ), - iBTEngDiscovery(NULL), - iService( EBTSendingService ), - iServiceStarted( EFalse ), - iMessageServerIndex(0), - iBytesSendWithBIP(0), - iProgressDialogActive(EFalse), - iUserCancel(EFalse), - iFeatureManagerInitialized(EFalse), - iTriedBIP(EFalse), - iTriedOPP(EFalse) - { - CActiveScheduler::Add( this ); - } - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::ConstructL() - { - FLOG(_L("[BTSU]\t CBTServiceStarter::ConstructL()")); - iDevice = CBTDevice::NewL(); - iDialog = CObexUtilsDialog::NewL( this ); - iDelayedDestroyer = CBTServiceDelayedDestroyer::NewL(CActive::EPriorityStandard); - FeatureManager::InitializeLibL(); - iFeatureManagerInitialized = ETrue; - FLOG(_L("[BTSU]\t CBTServiceStarter::ConstructL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CBTServiceStarter* CBTServiceStarter::NewL() - { - CBTServiceStarter* self = new( ELeave ) CBTServiceStarter(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - -CBTServiceStarter::~CBTServiceStarter() - { - FLOG(_L("[BTSU]\t CBTServiceStarter::Destructor()")); - if ( iMessageServerIndex != 0 ) - { - TRAPD( notUsedRetVal, TObexUtilsMessageHandler::DeleteOutboxEntryL( iMessageServerIndex ) ); - notUsedRetVal=notUsedRetVal; - FTRACE(FPrint(_L("[BTSU]\t ~CBTServiceStarter() delete ob entry %d"), notUsedRetVal ) ); - } - StopTransfer(KErrCancel); // Cancels active object - - delete iList; - delete iDevice; - - delete iController; - delete iBTEngDiscovery; - delete iDialog; - delete iDelayedDestroyer; - - if(iWaiter && iWaiter->IsStarted() ) - { - iWaiter->AsyncStop(); - } - delete iBTEngSettings; - - if ( iFeatureManagerInitialized ) - { - FeatureManager::UnInitializeLib(); - } - - FLOG(_L("[BTSU]\t CBTServiceStarter::Destructor() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::StartServiceL -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::StartServiceL( TBTServiceType aService, - CBTServiceParameterList* aList, - CActiveSchedulerWait* aWaiter ) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::StartServiceL()")); - - // Delete old list and take ownership of the new one - // - - delete iList; - iList = aList; - - if ( iServiceStarted ) - { - User::Leave( KErrInUse ); - } - if ( !ValidParameters( aService, aList ) ) - { - User::Leave( KErrArgument ); - } - - // Store the waiter pointer, a NULL value is also accepted - // - iWaiter = aWaiter; - - // Store the requested service - // - iService = aService; - - if( !iBTEngSettings ) - { - iBTEngSettings = CBTEngSettings::NewL( this ); - } - TBTPowerStateValue power = EBTPowerOff; - User::LeaveIfError( iBTEngSettings->GetPowerState( power ) ); - TBool offline = EFalse; - if( !power ) - { - offline = CheckOfflineModeL(); - } - if( !offline ) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::StartServiceL() Phone is online, request temporary power on.")); - TurnBTPowerOnL( power ); - } - - FLOG(_L("[BTSU]\t CBTServiceStarter::StartServiceL() completed")); - } - - - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::ControllerComplete -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::ControllerComplete( TInt aStatus ) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::ControllerComplete()")); - TInt error; - if ( iAllSend ) //stop transfer if everything is send - { - StopTransfer( aStatus ); - return; - } - if(( aStatus==KErrNone || aStatus==EBTSNoError ) && - iState == EBTSStarterFindingBIP ) - { - iBytesSendWithBIP=0; - if( iProgressGetter ) - { - iBytesSendWithBIP=iProgressGetter->GetProgressStatus(); - iProgressGetter=NULL; - delete iController; - iController = NULL; - } - if ( !iBTEngDiscovery ) - { - TRAPD(err, iBTEngDiscovery = CBTEngDiscovery::NewL(this) ); - if (err != KErrNone ) - { - StopTransfer(EBTSPuttingFailed); - return; - } - } - error=iBTEngDiscovery->RemoteProtocolChannelQuery(iDevice->BDAddr(), - TUUID(KBTServiceOPPSending)); - if( error == KErrNone ) - { - iState = EBTSStarterFindingOPP; - } - else - { - StopTransfer(EBTSPuttingFailed); - } - } - else - { - StopTransfer( aStatus ); - } - FLOG(_L("[BTSU]\t CBTServiceStarter::ControllerComplete() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::GetProgressStatus -// ----------------------------------------------------------------------------- -// -TInt CBTServiceStarter::GetProgressStatus() - { - if ( iProgressGetter ) - { - return iProgressGetter->GetProgressStatus()+iBytesSendWithBIP; - } - else - { - return iBytesSendWithBIP; - } - } - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::ValidParameters -// ----------------------------------------------------------------------------- -// -TBool CBTServiceStarter::ValidParameters( - TBTServiceType aService, const CBTServiceParameterList* aList) const - { - FLOG(_L("[BTSU]\t CBTServiceStarter::ValidParameters()")); - - TBool result = EFalse; - - if ( aList != NULL ) - { - switch ( aService ) - { - case EBTSendingService: - { - // Sending service must have object or image parameters - // - if ( aList->ObjectCount() > 0 || aList->ImageCount() > 0 ) - { - result = ETrue; - } - break; - } - case EBTPrintingService: - { - // Printing service must have xhtml parameters - // - if ( aList->XhtmlCount() > 0 ) - { - result = ETrue; - } - break; - } - case EBTObjectPushService: - { - // Sending service must have object or image parameters - // - if ( aList->ObjectCount() > 0 || aList->ImageCount() > 0 ) - { - result = ETrue; - } - break; - } - default: - { - result = EFalse; - break; - } - } - } - FTRACE(FPrint(_L("[BTSU]\t CBTServiceStarter::ValidParameters() completed with %d"), result ) ); - - return result; - } - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::StartProfileSelectL -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::StartProfileSelectL( TBTServiceType aService ) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::StartProfileSelectL()")); - LaunchWaitNoteL(); - iAllSend=EFalse; - iSendToBIPOnlyDevice = EFalse; - - if ( !iBTEngDiscovery ) - { - iBTEngDiscovery = CBTEngDiscovery::NewL(this); - } - - if ( !FeatureManager::FeatureSupported( KFeatureIdBtImagingProfile ) && (aService != EBTPrintingService) ) - { - // If BTimagingProfile is disabled, use OPP instead. - User::LeaveIfError( iBTEngDiscovery->RemoteProtocolChannelQuery(iDevice->BDAddr(), - TUUID(KBTServiceOPPSending))); - iState = EBTSStarterFindingOPP; - return; - } - - switch ( aService ) - { - case EBTSendingService: // Find OPP - { - if ( iList->ObjectCount() > 0 ) // We try to send files with OPP profile as long as it contains non-bip objects - { - FLOG(_L("[BTSU]\t CBTServiceStarter::StartProfileSelectL() OPP")); - User::LeaveIfError( iBTEngDiscovery->RemoteProtocolChannelQuery(iDevice->BDAddr(), - TUUID(KBTServiceOPPSending))); - iState = EBTSStarterFindingOPP; - } - else if(iList->ObjectCount() == 0 && iList->ImageCount() > 0) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::StartProfileSelectL() BIP")); - User::LeaveIfError( iBTEngDiscovery->RemoteProtocolChannelQuery(iDevice->BDAddr(), - TUUID(KBTServiceImagingResponder))); - iState = EBTSStarterFindingBIP; - } - break; - } - case EBTPrintingService: // Find BPP - { - FLOG(_L("[BTSU]\t CBTServiceStarter::StartProfileSelectL() BPP")); - User::LeaveIfError( iBTEngDiscovery->RemoteProtocolChannelQuery(iDevice->BDAddr(), - TUUID(KBTServiceDirectPrinting))); - iState = EBTSStarterFindingBPP; - break; - } - case EBTObjectPushService: // Find BIP - { - FLOG(_L("[BTSU]\t CBTServiceStarter::StartProfileSelectL() BIP")); - User::LeaveIfError( iBTEngDiscovery->RemoteProtocolChannelQuery(iDevice->BDAddr(), - TUUID(KBTServiceOPPSending))); - iState = EBTSStarterFindingOPP; - break; - } - default: - { - FLOG(_L("[BTSU]\t CBTServiceStarter::StartProfileSelectL() ERROR, unhandled case")); - break; - } - } - - FLOG(_L("[BTSU]\t CBTServiceStarter::StartProfileSelectL() completed")); - } - - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::StartProfileL -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::StartProfileL( TBTServiceProfile aProfile ) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::StartProfileL()")); - - switch ( aProfile ) - { - case EBTSBPP: - { - iController = CBTSBPPController::NewL( this, iClientChannel, - iDevice->BDAddr(), iList, - iBTEngDiscovery ); - break; - } - case EBTSOPP: - { - iController = CBTSOPPController::NewL( this, iClientChannel, - iDevice->BDAddr(), iList ); - break; - } - case EBTSBIP: - { - iController = CBTSBIPController::NewL( this, iClientChannel, - iDevice->BDAddr(), iList ); - break; - } - case EBTSNone: - default: - { - FLOG(_L("[BTSU]\t CBTServiceStarter::StartProfileL() ERROR, unhandled case")); - break; - } - } - - FLOG(_L("[BTSU]\t CBTServiceStarter::StartProfileL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::LaunchWaitNoteL -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::LaunchWaitNoteL() - { - FLOG(_L("[BTSU]\t CBTServiceStarter::LaunchWaitNoteL()")); - if ( iService == EBTPrintingService ) - { - iDialog->LaunchWaitDialogL( R_BT_PRINTING_WAIT_NOTE ); - } - else - { - iDialog->LaunchWaitDialogL( R_BT_CONNECTING_WAIT_NOTE ); - } - FLOG(_L("[BTSU]\t CBTServiceStarter::LaunchWaitNoteL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::CancelWaitNote -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::CancelWaitNote() - { - FLOG(_L("[BTSU]\t CBTServiceStarter::CancelWaitNote()")); - - if ( iDialog ) - { - TRAP_IGNORE( iDialog->CancelWaitDialogL() ); - } - - FLOG(_L("[BTSU]\t CBTServiceStarter::CancelWaitNote() completed")); - } - - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::LaunchProgressNoteL -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::LaunchProgressNoteL( MBTServiceProgressGetter* aGetter, - TInt aTotalSize ) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::LaunchProgressNoteL()")); - - if ( iService != EBTPrintingService ) - { - iProgressGetter = aGetter; - CancelWaitNote(); - - if ( !iProgressDialogActive ) - { - iMessageServerIndex = TObexUtilsMessageHandler::CreateOutboxEntryL( - KUidMsgTypeBt, R_BT_SEND_OUTBOX_SENDING ); - iDialog->LaunchProgressDialogL( this, aTotalSize, - R_BT_SENDING_DATA, KBTProgressInterval ); - } - iProgressDialogActive=ETrue; - } - - FLOG(_L("[BTSU]\t CBTServiceStarter::LaunchProgressNoteL() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::CancelProgressNote -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::CancelProgressNote() - { - FLOG(_L("[BTSU]\t CBTServiceStarter::CancelProgressNote()")); - - if ( iDialog ) - { - TRAP_IGNORE( iDialog->CancelProgressDialogL() ); - } - } - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::DialogDismissed -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::DialogDismissed( TInt aButtonId ) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::DialogDismissed()")); - if( aButtonId == EAknSoftkeyCancel ) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::DialogDissmissed(), cancelled by user")); - iUserCancel=ETrue; - if ( iController ) - { - iController->Abort(); - } - else - { - StopTransfer(KErrCancel); - } - } - else if ( aButtonId == EAknSoftkeyNo ) - { - // user abortion - // - iUserCancel = ETrue; - StopTransfer( KErrCancel ); - } - FLOG(_L("[BTSU]\t CBTServiceStarter::DialogDismissed() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::ShowNote -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::ShowNote( TInt aReason ) const - { - FLOG(_L("[BTSU]\t CBTServiceStarter::ShowNote()")); - - TInt resource = 0; - - switch ( aReason ) - { - case EBTSNoError: - { - if ( iService == EBTPrintingService ) - { - resource = R_BT_DATA_SENT2; - } - else - { - resource = R_BT_DATA_SENT; - } - break; - } - case EBTSConnectingFailed: - { - resource = R_BT_DEV_NOT_AVAIL; - break; - } - case EBTSGettingFailed: - case EBTSPuttingFailed: - { - if ( iService == EBTPrintingService ) - { - resource = R_BT_FAILED_TO_SEND2; - } - else - { - resource = R_BT_FAILED_TO_SEND; - } - break; - } - case EBTSNoSuitableProfiles: - { - if ( iService == EBTPrintingService ) - { - resource = R_BT_PRINTING_NOT_SUPPORTED; - } - else - { - resource = R_BT_FAILED_TO_SEND; - } - break; - } - case EBTSBIPSomeSend: - { - resource = R_BT_FAILED_TO_SEND; - break; - } - case EBTSBIPOneNotSend: - { - resource = R_BT_NOT_RECEIVE_ONE; - break; - } - case EBTSBIPNoneSend: - { - resource = R_BT_NOT_RECEIVE_ANY; - break; - } - default: - { - resource = R_BT_DEV_NOT_AVAIL; - break; - } - } - - TRAP_IGNORE(TObexUtilsUiLayer::ShowInformationNoteL( resource ) ); - FLOG(_L("[BTSU]\t CBTServiceStarter::ShowNote() completed")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::LaunchConfirmationQuery -// ----------------------------------------------------------------------------- -// -TInt CBTServiceStarter::LaunchConfirmationQuery(TInt aResourceId) - { - TInt keypress=0; - TRAP_IGNORE( keypress = iDialog->LaunchQueryDialogL( aResourceId )); - if ( !keypress ) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::LaunchConfirmationQuery(), cancelled by user")); - DialogDismissed(EAknSoftkeyNo); - CancelWaitNote(); - } - return keypress; - } - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::StopTransfer -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::StopTransfer(TInt aError) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::StopTransfer()")); - Cancel(); - if( !iUserCancel ) - { - CancelWaitNote(); - CancelProgressNote(); - - if ( aError != KErrCancel ) - { - ShowNote( aError ); - } - } - if ( iMessageServerIndex != 0 ) - { - TRAPD( notUsedRetVal, TObexUtilsMessageHandler::DeleteOutboxEntryL( iMessageServerIndex ) ); - notUsedRetVal=notUsedRetVal; - iMessageServerIndex=0; - FTRACE(FPrint(_L("[BTSU]\t CBTServiceStarter::StopTransfer() delete ob entry %d"), notUsedRetVal ) ); - } - // Release resources - // - if ( iList ) - { - delete iList; - iList = NULL; - } - - if ( iController ) - { - delete iController; - iController = NULL; - } - - if ( iNotifier.Handle() ) - { - iNotifier.Close(); - } - - // Reset states - // - iServiceStarted = EFalse; - if ( iWaiter && iWaiter->IsStarted() ) - { - iWaiter->AsyncStop(); - } - - iState = EBTSStarterStoppingService; - } - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::ConnectTimedOut() -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::ConnectTimedOut() - { - FLOG(_L("[BTSU]\t CBTServiceStarter::ConnectTimedOut()")); - StopTransfer(EBTSConnectingFailed); - FLOG(_L("[BTSU]\t CBTServiceStarter::ConnectTimedOut() completed")); - } -// ----------------------------------------------------------------------------- -// CBTServiceStarter::ServiceSearchComplete() -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::ServiceSearchComplete( const RSdpRecHandleArray& /*aResult*/, - TUint /*aTotalRecordsCount*/, TInt /*aErr */) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::ServiceSearchComplete()")); - } - -// ----------------------------------------------------------------------------- -// CBTServiceStarter::AttributeSearchComplete() -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::AttributeSearchComplete( TSdpServRecordHandle /*aHandle*/, - const RSdpResultArray& /*aAttr*/, - TInt /*aErr*/ ) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::AttributeSearchComplete()")); - } -// ----------------------------------------------------------------------------- -// CBTServiceStarter::ServiceAttributeSearchComplete() -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::ServiceAttributeSearchComplete( TSdpServRecordHandle /*aHandle*/, - const RSdpResultArray& aAttr, - TInt aErr ) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::ServiceAttributeSearchComplete()")); - TInt err = KErrNone; - if ((aErr==KErrEof || aErr==KErrNone) && aAttr.Count()>0 ) - { - RSdpResultArray results=aAttr; - iBTEngDiscovery->ParseRfcommChannel(results,iClientChannel); - - iBTEngDiscovery->CancelRemoteSdpQuery(); - - switch (iState) - { - case EBTSStarterFindingBIP: - { - TRAP(err, StartProfileL( EBTSBIP )); - iTriedBIP = ETrue; - if (err != KErrNone) - { - StopTransfer(EBTSConnectingFailed); - } - if ( iSendToBIPOnlyDevice ) - { - iAllSend = ETrue; - } - else - { - if(iList->ObjectCount() == 0) - { - iAllSend=ETrue; - } - } - break; - } - case EBTSStarterFindingOPP: - { - TRAP(err, StartProfileL( EBTSOPP ) ); - iTriedOPP = ETrue; - if (err != KErrNone) - { - StopTransfer(EBTSConnectingFailed); - } - iAllSend=ETrue; - break; - } - case EBTSStarterFindingBPP: - { - TRAP(err, StartProfileL( EBTSBPP )); - if (err != KErrNone) - { - StopTransfer(EBTSConnectingFailed); - } - break; - } - } - } - else if ( aErr==KErrEof && aAttr.Count()==0 && - iState == EBTSStarterFindingBIP && !iTriedBIP ) - { - iBTEngDiscovery->RemoteProtocolChannelQuery(iDevice->BDAddr(),TUUID(KBTServiceOPPSending)); - iState = EBTSStarterFindingOPP; - iTriedBIP = ETrue; - } - else if ( aErr==KErrEof && aAttr.Count()==0 && - iState == EBTSStarterFindingOPP && !iTriedOPP && - iList->ImageCount() > 0 && - FeatureManager::FeatureSupported( KFeatureIdBtImagingProfile ) ) - { - iSendToBIPOnlyDevice = ETrue; - iBTEngDiscovery->RemoteProtocolChannelQuery(iDevice->BDAddr(),TUUID(KBTServiceImagingResponder)); - iState = EBTSStarterFindingBIP; - iTriedOPP = ETrue; - } - else if (aErr==KErrNone && aAttr.Count()==0) - { - //This isn't KErrEoF so we aren't done yet, wait for future matches - } - else - { - // Set destroyer AO active (destroys CBTEngDiscovery/CBTEngSdpQuery classes). This is done - // to ensure that CBTEngDiscovery/CBTEngSdpQuery classes have finished all their activities, - // callbacks etc.. Destructing it self is handled in CBTServiceDelayedDestroyer's RunL. - iDelayedDestroyer->SetDestructPointer(iBTEngDiscovery); - iDelayedDestroyer->GoActive(); - // Set iBTEngDiscovery pointer to zero. Pointer doesn't exist CBTServiceStarter point of view anymore. - iBTEngDiscovery = NULL; - StopTransfer(EBTSConnectingFailed); - } - FLOG(_L("[BTSU]\t CBTServiceStarter::ServiceAttributeSearchComplete() done")); - } -// ----------------------------------------------------------------------------- -// CBTServiceStarter::DeviceSearchComplete() -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::DeviceSearchComplete( CBTDevice* /*aDevice*/, TInt aErr ) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::DeviceSearchComplete()")); - FTRACE(FPrint(_L("[BTSU]\t CBTServiceStarter DeviceSearchComplete()aErr = %d"), aErr) ); - if ( aErr == KErrNone ) - { - TRAPD(err, StartProfileSelectL( iService )); - if (err != KErrNone ) - { - StopTransfer(err); - } - - iServiceStarted = ETrue; - } - else - { - if ( aErr == KErrCancel ) - { - iUserCancel=ETrue; - } - StopTransfer(aErr); - } - FLOG(_L("[BTSU]\t CBTServiceStarter::DeviceSearchComplete() done")); - } - -// ----------------------------------------------------------------------------- -// From class MBTEngSettingsObserver. -// Power has changed, start searching for BT devices. -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::PowerStateChanged( TBTPowerStateValue aState ) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::PowerStateChanged()")); - if( aState == EBTPowerOn && iWaitingForBTPower ) - { - iWaitingForBTPower = EFalse; - TRAP_IGNORE( StartDiscoveryL() ); - } - FLOG(_L("[BTSU]\t CBTServiceStarter::PowerStateChanged() - completed")); - } - - -// ----------------------------------------------------------------------------- -// From class MBTEngSettingsObserver. -// Visibility has changed, ignore event. -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::VisibilityModeChanged( TBTVisibilityMode aState ) - { - (void) aState; - } - -// ----------------------------------------------------------------------------- -// Check if the phone is in offline mode, and ask the user if it is. -// ----------------------------------------------------------------------------- -// -TBool CBTServiceStarter::CheckOfflineModeL() - { - FLOG(_L("[BTSU]\t CBTServiceStarter::CheckOfflineModeL()")); - TCoreAppUIsNetworkConnectionAllowed offline = ECoreAppUIsNetworkConnectionNotAllowed; - TBTEnabledInOfflineMode offlineAllowed = EBTDisabledInOfflineMode; - User::LeaveIfError( iBTEngSettings->GetOfflineModeSettings( offline, offlineAllowed ) ); - if( offline == ECoreAppUIsNetworkConnectionNotAllowed && - offlineAllowed == EBTEnabledInOfflineMode ) - { - User::LeaveIfError( iNotifier.Connect() ); - TBTGenericQueryNotiferParamsPckg pckg; - pckg().iMessageType = EBTActivateOffLineQuery; - pckg().iNameExists = EFalse; - iActiveNotifier = EOfflineQuery; - iNotifier.StartNotifierAndGetResponse( iStatus, KBTGenericQueryNotifierUid, - pckg, iOffline ); - SetActive(); - } - else if( offline == ECoreAppUIsNetworkConnectionNotAllowed && - offlineAllowed == EBTDisabledInOfflineMode ) - { - StopTransfer( KErrNotSupported ); - } - FLOG(_L("[BTSU]\t CBTServiceStarter::CheckOfflineModeL() - completed")); - return ( offline == ECoreAppUIsNetworkConnectionNotAllowed ); - } - - -// ----------------------------------------------------------------------------- -// Start BT device discovery. -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::StartDiscoveryL() - { - FLOG(_L("[BTSU]\t CBTServiceStarter::StartDiscoveryL()")); - if( !iBTEngDiscovery ) - { - iBTEngDiscovery = CBTEngDiscovery::NewL(this); - } - TInt err = iBTEngDiscovery->SearchRemoteDevice(iDevice ); - if( err ) - { - StopTransfer( err ); - } - FLOG(_L("[BTSU]\t CBTServiceStarter::StartDiscoveryL() - completed")); - } - - -// ----------------------------------------------------------------------------- -// Turn BT on and start BT device discovery if possible. -// ----------------------------------------------------------------------------- -// -void CBTServiceStarter::TurnBTPowerOnL( const TBTPowerStateValue aState ) - { - FLOG( _L("[BTSU]\t CBTServiceStarter::TurnBTPowerOnL()") ); - if (iName() != EFalse) - { - if( !iBTEngSettings ) - { - iBTEngSettings = CBTEngSettings::NewL( this ); - } - TInt err = iBTEngSettings->ChangePowerStateTemporarily(); - iWaitingForBTPower = ETrue; - if( err ) - { - iWaitingForBTPower = EFalse; - StopTransfer( err ); - } - else if( aState == EBTPowerOn ) - { - // Power is already on, we just registered for turning it off if needed. - // Since there is no callback at this point (power is already on), start - // searching straight away. - iWaitingForBTPower = EFalse; - StartDiscoveryL(); - } - } - else - { - if ( !iNotifier.Handle() ) - { - User::LeaveIfError( iNotifier.Connect() ); - } - TBTGenericQueryNotiferParamsPckg pckg; - pckg().iMessageType = EBTNameQuery; - pckg().iNameExists = EFalse; - iActiveNotifier = ENameQuery; - iNotifier.StartNotifierAndGetResponse( iStatus, KBTGenericQueryNotifierUid, - pckg, iName ); - SetActive(); - } - FLOG(_L("[BTSU]\t CBTServiceStarter::TurnBTPowerOnL() - completed")); - } - - -// --------------------------------------------------------------------------- -// From class CActive. -// Called by the active scheduler when the request has been cancelled. -// --------------------------------------------------------------------------- -// -void CBTServiceStarter::DoCancel() - { - FLOG(_L("[BTSU]\t CBTServiceStarter::DoCancel()")); - iNotifier.CancelNotifier( KBTGenericQueryNotifierUid ); - iNotifier.Close(); - FLOG(_L("[BTSU]\t CBTServiceStarter::DoCancel() - completed")); - } - - -// --------------------------------------------------------------------------- -// From class CActive. -// Called by the active scheduler when the request has been completed. -// --------------------------------------------------------------------------- -// -void CBTServiceStarter::RunL() - { - FLOG(_L("[BTSU]\t CBTServiceStarter::RunL()")); - TInt err = iStatus.Int(); - if( !err ) - { - if ( (iActiveNotifier == ENameQuery && iName() != EFalse ) || ( iActiveNotifier == EOfflineQuery && iOffline() != EFalse ) ) - { - TBTPowerStateValue power = EBTPowerOff; - if ( iNotifier.Handle() ) - { - iNotifier.Close(); - } - User::LeaveIfError( iBTEngSettings->GetPowerState( power ) ); - TurnBTPowerOnL( power ); - } - else - { - err = KErrCancel; - } - } - - if( err ) - { - err = ( err == KErrNotSupported ? KErrCancel : err ); - if ( iWaiter && err != KErrInUse && err != KErrCancel ) - { - err = EBTSPuttingFailed; - } - StopTransfer( err ); - } - - FLOG(_L("[BTSU]\t CBTServiceStarter::RunL() - completed")); - } - - -// --------------------------------------------------------------------------- -// From class CActive. -// Called by the active scheduler when an error in RunL has occurred. -// --------------------------------------------------------------------------- -// -TInt CBTServiceStarter::RunError( TInt aError ) - { - FLOG(_L("[BTSU]\t CBTServiceStarter::RunError()")); - StopTransfer( aError ); - FLOG(_L("[BTSU]\t CBTServiceStarter::RunError() - completed")); - return KErrNone; - } -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceUtils.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceUtils.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2002 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: Contains BTSU wide definitions. -* -*/ - - -// INCLUDE FILES -#include "BTServiceUtils.h" - -// CONSTANTS - -// ============================= LOCAL FUNCTIONS =============================== -// - -// ----------------------------------------------------------------------------- -// BTSUPanic -// Issues a Panic using the panic codes and name defined by this subsystem. -// Returns: None. -// ----------------------------------------------------------------------------- -// -void BTSUPanic( TBTSUPanicCode aPanic ) - { - User::Panic( KBTSUModuleName, aPanic ); - } - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/rom/obexservicebtsend.iby --- a/localconnectivityservice/obexsendservices/rom/obexservicebtsend.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2004 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: IBY file for btsendingservice -* -*/ - - -#ifndef BTSENDINGSERVICE_IBY -#define BTSENDINGSERVICE_IBY - -#ifdef __BT -ECOM_PLUGIN(obexservicebtsend.dll,101F86A2.rsc) -#endif - -#endif // BTSENDINGSERVICE_IBY - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/rom/obexserviceirsend.iby --- a/localconnectivityservice/obexsendservices/rom/obexserviceirsend.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2004 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: IBY file for btsendingservice -* -*/ - - -#ifndef IRSENDINGSERVICE_IBY -#define IRSENDINGSERVICE_IBY - -#ifdef __IRDA -ECOM_PLUGIN(obexserviceirsend.dll,001F86A2.rsc) -#endif - -#endif // IRSENDINGSERVICE_IBY - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexsendservices/rom/obexservicesendutils.iby --- a/localconnectivityservice/obexsendservices/rom/obexservicesendutils.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2004 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: IBY file for BtServiceUtils -* -*/ - - -#ifndef BTSERVICEUTILS_IBY -#define BTSERVICEUTILS_IBY - -#ifdef __BT -file=ABI_DIR\BUILD_DIR\obexservicesendutils.dll SHARED_LIB_DIR\obexservicesendutils.dll -#endif -#endif // BTSERVICEUTILS_IBY - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/BWINS/obexusbapiU.DEF --- a/localconnectivityservice/obexserviceman/BWINS/obexusbapiU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -EXPORTS - ?CancelManageUSBServices@CObexUSB@@QAEXXZ @ 1 NONAME ; void CObexUSB::CancelManageUSBServices(void) - ?ManageUSBServices@CObexUSB@@QAEXHAAVTRequestStatus@@@Z @ 2 NONAME ; void CObexUSB::ManageUSBServices(int, class TRequestStatus &) - ?NewL@CObexUSB@@SAPAV1@XZ @ 3 NONAME ; class CObexUSB * CObexUSB::NewL(void) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/cenrep/keys_obexserviceman.xls Binary file localconnectivityservice/obexserviceman/cenrep/keys_obexserviceman.xls has changed diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/conf/obexserviceman.confml Binary file localconnectivityservice/obexserviceman/conf/obexserviceman.confml has changed diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/conf/obexserviceman_20016BC5.crml Binary file localconnectivityservice/obexserviceman/conf/obexserviceman_20016BC5.crml has changed diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/eabi/obexusbapiu.DEF --- a/localconnectivityservice/obexserviceman/eabi/obexusbapiu.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -EXPORTS - _ZN8CObexUSB17ManageUSBServicesEiR14TRequestStatus @ 1 NONAME - _ZN8CObexUSB23CancelManageUSBServicesEv @ 2 NONAME - _ZN8CObexUSB4NewLEv @ 3 NONAME - _ZTI8CObexUSB @ 4 NONAME ; ## - _ZTV8CObexUSB @ 5 NONAME ; ## - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/group/backup_registration.xml --- a/localconnectivityservice/obexserviceman/group/backup_registration.xml Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/group/bld.inf --- a/localconnectivityservice/obexserviceman/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This file provides the information required for building the -* whole of a ?module_name. -* -*/ - -#include - -PRJ_PLATFORMS - - -PRJ_MMPFILES - -../group/obexserviceman.mmp -../group/obexservicemanclient.mmp -../group/obexusbapi.mmp - -PRJ_EXPORTS - -../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 - - -../rom/obex.iby /epoc32/rom/include/obex.iby -../rom/obex.iby CORE_MW_LAYER_IBY_EXPORT_PATH(obex.iby) -../rom/obexserviceman.iby CORE_MW_LAYER_IBY_EXPORT_PATH(obexserviceman.iby) -../rom/obexservicemanbt.iby CORE_MW_LAYER_IBY_EXPORT_PATH(obexservicemanbt.iby) -../rom/obexservicemanirda.iby CORE_MW_LAYER_IBY_EXPORT_PATH(obexservicemanirda.iby) -../rom/obexservicemanusb.iby CORE_MW_LAYER_IBY_EXPORT_PATH(obexservicemanusb.iby) -../rom/ObexUtils.iby CORE_MW_LAYER_IBY_EXPORT_PATH(ObexUtils.iby) -../rom/ObexUtilsResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(ObexUtilsResources.iby) - - -#include "../utils/group/bld.inf" - -#include "../plugins/group/bld.inf" - - - - - - - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/group/obexserviceman.mmp --- a/localconnectivityservice/obexserviceman/group/obexserviceman.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This is project specification file for the SRCS. -* -*/ - -#include - -TARGET obexserviceman.exe -TARGETTYPE EXE - - - - -UID 0x1000008d 0x101F7C87 -CAPABILITY CAP_SERVER CommDD NetworkControl LocalServices -VENDORID VID_DEFAULT - -EPOCHEAPSIZE 0x500 0x800000 - -EPOCSTACKSIZE 0x4000 - -SOURCEPATH ../obexservicemanserver/src -SOURCE obexsmmain.cpp -SOURCE obexsm.cpp -SOURCE SrcsSession.cpp -SOURCE SrcsServiceManager.cpp -SOURCE SrcsMessage.cpp - - - - -USERINCLUDE ../obexservicemanserver/inc -SYSTEMINCLUDE ../../inc ../../../inc /epoc32/include/ecom -MW_LAYER_SYSTEMINCLUDE - - -LIBRARY euser.lib // Kernel API -LIBRARY ecom.lib -LIBRARY obex.lib -LIBRARY obexutils.lib -LIBRARY btfeatures.lib -DEBUGLIBRARY flogger.lib // File logging diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/group/obexservicemanclient.mmp --- a/localconnectivityservice/obexserviceman/group/obexservicemanclient.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2002 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: -* SRCS client side API project file. -* -* -*/ - -#include - - -TARGET obexserviceman.dll -TARGETTYPE PLUGIN - -UID 0x10009D8D 0x20002776 -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -START RESOURCE ../obexservicemanclient/data/0x101F7C88.rss - TARGET obexserviceman.rsc -END // RESOURCE - -SOURCEPATH ../obexservicemanclient/src - -SOURCE ObexSMClient.cpp -SOURCE ObexSMPlugin.cpp -SOURCE ObexSMProxy.cpp -SOURCE ObexSMRequester.cpp - -USERINCLUDE ../obexservicemanclient/inc -SYSTEMINCLUDE ../../inc ../../../inc /epoc32/include/ecom -MW_LAYER_SYSTEMINCLUDE - - -LIBRARY euser.lib // Kernel API -LIBRARY ecom.lib -DEBUGLIBRARY flogger.lib // File logging - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/group/obexusbapi.mmp --- a/localconnectivityservice/obexserviceman/group/obexusbapi.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2002 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: -* -* -* -*/ - -#include - - -TARGET obexusbapi.dll -TARGETTYPE DLL - -UID 0x1000008D 0x1020896D -CAPABILITY CAP_GENERAL_DLL CommDD NetworkControl LocalServices -VENDORID VID_DEFAULT - - -SOURCEPATH ../obexservicemanclient/src - -SOURCE ObexSMClient.cpp -SOURCE usbobex.cpp -SOURCE usbclientwrapper.cpp - -USERINCLUDE ../obexservicemanclient/inc -SYSTEMINCLUDE ../../inc ../../../inc /epoc32/include/ecom -MW_LAYER_SYSTEMINCLUDE - - -LIBRARY euser.lib // Kernel API -DEBUGLIBRARY flogger.lib // File logging \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/inc/obexservicemanprivatecrkeys.h --- a/localconnectivityservice/obexserviceman/inc/obexservicemanprivatecrkeys.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +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: Obex Service Manager private central repository key definitions. -* -*/ - - -#ifndef OBEXSERVICEMAN_PRIVATE_CR_KEYS_H -#define OBEXSERVICEMAN_PRIVATE_CR_KEYS_H - - -/** Obex Service Manager configuration CenRep UID */ -const TUid KCRUidObexServiceMan = { 0x20016BC5 }; - - -/** - * CenRep key for storing Obex USB DMA usage settings. - * - * Possible integer values: - * 0 USB DMA is not in use - * 1 USB DMA is in use - * - * Default value: 1 - * - */ -const TUint32 KObexUsbDmaUsage = 0x00000001; - -/** Enumeration for obex usb dma usage*/ -enum TObexUsbDmaUsage - { - EObexUsbDmaNotInUse = 0, - EObexUsbDmaInUse = 1 - }; - -#endif // OBEXSERVICEMAN_PRIVATE_CR_KEYS_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanclient/data/0x101F7C88.rss --- a/localconnectivityservice/obexserviceman/obexservicemanclient/data/0x101F7C88.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +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: Resource definitions for project ?myapp -* -*/ - - -#include "registryinfov2.rh" -#include "locodplugin.hrh" - -RESOURCE REGISTRY_INFO theInfo - { - // resource_format_version must always be set as follows - resource_format_version = RESOURCE_FORMAT_VERSION_2; - - // UID for the DLL - dll_uid = 0x20002776; - - // Declare array of interface info - interfaces = - { - INTERFACE_INFO - { - // UID of interface that is implemented - interface_uid = KLOCODSERVICEINTERFACEUID; - implementations = - { - // Info for CDunPlugin - IMPLEMENTATION_INFO - { - implementation_uid = KFeatureIdSrcs ; - version_no = 1; - display_name = "ObexService Plugin"; - default_data = ""; - opaque_data = ""; - - // This implementation CANNOT be overridden by a RAM-based plug-in - rom_only = 1; - } - }; - } - }; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanclient/inc/ObexSMPlugin.h --- a/localconnectivityservice/obexserviceman/obexservicemanclient/inc/ObexSMPlugin.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +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: This is the ObexServiceManager ecom plugin class declaration. -* -*/ - - -#ifndef OBEXSERVICEMANPLUGIN_H -#define OBEXSERVICEMANPLUGIN_H - -#include - -#include -#include -#include - - -#include "obexsmclient.h" - - -class CObexSMRequester; -class RObexSMServer; - -class MObexSMRequestObserver - { -public: - /** - * Tell service plugin that request has been completed. - * - * @since S60 v3.2 - * @param aBearer a Request to be completed - * @param aError Error code - */ - virtual void RequestComplete(CObexSMRequester* aRequest, TInt err) = 0; - - /** - * Get Obexservicemanager server interface - * - * @since S60 v3.2 - * @return Client handle. - */ - virtual RObexSMServer& GetServer()=0; - - }; - - - -/** - * ObexServiceManPlugin class - * - * This is the ObexServiceMan ecom plugin class - * @lib ?library - * @since S60 v3.2 - */ -class CObexSMPlugin : public CLocodServicePlugin, public MObexSMRequestObserver - { -public: - - /** - * Two-phased constructor. - * @param aParams the LocodServicePluginParams - */ - static CObexSMPlugin* NewL(TLocodServicePluginParams& aParams); - - /** - * Destructor. - */ - ~CObexSMPlugin(); - - /** - * Tell service plugin which service should be enabled or disabled according to - * specified bearer and its status. - * @since S60 v3.2 - * @param aBearer the bearer identification - * @param aStatus the status of this bearer, ETrue if it is available; - * EFalse otherwise. - */ - void ManageService(TLocodBearer aBearer, TBool aStatus); - - /** - * Tell service plugin that request has been completed. - * @since S60 v3.2 - * @param aRequest the Request to be completed. - * @param aError Error code - */ - void RequestComplete(CObexSMRequester* aRequest, TInt aError); - - /** - * Get Obexservicemanager server interface - * @since S60 v3.2 - * @return Client handle. - */ - RObexSMServer& GetServer(); - -private: - - CObexSMPlugin(TLocodServicePluginParams& aParams); - void ConstructL(); - -private: // data - RObexSMServer iObexSMServer; - RPointerArray iRequests; - }; - - - -#endif // OBEXSERVICEMANPLUGIN_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanclient/inc/ObexSMRequester.h --- a/localconnectivityservice/obexserviceman/obexservicemanclient/inc/ObexSMRequester.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: obexservicemanager client request class -* -*/ - - -#ifndef OBEXSMREQUESTER_H -#define OBEXSMREQUESTER_H - -#include - -#include -#include "ObexSMPlugin.h" - -class MObexSMRequestObserver; - - -/** - * Active object request class - * - * Its instance will be used to control Asynchronous request - * from ECom plugin to obex service manager server - * - * @lib obexserviceman.lib - * @since S60 3.2 - */ -NONSHARABLE_CLASS(CObexSMRequester) : public CActive - { - -public: - - /** - * Two-phased constructor. - * - * @param aObserver the request completing observer - * @param aBearer the bearer identification - * @param aBearStatus the status of this bearer, ETrue - if it is available EFalse otherwise. - */ - static CObexSMRequester* NewL(MObexSMRequestObserver* aObserver, - TLocodBearer aBearer, TBool aBearStatus); - - /** - * Two-phased constructor. - * - * @param aObserver the request completing observer - * @param aBearer the bearer identification - * @param aBearStatus the status of this bearer, ETrue - if it is available EFalse otherwise. - */ - static CObexSMRequester* NewLC(MObexSMRequestObserver* aObserver, - TLocodBearer aBearer, TBool aBearStatus); - /** - * Destructor. - */ - virtual ~CObexSMRequester(); - - /** - * Request function - * - * @since S60 3.2 - */ - void ActivateRequest(); - /** - * Get Request Status - * - * @since S60 3.2 - * @return the requested status - */ - TBool GetStatus(); - - /** - * Get the requested bearer - * - * @since S60 3.2 - * @return the requested bearer - */ - TLocodBearer GetBearer(); - -protected: - - // from base class CActive - /** - * From CActive. - * Cancel current activity. - * - * @since S60 3.2 - */ - void DoCancel(); - - /** - * From CActive. - * Called when read or write operation is ready. - * - * @since S60 3.2 - */ - void RunL(); - - /** - * From CActive. - * Called if RunL() leaves. Retry listening after error. - * - * @since S60 3.x - * @param aError the error code - */ - TInt RunError( TInt aError ); - -private: - - - CObexSMRequester(MObexSMRequestObserver* aObserver, TLocodBearer aBearer, TBool aBearStatus); - - void ConstructL(); - -private: // data - - MObexSMRequestObserver* iObserver; - TLocodBearer iBearer; - TBool iBearStatus; - }; - - -#endif // OBEXSMREQUESTER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanclient/inc/debug.h --- a/localconnectivityservice/obexserviceman/obexservicemanclient/inc/debug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,175 +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: Logging definition -* -*/ - - -#ifndef PRJ_LOGGING_H -#define PRJ_LOGGING_H - -#include "debugconfig.h" - -#ifdef PRJ_ENABLE_TRACE - -#ifdef PRJ_FILE_TRACE -#include -#else -#include -#endif - -const TInt KMaxLogLineLength = 512; - -#define KPRINTERROR 0x00000001 // Tracing level: error -#define KPRINTINFO 0x00000002 // Tracing level: function trace -#define KPRINTSTATE 0x00000004 // Tracing level: state machine info -#define KPRINTWARNING 0x00000008 // Tracing level: warning - -const TInt KTraceMask = KPRINTERROR | KPRINTINFO | KPRINTSTATE | KPRINTWARNING; - -NONSHARABLE_CLASS(TOverflowTruncate16) : public TDes16Overflow - { -public: - void Overflow(TDes16& /*aDes*/) {} - }; - -NONSHARABLE_CLASS(TOverflowTruncate8) : public TDes8Overflow - { -public: - void Overflow(TDes8& /*aDes*/) {} - }; - -inline void Trace(TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); -#ifdef PRJ_FILE_TRACE - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); -#else - TBuf16 theFinalString; - theFinalString.Append(KTracePrefix16); - TOverflowTruncate16 overflow; - theFinalString.AppendFormatList(aFmt,list,&overflow); - RDebug::Print(theFinalString); -#endif - } - -inline void Trace(TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list, aFmt); -#ifdef PRJ_FILE_TRACE - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); -#else - TOverflowTruncate8 overflow; - TBuf8 buf8; - buf8.Append(KTracePrefix8); - buf8.AppendFormatList(aFmt, list, &overflow); - TBuf16 buf16(buf8.Length()); - buf16.Copy(buf8); - TRefByValue tmpFmt(_L("%S")); - RDebug::Print(tmpFmt, &buf16); -#endif - } - -inline void TracePanic( - char* aFile, - TInt aLine, - TInt aPanicCode, - const TDesC& aPanicCategory) - { - TPtrC8 fullFileName((const TUint8*)aFile); - TPtrC8 fileName(fullFileName.Ptr()+fullFileName.LocateReverse('\\')+1); - TBuf8 buf; - buf.Append(KPanicPrefix8); - buf.AppendFormat(_L8("%d at line %d in file %S"), aPanicCode, aLine, &fileName); - Trace(buf); - User::Panic(aPanicCategory, aPanicCode); - } - -inline void TraceLeave(char* aFile, TInt aLine, TInt aReason) - { - TPtrC8 fullFileName((const TUint8*)aFile); - TPtrC8 fileName(fullFileName.Ptr()+fullFileName.LocateReverse('\\')+1); - TBuf8 buf; - buf.Append(KLeavePrefix8); - buf.AppendFormat(_L8("%d at line %d in file %S"), aReason, aLine, &fileName); - Trace(buf); - User::LeaveIfError(aReason); - } - -#define TRACE_INFO(p) {if(KTraceMask & KPRINTINFO) Trace p;} - -#define TRACE_ERROR(p) {if(KTraceMask & KPRINTERROR) Trace p;} - -#define TRACE_STATE(p) {if(KTraceMask & KPRINTSTATE) Trace p;} - -#define TRACE_WARNING(p) {if(KTraceMask & KPRINTWARNING) Trace p;} - -#define TRACE_INFO_SEG(p) {if(KTraceMask & KPRINTINFO) p;} - -#define TRACE_ASSERT(GUARD, CODE) {if (!(GUARD)) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory);} - -#define PANIC(CODE) TracePanic(__FILE__, __LINE__, CODE, KPanicCategory) - -#define LEAVE_IF_ERROR(REASON) {if (REASON) TraceLeave(__FILE__, __LINE__, REASON);} - -#define LEAVE(REASON) {TraceLeave(__FILE__, __LINE__, REASON);} - -#define TRACE_FUNC_ENTRY {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryFormat8, &ptr8);}} - -#define TRACE_FUNC_ENTRY_THIS {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncEntryThisFormat8, &ptr8, this);}} - -#define TRACE_FUNC_EXIT {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncExitFormat8, &ptr8);}} - -#define TRACE_FUNC {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncFormat8, &ptr8);}} - -#define TRACE_FUNC_THIS {if(KTraceMask & KPRINTINFO) { TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); Trace(KFuncThisFormat8, &ptr8, this);}} - -#define RETURN_IF_ERR(ERR) {if(ERR) {TPtrC8 ptr8((TUint8*)__FILE__); Trace(_L8(" RETURN %d at file %S line %d"), ERR, &ptr8, __LINE__); return ERR;}} - -#else // PRJ_ENABLE_TRACE not defined - -#define TRACE_INFO(p) - -#define TRACE_ERROR(p) - -#define TRACE_STATE(p) - -#define TRACE_WARNING(p) - -#define TRACE_INFO_SEG(p) - -#define TRACE_ASSERT(GUARD, CODE) - -#define PANIC(CODE) {User::Panic(KPanicCategory, CODE);} - -#define LEAVE_IF_ERROR(REASON) {static_cast(User::LeaveIfError(REASON));} - -#define LEAVE(REASON) {static_cast(User::Leave(REASON));} - -#define TRACE_FUNC_ENTRY - -#define TRACE_FUNC_ENTRY_THIS - -#define TRACE_FUNC_EXIT - -#define TRACE_FUNC - -#define TRACE_FUNC_THIS - -#define RETURN_IF_ERR(ERR) {if(ERR) return ERR;} -#endif // PRJ_ENABLE_TRACE - -#endif // PRJ_LOGGING_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanclient/inc/debugconfig.h --- a/localconnectivityservice/obexserviceman/obexservicemanclient/inc/debugconfig.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +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: Project configure file. -* -*/ - - -#ifndef OBEXSM_DEBUGCONFIG_H -#define OBEXSM_DEBUGCONFIG_H - -#include "prjconfig.h" - - -/** - * Custom logging variations. - */ -#ifdef PRJ_FILE_TRACE -_LIT(KLogFile,"obexservicemanclient.txt"); -_LIT(KLogDir,"locod"); -#endif - -#ifdef PRJ_ENABLE_TRACE -_LIT(KTracePrefix16, "[ObexSM] "); -_LIT8(KTracePrefix8, "[ObexSM] "); -_LIT8(KFuncFormat8, "><%S"); -_LIT8(KFuncThisFormat8, "><%S, [0x%08X]"); -_LIT8(KFuncEntryFormat8, ">%S"); -_LIT8(KFuncEntryThisFormat8, ">%S, [0x%08X]"); -_LIT8(KFuncExitFormat8, "<%S"); - -_LIT(KPanicCategory, "ObexSM"); -_LIT8(KPanicPrefix8, "PANIC code "); -_LIT8(KLeavePrefix8, "LEAVE code "); -#endif - -#endif // OBEXSM_DEBUGCONFIG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanclient/inc/obexsmclient.h --- a/localconnectivityservice/obexserviceman/obexservicemanclient/inc/obexsmclient.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: obexservicemanager client class definition -* -*/ - - -#ifndef OBEXSMCLIENT_H -#define OBEXSMCLIENT_H - -// INCLUDES -#include -#include -#include "usbobex.h" - -/// server name -_LIT(KSrcsName,"obexserviceman"); - -// Server path - -_LIT(KSrcsImg,"z:\\sys\\bin\\obexserviceman.exe"); - -// A version must be specifyed when creating a session with the server -const TUint KSrcsMajorVersionNumber=1; -const TUint KSrcsMinorVersionNumber=0; -const TUint KSrcsBuildVersionNumber=1; - -// SRCS Server Uid -const TUid KSrcsUid={0x101F7C87}; - -// Opcodes used in message passing between client and server -enum TSrcsServRequest -{ - ESrcsBTServicesON, - ESrcsBTServicesOFF, - ESrcsStartUSB, - ESrcsStopUSB, - ESrcsIrDAServicesON, - ESrcsIrDAServicesOFF, - ESrcsCancelRequest -}; - - - - -/** -* Client side thread starting function -* Start the server when client tries to contact it if it is not allready running -*/ -TInt StartThread(); - -/** - * The client class. An RSessionBase sends messages to the server with the function - * RSessionBase::SendReceive(); specifying an opcode and and array of argument pointers. - * Functions in derived classes, such as RSrcs::InitialiseServices(), are wrappers for different calls to - * SendReceive(). - */ -NONSHARABLE_CLASS (RObexSMServer): public RSessionBase - { -public: // Constructor - - /** - * C++ default constructor. - */ - RObexSMServer(); - -public: - - /** - * Turns BT services ON/OFF depending on given parameter. - * - * @since S60 v3.2 - * @param TBool aState Boolean value to toggle services. - * @return TInt indicating the success of call. - */ - TInt ManageServices(TLocodBearer aBearer, TBool aBearStatus,TRequestStatus &aStatus ); - - -public: // Functions from base classes - - /** - * From RSessionBase informs current version - * - * @since S60 v3.2 - * @return Version information about the server - */ - TVersion Version() const; - - /** - * From RSessionBase connect to the server - * - * @since S60 v3.2 - */ - TInt Connect(); - - /** - * Cancel pending request - * - * @since S60 v3.2 - */ - void CancelRequest(); - - -private: // Data - - RProcess iProses; - }; - - -#endif // OBEXSMCLIENT_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanclient/inc/prjconfig.h --- a/localconnectivityservice/obexserviceman/obexservicemanclient/inc/prjconfig.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +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: Project configure file. -* -*/ - - -#ifndef OBEXSM_PRJCONFIG_H -#define OBEXSM_PRJCONFIG_H - -/** - * Traces are enabled via RDebug::Print() in UDEB build, by default. - */ -#ifdef _DEBUG -#define PRJ_ENABLE_TRACE -#endif - -/** - * Traces will be written to file if this is defined. - */ -//#define PRJ_FILE_TRACE - - -/** - * build the project for module test purpose if this is defined - */ -//#define PRJ_MODULETEST_BUILD - -/** - * build the project using stubs to replace the dependencies if this is defined - */ -//#define PRJ_USE_STUB - -#endif // OBEXSM_PRJCONFIG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanclient/inc/usbclientwrapper.h --- a/localconnectivityservice/obexserviceman/obexservicemanclient/inc/usbclientwrapper.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* Copyright (c) 2007-2007 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: Obexserviceman client handling for usbobex api -* -*/ - - - -#ifndef CUSBCLIENTWRAPPER_H -#define CUSBCLIENTWRAPPER_H - - -#include -#include "obexsmclient.h" - - -/** - * Obexserviceman client handling for usbobex api - * - * - * @since S60 S60 v3.2 - */ -NONSHARABLE_CLASS (CUSBClientWrapper) : public CBase - { - - -public: - - static CUSBClientWrapper* NewL(); - - /** - * Destructor. - */ - virtual ~CUSBClientWrapper(); - - /** - * Turn USB services on or off - * - * @since S60 v3.2 - * @param aUSBStatus the requested USB service status - * @param aStatus the Request status - * @return None - */ - void ManageUSBServices(TBool aUSBStatus, TRequestStatus &aStatus); - - /** - * Cancel managment request and turn services off - * @since S60 v3.2 - * - */ - void CancelManageUSBServices(); - -private: - - - CUSBClientWrapper(); - - void ConstructL(); - -private: // data - - /** - * ObexServer Manager client - */ - RObexSMServer iServer; - - }; -#endif // CUSBCLIENTWRAPPER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanclient/inc/usbobex.h --- a/localconnectivityservice/obexserviceman/obexservicemanclient/inc/usbobex.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: USB obexservicemanager client definition -* -*/ - - -#ifndef USBOBEX_H -#define USBOBEX_H - -#include - - -class CUSBClientWrapper; - - -/** -* Transportation string definition -*/ -_LIT8(KSrcsTransportBT,"OBEX/BT"); -_LIT8(KSrcsTransportUSB,"OBEX/USB"); -_LIT8(KSrcsTransportIrDA,"OBEX/IrDA"); - - -/** - * obexservicemanager client for usb. - * @lib obexusbapi.lib - * @since S60 v3.2 - */ -class CObexUSB : public CBase - { -public: - - /** - * Two-phased constructor. - */ - IMPORT_C static CObexUSB* NewL(); - - /** - * Destructor. - */ - ~CObexUSB(); - - /** - * Turn USB services on or off - * - * @since S60 v3.2 - * @param aUSBStatus the requested USB service status - * @param aStatus the Request status - * @return None - */ - IMPORT_C void ManageUSBServices( TBool aUSBStatus, TRequestStatus &aStatus ); - - /** - * Cancel managment request and turn services off - * @since S60 v3.2 - * - */ - IMPORT_C void CancelManageUSBServices(); - -private: - - CObexUSB(); - void ConstructL(); - -private: //data - - /** - * Obexserviceman client wrapper - */ - CUSBClientWrapper* iUSBWrapper; - }; -#endif // USBOBEX_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanclient/src/ObexSMClient.cpp --- a/localconnectivityservice/obexserviceman/obexservicemanclient/src/ObexSMClient.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,271 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: obexservicemanager client class implementation -* -*/ - - -// INCLUDE FILES -#include "obexsmclient.h" -#include -#include "debug.h" - - -// CONSTANTS -const TInt KServerConnectRetries = 2; // How many times client tries to make connection to server - -// ======== LOCAL FUNCTIONS ======== - -// --------------------------------------------------------- -// StartThread -// -// Create the server thread/process depending on the framework. -// This function is exported from the DLL and called from the client -// RObexSMServer::Connect() -method. -// Returns: TInt: Error Code -// -// --------------------------------------------------------- - -TInt StartThread() - { - TRACE_FUNC - - TInt retVal = KErrNone; - // create server - if one of this name does not already exist - TFindServer findSrcs(KSrcsName); - TFullName name; - - if ( findSrcs.Next( name ) != KErrNone ) // we don't exist already - { - TRequestStatus started; - //TSrcsStart start( started ); - const TUidType serverUid( KNullUid,KNullUid,KSrcsUid ); - - // Then we have to create the server - // This depends on if we are in WINS or target HW environment. - - TRACE_INFO(_L("[SRCS]\tclient\tSrcs StartThread(): create the server")); - // We are on target HW or EKA2 WINS. - // New process has to be created for the SRCS - RProcess server; - retVal=server.Create(KSrcsName, // Full path to SRCS - KNullDesC, // Descriptor of parameters - serverUid); // Triplet UID of executable - - // Check the return value of process creation - if ( retVal != KErrNone ) - { - // Loading failed. - TRACE_ERROR((_L("[SRCS]\tclient\tSrcs StartThread(): process creation failed %d"), retVal)); - return retVal; - } - - TRACE_INFO(_L("[SRCS]\tclient\tSrcs StartThread(): Process created successfully")); - - - // Process/Thread has been created - // Now logon to the server - TRequestStatus stat; - //server.Logon(died); - server.Rendezvous(stat); - - if (stat!=KRequestPending) - { - server.Kill(0); // abort startup - //FTRACE(FPrint(_L("c\tclient\tSrcs abort startup.\n"))); - } - else - { - server.Resume(); // logon OK - start the server - //FTRACE(FPrint(_L("c\tclient\tSrcs Resumed.\n"))); - } - - // Then wait the start or death of the server. - User::WaitForRequest(stat); - - // we can't use the 'exit reason' if the server panicked as this - // is the panic 'reason' and may be '0' which cannot be distinguished - // from KErrNone - TRACE_INFO((_L("[SRCS]\tclient\tSrcs Server started, code %d (0=>success)\n"), stat.Int())); - retVal=(server.ExitType()==EExitPanic) ? KErrGeneral : stat.Int(); - - server.Close(); - TRACE_INFO(_L("[SRCS]\tclient\tSrcs server handle closed.")); - } - - return retVal; - } - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------------------------- -// Default constructor -// --------------------------------------------------------------------------- -// -RObexSMServer::RObexSMServer() - { - } - - -// --------------------------------------------------------- -// Connect -// Handles connection to server( creates session ) -// --------------------------------------------------------- -// -TInt RObexSMServer::Connect() - { - TRACE_FUNC - - // IF there is allready a session handle, - // no other session is created. - if ( Handle() ) - { - return KErrAlreadyExists; - } - - // Else try to create a new session with server - TInt retry= KServerConnectRetries; - - FOREVER - { - // Try to make session with server - TInt retVal=CreateSession(KSrcsName,Version()); - TRACE_INFO((_L("[SRCS]\tclient\tRSrcs: create Session returned: %d"), retVal)); - if ( retVal != KErrNotFound && retVal != KErrServerTerminated ) - { - // Error which can't be handled happened. - return retVal; - } - // Decrease count - --retry; - if ( retry == 0 ) - { - return retVal; - } - - // Try to start the server - TRACE_INFO(_L("[SRCS]\tclient\tRSrcs::Connect(): try to start server")); - retVal=StartThread(); - TRACE_INFO((_L("[SRCS]\tclient\tRSrcs: StartThread returned: %d"), retVal)); - - if ( retVal != KErrNone && retVal != KErrAlreadyExists ) - { - // Error can't be handled. - return retVal; - } - } - - } - -// --------------------------------------------------------- -// Version -// Defines server version number -// --------------------------------------------------------- -// -TVersion RObexSMServer::Version() const - { - TRACE_FUNC - return( TVersion( KSrcsMajorVersionNumber, - KSrcsMinorVersionNumber, - KSrcsBuildVersionNumber )); - } - -// --------------------------------------------------------- -// ManageServices -// Sends Manage services command to SRCS. -// --------------------------------------------------------- -// -TInt RObexSMServer::ManageServices(TLocodBearer aBearer, TBool aBearStatus,TRequestStatus &aStatus ) - { - TRACE_FUNC - TInt retVal = KErrNone; - - TPckgBuf pckg; - TIpcArgs args( &pckg, NULL, NULL ); - TSrcsServRequest request; - - switch(aBearer) - { - case ELocodBearerBT: - { - if(aBearStatus) - { - request=ESrcsBTServicesON; - } - else - { - request=ESrcsBTServicesOFF; - } - } - break; - case ELocodBearerIR: - { - if(aBearStatus) - { - request=ESrcsIrDAServicesON; - } - else - { - request=ESrcsIrDAServicesOFF; - } - } - break; - case ELocodBearerUSB: - { - if(aBearStatus) - { - request=ESrcsStartUSB; - } - else - { - request=ESrcsStopUSB; - } - } - break; - default: - { - TRACE_ERROR(_L("[SRCS]\tclient\tRSrcs Manageservice: Bad bearer")); - return KErrArgument; - } - } - if ( Handle() ) - { - SendReceive( request, args, aStatus ); - } - else - { - TRACE_ERROR(_L("[SRCS]\tclient\tRSrcs ManageBTServices. No Handle")); - retVal = KErrBadHandle; - } - return retVal; - } - -// --------------------------------------------------------- -// CancelRequest -// --------------------------------------------------------- -// -void RObexSMServer::CancelRequest() - { - TPckgBuf pckg; - TIpcArgs args( &pckg, NULL, NULL ); - TSrcsServRequest request; - request=ESrcsCancelRequest; - if ( Handle() ) - { - SendReceive( request, args ); - } - - } -//end of file - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanclient/src/ObexSMPlugin.cpp --- a/localconnectivityservice/obexserviceman/obexservicemanclient/src/ObexSMPlugin.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +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: This is the ObexServiceManager ecom plugin class implementation. -* -*/ - - -#include "ObexSMPlugin.h" -#include "ObexSMRequester.h" -#include "debug.h" - -// --------------------------------------------------------------------------- -// NewL -// --------------------------------------------------------------------------- -CObexSMPlugin* CObexSMPlugin::NewL(TLocodServicePluginParams& aParams) - { - TRACE_FUNC - CObexSMPlugin* self = new (ELeave) CObexSMPlugin(aParams); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -CObexSMPlugin::~CObexSMPlugin() - { - TRACE_FUNC_ENTRY - iRequests.ResetAndDestroy(); - iRequests.Close(); - if(iObexSMServer.Handle()) - { - iObexSMServer.Close(); - } - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// ManageService -// --------------------------------------------------------------------------- -// -void CObexSMPlugin::ManageService(TLocodBearer aBearer, TBool aStatus) - { - TRACE_FUNC_ENTRY - TInt err = KErrNone; - CObexSMRequester* request=NULL; - - if(!iObexSMServer.Handle()) - { - err = iObexSMServer.Connect(); - } - if(err == KErrNone && aBearer != ELocodBearerUSB) - { - TRAP(err, request = CObexSMRequester::NewL(this, aBearer, aStatus)); - if(err==KErrNone) - { - err=iRequests.Append( request ); - if(err==KErrNone) - { - request->ActivateRequest(); - } - } - } - else if(err == KErrNone && aBearer == ELocodBearerUSB) - { - Observer().ManageServiceCompleted(aBearer,aStatus,ImplementationUid(), KErrNone); - } - - if(err!=KErrNone) - { - Observer().ManageServiceCompleted(aBearer,aStatus,ImplementationUid(), err); - } - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// - -CObexSMPlugin::CObexSMPlugin(TLocodServicePluginParams& aParams) - : CLocodServicePlugin(aParams) - { - } - -// --------------------------------------------------------------------------- -// ConstructL -// --------------------------------------------------------------------------- -// -void CObexSMPlugin::ConstructL() - { - TRACE_FUNC - } - -// --------------------------------------------------------------------------- -// RequestComplete -// --------------------------------------------------------------------------- -// -void CObexSMPlugin::RequestComplete(CObexSMRequester* aRequest, TInt aError) - { - TRACE_FUNC_ENTRY - - TLocodBearer bearer= aRequest->GetBearer(); - TBool status = aRequest->GetStatus(); - for(TInt index=0; index //ECom header file -#include "ObexSMPlugin.h" - -// --------------------------------------------------------------------------- -// An array of TImplementationProxy objects which onnect each -// implemeation with its instantiation function -// --------------------------------------------------------------------------- -// -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY(KFeatureIdSrcs , CObexSMPlugin::NewL) - }; - -// --------------------------------------------------------------------------- -// Exported proxy function to resolve instantiation methods for an Ecom plug-in DLL -// --------------------------------------------------------------------------- -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt & aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - return ImplementationTable; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanclient/src/ObexSMRequester.cpp --- a/localconnectivityservice/obexserviceman/obexservicemanclient/src/ObexSMRequester.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,160 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: obexservicemanager client request class implementation -* -*/ - - - -#include "ObexSMPlugin.h" -#include "ObexSMRequester.h" -#include "obexsmclient.h" -#include "debug.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// NewL -// --------------------------------------------------------------------------- -// -CObexSMRequester* CObexSMRequester::NewL(MObexSMRequestObserver* aObserver, TLocodBearer aBearer, TBool aStatus) - { - TRACE_FUNC - CObexSMRequester* self = CObexSMRequester::NewLC(aObserver, aBearer,aStatus); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// NewLC -// --------------------------------------------------------------------------- -// -CObexSMRequester* CObexSMRequester::NewLC(MObexSMRequestObserver* aObserver, TLocodBearer aBearer, TBool aStatus) - { - TRACE_FUNC - CObexSMRequester* self = new( ELeave ) CObexSMRequester(aObserver,aBearer,aStatus); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// destructor -// --------------------------------------------------------------------------- -// -CObexSMRequester::~CObexSMRequester() - { - TRACE_FUNC - Cancel(); - } - - -// --------------------------------------------------------------------------- -// DoCancel -// --------------------------------------------------------------------------- -// -void CObexSMRequester::DoCancel() - { - - } -// --------------------------------------------------------------------------- -// RunL -// --------------------------------------------------------------------------- -// -void CObexSMRequester::RunL() - { - TRACE_FUNC - iObserver->RequestComplete(this,iStatus.Int()); - } -// --------------------------------------------------------------------------- -// RunError -// --------------------------------------------------------------------------- -// -TInt CObexSMRequester::RunError( TInt aError ) - { - TRACE_FUNC - iObserver->RequestComplete(this,aError); - return KErrNone; - } -// --------------------------------------------------------------------------- -// ActivateRequest -// --------------------------------------------------------------------------- -// -void CObexSMRequester::ActivateRequest() - { - TRACE_FUNC_ENTRY - TInt err; - RObexSMServer smServer; - if(iObserver) - { - smServer=iObserver->GetServer(); - iStatus = KRequestPending; - err=smServer.ManageServices(iBearer, iBearStatus, iStatus ); - if(err==KErrNone) - { - SetActive(); - } - else - { - iObserver->RequestComplete(this,err); - } - } - TRACE_FUNC_EXIT - } -// --------------------------------------------------------------------------- -// CObexSMRequester -// --------------------------------------------------------------------------- -// -CObexSMRequester::CObexSMRequester(MObexSMRequestObserver* aObserver, - TLocodBearer aBearer, TBool aBearStatus) - : CActive(EPriorityStandard), - iObserver(aObserver), - iBearer(aBearer), - iBearStatus(aBearStatus) - { - TRACE_FUNC - CActiveScheduler::Add( this ); - } - - -// --------------------------------------------------------------------------- -// ConstructL -// --------------------------------------------------------------------------- -// -void CObexSMRequester::ConstructL() - { - TRACE_FUNC - } - -// --------------------------------------------------------------------------- -// GetStatus -// --------------------------------------------------------------------------- -// -TBool CObexSMRequester::GetStatus() - { - return iBearStatus; - } - -// --------------------------------------------------------------------------- -// GetBearer -// --------------------------------------------------------------------------- -// -TLocodBearer CObexSMRequester::GetBearer() - { - return iBearer; - } -//End of file - - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanclient/src/usbclientwrapper.cpp --- a/localconnectivityservice/obexserviceman/obexservicemanclient/src/usbclientwrapper.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -/* -* Copyright (c) 2007-2007 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: Wrapper class for usb client -* -*/ - - - -#include "usbclientwrapper.h" -#include "debug.h" - -// ======== MEMBER FUNCTIONS ======== - - -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// -CUSBClientWrapper::CUSBClientWrapper() - { - TRACE_FUNC - } - - -// --------------------------------------------------------------------------- -// ConstructL -// --------------------------------------------------------------------------- -// -void CUSBClientWrapper::ConstructL() - { - TRACE_FUNC - } - - -// --------------------------------------------------------------------------- -// NewL -// --------------------------------------------------------------------------- -// -CUSBClientWrapper* CUSBClientWrapper::NewL() - { - CUSBClientWrapper* self = new (ELeave) CUSBClientWrapper(); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// destructor -// --------------------------------------------------------------------------- -// -CUSBClientWrapper::~CUSBClientWrapper() - { - TRACE_FUNC_ENTRY - if( iServer.Handle() ) - { - iServer.Close(); - } - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// ManageUSBServices -// --------------------------------------------------------------------------- -// -void CUSBClientWrapper::ManageUSBServices(TBool aUSBStatus, - TRequestStatus &aStatus) - { - TRACE_FUNC_ENTRY - TInt err = KErrNone; - TRequestStatus* status = &aStatus; - aStatus = KRequestPending; - if( !iServer.Handle() ) - { - err = iServer.Connect(); - } - if( err != KErrNone ) - { - User::RequestComplete( status, err ); - return; - } - err=iServer.ManageServices( ELocodBearerUSB, aUSBStatus, aStatus ); - if ( err != KErrNone ) - { - User::RequestComplete( status, err ); - } - TRACE_FUNC_EXIT - } - -// --------------------------------------------------------------------------- -// CancelManageUSBServices -// --------------------------------------------------------------------------- -// -void CUSBClientWrapper::CancelManageUSBServices() - { - if ( iServer.Handle() ) - { - iServer.CancelRequest(); - } - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanclient/src/usbobex.cpp --- a/localconnectivityservice/obexserviceman/obexservicemanclient/src/usbobex.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +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: USB obexservicemanager client implementation -* -*/ - - -#include "usbobex.h" -#include "debug.h" -#include "obexsmclient.h" -#include "usbclientwrapper.h" - -// --------------------------------------------------------------------------- -// NewL -// --------------------------------------------------------------------------- -EXPORT_C CObexUSB* CObexUSB::NewL() - { - TRACE_FUNC - CObexUSB* self = new (ELeave) CObexUSB(); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -CObexUSB::~CObexUSB() - { - delete iUSBWrapper; - iUSBWrapper = NULL; - } - -// --------------------------------------------------------------------------- -// ManageUSBServices -// --------------------------------------------------------------------------- -// -EXPORT_C void CObexUSB::ManageUSBServices(TBool aUSBStatus, TRequestStatus &aStatus) - { - iUSBWrapper->ManageUSBServices( aUSBStatus, aStatus ); - } - -// --------------------------------------------------------------------------- -// CancelManageUSBServices -// --------------------------------------------------------------------------- -// -EXPORT_C void CObexUSB::CancelManageUSBServices() - { - iUSBWrapper->CancelManageUSBServices(); - } - -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// -CObexUSB::CObexUSB() - { - } - -// --------------------------------------------------------------------------- -// ConstructL -// --------------------------------------------------------------------------- -// -void CObexUSB::ConstructL() - { - TRACE_FUNC - iUSBWrapper = CUSBClientWrapper::NewL(); - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/bwins/SrcsClientU.DEF --- a/localconnectivityservice/obexserviceman/obexservicemanserver/bwins/SrcsClientU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -EXPORTS - ??0RSrcs@@QAE@XZ @ 1 NONAME ; RSrcs::RSrcs(void) - ?Connect@RSrcs@@QAEHXZ @ 2 NONAME ; int RSrcs::Connect(void) - ?GetDescriptorInfo@RSrcs@@QBEHAAVTSrcsUsbDescriptorInfo@@@Z @ 3 NONAME ; int RSrcs::GetDescriptorInfo(class TSrcsUsbDescriptorInfo &) const - ?GetIrDAState@RSrcs@@QBEHAAH@Z @ 4 NONAME ; int RSrcs::GetIrDAState(int &) const - ?ManageBTServices@RSrcs@@QAEHH@Z @ 5 NONAME ; int RSrcs::ManageBTServices(int) - ?ManageIrDAServices@RSrcs@@QAEHH@Z @ 6 NONAME ; int RSrcs::ManageIrDAServices(int) - ?SignalL@TSrcsStart@@QAEXXZ @ 7 NONAME ; void TSrcsStart::SignalL(void) - ?StartThread@@YAHXZ @ 8 NONAME ; int StartThread(void) - ?StartUSB@RSrcs@@QAEHXZ @ 9 NONAME ; int RSrcs::StartUSB(void) - ?StopUSB@RSrcs@@QAEHXZ @ 10 NONAME ; int RSrcs::StopUSB(void) - ?Version@RSrcs@@QBE?AVTVersion@@XZ @ 11 NONAME ; class TVersion RSrcs::Version(void) const - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/eabi/SrcsClientu.DEF --- a/localconnectivityservice/obexserviceman/obexservicemanserver/eabi/SrcsClientu.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -EXPORTS - _Z11StartThreadv @ 1 NONAME - _ZN10TSrcsStart7SignalLEv @ 2 NONAME - _ZN5RSrcs16ManageBTServicesEi @ 3 NONAME - _ZN5RSrcs18ManageIrDAServicesEi @ 4 NONAME - _ZN5RSrcs7ConnectEv @ 5 NONAME - _ZN5RSrcs7StopUSBEv @ 6 NONAME - _ZN5RSrcs8StartUSBEv @ 7 NONAME - _ZN5RSrcsC1Ev @ 8 NONAME - _ZN5RSrcsC2Ev @ 9 NONAME - _ZNK5RSrcs12GetIrDAStateERi @ 10 NONAME - _ZNK5RSrcs17GetDescriptorInfoER22TSrcsUsbDescriptorInfo @ 11 NONAME - _ZNK5RSrcs7VersionEv @ 12 NONAME - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsClSv.h --- a/localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsClSv.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: ObexServicemanager opcodes, panic enumerations and other -* definitions. -* -*/ - - -#ifndef _SRCSCLSV_H -#define _SRCSCLSV_H - -// INCLUDES - -#include - -// CONSTANTS - -// Panic definitions -_LIT(KSrcsPanic,"Srcs panic"); - -// reasons for server panic -enum TSrcsPanic -{ - ESrcsBadRequest, - ESrcsBadDescriptor, - ESrcsBadHelper, - ESrcsBadMessage, - ESrcsNoLimitedMessage, - ESrcsClassMemberVariableIsNull, - ESrcsClassMemberVariableIsNotNull, - ESrcsMainSchedulerError, - ESrcsNotImplementedYet -}; - -/// server name -_LIT(KSrcsName,"obexserviceman"); - -// Server path - -_LIT(KSrcsImg,"z:\\sys\\bin\\obexserviceman.exe"); - -// SRCS Server Uid -const TUid KSrcsUid={0x101F7C87}; - -// SRCS Server thread memory allocation. -// These are only used in WINS when the server is not running -// before the client tries to connect to it. -#ifdef __WINS__ -const TInt KSrcsStackSize =0x2000; // 8KB -const TInt KSrcsMinHeapSize =0x1000; // 4KB -const TInt KSrcsMaxHeapSize =0x100000; // 1MB -#endif - -// A version must be specifyed when creating a session with the server -const TUint KSrcsMajorVersionNumber=1; -const TUint KSrcsMinorVersionNumber=0; -const TUint KSrcsBuildVersionNumber=1; - -// Opcodes used in message passing between client and server -enum TSrcsServRequest -{ - ESrcsBTServicesON, - ESrcsBTServicesOFF, - ESrcsStartUSB, - ESrcsStopUSB, - ESrcsIrDAServicesON, - ESrcsIrDAServicesOFF, - ESrcsCancelRequest -}; - -/** -* Define transports which are supported by SRCS -*/ -enum TSrcsTransport -{ - ESrcsTransportBT, - ESrcsTransportUSB, - ESrcsTransportIrDA -}; - -/** -* Transportation string definition -*/ -_LIT8(KSrcsTransportBT,"OBEX/BT"); -_LIT8(KSrcsTransportUSB,"OBEX/USB"); -_LIT8(KSrcsTransportIrDA,"OBEX/IrDA"); - - - -#endif // SRCSCLSV_H - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsMessage.h --- a/localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsMessage.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: CSrcsMessage definition -* -*/ - - -#ifndef _SRCSMESSAGE_H -#define _SRCSMESSAGE_H - -// INCLUDES -#include - - -// CLASS DECLARATION - -/** - * RMessage2 container class. - * Ties together client requests and helper objects dealing with them. - * Messages must be completed via this class. - */ -class CSrcsMessage : public CBase - { -public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aMessage the message to handled - */ - static CSrcsMessage* NewL( const RMessage2& aMessage ); - - /** - * Destructor. - */ - virtual ~CSrcsMessage(); - -public: // New functions - - /** - * Completes a message with given reason to client. - * @param aReason Reason value for complete. - * @return none - */ - void Complete( TInt aReason ); - - /** - * Returns RMessage2 reference to message. - * @return Reference to message - */ - const RMessage2& MessagePtr(); - - /** - * Returns pointer which can be used to cancel request. - * @return Pointer to be used for cancellation - */ - const TAny* CancelPtr(); - - /** - * Overload of comparison between CSrcsMessages - * @param aMessage Reference to another CSrcsMessage - * @return Boolean True = Messages are same - * False = Messaged differ. - */ - TBool operator==( CSrcsMessage& aMessage ) const; - -private: - - /** - * C++ default constructor. - */ - CSrcsMessage( const RMessage2& aMessage ); - -private: // Data - RMessage2 iMessagePtr; // The message to be completed - const TAny* iCancelPtr; // Address of the TRequestStatus of the client-side active object - used for cancelling purposes - - }; - -#endif // SRCSMESSAGE_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsSecurityPolicy.h --- a/localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsSecurityPolicy.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: Obexservicemanager security policy definition -* -*/ - - -#ifndef SRCS_SECURITYPOLICY_H -#define SRCS_SECURITYPOLICY_H - -// --------------------------------------------------------------------------- -// Srcs's policy -// --------------------------------------------------------------------------- -// - -// Count of ranges -const TUint KSrcsRangeCount = 2; - - -// Definition of the ranges of IPC numbers -const TInt KSrcsRanges[KSrcsRangeCount] = - { - 0, // ESrcsBTServicesON to ESrcsGetIrDAState - 7 // Out of IPC range - }; - -// Policy to implement for each of the above ranges -const TUint8 KSrcsElementsIndex[KSrcsRangeCount] = - { - 0, // applies to 0th range - CPolicyServer::ENotSupported // out of range Srcs's IPC - }; - -//Specific capability checks -const CPolicyServer::TPolicyElement KSrcsElements[] = - { - { - _INIT_SECURITY_POLICY_C1(ECapabilityLocalServices), CPolicyServer::EFailClient - } //policy 0. - }; - -// Policy structure for Srcs. This is passed to Srcs's constructor -const CPolicyServer::TPolicy KSrcsPolicy = - { - CPolicyServer::EAlwaysPass, // Indicates that Connect attempts should be processed without any further checks. - KSrcsRangeCount, // Range count - KSrcsRanges, // ranges array - KSrcsElementsIndex, // elements' index - KSrcsElements // array of elements - }; - -#endif // SRCS_SECURITYPOLICY_H - -// End of File \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsServiceManager.h --- a/localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsServiceManager.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,168 +0,0 @@ -/* -* 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" -* 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: This class handles service management requests. -* -*/ - - -#ifndef _SRCSSERVICEMANAGER_H -#define _SRCSSERVICEMANAGER_H - -// INCLUDES -#include -#include "obexserviceman.h" -#include "SrcsTransport.h" -#include "SrcsInterface.h" - - - -// CONSTANTS - - -// FORWARD DECLARATIONS - -/** - * Callback interface for completing request - * - * @since S60 v3.2 - */ -class MObexSMRequestObserver - { - public: - /** - * Comleting request - * - * @since S60 v3.2 - * @param aMessage Reference to message to be completed - * @param aError Possible error code - */ - virtual void RequestCompleted(const RMessage2 &aMessage, TInt aError)=0; - }; -/** -* SRCS service manager class. -* It handles all service requests. -*/ - -class CSrcsServiceManager: public CActive - { -public: - - /** - * Two-phased constructor. - */ - static CSrcsServiceManager* NewL(); - - /** - * Destructor. - */ - virtual ~CSrcsServiceManager(); - -public: - - /** - * Manage services on or off - * - * @since S60 v3.2 - * @param aTransport Transporter name for request - * @param aState Request On or Off - * @param aObserver Callback interface for completing request - * @param aMessage Reference to message - * @return TInt Indicates if the service request has succeed. - */ - TInt ManageServices( TSrcsTransport aTransport, TBool aState, - MObexSMRequestObserver* aObserver, - const RMessage2& aMessage ); - /** - * Manage services on or off - * - * @since S60 v3.2 - * @param aTransport Transporter name for request - * @param aState Request On or Off - * @param aObserver Callback interface for completing request - * @param aMessage Reference to message - * @return None - */ - void DoManageServices( TSrcsTransport aTransport, TBool aState, MObexSMRequestObserver* aObserver, - const RMessage2& aMessage); - /** - * Manage services on or off - * - * @since S60 v3.2 - * @param aTransport Transporter name for request - * @param aState Request On or Off - * @return None - */ - void RealDoManageServiceL(TSrcsTransport aTransport, TBool aState); - -private: - /** - * Second phase constructor. - */ - void ConstructL(); - - /** - * From CActive - * - * @since S60 v3.2 - */ - void RunL(); - - - /** - * From CActive - * - * @since S60 v3.2 - */ - void RunError(); - - - /** - * From CActive - * - * @since S60 v3.2 - */ - void DoCancel(); - - /** - * Handling of Service array - * - */ - 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 - MObexSMRequestObserver* iRequestObserver; - MObexSMRequestObserver* iObserver; - RMessage2 iMessage; - TInt iErrorState; - TPtrC8 iTransportName; // Service name - TSrcsTransport iTransportType; // Service type - TBool iTransportState; // Service On/Off - }; -#endif // SRCSSERVICEMANAGER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsSession.h --- a/localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsSession.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: SRCS session definition. -* -*/ - - - -#ifndef _SRCSSESSION_H -#define _SRCSSESSION_H - -// INCLUDES - -#include -#include "obexserviceman.h" -#include "SrcsServiceManager.h" - -// FORWARD DECLARATIONS -class CObexSM; -class CSrcsMessage; - -// CLASS DECLARATION - -/** - * CSrcsSession class represent session on server side - * - */ -class CSrcsSession : public CSession2, public MObexSMRequestObserver - { -public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CSrcsSession* NewL(CObexSM* aServer ); - - /** - * Destructor. - */ - virtual ~CSrcsSession(); - - /** - * 2nd phase construct for sessions - * @return None - */ - void CreateL( ); - -public: // Functions from base classes - - /** - * From CSession2 ServiceL - * Client-server framework calls this function - * to handle messages from client. - * @param aMessage received message class - * @return None - */ - virtual void ServiceL( const RMessage2 &aMessage ); - - /** - * From CSession2 DispatchMessageL - * Dispatchs and calls appropriate methods to - * handle messages. - * @param aMessage received message class - * @return None - */ - void DispatchMessageL( const RMessage2 &aMessage ); - - /** - * From CSession2 Server - * Returns reference to server. - * @param None - * @return Reference to server - */ - CObexSM& Server(); - -public: // New functions - - /** - * Complete Request - * @param aMessage Request message to be completed - * @param aError Error code - * @return None. - */ - void RequestCompleted(const RMessage2 &aMessage, TInt aError); - -private: // New functions - - /** - * OpCode function - * Turns Services ON/OFF according to aState - * @param aState boolean to indicate status of service. - * @return None. - */ - void ManageServices( TSrcsTransport aTransport, TBool aState, const RMessage2& aMessage ); - - /** - * Handles error situation. Panics client - * or completes message with error status. - * @param aError Error code - * @return None - */ - void HandleError( TInt aError, const RMessage2& aMessage ); - - /** - * Deletes message from message array - * @param aMessage Pointer to message to be deleted. - * @return None - */ - void DeleteMessage( CSrcsMessage* aMessage ); - - /** - * Finds a message from message array - * @param aMessage -reference to message. - * @return Pointer to CSrcsMessage -instance. - */ - CSrcsMessage* FindMessage( const RMessage2& aMessage ); - - /** - * Finds the first message with the function from message array - * @param aFunction -the request function. - * @return Pointer to CSrcsMessage -instance, NULL if not found. - */ - CSrcsMessage* FindMessage( TInt aFunction ); - - /** - * Completes a message to client - * @param aMessage -reference to message. - * @param aReason -code to be delivered to client. - */ - void CompleteMessage( const RMessage2& aMessage, TInt aReason ); - - /** - * Completes a message to client - * @param aMessage -reference to message. - * @param aReason -code to be delivered to client. - */ - void CompleteMessage( CSrcsMessage* aMessage, TInt aReason ); - - /** - * Completes any messages pending in the CBTManMessage array. - */ - void CompletePendingMessages(); - - /** - * Creates a new CSrcsMessage and puts it in - * message array. - * @param aMessage -reference to message. - * @return None - */ - void CreateSrcsMessageL( const RMessage2& aMessage ); - - /** - * Canceling previous request - * @param aMessage -reference to message. - */ - void CancelingRequest(const RMessage2& aMessage); - - /** - * Complete request when canceling - * @param aMessage Request message to be completed - * @param aError Error code - * @param aPostponeCompletion Not completed yet - * @return None. - */ - void CompleteCanceling(const RMessage2& aMessage, TInt aError, TBool& aPostponeCompletion); - -private: - - /** - * C++ default constructor. - */ - CSrcsSession( CObexSM* aServer ); - - /** - * Two-phase constructor. - */ - void ConstructL(); - - -private: // Data - CArrayPtr* iMessageArray; // array of outstanding messages - CObexSM *iServer; - TBool iCanceling; - }; - -#endif // SRCSSESSION_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsTransport.h --- a/localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsTransport.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/* -* 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" -* 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: Define SRCS's transport ECom interface. -* -*/ - - - -#ifndef _SRCSTRANSPORT_ -#define _SRCSTRANSPORT_ - -// INCLUDES -#include -#include -#include -#include -#include "SrcsClSv.h" - -// CONSTANTS -// UID of this interface -const TUid KCSrcsTransportUid = {0x101F7C9A}; - -// default OBEX receiving buffer size, -// used when service controller does not specify the receiving buffer size in its .rss -const TUint KSRCSDefaultReceiveMtu = 0x4000; - -// default OBEX sending buffer size, -// used when service controller does not specify the sending buffer size in its .rss -const TUint KSRCSDefaultTransmitMtu = 0x3000; - - - - -/** - * An abstract class being representative of the - * concrete class which the client wishes to use. - * It acts as a base, for a real class to provide all the - * functionality that a client requires. - * It supplies instantiation & destruction by using - * the ECom framework, and functional services - * by using the methods of the actual class. - */ -class CSrcsTransport : public CBase, public MObexAuthChallengeHandler - { -public: - - /** - * Two-phased constructor. - */ - static CSrcsTransport* NewL(TUid aImplUid, CImplementationInformation* aParams ); - - /** - * Destructor. - */ - virtual ~CSrcsTransport(); - - /** - * Request a list of all available implementations which satisfies this given interface. - * - * @param aImplInfoArray Implementation instance array. - * @return none. - */ - static void ListAllImplementationsL(RImplInfoPtrArray& aImplInfoArray); - - /** - * Request a list of matching implementations which satisfies this given interface. - * - * @param aMatchString String to be matched by the implemention. - * @param aImplInfoArray Implementation instance array. - * @return none. - */ - static void ListImplementationsL(const TDesC8& aMatchString, RImplInfoPtrArray& aImplInfoArray); - - /** - * Check if OBEX service is still active. - * - * @return true: OBEX service is still active. - * 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: - /** - * C++ default Constructor - */ - inline CSrcsTransport(); - - /** - * MObexAuthChallengeHandler implementation - */ - - /** - * Password for authenticated connection - * - * @param aUserID user id. - */ - virtual void GetUserPasswordL( const TDesC& aUserID ) = 0; - - -private: - // Unique instance identifier key - TUid iDtor_ID_Key; - }; - -#include "SrcsTransport.inl" - -#endif - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsTransport.inl --- a/localconnectivityservice/obexserviceman/obexservicemanserver/inc/SrcsTransport.inl Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* 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" -* 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: Define SRCS's service controller ECom interface. -* -*/ - - -// ----------------------------------------------------------------------------- -// CSrcsTransport -// ----------------------------------------------------------------------------- -// -inline CSrcsTransport::CSrcsTransport() - { - } - -// ----------------------------------------------------------------------------- -// ~CSrcsTransport -// ----------------------------------------------------------------------------- -// -inline CSrcsTransport::~CSrcsTransport() - { - // Destroy any instance variables and then - // inform the framework that this specific - // instance of the interface has been destroyed. - REComSession::DestroyedImplementation(iDtor_ID_Key); - } - -// ----------------------------------------------------------------------------- -// NewL -// ----------------------------------------------------------------------------- -// -inline CSrcsTransport* CSrcsTransport::NewL(TUid aImplUid, CImplementationInformation* aParams) - { - return REINTERPRET_CAST(CSrcsTransport*, - REComSession::CreateImplementationL(aImplUid, - _FOFF(CSrcsTransport,iDtor_ID_Key), - aParams)); - } - -// ----------------------------------------------------------------------------- -// ListAllImplementationsL -// ----------------------------------------------------------------------------- -// -inline void CSrcsTransport::ListAllImplementationsL(RImplInfoPtrArray& aImplInfoArray) - { - REComSession::ListImplementationsL(KCSrcsTransportUid, aImplInfoArray); - } - -// ----------------------------------------------------------------------------- -// ListImplementationsL -// ----------------------------------------------------------------------------- -// -inline void CSrcsTransport::ListImplementationsL(const TDesC8& aMatchString, RImplInfoPtrArray& aImplInfoArray) - { - TEComResolverParams resolverParams; - resolverParams.SetDataType(aMatchString); - resolverParams.SetWildcardMatch(EFalse); - REComSession::ListImplementationsL(KCSrcsTransportUid, resolverParams, aImplInfoArray); - } - -inline void CSrcsTransport::PostInitializeL() - { - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/inc/debug.h --- a/localconnectivityservice/obexserviceman/obexservicemanserver/inc/debug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2002 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: -* Central place for nice debug-type macros & functions -* -*/ - - -#ifndef _SRCS_DEBUG_H -#define _SRCS_DEBUG_H - -#ifdef _DEBUG - -// Enable this to enable memory tracing -// to SRCS -//#define MEMTRACE - -// Following define is to enable OOM -// situations in SRCS -// NOTE! SHOULD NEVER BE IN RELEASES -//#define TEST_OOM - -#ifdef __WINS__ - -// File logging for WIS -#define __FLOGGING__ - -#else - -// Logging with RDebug for target HW -#define __CLOGGING__ -//#define __FLOGGING__ - - -#endif //__WINS__ - -#endif - -#if defined ( __FLOGGING__ ) - -_LIT(KLogFile,"Srcslog.txt"); -_LIT(KLogDir,"SRCS"); - -#include -#include - -#define FLOG(a) {FPrint(a);} - -#define FLOGHEX(value, len) {RFileLogger::HexDump(KLogDir, KLogFile, EFileLoggingModeAppend, "", " ",value, len);} - -#define FTRACE(a) {a;} -// Declare the FPrint function - -inline void FPrint(const TRefByValue aFmt, ...) -{ - VA_LIST list; - VA_START(list,aFmt); - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); -} - -inline void FHex(const TUint8* aPtr, TInt aLen) -{ - RFileLogger::HexDump(KLogDir, KLogFile, EFileLoggingModeAppend, 0, 0, aPtr, aLen); -} - -inline void FHex(const TDesC8& aDes) -{ - FHex(aDes.Ptr(), aDes.Length()); -} - -// RDebug logging -#elif defined(__CLOGGING__) - -#include - -#define FLOG(a) {RDebug::Print(a);} - -#define FLOGHEX(a) - -#define FTRACE(a) {a;} - -// Declare the FPrint function - -inline void FPrint(const TRefByValue aFmt, ...) -{ - VA_LIST list; - VA_START(list,aFmt); - TInt tmpInt = VA_ARG(list, TInt); - TInt tmpInt2 = VA_ARG(list, TInt); - TInt tmpInt3 = VA_ARG(list, TInt); - VA_END(list); - RDebug::Print(aFmt, tmpInt, tmpInt2, tmpInt3); -} - - -#else // No loggings --> reduced code size -#define FLOG(a) -#define FLOGHEX(a) -#define FTRACE(a) - -#endif //_DEBUG - -#endif // SRCS_DEBUG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/inc/obexserviceman.h --- a/localconnectivityservice/obexserviceman/obexservicemanserver/inc/obexserviceman.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: ObexServicemanager opcodes, panic enumerations and other - definitions. -* -*/ - - -#ifndef OBEXSERVICEMAN_H -#define OBEXSERVICEMAN_H - -// INCLUDES - -#include -#include "SrcsClSv.h" - -/** -* Function to start server. -*/ -IMPORT_C void RunServerL(); - -/** -* Utility to panic the client. -*/ -void PanicClient(const RMessage2& aMessage, TInt aPanic); - -/** -* Utility to panic server. -*/ -void PanicServer(TInt aPanic); - -/** -* Provides server startup parameters. -*/ -class TSrcsStart -{ -public: - /** - * Constructor - */ - TSrcsStart(TRequestStatus& aStatus); - - /** - * Default constructor - * - * @since s60 3.2 - */ - inline TSrcsStart() {}; - - /** - * Provides startup parameters - * - * @since s60 3.2 - */ - TPtrC AsCommand() const; - - /** - * Signalling from Server start. - * - * @since s60 3.2 - */ - IMPORT_C void SignalL(); - - /** - * Initialize from memory - * - * @since s60 3.2 - */ - TInt Set(const TDesC& aData); - -public: // Data - TThreadId iId; - TRequestStatus* iStatus; -}; - -/** -* Number of interfaces and length of descriptors registered by SRCS -*/ -class TSrcsUsbDescriptorInfo - { -public: - TInt iNumInterfaces; - TInt iLength; - }; - -#endif // SRCSCLSV_H - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/inc/obexservicemanprop.h --- a/localconnectivityservice/obexserviceman/obexservicemanserver/inc/obexservicemanprop.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* - * 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 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/inc/obexsm.h --- a/localconnectivityservice/obexserviceman/obexservicemanserver/inc/obexsm.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: CObexSM class definition - definitions. -* -*/ - - - -#ifndef OBEXSM_H -#define OBEXSM_H - -// INCLUDES - -#include -#include "obexserviceman.h" -#include "SrcsServiceManager.h" - -// FORWARD DECLARATIONS - - -/** - * CSrcs server core class - * - */ -class CObexSM : public CPolicyServer - { - -public: - - /** - * Two-phased constructor. - */ - static CObexSM* NewL(); - - /** - * Destructor. - */ - ~CObexSM(); - -public: // New functions - - /** - * Initializes all server database classes - * - * @since s60 3.2 - */ - void InitialiseServerL(); - - /** - * Manages Services that are handled by SRCS - * - * @since s60 3.2 - * @param aTransport the used transport media - * @param aState Boolean ON/OFF - * @param aObserver the request completing observer - * @param aMessage the message to be completed - * @return TInt indicating the success of call. - */ - TInt ManageServices(TSrcsTransport aTransport,TBool aState, MObexSMRequestObserver* aObserver, - const RMessage2& aMessage); - - - -public: // Functions from base classes - - - /** - * From CServer NewSessionL. - * - * @since s60 3.2 - * @param aVersion version number - * @param aMessage the connect message - * @return Pointer to session - */ - CSession2* NewSessionL( const TVersion& aVersion, const RMessage2& aMessage ) const; - - /** - * Increase session count - * - * @since s60 3.2 - */ - void IncSessionCount(); - - /** - * Decrese session count and shutdown server when all session are closed. - * - * @since s60 3.2 - */ - void DecSessionCount(); - -private: - - /** - * Default constructor - */ - CObexSM( TInt aPriority ); - - /** - * Two-Phase constructor - */ - void ConstructL(); - -private: // Data - CSrcsServiceManager* iServiceHandler; // Service Handler - TInt iSessionCount; - }; - -#endif // OBEXSM_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/src/SrcsMessage.cpp --- a/localconnectivityservice/obexserviceman/obexservicemanserver/src/SrcsMessage.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: obexserviceman message handling. -* -*/ - - -// INCLUDE FILES -#include "SrcsMessage.h" - - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// C++ default constructor can NOT contain any code, that -// might leave. -// --------------------------------------------------------- -// -CSrcsMessage::CSrcsMessage(const RMessage2& aMessage) - { - iMessagePtr = aMessage; - iCancelPtr = aMessage.Ptr2(); - } -// --------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------- -// -CSrcsMessage* CSrcsMessage::NewL(const RMessage2& aMessage) - { - return (new(ELeave) CSrcsMessage(aMessage)); - } - -// --------------------------------------------------------- -// Destructor -// --------------------------------------------------------- -// -CSrcsMessage::~CSrcsMessage() - { - } - -// --------------------------------------------------------- -// Complete -// Completes the RMessage2 and deletes any associated helper. -// --------------------------------------------------------- -// -void CSrcsMessage::Complete(TInt aReason) - { - //complete the message - iMessagePtr.Complete(aReason); - } - -// --------------------------------------------------------- -// MessagePtr -// Returns reference to RMessage2. -// --------------------------------------------------------- -// -const RMessage2& CSrcsMessage::MessagePtr() - { - return iMessagePtr; - } - -// --------------------------------------------------------- -// CancelPtr -// The CancelPtr is the address of the TRequestStatus of the -// client-side active object dealing with the request. -// When a request is cancelled, it is located server-side using -// this address. -// --------------------------------------------------------- -// -const TAny* CSrcsMessage::CancelPtr() - { - return iCancelPtr; - } - -// --------------------------------------------------------- -// operator== -// Compares Message pointers, if they are same, return value -// is ETrue, else EFalse. -// --------------------------------------------------------- -// -TBool CSrcsMessage::operator==(CSrcsMessage& aMessage) const - { - if (iMessagePtr == aMessage.MessagePtr()) - { - return ETrue; - } - return EFalse; - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/src/SrcsServiceManager.cpp --- a/localconnectivityservice/obexserviceman/obexservicemanserver/src/SrcsServiceManager.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,372 +0,0 @@ -/* -* 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" -* 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: This class handles services management requests. -* -*/ - - - -// INCLUDE FILES -#include "SrcsServiceManager.h" -#include "debug.h" -#include -#include "obexservicemanprop.h" - - -// CONSTANTS - -// 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 ======================= - - -// --------------------------------------------------------- -// C++ default constructor can NOT contain any code, that -// might leave. -// --------------------------------------------------------- -// -CSrcsServiceManager::CSrcsServiceManager():CActive(CActive::EPriorityStandard) - { - CActiveScheduler::Add(this); - } - -// --------------------------------------------------------- -// Destructor -// --------------------------------------------------------- -// -CSrcsServiceManager::~CSrcsServiceManager() - { - Cancel(); - RProperty::Delete(KUidObexSMCategory, KObexSMPostInitErrorProperty); - if ( iBTConnectionArray ) - { - // Cleanup the array - iBTConnectionArray->ResetAndDestroy(); - } - delete iBTConnectionArray; - - if ( iUSBConnectionArray ) - { - // Cleanup the array - iUSBConnectionArray->ResetAndDestroy(); - } - delete iUSBConnectionArray; - - - if ( iIrDAConnectionArray ) - { - // Cleanup the array - iIrDAConnectionArray->ResetAndDestroy(); - } - delete iIrDAConnectionArray; - - REComSession::FinalClose(); - } - -// --------------------------------------------------------- -// NewL -// --------------------------------------------------------- -// -CSrcsServiceManager* CSrcsServiceManager::NewL() - { - FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: NewL")); - CSrcsServiceManager* self = new (ELeave) CSrcsServiceManager(); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - -// --------------------------------------------------------- -// ConstructL -// --------------------------------------------------------- -// -void CSrcsServiceManager::ConstructL() - { - 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); - } - -// --------------------------------------------------------- -// ManagerServicesL -// Method to manage service controllers on all supported transports. -// --------------------------------------------------------- -// -TInt CSrcsServiceManager::ManageServices( TSrcsTransport aTransport, TBool aState, - MObexSMRequestObserver* aObserver, - const RMessage2& aMessage) - { - FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServices")); - if ( !IsActive() ) - { - iStatus=KRequestPending; - DoManageServices( aTransport,aState, aObserver, aMessage ); - SetActive(); - FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServices KErrNone")); - return KErrNone; - } - else - { - FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServices KErrServerBusy")); - return KErrServerBusy; - } - } - -// --------------------------------------------------------- -// DoManageServices -// Method to manage service controllers on all supported transports. -// --------------------------------------------------------- -// -void CSrcsServiceManager::DoManageServices(TSrcsTransport aTransport, TBool aState, MObexSMRequestObserver* aObserver, - const RMessage2& aMessage) - { - FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: DoManageServices")); - iObserver=aObserver; - iMessage=aMessage; - iTransportType = aTransport; - iTransportState = aState; - TRAPD(error,RealDoManageServiceL(aTransport,aState)); - if (error != KErrNone) - { - iErrorState=error; - } - TRequestStatus* temp = &iStatus; - User::RequestComplete( temp, iErrorState ); - FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: DoManageServices exit")); - } - -// --------------------------------------------------------- -// RunL -// Notifies request completion -// --------------------------------------------------------- -// -void CSrcsServiceManager::RunL() - { - 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")); - } -// --------------------------------------------------------- -// RunErrorL -// --------------------------------------------------------- -// -void CSrcsServiceManager::RunError() - { - } -// --------------------------------------------------------- -// DoCancel -// --------------------------------------------------------- -// -void CSrcsServiceManager::DoCancel() - { - FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: DoCancel")); - } -// --------------------------------------------------------- -// RealDoManageServiceL -// Method to manage service controllers on all supported transports. -// --------------------------------------------------------- -// -void CSrcsServiceManager::RealDoManageServiceL(TSrcsTransport aTransport, TBool aState) - { - FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: RealDoManageServiceL")); - - switch(aTransport) - { - case ESrcsTransportBT: - FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServicesL(Bluetooth)")); - iTransportName.Set(KSrcsTransportBT); - ServiceArray(*iBTConnectionArray, aState); - break; - case ESrcsTransportUSB: - FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServicesL(USB)")); - iTransportName.Set(KSrcsTransportUSB); - ServiceArray(*iUSBConnectionArray, aState); - break; - case ESrcsTransportIrDA: - FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServicesL(IrDA)")); - iTransportName.Set(KSrcsTransportIrDA); - ServiceArray(*iIrDAConnectionArray, aState); - break; - default: - FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServicesL. Transport not supported."))); - User::Leave(KErrNotSupported); - } - - } - -// --------------------------------------------------------- -// CSrcsServiceManager -// Method to manage Service arrays -// --------------------------------------------------------- -// -void CSrcsServiceManager::ServiceArray(CArrayPtr &aTransport, TBool aState) - { - FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: ServiceArray")); - - // We start and stop services by aState value - if ( aState ) // trun on service - { - FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServicesL(Turn ON)")); - // We do not re-start services if they have been started - if (!(aTransport.Count())) - { - //Declare array of service controllers - RImplInfoPtrArray infoArrayServiceController; - - //Declare array of SRCS transport plugins - RImplInfoPtrArray infoArrayTranport; - CleanupClosePushL(infoArrayTranport); - - CleanupClosePushL(infoArrayServiceController); - - //List all SRCS transport plugin implementations - FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServicesL about to list Transport Impl")); - CSrcsTransport::ListImplementationsL(iTransportName,infoArrayTranport); - - //Found SRCS transport plugin. Then start to enumerate service controller and make connections. - if(infoArrayTranport.Count()) - { - //There should be only one transport plugin of each type. Others are just ignored. - if(infoArrayTranport.Count() != 1) - { - FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServicesL. Warning: Found %d transport implementations." ), infoArrayTranport.Count())); - } - - FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServicesL. Using Transport ImplementationUid %x"), infoArrayTranport[0]->ImplementationUid())); - - //enumerate service controllers - CSrcsInterface::ListImplementationsL(iTransportName,infoArrayServiceController); - - // Loop through each found service controller, - // create SRCS transport connection for each found service controller - // and instantiate the service controller. - CSrcsTransport *cm; - - for (TInt i=0; i< infoArrayServiceController.Count(); i++) - { - // TRAP is needed because of OOM situations. - // Otherwise whole server is leaving and panicing. - FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServicesL. Found Service Controller ImplementationUid %x"), infoArrayServiceController[i]->ImplementationUid())); - - TRAPD( error, cm = CSrcsTransport::NewL(infoArrayTranport[0]->ImplementationUid(), infoArrayServiceController[i] )); - if ( error != KErrNone ) - { - // Error when creating service controller (e.g. no memory). Cleanup and zero. - FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServicesL. Create implementation failed with error code %d"), error)); - } - else - { - // Add this connection to the list - aTransport.AppendL(cm); - FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServicesL: Implementation created successfully."))); - } - } - } - else - { - FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServicesL. Transport implementation not found."))); - } - - // Clean up - infoArrayTranport.ResetAndDestroy(); - infoArrayServiceController.ResetAndDestroy(); - CleanupStack::PopAndDestroy(2); //infoArrayServiceController - - } - } - else // turn off service - { - FLOG(_L("[SRCS]\tserver\tCSrcsServiceManager: ManageServicesL(Turn OFF)")); - 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 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/src/SrcsSession.cpp --- a/localconnectivityservice/obexserviceman/obexservicemanserver/src/SrcsSession.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,502 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: SRCS session handler. Dispatchs requests from -* clients and serves them. -* -*/ - - - -// INCLUDE FILES - -#include "SrcsSession.h" -#include "obexsm.h" -#include "SrcsMessage.h" -#include "debug.h" -#include - - -// CONSTANTS - -// The granularity of the array used to hold CSrcsMessage objects -static const TInt KMessageArrayGranularity = 4; - - - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// C++ default constructor can NOT contain any code, that -// might leave. -// constructor - must pass client to CSession2 -// --------------------------------------------------------- -// -CSrcsSession::CSrcsSession(CObexSM* aServer) : CSession2(), - iServer(aServer), - iCanceling(EFalse) - { - if(iServer) - { - iServer->IncSessionCount(); - } - } -// --------------------------------------------------------- -// destructor -// --------------------------------------------------------- -// -CSrcsSession::~CSrcsSession() - { - FLOG(_L("[SRCS]\tserver\tCSrcsSession closed.")); - if ( iMessageArray ) - { - // Cleanup the array - iMessageArray->ResetAndDestroy(); - } - delete iMessageArray; - if(iServer) - { - iServer->DecSessionCount(); - } - } -// --------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------- -// -CSrcsSession* CSrcsSession::NewL(CObexSM* aServer) - { - return new(ELeave) CSrcsSession(aServer); - } - -// --------------------------------------------------------- -// Server -// Return a reference to CSrcs -// --------------------------------------------------------- -CObexSM& CSrcsSession::Server() - { - return *iServer; - } - -// --------------------------------------------------------- -// CreateL -// 2nd phase construct for sessions -// - called by the CServer framework -// --------------------------------------------------------- -void CSrcsSession::CreateL() - { - // Add session to server first. - // If anything leaves, it will be removed by the destructor - ConstructL(); - } - -// --------------------------------------------------------- -// ConstructL -// 2nd phase construct for sessions -// - called by the CServer framework -// -// --------------------------------------------------------- -void CSrcsSession::ConstructL() - { - iMessageArray = new(ELeave) CArrayPtrFlat(KMessageArrayGranularity); - } - -// --------------------------------------------------------- -// HandleError -// Handle an error from ServiceL() -// A bad descriptor error implies a badly programmed client, so panic it; -// otherwise report the error to the client -// -// --------------------------------------------------------- -void CSrcsSession::HandleError(TInt aError, const RMessage2& aMessage) - { - FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsSession::HandleError(): %d"), aError)); - if (aError==KErrBadDescriptor) - { - PanicClient( aMessage, ESrcsBadDescriptor); - } - else - { - CompleteMessage( aMessage, aError); - } - } - - -// --------------------------------------------------------- -// ServiceL -// Calls DispatchMessage under trap harness -// -// --------------------------------------------------------- -void CSrcsSession::ServiceL(const RMessage2& aMessage) - { - // First make our own message from RMessage2 - // TRAP because message needs to be completed - // in case of Leave. - TRAPD( err, CreateSrcsMessageL( aMessage )); - if ( err ) - { - FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsSession: ServiceL. Error %d when creating message."), err)); - aMessage.Complete( err ); - } - else - { - err = KErrNone; - TRAP( err ,DispatchMessageL( aMessage )); - - // If we have an error, try to handle it with handle-error. - if ( err ) - { - HandleError( err, aMessage ); - } - } - } - -// --------------------------------------------------------- -// CreateSrcsMessageL -// Creates a CSrcsMessage and appends it to iMessageArray. -// --------------------------------------------------------- -// -void CSrcsSession::CreateSrcsMessageL(const RMessage2& aMessage) - { - __ASSERT_DEBUG(iMessageArray!=NULL, PanicServer(ESrcsClassMemberVariableIsNull)); - CSrcsMessage* message = CSrcsMessage::NewL(aMessage); - CleanupStack::PushL( message ); - iMessageArray->AppendL( message ); - CleanupStack::Pop(); - FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsSession: MessageArray count: %d"), iMessageArray->Count())); - } - -// --------------------------------------------------------- -// CompleteMessage -// Finds a message based on aMessage and completes it. -// --------------------------------------------------------- -// -void CSrcsSession::CompleteMessage(const RMessage2& aMessage, TInt aReason) - { - FLOG(_L("[SRCS]\tserver\tCSrcsSession: CompleteMessage.")); - CSrcsMessage* message = FindMessage(aMessage); - __ASSERT_DEBUG(message!=NULL, PanicServer(ESrcsBadMessage)); - message->Complete(aReason); - DeleteMessage( message ); - } - -// --------------------------------------------------------- -// CompleteMessage -// Completes given message. -// --------------------------------------------------------- -// -void CSrcsSession::CompleteMessage(CSrcsMessage* aMessage, TInt aReason) - { - __ASSERT_DEBUG(aMessage!=NULL, PanicServer(ESrcsBadMessage)); - FLOG(_L("[SRCS]\tserver\tCSrcsSession: CompleteMessage.")); - aMessage->Complete(aReason); - DeleteMessage(aMessage); - } - -// --------------------------------------------------------- -// CompletePendingMessages -// Completes any messages pending in the CBTManMessage array. -// --------------------------------------------------------- -void CSrcsSession::CompletePendingMessages() - { - __ASSERT_DEBUG(iMessageArray!=NULL, PanicServer(ESrcsClassMemberVariableIsNull)); - CSrcsMessage* messagePtr = NULL; - TInt count = iMessageArray->Count(); - FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsSession::CompletePendingMessages. Message count: %d"), count)); - - // Messages can be completed from array - // and deleted after that. - for ( TInt index = ( count-1 ) ; index >= 0 ; index-- ) - { - messagePtr = iMessageArray->At(index); - messagePtr->Complete(KErrDied); - iMessageArray->Delete(index); - delete messagePtr; - messagePtr = NULL; - } - } - -// --------------------------------------------------------- -// FindMessage -// Searches the array of CBTManMessages for the one dealing with aMessage. -// --------------------------------------------------------- -// -CSrcsMessage* CSrcsSession::FindMessage(const RMessage2& aMessage) - { - __ASSERT_DEBUG(iMessageArray!=NULL, PanicServer(ESrcsClassMemberVariableIsNull)); - FLOG(_L("[SRCS]\tserver\tCSrcsSession: FindMessage.")); - RMessagePtr2 messagePtr = aMessage; - CSrcsMessage* ptr = NULL; - - for ( TInt index = 0 ; index < iMessageArray->Count() ; index++ ) - { - ptr = iMessageArray->At( index ); - if( ptr->MessagePtr() == messagePtr ) - { - FLOG(_L("[SRCS]\tserver\tCSrcsSession: FindMessage. Message found")); - return ptr; - } - } - return NULL; - } - -// --------------------------------------------------------- -// FindMessage -// Searches the array for the 1st message with the function. -// --------------------------------------------------------- -// -CSrcsMessage* CSrcsSession::FindMessage(TInt aFunction) - { - __ASSERT_DEBUG(iMessageArray!=NULL, PanicServer(ESrcsClassMemberVariableIsNull)); - FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsSession: FindMessage aFunction %d"), aFunction)); - CSrcsMessage* ptr = NULL; - for ( TInt index = 0 ; index < iMessageArray->Count() ; index++ ) - { - ptr = iMessageArray->At( index ); - if ( ptr->MessagePtr().Function() == aFunction ) - { - FLOG(_L("[SRCS]\tserver\tCSrcsSession: FindMessage. Message found")); - return ptr; - } - } - FLOG(_L("[SRCS]\tserver\tCSrcsSession: FindMessage. Message not found")); - return NULL; - } - -// --------------------------------------------------------- -// DeleteMessage -// Find the CSrcsMessage in the message array and delete it. -// --------------------------------------------------------- -// -void CSrcsSession::DeleteMessage(CSrcsMessage* aMessage) - { - __ASSERT_DEBUG(iMessageArray!=NULL, PanicServer(ESrcsClassMemberVariableIsNull)); - FLOG(_L("[SRCS]\tserver\tCSrcsSession: DeleteMessage. ")); - CSrcsMessage* ptr = NULL; - TInt count = iMessageArray->Count(); - for ( TInt index = ( count-1 ) ; index >= 0 ; index-- ) - { - ptr = iMessageArray->At( index ); - if( ptr == aMessage ) - { - FLOG(_L("[SRCS]\tserver\tCSrcsSession: Message deleting. ")); - //Delete the message first before removing from the array since a helper associated - //with the message will try to find the message by parsing the array as part of the - //destruction the message. - delete ptr; - iMessageArray->Delete( index ); - ptr = NULL; - break; - } - } - FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsSession: MessageArray count: %d"), iMessageArray->Count())); - //compress the array if the count is less than the length - granularity AND if the count != 0 - if ( iMessageArray->Count() ) - { - if (iMessageArray->Length() - iMessageArray->Count() >= KMessageArrayGranularity) - iMessageArray->Compress(); - } - } - - -// --------------------------------------------------------- -// DispatchMessageL -// service a client request; test the opcode and then do -// appropriate servicing -// --------------------------------------------------------- -// -void CSrcsSession::DispatchMessageL(const RMessage2 &aMessage) - { - FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsSession: DispatchMessageL function %d"), aMessage.Function())); - iCanceling=EFalse; - switch (aMessage.Function()) - { - // Turn BT services ON (with service handler). - case ESrcsBTServicesON: - { - if ( BluetoothFeatures::EnterpriseEnablementL() != BluetoothFeatures::EEnabled ) - { - CompleteMessage(aMessage, KErrNotSupported); - } - else - { - ManageServices(ESrcsTransportBT, ETrue, aMessage); - } - break; - } - // Turn BT services OFF. - case ESrcsBTServicesOFF: - { - ManageServices(ESrcsTransportBT, EFalse, aMessage); - break; - } - - // Turn IrDA services ON (with service handler). - case ESrcsIrDAServicesON: - { - ManageServices(ESrcsTransportIrDA, ETrue, aMessage); - break; - } - // Turn IrDA services OFF. - case ESrcsIrDAServicesOFF: - { - ManageServices(ESrcsTransportIrDA, EFalse, aMessage); - break; - } - - case ESrcsStartUSB: - { - ManageServices(ESrcsTransportUSB, ETrue, aMessage); - break; - } - case ESrcsStopUSB: - { - ManageServices(ESrcsTransportUSB, EFalse, aMessage); - break; - } - case ESrcsCancelRequest: - { - FLOG(_L("[SRCS]\tserver\tCSrcsSession: DispatchMessageL: ESrcsCancelRequest")); - CancelingRequest(aMessage); - break; - } - default: - { - PanicClient( aMessage, ESrcsBadRequest); - break; - } - } - } - -// --------------------------------------------------------- -// ManageServicesL -// OpCode function; Manages Services. -// --------------------------------------------------------- -// -void CSrcsSession::ManageServices(TSrcsTransport aTransport, TBool aState, - const RMessage2& aMessage) - { - FLOG(_L("[SRCS]\tserver\tCSrcsSession: ManageServicesL")); - TInt retVal = Server().ManageServices(aTransport, aState, this, aMessage); - FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsSession: ManageServicesL return %d"), retVal)); - } - -// --------------------------------------------------------- -// CancelingRequest -// Canceling the ongoing request. -// --------------------------------------------------------- -// -void CSrcsSession::CancelingRequest(const RMessage2& aMessage) - { - FLOG(_L("[SRCS]\tserver\tCSrcsSession: CancelingRequest")); - iCanceling=ETrue; - if (iMessageArray->Count() == 1) - { - FLOG(_L("[SRCS]\tserver\tCSrcsSession: CancelingRequest completing")); - CompleteMessage(aMessage, KErrGeneral); - } - else - { - //The cancel handling continues, when another request completes. - } - } - -// --------------------------------------------------------- -// RequestCompleted -// --------------------------------------------------------- -// -void CSrcsSession::RequestCompleted(const RMessage2 &aMessage, TInt aError) - { - FLOG(_L("[SRCS]\tserver\tCSrcsSession: RequestCompleted")); - TBool postponeCompletion = EFalse; - if ( !iCanceling ) - { - FLOG(_L("[SRCS]\tserver\tCSrcsSession: RequestCompleted completing")); - CompleteMessage( aMessage, aError ); - } - else - { - CompleteCanceling(aMessage, aError, postponeCompletion); - } - if ( !postponeCompletion && iMessageArray->Count() > 0 ) - { - FLOG(_L("[SRCS]\tserver\tCSrcsSession: RequestCompleted dispatching")); - CSrcsMessage* messagePtr = NULL; - messagePtr=iMessageArray->At( 0 ); - RMessage2 message=messagePtr->MessagePtr(); - TRAP_IGNORE( DispatchMessageL( message ) ); - } - FLOG(_L("[SRCS]\tserver\tCSrcsSession: RequestCompleted exit")); - } - -// --------------------------------------------------------- -// CompleteCanceling -// Only USB service cancel is handled, since Locod Service -// Plugin API does not allow cancel for BT or IrDA. -// --------------------------------------------------------- -// -void CSrcsSession::CompleteCanceling(const RMessage2& aMessage, TInt aError, - TBool& aPostponeCompletion) - { - FLOG(_L("[SRCS]\tserver\tCSrcsSession: CompleteCanceling")); - TBool cancelMsgFound = EFalse; - CSrcsMessage* messagePtr = NULL; - FTRACE(FPrint(_L("[SRCS]\tserver\tCSrcsSession: CompleteCanceling function %d"), - aMessage.Function())); - switch ( aMessage.Function() ) - { - case ESrcsStartUSB: - messagePtr = FindMessage(ESrcsCancelRequest); - if ( messagePtr ) - { - FLOG(_L("[SRCS]\tserver\tCSrcsSession: CompleteCanceling ESrcsStartUSB found cancel req")); - RMessage2 message=messagePtr->MessagePtr(); - ManageServices(ESrcsTransportUSB, EFalse, message); - aPostponeCompletion = ETrue; - cancelMsgFound = ETrue; - } - break; - case ESrcsStopUSB: - messagePtr = FindMessage(ESrcsCancelRequest); - if ( messagePtr ) - { - CompleteMessage(aMessage, KErrCancel); - CompleteMessage(messagePtr, aError); - cancelMsgFound = ETrue; - } - break; - case ESrcsCancelRequest: - //either start or stop USB - messagePtr = FindMessage(ESrcsStartUSB); - if ( !messagePtr ) - { - messagePtr = FindMessage(ESrcsStopUSB); - } - if ( messagePtr ) - { - CompleteMessage(messagePtr, KErrCancel); - CompleteMessage(aMessage, aError); - cancelMsgFound = ETrue; - } - break; - default: - FLOG(_L("[SRCS]\tserver\tCSrcsSession: CompleteCanceling ESrcsCancelRequest unhandled msg")); - break; - } - if ( !cancelMsgFound ) - { - FLOG(_L("[SRCS]\tserver\tCSrcsSession: CompleteCanceling no message")); - CompleteMessage(aMessage, KErrGeneral); - } - FLOG(_L("[SRCS]\tserver\tCSrcsSession: CompleteCanceling exit")); - } -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/src/obexsm.cpp --- a/localconnectivityservice/obexserviceman/obexservicemanserver/src/obexsm.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: Implementation of obexservicemanager core. -* -*/ - - -// INCLUDE FILES - -#include "obexserviceman.h" -#include "obexsm.h" -#include "SrcsSession.h" -#include "SrcsServiceManager.h" -#include "debug.h" -#include "SrcsSecurityPolicy.h" -#include "obexutilsmessagehandler.h" - - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// C++ default constructor can NOT contain any code, that -// might leave. -// --------------------------------------------------------- -// -CObexSM::CObexSM(TInt aPriority) - // aPriority: priority of AO - // KSrcsPolicy: TPolicy structure of Faxmodem - :CPolicyServer( aPriority, KSrcsPolicy ) - { - } -// --------------------------------------------------------- -// Destructor -// --------------------------------------------------------- -// -CObexSM::~CObexSM() - { - FLOG(_L("[SRCS]\tserver\tCSrcs: Destructor") ); - - delete iServiceHandler; - - } - -// --------------------------------------------------------- -// NewL -// --------------------------------------------------------- -// -CObexSM* CObexSM::NewL() - { - FLOG(_L("[SRCS]\tserver\tCSrcs: NewL") ); - CObexSM* self=new(ELeave) CObexSM( EPriorityBackground ); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - -// --------------------------------------------------------- -// ConstructL -// --------------------------------------------------------- -// -void CObexSM::ConstructL() - { - FLOG(_L("[SRCS]\tserver\tCSrcs: ConstrucL") ); - // and class for service handling - iServiceHandler = CSrcsServiceManager::NewL(); - // Then we are ready to start server - StartL(KSrcsName); - // Do server initialisation - InitialiseServerL(); - } - -// --------------------------------------------------------- -// NewSessionL -// Create session(s) to client(s) -// -// --------------------------------------------------------- -// -CSession2* CObexSM::NewSessionL( const TVersion& aVersion, const RMessage2& ) const - { - FLOG(_L("[SRCS]\tserver\tCSrcs NewSessionL")); - - // check we're the right version - TVersion srvVersion(KSrcsMajorVersionNumber, - KSrcsMinorVersionNumber, - KSrcsBuildVersionNumber); - - if (!User::QueryVersionSupported(srvVersion,aVersion)) - { - User::Leave(KErrNotSupported); - } - - // make new session - - return ( CSrcsSession::NewL(const_cast(this)) ); - } - -// --------------------------------------------------------- -// InitialiseServerL -// Start Media Watchers at this point. -// --------------------------------------------------------- -// -void CObexSM::InitialiseServerL() - { - FLOG(_L("[SRCS]\tserver\tSrcs Initialise Server")); - // If phone battery is removed during file receiving, - // There will be two temp file objects left in Received Folders. - // We clean those temp files here. - TFileName filename; - TObexUtilsMessageHandler::RemoveTemporaryRFileL (filename); - FLOG(_L("[SRCS]\tserver\tSrcs Initialize server complete.")); - } - -// --------------------------------------------------------- -// ManageServices -// Initialise services according to parameter value. -// --------------------------------------------------------- -// -TInt CObexSM::ManageServices(TSrcsTransport aTransport, TBool aState, - MObexSMRequestObserver* aObserver, const RMessage2& aMessage) - { - FLOG(_L("[SRCS]\tserver\tSrcs ManageServicesL")); - // Simply forward call - return iServiceHandler->ManageServices( aTransport, aState, aObserver, aMessage); - } -// --------------------------------------------------------- -// IncSessionCount -// Increase session count. -// --------------------------------------------------------- -// -void CObexSM::IncSessionCount() - { - FLOG(_L("[SRCS]\tserver\tSrcs IncSessionCount")); - iSessionCount++; - } -// --------------------------------------------------------- -// DecSessionCount -// Decrease session count -// --------------------------------------------------------- -// -void CObexSM::DecSessionCount() - { - FLOG(_L("[SRCS]\tserver\tSrcs DecSessionCount")); - if ( iSessionCount>0 ) - { - iSessionCount--; - if (iSessionCount == 0) - { - FLOG(_L("[SRCS]\tserver\tSrcs StoppingServer")); - CActiveScheduler::Stop(); - } - } - } -// End of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/obexservicemanserver/src/obexsmmain.cpp --- a/localconnectivityservice/obexserviceman/obexservicemanserver/src/obexsmmain.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: Implementation of obexservicemanager core. -* -*/ - - - -// INCLUDE FILES - -#include -#include "obexserviceman.h" -#include "debug.h" -#include "obexsm.h" - - -// --------------------------------------------------------- -// PanicClient -// -// RMessage2::Panic() also completes the message. -// -// --------------------------------------------------------- -void PanicClient(const RMessage2& aMessage,TInt aPanic ) - { - FTRACE(FPrint(_L("[SRCS]\tserver\tPanicClient: Reason = %d"), aPanic)); - aMessage.Panic(KSrcsPanic,aPanic); - } - -// --------------------------------------------------------- -// PanicServer -// -// Panic our own thread -// -// --------------------------------------------------------- -void PanicServer(TInt aPanic) - { - FTRACE(FPrint(_L("[SRCS]\tserver\tPanicServer: Reason = %d"), aPanic)); - User::Panic(KSrcsPanic, aPanic); - } - - - -// ================= OTHER EXPORTED FUNCTIONS ============== - - -// --------------------------------------------------------- -// RunServerL -// -// Perform all server initialisation, in particular creation -// of the scheduler and server and then run the scheduler. -// This is called from Srcs.exe (RunServer -method). -// -// --------------------------------------------------------- -EXPORT_C void RunServerL() - { - FLOG(_L("[SRCS]\tclient\tSrcs RunServerL")); - - // create and install the active scheduler we need - CActiveScheduler* scheduler = new (ELeave) CActiveScheduler; - CleanupStack::PushL(scheduler); - CActiveScheduler::Install(scheduler); - - // create the server (leave it on the cleanup stack) - CleanupStack::PushL( CObexSM::NewL() ); - - - // naming the server thread after the server helps to debug panics - // ignore error - we tried the best we could - - User::RenameThread(KSrcsName); - - - RProcess::Rendezvous(KErrNone); - - - FLOG(_L("[SRCS]\tclient\tSrcs RunServerL: Starting active scheduler...")); - CActiveScheduler::Start(); - - FLOG(_L("[SRCS]\tclient\tSrcs RunServerL: Done")); - // - // Cleanup the server and scheduler - CleanupStack::PopAndDestroy(2); - } - - - - - -TInt E32Main() //used in all case( WINS and TARGET) - { - __UHEAP_MARK; - - CTrapCleanup* cleanup=CTrapCleanup::New(); - TInt retVal = KErrNoMemory; - if ( cleanup ) - { - TRAP( retVal,RunServerL() ); - delete cleanup; - } - - __UHEAP_MARKEND; - return retVal; - } - - -// End of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/group/bld.inf --- a/localconnectivityservice/obexserviceman/plugins/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This file provides the information required for building the -* whole of a ?module_name. -* -*/ - - -PRJ_PLATFORMS - - -PRJ_MMPFILES - - -../group/obexservicemanbt.mmp -../group/obexservicemanir.mmp -../group/obexservicemanusb.mmp - - - - - - - - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/group/obexservicemanbt.mmp --- a/localconnectivityservice/obexserviceman/plugins/group/obexservicemanbt.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This is project specification file for the SRCS BT Plug-in. -* -*/ - -#include - -TARGET obexservicemanbt.dll - -TARGETTYPE PLUGIN - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -// ECom Dll recognition UID followed by the unique UID for this dll -UID 0x10009D8D 0x101F7C9D - -SOURCEPATH ../src/bt -SOURCE obexsmbtconnection.cpp -SOURCE obexsmpasskey.cpp -SOURCE proxy.cpp - - -START RESOURCE 101f7c9d.rss - TARGET obexservicemanbt.rsc -END - -USERINCLUDE ../inc/bt ../../obexservicemanserver/inc ../../utils/inc -SYSTEMINCLUDE ../../../inc ../../../../inc /epoc32/include/ecom -MW_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib // Base library -LIBRARY ecom.lib // ECom library -LIBRARY irobex.lib // For Object exchange -LIBRARY charconv.lib // For Unicode conversion -DEBUGLIBRARY flogger.lib // For logging -LIBRARY esock.lib // Socket functionality -LIBRARY bluetooth.lib // For Bluetooth connection -LIBRARY btengdiscovery.lib // For Bluetooth discovery -LIBRARY obexutils.lib // opaque_data parser diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/group/obexservicemanir.mmp --- a/localconnectivityservice/obexserviceman/plugins/group/obexservicemanir.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2003 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: -* This is project specification file for the SRCS IrDA Plug-in. -* -*/ - -#include -TARGET obexservicemanir.dll - -TARGETTYPE PLUGIN - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -// ECom Dll recognition UID followed by the unique UID for this dll -UID 0x10009D8D 0x101F9695 - - -SOURCEPATH ../src/ir -SOURCE obexsmirdaconnection.cpp -SOURCE proxy.cpp - - -START RESOURCE 101F9695.rss - TARGET obexservicemanir.rsc -END - -USERINCLUDE ../inc/ir ../../obexservicemanserver/inc ../../utils/inc -SYSTEMINCLUDE ../../../inc ../../../../inc /epoc32/include/ecom -MW_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib // Base library -LIBRARY ecom.lib // ECom library -LIBRARY irda.lib // IrDA library -LIBRARY irobex.lib // For Object exchange -DEBUGLIBRARY flogger.lib // For logging -LIBRARY esock.lib // Socket functionality -LIBRARY obexutils.lib // opaque_data parser diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/group/obexservicemanusb.mmp --- a/localconnectivityservice/obexserviceman/plugins/group/obexservicemanusb.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This is project specification file for the SRCS USB Plug-in. -* -*/ - -#include - -TARGET obexservicemanusb.dll - -TARGETTYPE PLUGIN - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -// ECom Dll recognition UID followed by the unique UID for this dll -UID 0x10009D8D 0x101F9693 - - -SOURCEPATH ../src/usb -SOURCE obexsmusbconnection.cpp -SOURCE proxy.cpp - - -START RESOURCE 101F9693.rss - TARGET obexservicemanusb.rsc -END - -USERINCLUDE ../inc/usb ../../obexservicemanserver/inc ../../utils/inc ../../inc -SYSTEMINCLUDE ../../../inc ../../../../inc /epoc32/include/ecom -MW_LAYER_SYSTEMINCLUDE - - -LIBRARY euser.lib // Base library -LIBRARY ecom.lib // ECom library -LIBRARY irobex.lib // For Object exchange -DEBUGLIBRARY flogger.lib // For logging -LIBRARY obexutils.lib // opaque_data parser -LIBRARY centralrepository.lib diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/inc/bt/debug.h --- a/localconnectivityservice/obexserviceman/plugins/inc/bt/debug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -/* -* Copyright (c) 2002 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: -* Central place for nice debug-type macros & functions -* -*/ - - -#ifndef SRCS_DEBUG_H -#define SRCS_DEBUG_H - -#ifdef _DEBUG - -// Enable this to enable memory tracing to SRCS -//#define MEMTRACE - -// Following define is to enable OOM situations in SRCS -// NOTE! SHOULD NEVER BE IN RELEASES -//#define TEST_OOM - -#ifdef __WINS__ - -// File logging for WIS -#define __FLOGGING__ - -#else - -// Logging with RDebug for target HW -#define __CLOGGING__ -//#define __FLOGGING__ - - -#endif //__WINS__ - -#endif - -#if defined ( __FLOGGING__ ) - -_LIT(KLogFile,"Srcslog.txt"); -_LIT(KLogDir,"SRCS"); - -#include -#include - -#define FLOG(a) {FPrint(a);} - -#define FLOGHEX(value, len) {RFileLogger::HexDump(KLogDir, KLogFile, EFileLoggingModeAppend, "", " ",value, len);} - -#define FTRACE(a) {a;} -// Declare the FPrint function - -inline void FPrint(const TRefByValue aFmt, ...) -{ - VA_LIST list; - VA_START(list,aFmt); - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); - - // If memory tracing is activated. -#ifdef MEMTRACE - TInt size; - User::Heap().AllocSize(size); - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, _L("[SRCS]\tmemory\tMemory usage: %d high: %d"), size, User::Heap().Size()); -#endif -} - -inline void FHex(const TUint8* aPtr, TInt aLen) -{ - RFileLogger::HexDump(KLogDir, KLogFile, EFileLoggingModeAppend, 0, 0, aPtr, aLen); -} - -inline void FHex(const TDesC8& aDes) -{ - FHex(aDes.Ptr(), aDes.Length()); -} - -// RDebug logging -#elif defined(__CLOGGING__) - -#include - -#define FLOG(a) {RDebug::Print(a);} - -#define FLOGHEX(a) - -#define FTRACE(a) {a;} - -// Declare the FPrint function - -inline void FPrint(const TRefByValue aFmt, ...) -{ - VA_LIST list; - VA_START(list,aFmt); - TInt tmpInt = VA_ARG(list, TInt); - TInt tmpInt2 = VA_ARG(list, TInt); - TInt tmpInt3 = VA_ARG(list, TInt); - VA_END(list); - RDebug::Print(aFmt, tmpInt, tmpInt2, tmpInt3); -} - - -#else // No loggings --> reduced code size -#define FLOG(a) -#define FLOGHEX(a) -#define FTRACE(a) - -#endif //_DEBUG - -#endif // SRCS_DEBUG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/inc/bt/obexsmbtconnection.h --- a/localconnectivityservice/obexserviceman/plugins/inc/bt/obexsmbtconnection.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: This class handles bt obex settings. -* -*/ - - -#ifndef _OBEXSMBTCONNECTION_H -#define _OBEXSMBTCONNECTION_H - -// INCLUDES -#include - -#include -#include "SrcsTransport.h" -#include "obexsmpasskey.h" -#include "SrcsInterface.h" -#include "btengdiscovery.h" -#include "obexutilsopaquedata.h" - -// CLASS DECLARATION -/** -* Class to handle Bluetooth connection -*/ -class CObexSMBtConnection: public CSrcsTransport - { -public: - - /** - * Two-phased constructor. - * - * @param aInitParams initial parameters - */ - static CObexSMBtConnection* NewL(TAny* aInitParams); - - /** - * Destructor. - * - */ - virtual ~CObexSMBtConnection(); - - /** - * Check if OBEX service is still active. - * - * @return ETrue: OBEX service is still active. - * EFalse: OBEX service is inactive. - */ - TBool IsOBEXActive(); - -private: - - /** - * C++ default constructor. - */ - CObexSMBtConnection(); - - /** - * Constructor. - * - * @param aInitParams initial parameters - */ - CObexSMBtConnection(TAny* aInitParams); - - /** - * Constructor - * registers to sdp and btmanager - * sets up the protocol stack - * creates new messagehandler - */ - void ConstructL(); - - /** - * MObexAuthChallengeHandler implementation - */ - - /** - * Password for authenticated connection - * - * @param aUserID User ID. - */ - void GetUserPasswordL( const TDesC& aUserID ); - -private: - CObexServer* iServer; // Obex Server - TSdpServRecordHandle iSDPHandle; // SDP handle for registrations - CObexSMPasskey* iPasskey; // Class to handle Obex passkey - - CSrcsInterface* iController; // Service Controller callback - CImplementationInformation* iImplementationInfo; // Implementation Info - - TUint iServiceUid; // short form service id, so we can unregister later - TUUID iServiceUUID; // 128-bit UUID for Nokia proprietory service - CBTEngDiscovery* iBtDiscovery; // Bteng discovery - }; - - - -#endif // SRCSBTCONNECTION_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/inc/bt/obexsmpasskey.h --- a/localconnectivityservice/obexserviceman/plugins/inc/bt/obexsmpasskey.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: CObexSMPasskey definition -* -*/ - - -#ifndef _OBEXSMPASSKEY_H -#define _OBEXSMPASSKEY_H - -#include - -class CObexServer; - -/** - * Class to handle BT Obex Passkey events - */ -class CObexSMPasskey : public CActive - { -public: - static CObexSMPasskey* NewL(); - ~CObexSMPasskey(); - - void StartPassKeyRequestL(CObexServer* aObexServer); - -private: - CObexSMPasskey(); - void Cleanup(); - -private: // from CActive - void DoCancel(); - void RunL(); - TInt RunError(TInt aError); - -private: - RNotifier iNotif; // For Obex passkey notifier - TObexPasskeyBuf iObexPasskey; // Obex passkey - CObexServer* iObexServer; // Obex Server - }; - -#endif - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/inc/ir/debug.h --- a/localconnectivityservice/obexserviceman/plugins/inc/ir/debug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* -* Copyright (c) 2002 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: -* Central place for nice debug-type macros & functions -* -*/ - - -#ifndef SRCS_DEBUG_H -#define SRCS_DEBUG_H - -#ifdef _DEBUG - -// Enable this to enable memory tracing -// to SRCS -//#define MEMTRACE - -// Following define is to enable OOM -// situations in SRCS -// NOTE! SHOULD NEVER BE IN RELEASES -//#define TEST_OOM - -#ifdef __WINS__ - -// File logging for WIS -#define __FLOGGING__ - -#else - -// Logging with RDebug for target HW -#define __CLOGGING__ -//#define __FLOGGING__ - - -#endif //__WINS__ - -#endif - -#if defined ( __FLOGGING__ ) - -_LIT(KLogFile,"Srcslog.txt"); -_LIT(KLogDir,"SRCS"); - -#include -#include - -#define FLOG(a) {FPrint(a);} - -#define FLOGHEX(value, len) {RFileLogger::HexDump(KLogDir, KLogFile, EFileLoggingModeAppend, "", " ",value, len);} - -#define FTRACE(a) {a;} -// Declare the FPrint function - -inline void FPrint(const TRefByValue aFmt, ...) -{ - VA_LIST list; - VA_START(list,aFmt); - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); - - // If memory tracing is activated. -#ifdef MEMTRACE - TInt size; - User::Heap().AllocSize(size); - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, _L("[SRCS]\tmemory\tMemory usage: %d high: %d"), size, User::Heap().Size()); -#endif -} - -inline void FHex(const TUint8* aPtr, TInt aLen) -{ - RFileLogger::HexDump(KLogDir, KLogFile, EFileLoggingModeAppend, 0, 0, aPtr, aLen); -} - -inline void FHex(const TDesC8& aDes) -{ - FHex(aDes.Ptr(), aDes.Length()); -} - -// RDebug logging -#elif defined(__CLOGGING__) - -#include - -#define FLOG(a) {RDebug::Print(a);} - -#define FLOGHEX(a) - -#define FTRACE(a) {a;} - -// Declare the FPrint function - -inline void FPrint(const TRefByValue aFmt, ...) -{ - VA_LIST list; - VA_START(list,aFmt); - TInt tmpInt = VA_ARG(list, TInt); - TInt tmpInt2 = VA_ARG(list, TInt); - TInt tmpInt3 = VA_ARG(list, TInt); - VA_END(list); - RDebug::Print(aFmt, tmpInt, tmpInt2, tmpInt3); -} - - -#else // No loggings --> reduced code size -#define FLOG(a) -#define FLOGHEX(a) -#define FTRACE(a) - -#endif //_DEBUG - -#endif // SRCS_DEBUG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/inc/ir/obexsmirdaconnection.h --- a/localconnectivityservice/obexserviceman/plugins/inc/ir/obexsmirdaconnection.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: This class handles irda obex settings. -* -*/ - - - -#ifndef _SRCSIRDACONNECTION_H -#define _SRCSIRDACONNECTION_H - -// INCLUDES -#include - -#include -#include "SrcsTransport.h" -#include "SrcsInterface.h" - -// CLASS DECLARATION - -/** - * Class to handle IRDA connection - */ -class CObexSMIrDAConnection: public CSrcsTransport - { -public: - - /** - * Two-phased constructor. - * @param aInitParams initial parameters - */ - static CObexSMIrDAConnection* NewL(TAny* aInitParams); - - /** - * Destructor. - */ - virtual ~CObexSMIrDAConnection(); - - /** - * Check if OBEX service is still active. - * @return ETrue: OBEX service is still active. - * EFalse: OBEX service is inactive. - */ - TBool IsOBEXActive(); - -private: - - /** - * C++ default constructor. - */ - CObexSMIrDAConnection(); - - /** - * Constructor. - * - * @param aInitParams initial parameters - */ - CObexSMIrDAConnection(TAny* aInitParams); - - /** - * Constructor - * Open IRDA connection and creates OBEX server. - */ - void ConstructL(); - - /** - * MObexAuthChallengeHandler implementation - */ - - /** - * Password for authenticated connection - * - * @param aUserID User ID. - */ - void GetUserPasswordL( const TDesC& aUserID ); - - - -private: - CObexServer* iServer; // Obex Server - CSrcsInterface* iController; // Service Controller callback - CImplementationInformation* iImplementationInfo; // Implementation Info - }; - - - -#endif // _SRCSIRDACONNECTION_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/inc/usb/debug.h --- a/localconnectivityservice/obexserviceman/plugins/inc/usb/debug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* -* Copyright (c) 2002 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: -* Central place for nice debug-type macros & functions -* -*/ - - -#ifndef SRCS_DEBUG_H -#define SRCS_DEBUG_H - -#ifdef _DEBUG - -// Enable this to enable memory tracing -// to SRCS -//#define MEMTRACE - -// Following define is to enable OOM -// situations in SRCS -// NOTE! SHOULD NEVER BE IN RELEASES -//#define TEST_OOM - -#ifdef __WINS__ - -// File logging for WIS -#define __FLOGGING__ - -#else - -// Logging with RDebug for target HW -#define __CLOGGING__ -//#define __FLOGGING__ - - -#endif //__WINS__ - -#endif - -#if defined ( __FLOGGING__ ) - -_LIT(KLogFile,"Srcslog.txt"); -_LIT(KLogDir,"SRCS"); - -#include -#include - -#define FLOG(a) {FPrint(a);} - -#define FLOGHEX(value, len) {RFileLogger::HexDump(KLogDir, KLogFile, EFileLoggingModeAppend, "", " ",value, len);} - -#define FTRACE(a) {a;} -// Declare the FPrint function - -inline void FPrint(const TRefByValue aFmt, ...) -{ - VA_LIST list; - VA_START(list,aFmt); - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); - - // If memory tracing is activated. -#ifdef MEMTRACE - TInt size; - User::Heap().AllocSize(size); - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, _L("[SRCS]\tmemory\tMemory usage: %d high: %d"), size, User::Heap().Size()); -#endif -} - -inline void FHex(const TUint8* aPtr, TInt aLen) -{ - RFileLogger::HexDump(KLogDir, KLogFile, EFileLoggingModeAppend, 0, 0, aPtr, aLen); -} - -inline void FHex(const TDesC8& aDes) -{ - FHex(aDes.Ptr(), aDes.Length()); -} - -// RDebug logging -#elif defined(__CLOGGING__) - -#include - -#define FLOG(a) {RDebug::Print(a);} - -#define FLOGHEX(a) - -#define FTRACE(a) {a;} - -// Declare the FPrint function - -inline void FPrint(const TRefByValue aFmt, ...) -{ - VA_LIST list; - VA_START(list,aFmt); - TInt tmpInt = VA_ARG(list, TInt); - TInt tmpInt2 = VA_ARG(list, TInt); - TInt tmpInt3 = VA_ARG(list, TInt); - VA_END(list); - RDebug::Print(aFmt, tmpInt, tmpInt2, tmpInt3); -} - - -#else // No loggings --> reduced code size -#define FLOG(a) -#define FLOGHEX(a) -#define FTRACE(a) - -#endif //_DEBUG - -#endif // SRCS_DEBUG_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/inc/usb/obexsmusbconnection.h --- a/localconnectivityservice/obexserviceman/plugins/inc/usb/obexsmusbconnection.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* -* 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" -* 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: This class handles service connection settings. -* -*/ - - - -#ifndef OBEXSMUSBCONNECTION_H -#define OBEXSMUSBCONNECTION_H - -// INCLUDES -#include - - -#include -#include "SrcsTransport.h" -#include "SrcsInterface.h" - - -// CLASS DECLARATION - - -/** - * Class to handle USB connection - */ -class CObexSMUsbConnection: public CSrcsTransport - { -public: - /** - * Two-phased constructor. - * @param aInitParams initial parameters - */ - static CObexSMUsbConnection* NewL(TAny* aInitParams); - - /** - * Destructor. - */ - virtual ~CObexSMUsbConnection(); - - /** - * Check if OBEX service is still active. - * @return ETrue: OBEX service is still active. - * EFalse: OBEX service is inactive. - */ - TBool IsOBEXActive(); - - /** - * Perform any outstanding initialization tasks - * - * @return none. - */ - void PostInitializeL(); - -private: - - /** - * C++ default constructor. - */ - CObexSMUsbConnection(); - - /** - * Constructor. - * - * @param aInitParams initial parameters - */ - CObexSMUsbConnection(TAny* aInitParams); - - /** - * Constructor - * registers to sdp and btmanager - * sets up the protocol stack - * creates new messagehandler - */ - void ConstructL(); - - /** - * MObexAuthChallengeHandler implementation - */ - - /** - * Password for authenticated connection - * - * @param aUserID User ID. - */ - void GetUserPasswordL( const TDesC& aUserID ); - - - -private: - CObexServer* iServer; // Obex Server - CSrcsInterface* iController; // Service Controller callback - CImplementationInformation* iImplementationInfo; // Implementation Info - TUid iImplUid; - }; - -#endif // OBEXSMUSBCONNECTION_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/src/bt/101f7c9d.rss --- a/localconnectivityservice/obexserviceman/plugins/src/bt/101f7c9d.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This file contains all the resources for the SRCS BT transport plug-in. -* -*/ - - -#include "registryinfo.rh" - -// Declares info for two implementations -RESOURCE REGISTRY_INFO theInfo - { - // UID for the DLL - dll_uid = 0x101F7C9D; - // Declare array of interface info - interfaces = - { - INTERFACE_INFO - { - // UID of interface that is implemented - interface_uid = 0x101F7C9A; - implementations = - { - // Info for CSrcsBTConnection - IMPLEMENTATION_INFO - { - implementation_uid = 0x101F7C9C; - version_no = 1; - display_name = "Srcs Bluetooth Tranport"; - default_data = "OBEX/BT"; - opaque_data = ""; - } - }; - } - }; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/src/bt/obexsmbtconnection.cpp --- a/localconnectivityservice/obexserviceman/plugins/src/bt/obexsmbtconnection.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,295 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: This class handles service connections. -* -*/ - - -// INCLUDE FILES -#include -#include "obexsmbtconnection.h" -#include "debug.h" - -_LIT( KBTProtocol, "RFCOMM" ); - - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// C++ default constructor can NOT contain any code, that -// might leave. -// --------------------------------------------------------- -// -CObexSMBtConnection::CObexSMBtConnection() - { - } -// --------------------------------------------------------- -// Constructor -// --------------------------------------------------------- -// -CObexSMBtConnection::CObexSMBtConnection(TAny* aInitParams) - :iImplementationInfo((CImplementationInformation *)aInitParams), - iBtDiscovery(NULL) - { - } -// --------------------------------------------------------- -// Destructor -// --------------------------------------------------------- -// -CObexSMBtConnection::~CObexSMBtConnection() - { - // Cleanup - FLOG(_L("[SRCS]\tserver\tCSrcsBtConnection::~CSrcsBtConnection begin")); - - if(iPasskey) - { - iPasskey->Cancel(); - FLOG(_L("[SRCS]\tserver\tCSrcsBtConnection::~CSrcsBtConnection passkey query cancelled.")); - } - - if ( iBtDiscovery ) - { - iBtDiscovery->DeleteSdpRecord( iSDPHandle ); - delete iBtDiscovery; - } - - FTRACE( FPrint( _L( "[SRCS] CSrcsBtConnection::~CSrcsBtConnection: UnregisterSDPSettingsL" ) ) ); - - - if(iServer) - { - iServer->Stop(); - FLOG(_L("[SRCS]\tserver\tCSrcsBtConnection::~CSrcsBtConnection obex server stopped.")); - } - // Delete OBEX Server - if (iServer) - { - delete iServer; - FLOG(_L("[SRCS]\tserver\tCSrcsBtConnection::~CSrcsBtConnection obex server deleted.")); - iServer = NULL; - } - - // Delete passkey - delete iPasskey; - FLOG(_L("[SRCS]\tserver\tCSrcsBtConnection::~CSrcsBtConnection iPasskey deleted.")); - iPasskey = NULL; - - // Delete Service Controller callback - delete iController; - FLOG(_L("[SRCS]\tserver\tCSrcsBtConnection::~CSrcsBtConnection service controller deleted.")); - iController = NULL; - } - -// --------------------------------------------------------- -// NewL -// --------------------------------------------------------- -// -CObexSMBtConnection* CObexSMBtConnection::NewL(TAny* aInitParams) - { - FLOG(_L("[SRCS]\tserver\tCSrcsBtConnection: NewL")); - CObexSMBtConnection* self = new (ELeave) CObexSMBtConnection(aInitParams); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - - -// --------------------------------------------------------- -// ConstructL -// Method to create BT connections. -// --------------------------------------------------------- -// -void CObexSMBtConnection::ConstructL() - { - TLex8 lex; - // Create service controller implementation object - iController = CSrcsInterface::NewL(iImplementationInfo->ImplementationUid()); - - FLOG(_L("[SRCS] CSrcsBtConnection: ConstructL: CSrcsInterface::NewL\t")); - iController->SetMediaType( ESrcsMediaBT ); - // parsing opaque_data in iImplementationInfo - TPtrC8 res_string = iImplementationInfo->OpaqueData(); - - CObexUtilsOpaqueData res_data(res_string); - - TBuf8 op_LocalWho; - TUint op_Protocol, op_Authenticate, op_Authorise, op_Encrypt; - TUint op_ReceiveMtu(KSRCSDefaultReceiveMtu), op_TransmitMtu(KSRCSDefaultTransmitMtu); - - // skip 1st entry: USB interface string descriptor - User::LeaveIfError ( res_data.GetString(op_LocalWho) ); - - // get 2nd entry: OBEX local who - User::LeaveIfError ( res_data.GetString(op_LocalWho) ); - - // get 3rd to 7th entry - - // All service ID should be strings ! - TBuf8 serviceUUID; - User::LeaveIfError ( res_data.GetString(serviceUUID) ); - - FTRACE(FPrint(_L("[SRCS] CObexSMBtConnection::ConstructL() serviceUUID Length %d"), serviceUUID.Length())); - - if (serviceUUID.Length() < 6) - { - User::Leave( KErrArgument ); - } - - lex.Assign(serviceUUID); - - User::LeaveIfError ( res_data.GetNumber(op_Protocol) ); - User::LeaveIfError ( res_data.GetNumber(op_Authenticate) ); - User::LeaveIfError ( res_data.GetNumber(op_Authorise) ); - User::LeaveIfError ( res_data.GetNumber(op_Encrypt) ); - - // Get OBEX packet size: - if( res_data.GetNumber(op_ReceiveMtu) != KErrNone ) - { - op_ReceiveMtu = KSRCSDefaultReceiveMtu; // restore default value in case it is modified; - FLOG(_L("[SRCS] CSrcsBtConnection: ConstructL: op_ReceiveMtu not specified.\t")); - } - - if( res_data.GetNumber(op_TransmitMtu) != KErrNone ) - { - op_TransmitMtu = KSRCSDefaultTransmitMtu; // restore default value in case it is modified; - FLOG(_L("[SRCS] CSrcsBtConnection: ConstructL: op_TransmitMtu not specified.\t")); - } - - FLOG(_L("[SRCS] CSrcsBtConnection: ConstructL: Successfully get all data from opaque_data.\t")); - - // Create CBTEngDiscovery - - FLOG(_L("[SRCS] CSrcsBtConnection: ConstructL: CBTConnection::NewL\t")); - - // For handling Obex Passkey note - iPasskey = CObexSMPasskey::NewL(); - FLOG(_L("[SRCS] CSrcsBtConnection: ConstructL: CSrcsPasskey::NewL\t")); - - // For showing Error Notes - // iErrorUi = CErrorUI::NewL(); - - // set up the protocol stack... - TObexBluetoothProtocolInfo aObexBluetoothProtocolInfo; - aObexBluetoothProtocolInfo.iTransport = KBTProtocol ; - - // Configure security setting - FLOG(_L("[SRCS] CSrcsBtConnection: ConstructL: Setting Security\t")); - TBTServiceSecurity sec; - sec.SetAuthentication(op_Authenticate); - sec.SetAuthorisation(op_Authorise); - sec.SetEncryption(op_Encrypt); - - TUint32 serviceUID; - lex.Inc(2); - lex.Val(serviceUID,EHex); - sec.SetUid(TUid::Uid(serviceUID)); - aObexBluetoothProtocolInfo.iAddr.SetSecurity(sec); - if (serviceUUID.Length() == 34) - { - TUint32 HH; TUint32 HL; TUint32 LH; TUint32 LL; - lex = serviceUUID.Mid(2, 8); - lex.Val(HH, EHex); - lex = serviceUUID.Mid(10, 8); - lex.Val(HL, EHex); - lex = serviceUUID.Mid(18, 8); - lex.Val(LH, EHex); - lex = serviceUUID.Mid(26, 8); - lex.Val(LL, EHex); - iServiceUUID = TUUID(HH, HL, LH, LL); - } - else - { - iServiceUUID = TUUID(serviceUID); - } - - // Configure Obex packet size - TObexProtocolPolicy aObexProtocolPolicy; - aObexProtocolPolicy.SetReceiveMtu( static_cast(op_ReceiveMtu) ); - aObexProtocolPolicy.SetTransmitMtu( static_cast(op_TransmitMtu) ); - FTRACE(FPrint(_L("[SRCS] CSrcsBtConnection: ConstructL: op_ReceiveMtu[%x] op_TransmitMtu[%x]"), - aObexProtocolPolicy.ReceiveMtu(), aObexProtocolPolicy.TransmitMtu() )); - - // try to find a available channel to start OBEX server. - TUint channel=KRfcommPassiveAutoBind; - - aObexBluetoothProtocolInfo.iAddr.SetPort( channel ); - TRAPD(err,iServer = CObexServer::NewL(aObexBluetoothProtocolInfo, aObexProtocolPolicy);) - // Try to start server on this channel - if ( err == KErrNone ) - { - err=iController->SetObexServer( iServer ); - if ( err == KErrNone ) - { - // Set authentication handler - iServer->SetCallBack( *this ); - //If there is "local who" field, set it to OBEX server. - if(op_LocalWho.Size()) - { - User::LeaveIfError ( iServer->SetLocalWho( op_LocalWho ) ); - FLOG(_L("[SRCS] CSrcsBtConnection: ConstructL: SetLocalWho\t")); - } - FLOG(_L("[SRCS] CSrcsBtConnection: ConstructL: SetObexServer\t")); - - // Register SDP settings - - TObexBtTransportInfo *info=(TObexBtTransportInfo*)iServer->TransportInfo(); - channel=info->iAddr.Port(); - FTRACE(FPrint(_L("[SRCS] CSrcsBtConnection: ConstructL: CObexServer started on channel %d"), channel)); - iBtDiscovery = CBTEngDiscovery::NewL(); - User::LeaveIfError ( iBtDiscovery->RegisterSdpRecord(iServiceUUID, channel, iSDPHandle )); - } - else - { - // Failed to start Obex server. Delete server and try again - FLOG(_L("[SRCS] CSrcsBtConnection: ConstructL: Failed to start Obex server. Delete server and try again.\t")); - delete iServer; - iServer = NULL; - } - } - if ( !iServer ) - { - // Server did not start. - FLOG(_L("[SRCS] CSrcsBtConnection: ConstructL: Failed to start Obex server. Leave now! \t")); - User::Leave( KErrGeneral ); - } - - } - -// --------------------------------------------------------- -// GetUserPasswordL(const TDesC& ) -// Purpose: Get the Obex password from user with ObexPasskeyNotifier -// Parameters: -// Return value: -// --------------------------------------------------------- -// -void CObexSMBtConnection::GetUserPasswordL( const TDesC& ) - { - FLOG( _L( "[SRCS] CSrcsBtConnection: GetUserPassword\t" ) ); - iPasskey->StartPassKeyRequestL( iServer ); - } - -// --------------------------------------------------------- -// Check if OBEX service is still active. -// @return ETrue: OBEX service is still active. -// EFalse: OBEX service is inactive. -// --------------------------------------------------------- -// -TBool CObexSMBtConnection::IsOBEXActive() - { - FLOG( _L( "[SRCS] CSrcsBtConnection: IsOBEXActive\t" ) ); - return ETrue; - } - -// End of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/src/bt/obexsmpasskey.cpp --- a/localconnectivityservice/obexserviceman/plugins/src/bt/obexsmpasskey.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: Class to handle Obexpasskey queries -* -*/ - - - -// INCLUDE FILES -#include "obexsmpasskey.h" -#include -#include -#include "debug.h" - - -CObexSMPasskey::CObexSMPasskey() - : CActive(CActive::EPriorityStandard) - { - CActiveScheduler::Add(this); - } - -CObexSMPasskey* CObexSMPasskey::NewL() - { - CObexSMPasskey* self = new (ELeave) CObexSMPasskey; - return self; - } - -CObexSMPasskey::~CObexSMPasskey() - { - Cancel(); - iNotif.Close(); - FLOG( _L( "[SRCS] CObexSMPasskey: ~CObexSMPasskey" ) ); - } - -void CObexSMPasskey::Cleanup() - { - iNotif.CancelNotifier( KBTObexPasskeyQueryNotifierUid ); - iNotif.Close(); - } - -// --------------------------------------------------------- -// DoCancel() -// Purpose: Cancels ObexPasskey notifier -// Parameters: -// Return value: -// --------------------------------------------------------- -// -void CObexSMPasskey::DoCancel() - { - Cleanup(); - FLOG( _L( "[SRCS] CObexSMPasskey: DoCancel" ) ); - } - -// --------------------------------------------------------- -// RunL() -// Purpose: Handles ObexPasskey notifiers return value -// Parameters: -// Return value: -// --------------------------------------------------------- -// -void CObexSMPasskey::RunL() - { - if ( iStatus.Int() != KErrNone ) - { - FLOG( _L( "[SRCS] CObexSMPasskey: RunL::Cancel\t" ) ); - User::Leave(KErrCancel); - } - - TBuf tempResultBuffer; - CnvUtfConverter::ConvertToUnicodeFromUtf8( tempResultBuffer, iObexPasskey() ); - iObexServer->UserPasswordL( tempResultBuffer ); - FLOG( _L( "[SRCS] CObexSMPasskey: RunL ObexPasskey returned\t" ) ); - - Cleanup(); - } - -// --------------------------------------------------------- -// RunError( TInt aError ) -// Purpose: Handle error cases -// Parameters: TInt -// Return value: error value -// --------------------------------------------------------- -// -TInt CObexSMPasskey::RunError( TInt aError ) - { - FTRACE(FPrint(_L("[SRCS] CObexSMPasskey: RunError: aError = %d"), aError)); - Cleanup(); - iObexServer->Error(aError); // Ensure that OBEX is kept informed of the problem. - return KErrNone; - } - -// --------------------------------------------------------- -// StartPassKeyRequestL( CObexServer* aObexServer ) -// Purpose: Starts ObexPasskey notifier -// Parameters: CObexServer* -// Return value: -// --------------------------------------------------------- -// -void CObexSMPasskey::StartPassKeyRequestL( CObexServer* aObexServer ) - { - FLOG( _L( "[SRCS] CObexSMPasskey: StartPassKeyRequest" ) ); - User::LeaveIfError( iNotif.Connect() ); - TPtrC8 dummy( KNullDesC8 ); - // Starts notifier and gets the passkey for Obex - iNotif.StartNotifierAndGetResponse( iStatus, KBTObexPasskeyQueryNotifierUid, dummy, iObexPasskey ); - iObexServer = aObexServer; - SetActive(); - FLOG( _L( "[SRCS] CObexSMPasskey: SetActive" ) ); - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/src/bt/proxy.cpp --- a/localconnectivityservice/obexserviceman/plugins/src/bt/proxy.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: This class export ECom interface implementations. -* -*/ - - -#include -#include - -#include "obexsmbtconnection.h" - -// Map the interface UIDs to implementation factory functions -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY(0x101F7C9C, CObexSMBtConnection::NewL) - //{{0x101F7C9C}, CSrcsBtConnection::NewL}, - }; - -// Exported proxy for instantiation method resolution -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - - return ImplementationTable; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/src/ir/101F9695.rss --- a/localconnectivityservice/obexserviceman/plugins/src/ir/101F9695.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This file contains all the resources for the SRCS IrDA transport plug-in. -* -*/ - - -#include "registryinfo.rh" - -// Declares info for two implementations -RESOURCE REGISTRY_INFO theInfo - { - // UID for the DLL - dll_uid = 0x101F9695; - // Declare array of interface info - interfaces = - { - INTERFACE_INFO - { - // UID of interface that is implemented - interface_uid = 0x101F7C9A; - implementations = - { - // Info for CSrcsBTConnection - IMPLEMENTATION_INFO - { - implementation_uid = 0x101F9694; - version_no = 1; - display_name = "Srcs IrDA Tranport"; - default_data = "OBEX/IrDA"; - opaque_data = ""; - } - }; - } - }; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/src/ir/obexsmirdaconnection.cpp --- a/localconnectivityservice/obexserviceman/plugins/src/ir/obexsmirdaconnection.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,234 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: This class handles service connections. -* -*/ - - - -// INCLUDE FILES - -#include "obexsmirdaconnection.h" -#include "debug.h" -#include "obexutilsopaquedata.h" - -const TUint16 KMaxMtuSize = 0x7FFF; // 32kB-1 - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// C++ default constructor can NOT contain any code, that -// might leave. -// --------------------------------------------------------- -// -CObexSMIrDAConnection::CObexSMIrDAConnection() - { - } -// --------------------------------------------------------- -// Constructor -// --------------------------------------------------------- -// -CObexSMIrDAConnection::CObexSMIrDAConnection(TAny* aInitParams) - :iImplementationInfo((CImplementationInformation *)aInitParams) - { - } - -// --------------------------------------------------------- -// Destructor -// --------------------------------------------------------- -// -CObexSMIrDAConnection::~CObexSMIrDAConnection() - { - // Cleanup - FLOG(_L("[SRCS]\tserver\tCSrcsIrDAConnection::~CSrcsIrDAConnection")); - if(iServer) - { - iServer->Stop(); - FLOG(_L("[SRCS]\tserver\tCSrcsIrDAConnection::~CSrcsIrDAConnection: OBEX server stopped.")); - } - - // Delete OBEX Server - if (iServer) - { - delete iServer; - FLOG(_L("[SRCS]\tserver\tCSrcsBtConnection::~CSrcsBtConnection obex server deleted.")); - iServer = NULL; - } - - // Delete Service Controller callback - delete iController; - FLOG(_L("[SRCS]\tserver\tCSrcsIrDAConnection::~CSrcsIrDAConnection: service controller deleted.")); - iController = NULL; - - FLOG(_L("[SRCS]\tserver\tCSrcsIrDAConnection::~CSrcsIrDAConnection finished.")); - } - -// --------------------------------------------------------- -// NewL -// --------------------------------------------------------- -// -CObexSMIrDAConnection* CObexSMIrDAConnection::NewL(TAny* aInitParams) - { - FLOG(_L("[SRCS]\tserver\tCSrcsIrDAConnection: NewL")); - CObexSMIrDAConnection* self = new (ELeave) CObexSMIrDAConnection(aInitParams); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - - -// --------------------------------------------------------- -// ConstructL -// Method to create IrDA connections. -// --------------------------------------------------------- -// -void CObexSMIrDAConnection::ConstructL() - { - - // Create service controller implementation object - iController = CSrcsInterface::NewL(iImplementationInfo->ImplementationUid()); - FLOG(_L("[SRCS] CSrcsIrDAConnection: ConstructL: CSrcsInterface::NewL\t")); - - iController->SetMediaType( ESrcsMediaIrDA ); - - //Start service controller state machine. - iController->IsOBEXActive(); - - // parsing opaque_data in iImplementationInfo - TPtrC8 res_string = iImplementationInfo->OpaqueData(); - - CObexUtilsOpaqueData res_data(res_string); - TBuf8 op_StringDesc, op_LocalWho, op_SkipStr; - TUint op_SkipInt; //used to skip certain fields - TUint op_ReceiveMtu(KSRCSDefaultReceiveMtu), op_TransmitMtu(KSRCSDefaultTransmitMtu); - - // get 1st entry: USB interface string descriptor - User::LeaveIfError ( res_data.GetString(op_StringDesc) ); - - // get 2nd entry: OBEX local who - User::LeaveIfError ( res_data.GetString(op_LocalWho) ); - - // skip 3rd to 7th entry - // All service ID should be strings ! - res_data.GetString(op_SkipStr); - res_data.GetNumber(op_SkipInt); - res_data.GetNumber(op_SkipInt); - res_data.GetNumber(op_SkipInt); - res_data.GetNumber(op_SkipInt); - - // Get OBEX packet size: - if( res_data.GetNumber(op_ReceiveMtu) != KErrNone ) - { - op_ReceiveMtu = KSRCSDefaultReceiveMtu; // restore default value in case it is modified; - FLOG(_L("[SRCS] CSrcsIrDAConnection: ConstructL: op_ReceiveMtu not specified.\t")); - } - - if( res_data.GetNumber(op_TransmitMtu) != KErrNone ) - { - op_TransmitMtu = KSRCSDefaultTransmitMtu; // restore default value in case it is modified; - FLOG(_L("[SRCS] CSrcsIrDAConnection: ConstructL: op_TransmitMtu not specified.\t")); - } - //limit max mtu size to 32kB-1 - if (op_ReceiveMtu>KMaxMtuSize) - { - op_ReceiveMtu=KMaxMtuSize; - } - if (op_TransmitMtu>KMaxMtuSize) - { - op_TransmitMtu=KMaxMtuSize; - } - - FLOG(_L("[SRCS] CSrcsIrDAConnection: ConstructL: Successfully get all data from opaque_data.\t")); - - // set up the protocol stack... - TObexIrProtocolInfo aInfo; - - aInfo.iTransport = KObexIrTTPProtocol; //"IrTinyTP" from obex.h - aInfo.iClassName.Copy(op_StringDesc); - aInfo.iAttributeName = _L8("IrDA:TinyTP:LsapSel");; - - // Configure Obex packet size - TObexProtocolPolicy aObexProtocolPolicy; - aObexProtocolPolicy.SetReceiveMtu( static_cast(op_ReceiveMtu) ); - aObexProtocolPolicy.SetTransmitMtu( static_cast(op_TransmitMtu) ); - FTRACE(FPrint(_L("[SRCS] CSrcsIrDAConnection: ConstructL: op_ReceiveMtu[%x] op_TransmitMtu[%x]"), - aObexProtocolPolicy.ReceiveMtu(), aObexProtocolPolicy.TransmitMtu() )); - - // try to find a available port to start OBEX server. - TUint port=KAutoBindLSAP; - // create obex server - - aInfo.iAddr.SetPort( port ); - TRAPD(err,iServer = CObexServer::NewL(aInfo, aObexProtocolPolicy);) - - // Try to start server on this port - if ( err == KErrNone ) - { - FLOG(_L("[SRCS] CSrcsIrDAConnection: ConstructL: SetObexServer\t")); - err=iController->SetObexServer( iServer ); - FTRACE(FPrint(_L("[SRCS] CSrcsIrDAConnection: ConstructL: CObexServer started on port %d"), port)); - - if (err!=KErrNone) - { - // Failed to start Obex server. Delete server and try again - delete iServer; - iServer = NULL; - } - } - - - if ( !iServer ) - { - // Server did not start. - FLOG(_L("[SRCS] CSrcsIrDAConnection: ConstructL: Failed to start Obex server\t")); - User::Leave( KErrGeneral ); - } - else - { - // if there is "local who" field - if(op_LocalWho.Size()) - { - User::LeaveIfError ( iServer->SetLocalWho( op_LocalWho ) ); - FLOG(_L("[SRCS] CSrcsIrDAConnection: ConstructL: SetLocalWho")); - } - } - } - -// --------------------------------------------------------- -// GetUserPasswordL(const TDesC& ) -// Purpose: Get the Obex password from user with ObexPasskeyNotifier -// Parameters: -// Return value: -// --------------------------------------------------------- -// -void CObexSMIrDAConnection::GetUserPasswordL( const TDesC& ) - { - FLOG( _L( "[SRCS] CSrcsIrDAConnection: GetUserPassword\t" ) ); - } - -// --------------------------------------------------------- -// Check if OBEX service is still active. -// @return ETrue: OBEX service is still active. -// EFalse: OBEX service is inactive. -// --------------------------------------------------------- -// - -TBool CObexSMIrDAConnection::IsOBEXActive() - { - FLOG( _L( "[SRCS] CSrcsIrDAConnection: IsOBEXActive\t" ) ); - return iController->IsOBEXActive(); - } - -// End of file diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/src/ir/proxy.cpp --- a/localconnectivityservice/obexserviceman/plugins/src/ir/proxy.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: This class export ECom interface implementations. -* -*/ - - - -#include -#include - -#include "obexsmirdaconnection.h" - -// Map the interface UIDs to implementation factory functions -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY(0x101F9694, CObexSMIrDAConnection::NewL) - //{{0x101F9694}, CSrcsIrDAConnection::NewL}, - }; - -// Exported proxy for instantiation method resolution -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - - return ImplementationTable; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/src/usb/101F9693.rss --- a/localconnectivityservice/obexserviceman/plugins/src/usb/101F9693.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This file contains all the resources for the SRCS USB transport plug-in. -* -*/ - - -#include "registryinfo.rh" - -// Declares info for two implementations -RESOURCE REGISTRY_INFO theInfo - { - // UID for the DLL - dll_uid = 0x101F9693; - // Declare array of interface info - interfaces = - { - INTERFACE_INFO - { - // UID of SRCS Transport interface - interface_uid = 0x101F7C9A; - implementations = - { - // Info for CSrcsUSBConnection - IMPLEMENTATION_INFO - { - implementation_uid = 0x101F9692; - version_no = 1; - display_name = "Srcs USB Tranport"; - default_data = "OBEX/USB"; - opaque_data = ""; - } - }; - } - }; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/src/usb/obexsmusbconnection.cpp --- a/localconnectivityservice/obexserviceman/plugins/src/usb/obexsmusbconnection.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,223 +0,0 @@ -/* -* 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" -* 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: This class handles service connections. -* -*/ - - - -// INCLUDE FILES - -#include "obexsmusbconnection.h" -#include "debug.h" -#include -#include "obexutilsopaquedata.h" -#include -#include "obexservicemanprivatecrkeys.h" - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// C++ default constructor can NOT contain any code, that -// might leave. -// --------------------------------------------------------- -// -CObexSMUsbConnection::CObexSMUsbConnection() - { - } -// --------------------------------------------------------- -// Constructor -// --------------------------------------------------------- -// -CObexSMUsbConnection::CObexSMUsbConnection(TAny* aInitParams) - :iImplementationInfo((CImplementationInformation *)aInitParams) - { - } - -// --------------------------------------------------------- -// Destructor -// --------------------------------------------------------- -// -CObexSMUsbConnection::~CObexSMUsbConnection() - { - // Cleanup - FLOG(_L("[SRCS] CSrcsUsbConnection: StopObexServer")); - if(iServer) - { - iServer->Stop(); - } - - // Delete OBEX Server - if (iServer) - { - delete iServer; - FLOG(_L("[SRCS]\tserver\tCSrcsBtConnection::~CSrcsBtConnection obex server deleted.")); - iServer = NULL; - } - - // Delete Service Controller callback - delete iController; - iController = NULL; - - FLOG(_L("[SRCS] CSrcsUsbConnection: ~CSrcsUsbConnection: Completed\t")); - } - -// --------------------------------------------------------- -// NewL -// --------------------------------------------------------- -// -CObexSMUsbConnection* CObexSMUsbConnection::NewL(TAny* aInitParams) - { - FLOG(_L("[SRCS]\tserver\tCSrcsUsbConnection: NewL")); - CObexSMUsbConnection* self = new (ELeave) CObexSMUsbConnection(aInitParams); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - - -// --------------------------------------------------------- -// ConstructL -// Method to create BT connections. -// --------------------------------------------------------- -// -void CObexSMUsbConnection::ConstructL() - { - // Save service controller implementation UID for deferred initialization - iImplUid = iImplementationInfo->ImplementationUid(); - - FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: CSrcsInterface::NewL\t")); - - // parsing opaque_data in iImplementationInfo - TPtrC8 res_string = iImplementationInfo->OpaqueData(); - - CObexUtilsOpaqueData res_data(res_string); - TBuf8 op_StringDesc, op_LocalWho, op_SkipStr; - TUint op_SkipInt; //used to skip certain fields - TUint op_ReceiveMtu(KSRCSDefaultReceiveMtu), op_TransmitMtu(KSRCSDefaultTransmitMtu); - // get 1st entry: USB interface string descriptor - User::LeaveIfError ( res_data.GetString(op_StringDesc) ); - // get 2nd entry: OBEX local who - User::LeaveIfError ( res_data.GetString(op_LocalWho) ); - // skip 3rd to 7th entry - // All service ID should be strings ! - res_data.GetString(op_SkipStr); - res_data.GetNumber(op_SkipInt); - res_data.GetNumber(op_SkipInt); - res_data.GetNumber(op_SkipInt); - res_data.GetNumber(op_SkipInt); - - // Get OBEX packet size: - if( res_data.GetNumber(op_ReceiveMtu) != KErrNone ) - { - op_ReceiveMtu = KSRCSDefaultReceiveMtu; // restore default value in case it is modified; - FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: op_ReceiveMtu not specified.\t")); - } - - if( res_data.GetNumber(op_TransmitMtu) != KErrNone ) - { - op_TransmitMtu = KSRCSDefaultTransmitMtu; // restore default value in case it is modified; - FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: op_TransmitMtu not specified.\t")); - } - - FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: Successfully get all data from opaque_data.\t")); - - // Get OBEX usb dma usage - CRepository* cenrep = NULL; - TRAP_IGNORE(cenrep = CRepository::NewL(KCRUidObexServiceMan)); - TInt dmaUsage = EObexUsbDmaInUse; - if (cenrep) - { - cenrep->Get(KObexUsbDmaUsage, dmaUsage); - delete cenrep; - } - - // set up the protocol stack... - TObexUsbProtocolInfoV2 obexUsbProtocolInfo; - obexUsbProtocolInfo.iTransport = KObexUsbProtocolV2; - obexUsbProtocolInfo.iInterfaceStringDescriptor.Copy(op_StringDesc); - if(dmaUsage == EObexUsbDmaInUse) - { - obexUsbProtocolInfo.iDmaOnInEndpoint = ETrue; - obexUsbProtocolInfo.iDmaOnOutEndpoint = ETrue; - } - else - { - obexUsbProtocolInfo.iDmaOnInEndpoint = EFalse; - obexUsbProtocolInfo.iDmaOnOutEndpoint = EFalse; - } - obexUsbProtocolInfo.iBandwidthPriority = EUsbcBandwidthOUTPlus2 | EUsbcBandwidthINPlus2; - - - - // Configure Obex packet size - TObexProtocolPolicy aObexProtocolPolicy; - aObexProtocolPolicy.SetReceiveMtu( static_cast(op_ReceiveMtu) ); - aObexProtocolPolicy.SetTransmitMtu( static_cast(op_TransmitMtu) ); - FTRACE(FPrint(_L("[SRCS] CSrcsUsbConnection: ConstructL: op_ReceiveMtu[%x] op_TransmitMtu[%x]"), - aObexProtocolPolicy.ReceiveMtu(), aObexProtocolPolicy.TransmitMtu() )); - - // Try to create OBEX server - iServer = CObexServer::NewL(obexUsbProtocolInfo, aObexProtocolPolicy); - FLOG(_L("[SRCS] CSrcsUsbConnection: ConstructL: CObexServer::NewL")); - // 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() - } - -// --------------------------------------------------------- -// GetUserPasswordL(const TDesC& ) -// Purpose: Get the Obex password from user with ObexPasskeyNotifier -// Parameters: -// Return value: -// --------------------------------------------------------- -// -void CObexSMUsbConnection::GetUserPasswordL( const TDesC& ) - { - FLOG( _L( "[SRCS] CSrcsUsbConnection: GetUserPassword\t" ) ); - } - -// --------------------------------------------------------- -// Check if OBEX service is still active. -// @return ETrue: OBEX service is still active. -// EFalse: OBEX service is inactive. -// --------------------------------------------------------- -// - -TBool CObexSMUsbConnection::IsOBEXActive() - { - FLOG( _L( "[SRCS] CSrcsUsbConnection: IsOBEXActive\t" ) ); - 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 diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/plugins/src/usb/proxy.cpp --- a/localconnectivityservice/obexserviceman/plugins/src/usb/proxy.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: This class export ECom interface implementations. -* -*/ - - -#include -#include - -#include "obexsmusbconnection.h" - -// Map the interface UIDs to implementation factory functions -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY(0x101F9692, CObexSMUsbConnection::NewL) - //{{0x101F9692}, CSrcsUsbConnection::NewL}, - }; - -// Exported proxy for instantiation method resolution -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - - return ImplementationTable; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/rom/ObexUtils.iby --- a/localconnectivityservice/obexserviceman/rom/ObexUtils.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* -* Copyright (c) 2002 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: IBY file for non localizable elements -* -*/ - - -#ifndef __OBEXUTILS_IBY__ -#define __OBEXUTILS_IBY__ - -file=ABI_DIR\BUILD_DIR\obexutils.dll SHARED_LIB_DIR\obexutils.dll - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/rom/ObexUtilsResources.iby --- a/localconnectivityservice/obexserviceman/rom/ObexUtilsResources.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2002 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: IBY file for localizable elements (resources of ObexUtils -* library -* -*/ - - -#ifndef OBEXUTILSRESOURCES_IBY -#define OBEXUTILSRESOURCES_IBY - -data=DATAZ_\RESOURCE_FILES_DIR\obexutils.rsc RESOURCE_FILES_DIR\obexutils.rsc - -#endif - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/rom/obex.iby --- a/localconnectivityservice/obexserviceman/rom/obex.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* -* Copyright (c) 2001-2005 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: -* -*/ - - -#ifndef __OBEX_IBY__ -#define __OBEX_IBY__ - -#ifdef SYMBIAN_EXCLUDE_OBEX -REM Messaging OBEX MTM is not included in this ROM, because it depends on excluded OBEX -#else - -// generic OBEX Modules -file=ABI_DIR\BUILD_DIR\obexservermtm.dll System\libs\obexservermtm.dll -file=ABI_DIR\BUILD_DIR\obexclientmtm.dll System\libs\obexclientmtm.dll -file=ABI_DIR\BUILD_DIR\obexmtmutil.dll System\libs\obexmtmutil.dll - -// test harness support libraries -//file=ABI_DIR\BUILD_DIR\msvtestutils.dll System\libs\msvtestutils.dll -//file=ABI_DIR\BUILD_DIR\msgth.dll System\libs\msgth.dll - - -#ifdef SYMBIAN_EXCLUDE_INFRARED -REM Messaging infrared MTM is not included in this ROM, because it depends on excluded INFRARED -#else -//IR MTM Client -file=ABI_DIR\BUILD_DIR\irc.dll System\libs\irc.dll - -//IR MTM Server -file=ABI_DIR\BUILD_DIR\irs.dll System\libs\irs.dll - -//IR MTM Resources - -#endif // SYMBIAN_EXCLUDE_INFRARED - - -#ifdef SYMBIAN_EXCLUDE_BLUETOOTH -REM Messaging Bluetooth MTM is not included in this ROM, because it depends on excluded BLUETOOTH -#else -//BT MTM Client -file=ABI_DIR\BUILD_DIR\btcmtm.dll System\libs\btcmtm.dll - -//BT MTM Server -file=ABI_DIR\BUILD_DIR\btsmtm.dll System\libs\btsmtm.dll - -//BT MTM Resources - -#endif // SYMBIAN_EXCLUDE_BLUETOOTH - - -//Test Harness Executable -//file=ABI_DIR\BUILD_DIR\T_ObexMTM.exe System\Samples\T_ObexMTM.exe - -#endif // SYMBIAN_EXCLUDE_OBEX - - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/rom/obexserviceman.iby --- a/localconnectivityservice/obexserviceman/rom/obexserviceman.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ - -#ifndef OBEXSERVICEMANCLIENT_IBY -#define OBEXSERVICEMANCLIENT_IBY - - -ECOM_PLUGIN(obexserviceman.dll,obexserviceman.rsc) -file=ABI_DIR\BUILD_DIR\obexserviceman.exe PROGRAMS_DIR\obexserviceman.exe -file=ABI_DIR\BUILD_DIR\obexusbapi.dll PROGRAMS_DIR\obexusbapi.dll -data=ZPRIVATE\101F7C87\backup_registration.xml private\101F7C87\backup_registration.xml - -#endif // OBEXSERVICEMANCLIENT_IBY - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/rom/obexservicemanbt.iby --- a/localconnectivityservice/obexserviceman/rom/obexservicemanbt.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ -#ifndef __SRCSBT_IBY__ -#define __SRCSBT_IBY__ -//file content - -#ifdef __BT - -ECOM_PLUGIN(obexservicemanbt.dll,101F7C9D.rsc) - -#endif - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/rom/obexservicemanirda.iby --- a/localconnectivityservice/obexserviceman/rom/obexservicemanirda.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ - -#ifndef __SRCSIRDA_IBY__ -#define __SRCSIRDA_IBY__ - -#ifdef __IRDA -ECOM_PLUGIN(obexservicemanir.dll, 101F9695.rsc) -#endif - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/rom/obexservicemanusb.iby --- a/localconnectivityservice/obexserviceman/rom/obexservicemanusb.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ -#ifndef __SRCSUSB_IBY__ -#define __SRCSUSB_IBY__ -//file content - -#ifdef __USB -ECOM_PLUGIN(obexservicemanusb.dll,101F9693.rsc) -#endif - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/bmarm/OBEXUTILSU.DEF --- a/localconnectivityservice/obexserviceman/utils/bmarm/OBEXUTILSU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -EXPORTS - UpdateProgressDialogL__16CObexUtilsDialogii @ 1 NONAME R3UNUSED ; CObexUtilsDialog::UpdateProgressDialogL(int, int) - CancelWaitDialogL__16CObexUtilsDialog @ 2 NONAME R3UNUSED ; CObexUtilsDialog::CancelWaitDialogL(void) - ContextIcon__17TObexUtilsUiLayerRC9TMsvEntry13TContextMedia @ 3 NONAME R3UNUSED ; TObexUtilsUiLayer::ContextIcon(TMsvEntry const &, TContextMedia) - CreateOutboxEntryL__24TObexUtilsMessageHandlerRC4TUidRCi @ 4 NONAME R3UNUSED ; TObexUtilsMessageHandler::CreateOutboxEntryL(TUid const &, int const &) - DeleteOutboxEntryL__24TObexUtilsMessageHandlerRCl @ 5 NONAME R3UNUSED ; TObexUtilsMessageHandler::DeleteOutboxEntryL(long const &) - GetFileSystemStatus__24TObexUtilsMessageHandler @ 6 NONAME R3UNUSED ; TObexUtilsMessageHandler::GetFileSystemStatus(void) - GetMmcFileSystemStatus__24TObexUtilsMessageHandler @ 7 NONAME R3UNUSED ; TObexUtilsMessageHandler::GetMmcFileSystemStatus(void) - LaunchEditorApplicationL__17TObexUtilsUiLayerP9CMsvEntryR11CMsvSession @ 8 NONAME R3UNUSED ; TObexUtilsUiLayer::LaunchEditorApplicationL(CMsvEntry *, CMsvSession &) - LaunchProgressDialogL__16CObexUtilsDialogP26MObexUtilsProgressObserveriii @ 9 NONAME ; CObexUtilsDialog::LaunchProgressDialogL(MObexUtilsProgressObserver *, int, int, int) - LaunchWaitDialogL__16CObexUtilsDialogi @ 10 NONAME R3UNUSED ; CObexUtilsDialog::LaunchWaitDialogL(int) - NewLC__16CObexUtilsDialogP24MObexUtilsDialogObserver @ 11 NONAME R3UNUSED ; CObexUtilsDialog::NewLC(MObexUtilsDialogObserver *) - NewL__16CObexUtilsDialogP24MObexUtilsDialogObserver @ 12 NONAME R3UNUSED ; CObexUtilsDialog::NewL(MObexUtilsDialogObserver *) - OperationNotSupported__17TObexUtilsUiLayer @ 13 NONAME R3UNUSED ; TObexUtilsUiLayer::OperationNotSupported(void) - ReadResourceL__17TObexUtilsUiLayerR6TDes16RCi @ 14 NONAME R3UNUSED ; TObexUtilsUiLayer::ReadResourceL(TDes16 &, int const &) - SaveObjToInboxL__24TObexUtilsMessageHandlerP14CObexBufObjectRC7TDesC16G4TUid @ 15 NONAME R3UNUSED ; TObexUtilsMessageHandler::SaveObjToInboxL(CObexBufObject *, TDesC16 const &, TUid) - ShowErrorNoteL__17TObexUtilsUiLayerRCi @ 16 NONAME R3UNUSED ; TObexUtilsUiLayer::ShowErrorNoteL(int const &) - ShowInformationNoteL__17TObexUtilsUiLayerRCi @ 17 NONAME R3UNUSED ; TObexUtilsUiLayer::ShowInformationNoteL(int const &) - UpdateBitmaps__17TObexUtilsUiLayerG4TUidRiRt4TBuf1i256T2T2 @ 18 NONAME ; TObexUtilsUiLayer::UpdateBitmaps(TUid, int &, TBuf<256> &, int &, int &) - CancelProgressDialogL__16CObexUtilsDialog @ 19 NONAME R3UNUSED ; CObexUtilsDialog::CancelProgressDialogL(void) - CreateIconsL__17TObexUtilsUiLayerG4TUidPt9CArrayPtr1Zt9CArrayPtr1Z10CFbsBitmap @ 20 NONAME R3UNUSED ; TObexUtilsUiLayer::CreateIconsL(TUid, CArrayPtr > *) - NewL__26CObexUtilsPropertyNotifierP31MObexUtilsPropertyNotifyHandler24TMemoryPropertyCheckType @ 21 NONAME R3UNUSED ; CObexUtilsPropertyNotifier::NewL(MObexUtilsPropertyNotifyHandler *, TMemoryPropertyCheckType) - LaunchQueryDialogL__16CObexUtilsDialogRCi @ 22 NONAME R3UNUSED ; CObexUtilsDialog::LaunchQueryDialogL(int const &) - ShowNumberOfSendFileL__16CObexUtilsDialogii @ 23 NONAME R3UNUSED ; CObexUtilsDialog::ShowNumberOfSendFileL(int, int) - CreateInboxAttachmentL__24TObexUtilsMessageHandlerP14CObexBufObjectG4TUidRlR5RFile @ 24 NONAME ; TObexUtilsMessageHandler::CreateInboxAttachmentL(CObexBufObject *, TUid, long &, RFile &) - RemoveInboxEntriesL__24TObexUtilsMessageHandlerRP14CObexBufObjectl @ 25 NONAME R3UNUSED ; TObexUtilsMessageHandler::RemoveInboxEntriesL(CObexBufObject *&, long) - SaveObjToInboxL__24TObexUtilsMessageHandlerRP14CObexBufObjectR5RFilel @ 26 NONAME R3UNUSED ; TObexUtilsMessageHandler::SaveObjToInboxL(CObexBufObject *&, RFile &, long) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/bwins/OBEXUTILSU.DEF --- a/localconnectivityservice/obexserviceman/utils/bwins/OBEXUTILSU.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -EXPORTS - ?ReadResourceL@TObexUtilsUiLayer@@SAXAAVTDes16@@ABH@Z @ 1 NONAME ; void TObexUtilsUiLayer::ReadResourceL(class TDes16 &, int const &) - ?SaveObjToInboxL@TObexUtilsMessageHandler@@SAXPAVCObexBufObject@@ABVTDesC16@@VTUid@@@Z @ 2 NONAME ; void TObexUtilsMessageHandler::SaveObjToInboxL(class CObexBufObject *, class TDesC16 const &, class TUid) - ?RemoveInboxEntriesL@TObexUtilsMessageHandler@@SAXAAPAVCObexBufObject@@J@Z @ 3 NONAME ; void TObexUtilsMessageHandler::RemoveInboxEntriesL(class CObexBufObject * &, long) - ?GetNumber@CObexUtilsOpaqueData@@QAEHAAI@Z @ 4 NONAME ; int CObexUtilsOpaqueData::GetNumber(unsigned int &) - ??0CObexUtilsOpaqueData@@QAE@ABVTDesC8@@@Z @ 5 NONAME ; CObexUtilsOpaqueData::CObexUtilsOpaqueData(class TDesC8 const &) - ?UpdateProgressDialog@CGlobalProgressDialog@@QAEXHH@Z @ 6 NONAME ; void CGlobalProgressDialog::UpdateProgressDialog(int, int) - ?AddEntryToInboxL@TObexUtilsMessageHandler@@SAXAAJAAV?$TBuf@$0BAA@@@@Z @ 7 NONAME ; void TObexUtilsMessageHandler::AddEntryToInboxL(long &, class TBuf<256> &) - ?CancelWaitDialogL@CObexUtilsDialog@@QAEXXZ @ 8 NONAME ; void CObexUtilsDialog::CancelWaitDialogL(void) - ?LaunchFileManagerL@TObexUtilsUiLayer@@SAXAAVTDesC16@@HH@Z @ 9 NONAME ; void TObexUtilsUiLayer::LaunchFileManagerL(class TDesC16 &, int, int) - ?CreateDefaultMtmServiceL@TObexUtilsMessageHandler@@SAXVTUid@@@Z @ 10 NONAME ; void TObexUtilsMessageHandler::CreateDefaultMtmServiceL(class TUid) - ?UpdateProgressDialogL@CObexUtilsDialog@@QAEXHH@Z @ 11 NONAME ; void CObexUtilsDialog::UpdateProgressDialogL(int, int) - ?GetCenRepKeyStringValueL@TObexUtilsMessageHandler@@SAHVTUid@@KAAVTDes16@@@Z @ 12 NONAME ; int TObexUtilsMessageHandler::GetCenRepKeyStringValueL(class TUid, unsigned long, class TDes16 &) - ?GetMmcFileSystemStatus@TObexUtilsMessageHandler@@SAHXZ @ 13 NONAME ; int TObexUtilsMessageHandler::GetMmcFileSystemStatus(void) - ?GetPubSubKeyIntValue@TObexUtilsMessageHandler@@SAHVTUid@@IAAH@Z @ 14 NONAME ; int TObexUtilsMessageHandler::GetPubSubKeyIntValue(class TUid, unsigned int, int &) - ?IsBackupRunning@TObexUtilsUiLayer@@SAHXZ @ 15 NONAME ; int TObexUtilsUiLayer::IsBackupRunning(void) - ?CancelProgressDialogL@CObexUtilsDialog@@QAEXXZ @ 16 NONAME ; void CObexUtilsDialog::CancelProgressDialogL(void) - ?ProcessFinished@CGlobalProgressDialog@@QAEXXZ @ 17 NONAME ; void CGlobalProgressDialog::ProcessFinished(void) - ?AddEntryToInboxL@TObexUtilsMessageHandler@@SAXAAJAAV?$TBuf@$0BAA@@@PAV?$RArray@J@@@Z @ 18 NONAME ; void TObexUtilsMessageHandler::AddEntryToInboxL(long &, class TBuf<256> &, class RArray *) - ?CreateIconsL@TObexUtilsUiLayer@@SAXVTUid@@PAV?$CArrayPtr@V?$CArrayPtr@VCFbsBitmap@@@@@@@Z @ 19 NONAME ; void TObexUtilsUiLayer::CreateIconsL(class TUid, class CArrayPtr > *) - ?ShowProgressDialogNameSizeL@CGlobalProgressDialog@@QAEXAAVTDesC16@@_J@Z @ 20 NONAME ; void CGlobalProgressDialog::ShowProgressDialogNameSizeL(class TDesC16 &, long long) - ?GetFileSystemStatus@TObexUtilsMessageHandler@@SAHXZ @ 21 NONAME ; int TObexUtilsMessageHandler::GetFileSystemStatus(void) - ?NewL@CObexUtilsDialog@@SAPAV1@PAVMObexUtilsDialogObserver@@@Z @ 22 NONAME ; class CObexUtilsDialog * CObexUtilsDialog::NewL(class MObexUtilsDialogObserver *) - ?LaunchQueryDialogL@CObexUtilsDialog@@QAEHABH@Z @ 23 NONAME ; int CObexUtilsDialog::LaunchQueryDialogL(int const &) - ?CreateOutboxEntryL@TObexUtilsMessageHandler@@SAJABVTUid@@ABH@Z @ 24 NONAME ; long TObexUtilsMessageHandler::CreateOutboxEntryL(class TUid const &, int const &) - ?ShowGlobalConfirmationQueryL@TObexUtilsUiLayer@@SAXABH@Z @ 25 NONAME ; void TObexUtilsUiLayer::ShowGlobalConfirmationQueryL(int const &) - ?CreateInboxAttachmentL@TObexUtilsMessageHandler@@SAXAAPAVCObexBufObject@@VTUid@@AAJAAVRFile@@@Z @ 26 NONAME ; void TObexUtilsMessageHandler::CreateInboxAttachmentL(class CObexBufObject * &, class TUid, long &, class RFile &) - ?GetMessageCentreDriveL@TObexUtilsMessageHandler@@SAHXZ @ 27 NONAME ; int TObexUtilsMessageHandler::GetMessageCentreDriveL(void) - ?LaunchEditorApplicationL@TObexUtilsUiLayer@@SAXAAJ@Z @ 28 NONAME ; void TObexUtilsUiLayer::LaunchEditorApplicationL(long &) - ?GetCenRepKeyIntValueL@TObexUtilsMessageHandler@@SAHVTUid@@KAAH@Z @ 29 NONAME ; int TObexUtilsMessageHandler::GetCenRepKeyIntValueL(class TUid, unsigned long, int &) - ?LaunchWaitDialogL@CObexUtilsDialog@@QAEXH@Z @ 30 NONAME ; void CObexUtilsDialog::LaunchWaitDialogL(int) - ?ShowNoteDialogL@CGlobalDialog@@QAEXHH@Z @ 31 NONAME ; void CGlobalDialog::ShowNoteDialogL(int, int) - ?ShowGlobalConfirmationQueryPlainL@TObexUtilsUiLayer@@SAHABH@Z @ 32 NONAME ; int TObexUtilsUiLayer::ShowGlobalConfirmationQueryPlainL(int const &) - ?NewLC@CGlobalProgressDialog@@SAPAV1@PAVMGlobalProgressCallback@@@Z @ 33 NONAME ; class CGlobalProgressDialog * CGlobalProgressDialog::NewLC(class MGlobalProgressCallback *) - ?IsString@CObexUtilsOpaqueData@@QAEHXZ @ 34 NONAME ; int CObexUtilsOpaqueData::IsString(void) - ?CreateReceiveBufferAndRFileL@TObexUtilsMessageHandler@@SAHAAVRFile@@ABVTDesC16@@AAV?$TBuf@$0BAA@@@AAPAVCBufFlat@@H@Z @ 35 NONAME ; int TObexUtilsMessageHandler::CreateReceiveBufferAndRFileL(class RFile &, class TDesC16 const &, class TBuf<256> &, class CBufFlat * &, int) - ?LaunchEditorApplicationOperationL@TObexUtilsUiLayer@@SAPAVCMsvOperation@@AAVCMsvSession@@PAVCMsvEntry@@AAVTRequestStatus@@@Z @ 36 NONAME ; class CMsvOperation * TObexUtilsUiLayer::LaunchEditorApplicationOperationL(class CMsvSession &, class CMsvEntry *, class TRequestStatus &) - ?OperationNotSupported@TObexUtilsUiLayer@@SAHXZ @ 37 NONAME ; int TObexUtilsUiLayer::OperationNotSupported(void) - ?ProcessFinished@CGlobalDialog@@QAEXXZ @ 38 NONAME ; void CGlobalDialog::ProcessFinished(void) - ?UpdateBitmaps@TObexUtilsUiLayer@@SAXVTUid@@AAHAAV?$TBuf@$0BAA@@@11@Z @ 39 NONAME ; void TObexUtilsUiLayer::UpdateBitmaps(class TUid, int &, class TBuf<256> &, int &, int &) - ?ShowErrorDialogL@CGlobalDialog@@QAEXH@Z @ 40 NONAME ; void CGlobalDialog::ShowErrorDialogL(int) - ?ShowProgressDialogL@CGlobalProgressDialog@@QAEXH@Z @ 41 NONAME ; void CGlobalProgressDialog::ShowProgressDialogL(int) - ?ShowNumberOfSendFileL@CObexUtilsDialog@@QAEXHH@Z @ 42 NONAME ; void CObexUtilsDialog::ShowNumberOfSendFileL(int, int) - ?ShowErrorNoteL@TObexUtilsUiLayer@@SAXABH@Z @ 43 NONAME ; void TObexUtilsUiLayer::ShowErrorNoteL(int const &) - ?NewL@CObexUtilsPropertyNotifier@@SAPAV1@PAVMObexUtilsPropertyNotifyHandler@@W4TMemoryPropertyCheckType@@@Z @ 44 NONAME ; class CObexUtilsPropertyNotifier * CObexUtilsPropertyNotifier::NewL(class MObexUtilsPropertyNotifyHandler *, enum TMemoryPropertyCheckType) - ?ShowGlobalFileOpenConfirmationQueryL@TObexUtilsUiLayer@@SAHABHABVTDesC16@@@Z @ 45 NONAME ; int TObexUtilsUiLayer::ShowGlobalFileOpenConfirmationQueryL(int const &, class TDesC16 const &) - ?GetString@CObexUtilsOpaqueData@@QAEHAAV?$TBuf8@$0BAA@@@@Z @ 46 NONAME ; int CObexUtilsOpaqueData::GetString(class TBuf8<256> &) - ?UpdateEntryAttachmentL@TObexUtilsMessageHandler@@SAXAAV?$TBuf@$0BAA@@@PAVCMsvEntry@@@Z @ 47 NONAME ; void TObexUtilsMessageHandler::UpdateEntryAttachmentL(class TBuf<256> &, class CMsvEntry *) - ?NewL@CGlobalDialog@@SAPAV1@PAVMGlobalNoteCallback@@@Z @ 48 NONAME ; class CGlobalDialog * CGlobalDialog::NewL(class MGlobalNoteCallback *) - ?CreateInboxAttachmentL@TObexUtilsMessageHandler@@SAXAAPAVCObexBufObject@@VTUid@@AAJAAVRFile@@ABVTDesC16@@@Z @ 49 NONAME ; void TObexUtilsMessageHandler::CreateInboxAttachmentL(class CObexBufObject * &, class TUid, long &, class RFile &, class TDesC16 const &) - ?NewL@CGlobalProgressDialog@@SAPAV1@PAVMGlobalProgressCallback@@@Z @ 50 NONAME ; class CGlobalProgressDialog * CGlobalProgressDialog::NewL(class MGlobalProgressCallback *) - ?RemoveTemporaryRFileL@TObexUtilsMessageHandler@@SAXABV?$TBuf@$0BAA@@@@Z @ 51 NONAME ; void TObexUtilsMessageHandler::RemoveTemporaryRFileL(class TBuf<256> const &) - ?LaunchProgressDialogL@CObexUtilsDialog@@QAEXPAVMObexUtilsProgressObserver@@HHH@Z @ 52 NONAME ; void CObexUtilsDialog::LaunchProgressDialogL(class MObexUtilsProgressObserver *, int, int, int) - ?DeleteOutboxEntryL@TObexUtilsMessageHandler@@SAXABJ@Z @ 53 NONAME ; void TObexUtilsMessageHandler::DeleteOutboxEntryL(long const &) - ?ContextIcon@TObexUtilsUiLayer@@SAHABVTMsvEntry@@W4TContextMedia@@@Z @ 54 NONAME ; int TObexUtilsUiLayer::ContextIcon(class TMsvEntry const &, enum TContextMedia) - ?SaveFileToFileSystemL@TObexUtilsMessageHandler@@SAXAAPAVCObexBufObject@@VTUid@@AAJAAV?$TBuf@$0BAA@@@AAVRFile@@ABVTDesC16@@@Z @ 55 NONAME ; void TObexUtilsMessageHandler::SaveFileToFileSystemL(class CObexBufObject * &, class TUid, long &, class TBuf<256> &, class RFile &, class TDesC16 const &) - ?ShowInformationNoteL@TObexUtilsUiLayer@@SAXABH@Z @ 56 NONAME ; void TObexUtilsUiLayer::ShowInformationNoteL(int const &) - ?NewLC@CObexUtilsDialog@@SAPAV1@PAVMObexUtilsDialogObserver@@@Z @ 57 NONAME ; class CObexUtilsDialog * CObexUtilsDialog::NewLC(class MObexUtilsDialogObserver *) - ?LaunchEditorApplicationL@TObexUtilsUiLayer@@SAHPAVCMsvEntry@@AAVCMsvSession@@@Z @ 58 NONAME ; int TObexUtilsUiLayer::LaunchEditorApplicationL(class CMsvEntry *, class CMsvSession &) - ?SaveObjToInboxL@TObexUtilsMessageHandler@@SAXAAPAVCObexBufObject@@AAVRFile@@J@Z @ 59 NONAME ; void TObexUtilsMessageHandler::SaveObjToInboxL(class CObexBufObject * &, class RFile &, long) - ?NewLC@CGlobalDialog@@SAPAV1@PAVMGlobalNoteCallback@@@Z @ 60 NONAME ; class CGlobalDialog * CGlobalDialog::NewLC(class MGlobalNoteCallback *) - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/data/Obexutils.hrh --- a/localconnectivityservice/obexserviceman/utils/data/Obexutils.hrh Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2002, 2003 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: -* -*/ - - -enum -{ - ESendingProgressNote = 1, - EConnectingWaitNote, - EPrintingWaitNote -}; - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/data/Obexutils.rss --- a/localconnectivityservice/obexserviceman/utils/data/Obexutils.rss Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,532 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This file contains all the resources for the obexutils. -* -* -*/ - - -// RESOURCE IDENTIFIER -NAME OBUT - -// INCLUDES -#include -#include "Obexutils.hrh" -#include -#include -#include -#include -#include - -RESOURCE RSS_SIGNATURE { } - -// RESOURCE DEFINITIONS - -// Popup texts (information notes and error notes) - -// --------------------------------------------------------- -// -// r_ir_connecting -// this is the first shown when the user tries connect to other -// remote device. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_ir_connecting {buf= qtn_ir_connecting;} - -// --------------------------------------------------------- -// -// r_ir_cannot_establish -// This informs that the IR connection cannot made to other remote device -// for some reason. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_ir_cannot_establish {buf= qtn_ir_cant_establish_conn;} - -// --------------------------------------------------------- -// -// r_ir_sending_data -// This is shown after the IR connection is made succesfully and we are -// sending message over IR. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_ir_sending_data {buf= qtn_ir_sending_data;} - -// --------------------------------------------------------- -// -// r_ir_sending_failed -// This is shown when the IR connection is made and some thing goes wrong -// during connection. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_ir_sending_failed {buf= qtn_ir_sending_failed;} - -// --------------------------------------------------------- -// -// r_ir_data_sent -// This is shown to the user when the message is sended succesfully. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_ir_data_sent {buf= qtn_ir_data_sent;} - -// --------------------------------------------------------- -// -// r_bt_connecting -// Informs state of Bluetooth connection. -// this is the first shown when the user tries connect to other -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_bt_connecting {buf= qtn_bt_connecting;} - -// --------------------------------------------------------- -// -// r_bt_sending_data -// This is shown after the Bluetooth connection is made succesfully -// and we are sending message over Bluetooth. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_bt_sending_data {buf= qtn_bt_sending_data;} - -// --------------------------------------------------------- -// -// r_bt_dev_not_avail -// This informs that the Bluetooth connection cannot made to other -// remote device for some reason. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_bt_dev_not_avail {buf= qtn_bt_dev_not_avail;} - -// --------------------------------------------------------- -// -// r_bt_failed_to_send -// This is shown when the BT connection is made and some thing goes wrong -// during connection. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_bt_failed_to_send {buf= qtn_bt_failed_to_send;} - -// --------------------------------------------------------- -// -// r_bt_data_sent -// This is shown to the user when the message is sended succesfully via BT. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_bt_data_sent {buf= qtn_bt_data_sent;} - -// --------------------------------------------------------- -// -// r_bt_not_receive_one -// This is shown when one image could not be sent -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_bt_not_receive_one {buf= qtn_bt_bip_format_not_supported;} - -// --------------------------------------------------------- -// -// r_out_of_memory -// This is shown when not enough memory -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_out_of_memory {buf= qtn_memlo_not_enough_memory;} - -// --------------------------------------------------------- -// -// r_bt_not_receive_all -// This is shown when no images could be sent -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_bt_sent_image_number {buf= qtn_bt_bip_some_files_sent;} -RESOURCE TBUF r_bt_not_receive_any {buf= qtn_bt_bip_no_formats_supported;} - -// Confirmation queries - -// --------------------------------------------------------- -// -// Confirmation query -// __RD_BT_MSG_RENOVATION not flagged -// This is shown when some images could not be sent -// -// --------------------------------------------------------- -// -RESOURCE DIALOG r_bt_not_send_all_query - { - flags = EGeneralQueryFlags; - buttons = R_AVKON_SOFTKEYS_YES_NO; - items = - { - DLG_LINE - { - type = EAknCtQuery; - id = EGeneralQuery; - control = AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationLayout; - label = qtn_bt_bip_not_all_formats_supported; - animation = R_QGN_NOTE_QUERY_ANIM; - }; - } - }; - } - -// --------------------------------------------------------- -// -// Confirmation query -// This is shown when some images are not supported -// -// --------------------------------------------------------- -// -RESOURCE DIALOG r_bt_not_all_supported_query - { - flags = EGeneralQueryFlags; - buttons = R_AVKON_SOFTKEYS_YES_NO; - items = - { - DLG_LINE - { - type = EAknCtQuery; - id = EGeneralQuery; - control = AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationLayout; - label = qtn_bt_bip_not_all_formats_supported; - animation = R_QGN_NOTE_QUERY_ANIM; - }; - } - }; - } - -// --------------------------------------------------------- -// -// Confirmation query for mixed list -// __RD_BT_MSG_RENOVATION flagged -// This is shown when some images could not be sent -// -// --------------------------------------------------------- -// -RESOURCE DIALOG r_bt_not_send_all_query_mixed - { - flags = EGeneralQueryFlags; - buttons = R_AVKON_SOFTKEYS_YES_NO; - items = - { - DLG_LINE - { - type = EAknCtQuery; - id = EGeneralQuery; - control = AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationLayout; - label = qtn_bt_bip_mixed_list; - animation = R_QGN_NOTE_QUERY_ANIM; - }; - } - }; - } - - - -// Notes - -// ----------------------------------------------------------------------------- -// -// r_bt_connecting_wait_note -// -// -// ----------------------------------------------------------------------------- -// -RESOURCE DIALOG r_bt_connecting_wait_note - { - flags = EAknProgressNoteFlags; - buttons = R_AVKON_SOFTKEYS_CANCEL; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = EConnectingWaitNote; - control = AVKON_NOTE - { - layout = EProgressLayout; - singular_label = qtn_bt_connecting; - imageid = EMbmAvkonQgn_note_progress; - imagemask = EMbmAvkonQgn_note_progress_mask; - animation = R_QGN_GRAF_WAIT_BAR_ANIM; - }; - } - }; - } -// ----------------------------------------------------------------------------- -// -// r_ir_connecting_wait_note -// -// -// ----------------------------------------------------------------------------- -// -RESOURCE DIALOG r_ir_connecting_wait_note - { - flags = EAknProgressNoteFlags; - buttons = R_AVKON_SOFTKEYS_CANCEL; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = EConnectingWaitNote; - control = AVKON_NOTE - { - layout = EProgressLayout; - singular_label = qtn_ir_connecting; - imageid = EMbmAvkonQgn_note_progress; - imagemask = EMbmAvkonQgn_note_progress_mask; - }; - } - }; - } - - -// ----------------------------------------------------------------------------- -// -// r_bt_printing_wait_note -// -// -// ----------------------------------------------------------------------------- -// - -// NOTE! The strings in the following resources need to be added into -// localization file, once the UI specification is approved. -// - -RESOURCE DIALOG r_bt_printing_wait_note - { - flags = EAknWaitNoteFlags; - buttons = R_AVKON_SOFTKEYS_CANCEL; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = EPrintingWaitNote; - control = AVKON_NOTE - { - layout = EWaitLayout; - singular_label = "Sending data..."; - animation = R_QGN_GRAF_WAIT_BAR_ANIM; - }; - } - }; - } - -// Skeletons (resources with changing text) - -// ----------------------------------------------------------------------------- -// -// r_sending_progress_note -// -// -// ----------------------------------------------------------------------------- -// -RESOURCE DIALOG r_sending_progress_note - { - flags = EAknProgressNoteFlags; - buttons = R_AVKON_SOFTKEYS_CANCEL; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = ESendingProgressNote; - control = AVKON_NOTE - { - layout = EProgressLayout; - singular_label = qtn_bt_sending_data; - imageid = EMbmAvkonQgn_note_progress; - imagemask = EMbmAvkonQgn_note_progress_mask; - }; - } - }; - } - -// --------------------------------------------------------- -// -// r_ir_failed_to_receive -// This is shown to the user when failing receive file via infrared. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_ir_failed_to_receive {buf=qtn_ir_failed_to_receive;} - -// --------------------------------------------------------- -// -// qtn_ir_receiving_data -// This is shown to the user when receiving data via IR. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_ir_receiving_data {buf=qtn_ir_receiving_data;} - -// --------------------------------------------------------- -// -// r_bt_receiving_data -// This is shown after the Bluetooth connection is made succesfully -// and we are receiving message over Bluetooth. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_bt_receiving_data {buf= qtn_bt_receiving_data;} - -// --------------------------------------------------------- -// -// qtn_bt_failed_to_receive -// This is shown when the BT connection is made and some thing goes wrong -// when receiving data. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_bt_failed_to_receive {buf= qtn_bt_failed_to_receive;} - -// Other resource texts - -// --------------------------------------------------------- -// -// r_ir_send_progress_sending -// descripes status of item that is currently sending state in the outbox. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_ir_send_progress_sending {buf= qtn_mce_outbox_status_sending;} - -// --------------------------------------------------------- -// -// r_ir_send_progress_sending -// descripes status of item that is currently sending state in the outbox. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_bt_send_progress_sending {buf= qtn_mce_outbox_status_sending;} - -// --------------------------------------------------------- -// -// r_ir_send_outbox_sending -// Displayed in the "To/From" section for Ir objects in message centre. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_ir_send_outbox_sending {buf= qtn_mce_ir_message;} - -// --------------------------------------------------------- -// -// r_bt_send_outbox_sending -// Displayed in the "To/From" section for Ir objects in message centre. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_bt_send_outbox_sending {buf= qtn_mce_bt_message;} - -// --------------------------------------------------------- -// -// r_message_not_opened -// This is shown, when the user tries open a message that is not -// supported type. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_message_not_opened {buf= qtn_mce_info_message_not_opened;} - -// --------------------------------------------------------- -// -// r_name_for_invalid_file -// Default invalid filename -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_name_for_invalid_file { buf=qtn_fldr_default_doc_name; } - -// --------------------------------------------------------- -// -// r_bt_to_from_in_inbox -// Displayed in the "To/From" section for Bluetooth objects. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_bt_to_from_in_inbox { buf=qtn_mce_bt_message; } - -// --------------------------------------------------------- -// -// r_ir_to_from_in_inbox -// Displayed in the "To/From" section for Ir objects. -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_ir_to_from_in_inbox { buf=qtn_mce_ir_message; } - -RESOURCE TBUF r_bt_data_sent2 { buf= "Data sent"; } -RESOURCE TBUF r_bt_failed_to_send2 { buf= "Sending failed"; } -RESOURCE TBUF r_bt_printing_not_supported { buf = "Printer not supported"; } -RESOURCE TBUF r_bt_sending_not_supported {buf = "Unsupported device";} - -RESOURCE TBUF r_bt_saved_single { buf = qtn_bt_saved_single; } -RESOURCE TBUF r_bt_saved_multiple { buf = qtn_bt_saved_multiple; } -RESOURCE TBUF r_bt_saved_search { buf = qtn_bt_saved_search; } -RESOURCE TBUF r_bt_saved_no_memory_card { buf = qtn_bt_saved_no_memory_card; } -RESOURCE TBUF r_bt_saved_link_updated { buf = qtn_bt_saved_link_updated; } -RESOURCE TBUF r_bt_saved_search_update { buf = qtn_bt_saved_search_update; } - -RESOURCE TBUF r_bt_ir_receiving_data_size_kb { buf = qtn_bt_ir_receiving_data_size_kb ; } -RESOURCE TBUF r_bt_ir_receiving_data_size_mb { buf = qtn_bt_ir_receiving_data_size_mb ; } - -RESOURCE TBUF r_bt_ir_receiving_data_no_size { buf = qtn_bt_ir_receiving_data_no_size ; } - -// --------------------------------------------------------- -// -// Confirmation query for mixed list -// __RD_BT_MSG_RENOVATION flagged -// This is shown when some images could not be sent -// -// --------------------------------------------------------- -// -RESOURCE DIALOG r_bt_not_send_all_query_single - { - flags = EGeneralQueryFlags; - buttons = R_AVKON_SOFTKEYS_YES_NO; - items = - { - DLG_LINE - { - type = EAknCtQuery; - id = EGeneralQuery; - control = AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationLayout; - label = qtn_bt_bip_format_not_supported_send; - animation = R_QGN_NOTE_QUERY_ANIM; - }; - } - }; - } - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/eabi/obexutilsu.DEF --- a/localconnectivityservice/obexserviceman/utils/eabi/obexutilsu.DEF Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -EXPORTS - _ZN13CGlobalDialog15ProcessFinishedEv @ 1 NONAME - _ZN13CGlobalDialog15ShowNoteDialogLEii @ 2 NONAME - _ZN13CGlobalDialog16ShowErrorDialogLEi @ 3 NONAME - _ZN13CGlobalDialog4NewLEP19MGlobalNoteCallback @ 4 NONAME - _ZN13CGlobalDialog5NewLCEP19MGlobalNoteCallback @ 5 NONAME - _ZN16CObexUtilsDialog17CancelWaitDialogLEv @ 6 NONAME - _ZN16CObexUtilsDialog17LaunchWaitDialogLEi @ 7 NONAME - _ZN16CObexUtilsDialog18LaunchQueryDialogLERKi @ 8 NONAME - _ZN16CObexUtilsDialog21CancelProgressDialogLEv @ 9 NONAME - _ZN16CObexUtilsDialog21LaunchProgressDialogLEP26MObexUtilsProgressObserveriii @ 10 NONAME - _ZN16CObexUtilsDialog21ShowNumberOfSendFileLEii @ 11 NONAME - _ZN16CObexUtilsDialog21UpdateProgressDialogLEii @ 12 NONAME - _ZN16CObexUtilsDialog4NewLEP24MObexUtilsDialogObserver @ 13 NONAME - _ZN16CObexUtilsDialog5NewLCEP24MObexUtilsDialogObserver @ 14 NONAME - _ZN17TObexUtilsUiLayer11ContextIconERK9TMsvEntry13TContextMedia @ 15 NONAME - _ZN17TObexUtilsUiLayer12CreateIconsLE4TUidP9CArrayPtrIS1_I10CFbsBitmapEE @ 16 NONAME - _ZN17TObexUtilsUiLayer13ReadResourceLER6TDes16RKi @ 17 NONAME - _ZN17TObexUtilsUiLayer13UpdateBitmapsE4TUidRiR4TBufILi256EES1_S1_ @ 18 NONAME - _ZN17TObexUtilsUiLayer14ShowErrorNoteLERKi @ 19 NONAME - _ZN17TObexUtilsUiLayer15IsBackupRunningEv @ 20 NONAME - _ZN17TObexUtilsUiLayer18LaunchFileManagerLER7TDesC16ii @ 21 NONAME - _ZN17TObexUtilsUiLayer20ShowInformationNoteLERKi @ 22 NONAME - _ZN17TObexUtilsUiLayer21OperationNotSupportedEv @ 23 NONAME - _ZN17TObexUtilsUiLayer24LaunchEditorApplicationLEP9CMsvEntryR11CMsvSession @ 24 NONAME - _ZN17TObexUtilsUiLayer24LaunchEditorApplicationLERl @ 25 NONAME - _ZN17TObexUtilsUiLayer28ShowGlobalConfirmationQueryLERKi @ 26 NONAME - _ZN17TObexUtilsUiLayer33LaunchEditorApplicationOperationLER11CMsvSessionP9CMsvEntryR14TRequestStatus @ 27 NONAME - _ZN17TObexUtilsUiLayer33ShowGlobalConfirmationQueryPlainLERKi @ 28 NONAME - _ZN17TObexUtilsUiLayer36ShowGlobalFileOpenConfirmationQueryLERKiRK7TDesC16 @ 29 NONAME - _ZN20CObexUtilsOpaqueData8IsStringEv @ 30 NONAME - _ZN20CObexUtilsOpaqueData9GetNumberERj @ 31 NONAME - _ZN20CObexUtilsOpaqueData9GetStringER5TBuf8ILi256EE @ 32 NONAME - _ZN20CObexUtilsOpaqueDataC1ERK6TDesC8 @ 33 NONAME - _ZN20CObexUtilsOpaqueDataC2ERK6TDesC8 @ 34 NONAME - _ZN21CGlobalProgressDialog15ProcessFinishedEv @ 35 NONAME - _ZN21CGlobalProgressDialog19ShowProgressDialogLEi @ 36 NONAME - _ZN21CGlobalProgressDialog20UpdateProgressDialogEii @ 37 NONAME - _ZN21CGlobalProgressDialog27ShowProgressDialogNameSizeLER7TDesC16x @ 38 NONAME - _ZN21CGlobalProgressDialog4NewLEP23MGlobalProgressCallback @ 39 NONAME - _ZN21CGlobalProgressDialog5NewLCEP23MGlobalProgressCallback @ 40 NONAME - _ZN24TObexUtilsMessageHandler15SaveObjToInboxLEP14CObexBufObjectRK7TDesC164TUid @ 41 NONAME - _ZN24TObexUtilsMessageHandler15SaveObjToInboxLERP14CObexBufObjectR5RFilel @ 42 NONAME - _ZN24TObexUtilsMessageHandler16AddEntryToInboxLERlR4TBufILi256EE @ 43 NONAME - _ZN24TObexUtilsMessageHandler16AddEntryToInboxLERlR4TBufILi256EEP6RArrayIlE @ 44 NONAME - _ZN24TObexUtilsMessageHandler18CreateOutboxEntryLERK4TUidRKi @ 45 NONAME - _ZN24TObexUtilsMessageHandler18DeleteOutboxEntryLERKl @ 46 NONAME - _ZN24TObexUtilsMessageHandler19GetFileSystemStatusEv @ 47 NONAME - _ZN24TObexUtilsMessageHandler19RemoveInboxEntriesLERP14CObexBufObjectl @ 48 NONAME - _ZN24TObexUtilsMessageHandler20GetPubSubKeyIntValueE4TUidjRi @ 49 NONAME - _ZN24TObexUtilsMessageHandler21GetCenRepKeyIntValueLE4TUidmRi @ 50 NONAME - _ZN24TObexUtilsMessageHandler21RemoveTemporaryRFileLERK4TBufILi256EE @ 51 NONAME - _ZN24TObexUtilsMessageHandler21SaveFileToFileSystemLERP14CObexBufObject4TUidRlR4TBufILi256EER5RFileRK7TDesC16 @ 52 NONAME - _ZN24TObexUtilsMessageHandler22CreateInboxAttachmentLERP14CObexBufObject4TUidRlR5RFile @ 53 NONAME - _ZN24TObexUtilsMessageHandler22CreateInboxAttachmentLERP14CObexBufObject4TUidRlR5RFileRK7TDesC16 @ 54 NONAME - _ZN24TObexUtilsMessageHandler22GetMessageCentreDriveLEv @ 55 NONAME - _ZN24TObexUtilsMessageHandler22GetMmcFileSystemStatusEv @ 56 NONAME - _ZN24TObexUtilsMessageHandler22UpdateEntryAttachmentLER4TBufILi256EEP9CMsvEntry @ 57 NONAME - _ZN24TObexUtilsMessageHandler24CreateDefaultMtmServiceLE4TUid @ 58 NONAME - _ZN24TObexUtilsMessageHandler24GetCenRepKeyStringValueLE4TUidmR6TDes16 @ 59 NONAME - _ZN24TObexUtilsMessageHandler28CreateReceiveBufferAndRFileLER5RFileRK7TDesC16R4TBufILi256EERP8CBufFlati @ 60 NONAME - _ZN26CObexUtilsPropertyNotifier4NewLEP31MObexUtilsPropertyNotifyHandler24TMemoryPropertyCheckType @ 61 NONAME - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/group/bld.inf --- a/localconnectivityservice/obexserviceman/utils/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This file provides the information required for building the -* whole of a Obexutils. -* -*/ - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -../inc/obexutilsuilayer.h |../../../inc/obexutilsuilayer.h -../inc/obexutilsdialog.h |../../../inc/obexutilsdialog.h -../inc/obexutilspropertynotifier.h |../../../inc/obexutilspropertynotifier.h -../inc/obexutilsglobalprogressdialog.h |../../../inc/obexutilsglobalprogressdialog.h - -../loc/Obexutils.loc MW_LAYER_LOC_EXPORT_PATH(obexutils.loc) - - -PRJ_MMPFILES -obexutils.mmp - - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/group/obexutils.mmp --- a/localconnectivityservice/obexserviceman/utils/group/obexutils.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* Copyright (c) 2002 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: -* Constructs obexutils.dll -* -* -*/ - - -#include -#include - -TARGET obexutils.dll -TARGETTYPE dll -UID 0x10004262 0x101F86AF -VENDORID VID_DEFAULT - -START RESOURCE ../data/Obexutils.rss -TARGETPATH RESOURCE_FILES_DIR -HEADER -LANGUAGE_IDS -END - -SOURCEPATH ../src -SOURCE obexutilsuilayer.cpp -SOURCE obexutilslaunchwaiter.cpp -SOURCE obexutilsdialogtimer.cpp -SOURCE obexutilsdialog.cpp -SOURCE obexutilsmessagehandler.cpp -SOURCE obexutilspropertynotifier.cpp -SOURCE obexutilsopaquedata.cpp -SOURCE obexutilsglobalprogressdialog.cpp -SOURCE obexutilsglobaldialog.cpp -SOURCE obexutilsentryhandler.cpp -SOURCE updatemusiccollection.cpp -#ifdef __BT_SAP - SOURCE vMessageHandler.cpp -#endif - - -USERINCLUDE ../inc - -SYSTEMINCLUDE ../../../inc ../../../../inc -MW_LAYER_SYSTEMINCLUDE -APP_LAYER_SYSTEMINCLUDE -// SMUT Unbranch -#ifdef __BT_SAP -SYSTEMINCLUDE /epoc32/include/ecom -#endif - -LIBRARY apgrfx.lib -LIBRARY apmime.lib -LIBRARY avkon.lib -LIBRARY bafl.lib -LIBRARY bifu.lib -LIBRARY biodb.lib -LIBRARY charconv.lib -LIBRARY cone.lib -LIBRARY commonengine.lib -LIBRARY commonui.lib -LIBRARY efsrv.lib -LIBRARY eikctl.lib -LIBRARY etext.lib -LIBRARY euser.lib -LIBRARY irobex.lib -LIBRARY msgs.lib -LIBRARY aknskins.lib -LIBRARY centralrepository.lib -LIBRARY apparc.lib -LIBRARY servicehandler.lib -LIBRARY eikdlg.lib -LIBRARY featmgr.lib -LIBRARY aknnotify.lib -LIBRARY commondialogs.lib -LIBRARY platformenv.lib -LIBRARY mpxcollectionhelper.lib -LIBRARY mpxplaybackutility.lib - -#ifdef __BT_SAP - LIBRARY smcm.lib - LIBRARY gsmu.lib -// SMUT Unbranch - LIBRARY ecom.lib -#endif - -DEBUGLIBRARY flogger.lib - -CAPABILITY CAP_GENERAL_DLL diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/inc/obexutilsdebug.h --- a/localconnectivityservice/obexserviceman/utils/inc/obexutilsdebug.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* Copyright (c) 2002 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: This file defines logging macros for ObexUtils -* -*/ - - -#ifndef OBEXUTILS_DEBUG_H -#define OBEXUTILS_DEBUG_H - - -#ifdef _DEBUG - -#include -#include -#include -#include - -_LIT(KLogFile,"obexutils.txt"); -_LIT(KLogDirFullName,"c:\\logs\\"); -_LIT(KLogDir,"obexutils"); - -// Declare the FPrint function -inline void FPrint(const TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); - RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list); - } - -// =========================================================================== -#ifdef __WINS__ // File logging for WINS -// =========================================================================== -#define FLOG(a) { FPrint(a); } -#define FTRACE(a) { a; } -// =========================================================================== -#else // RDebug logging for target HW -// =========================================================================== -#define FLOG(a) { RDebug::Print(a); } -#define FTRACE(a) { a; } -#endif //__WINS__ - -// =========================================================================== -#else // // No loggings --> Reduced binary size -// =========================================================================== -#define FLOG(a) -#define FTRACE(a) - -#endif // _DEBUG - - -#endif // OBEXUTILS_DEBUG_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/inc/obexutilsdialog.h --- a/localconnectivityservice/obexserviceman/utils/inc/obexutilsdialog.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,217 +0,0 @@ -/* -* Copyright (c) 2002 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: -* -*/ - - -#ifndef COBEXUTILSDIALOG_H -#define COBEXUTILSDIALOG_H - -// INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CAknWaitDialog; -class CObexUtilsDialogTimer; - -// CLASS DECLARATION - -/** -* An observer interface for asking progress status of an operation using -* a progress dialog. -*/ -NONSHARABLE_CLASS( MObexUtilsProgressObserver ) - { - public: - - /** - * Returns the progress status of the operation. - * @since 2.6 - * @return A progress value relative to final value. - */ - virtual TInt GetProgressStatus() = 0; - }; - -// CLASS DECLARATION - -/** -* An observer interface for informing about dialog events. -*/ -NONSHARABLE_CLASS( MObexUtilsDialogObserver ) - { - public: - - /** - * Informs the observer that a dialog has been dismissed. - * @since 2.6 - * @param aButtonId The button that was used to dismiss the dialog. - * @return None. - */ - virtual void DialogDismissed( TInt aButtonId ) = 0; - }; - - -// CLASS DECLARATION - -/** -* A class for launching and managing dialogs. -*/ -NONSHARABLE_CLASS( CObexUtilsDialog ) : public CBase, public MProgressDialogCallback - { - public:// Constructors and destructor - - /** - * Two-phased constructor. - */ - IMPORT_C static CObexUtilsDialog* NewL( - MObexUtilsDialogObserver* aObserverPtr ); - - IMPORT_C static CObexUtilsDialog* NewLC( - MObexUtilsDialogObserver* aObserverPtr ); - - /** - * Destructor. - */ - virtual ~CObexUtilsDialog(); - - public: // New functions - - /** - * Launches a progress dialog. - * @since 2.6 - * @param aObserverPtr A pointer to progress observer. A NULL pointer if - the progress dialog is updated manually. - * @param aFinalValue The final value of the operation (progress=100%). - * @param aResId A resource id for the string to be shown in the dialog. - * @param aTimeoutValue A value telling how often should the dialog be - updated. Relevant only if observer given. - * @return None. - */ - IMPORT_C void LaunchProgressDialogL( - MObexUtilsProgressObserver* aObserverPtr, TInt aFinalValue, - TInt aResId, TInt aTimeoutValue ); - - /** - * Launches a wait dialog. - * @since 2.6 - * @param aResId A resource id for the string to be shown in the dialog. - * @return None. - */ - IMPORT_C void LaunchWaitDialogL( TInt aResId ); - - /** - * Cancels a wait dialog if one exists. - * @since 2.6 - * @return None. - */ - IMPORT_C void CancelWaitDialogL(); - - /** - * Cancels a wait progress dialog if one exists. - * @since 2.6 - * @return None. - */ - IMPORT_C void CancelProgressDialogL(); - - /** - * Updates a progress dialog. Should not be used if the - * MObexUtilsDialogObserver pointer was given. - * @since 2.6 - * @param aValue A progress value relative to final value. - * @param aResId A resource id for the string to be shown in the dialog. - * @return None - */ - IMPORT_C void UpdateProgressDialogL( TInt aValue, TInt aResId ); - - /** - * Show a query note - * @param aResourceID A resource id for the note. - * @return User's input - Yes/No - */ - IMPORT_C TInt LaunchQueryDialogL( const TInt& aResourceID ); - - /** - * Show how many files are sent in case not all images are supported - * @param aSentNum Number of sent files - * @param aTotlNum Number of total files - * return None. - */ - - IMPORT_C void ShowNumberOfSendFileL( TInt aSentNum, TInt aTotalNum ); - - /** - * Prepares dialog for execution - * @param aResourceID Resource ID of the dialog - * @param aDialog Dialog - */ - void PrepareDialogExecuteL( const TInt& aResourceID, CEikDialog* aDialog ); - - /** - * Check if cover display is enabled - * return True if enabled - */ - TBool IsCoverDisplayL(); - - public: // New functions (not exported) - - /** - * Updates the progress dialog. - * @return None. - */ - void UpdateProgressDialog(); - - private: // Functions from base classes - - /** - * From MProgressDialogCallback A dialog has been dismissed. - * @param aButtonId The button that was used to dismiss the dialog. - * @return None. - */ - void DialogDismissedL( TInt aButtonId ); - - private: - TInt ExecuteDialogL( const TInt& aResourceID, CEikDialog* aDialog ); - - private: - - /** - * C++ default constructor. - */ - CObexUtilsDialog( MObexUtilsDialogObserver* aObserverPtr ); - - /** - * By default Symbian OS constructor is private. - */ - void ConstructL(); - - private: // Data - - CAknProgressDialog* iProgressDialog; - CAknWaitDialog* iWaitDialog; - CObexUtilsDialogTimer* iObexDialogTimer; - TInt iResourceFileId; - TInt iProgressDialogResId; - TBool iCoverDisplayEnabled; - - // Not Owned - // - MObexUtilsProgressObserver* iProgressObserverPtr; - MObexUtilsDialogObserver* iDialogObserverPtr; - }; - -#endif // COBEXUTILSDIALOG_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/inc/obexutilsdialogtimer.h --- a/localconnectivityservice/obexserviceman/utils/inc/obexutilsdialogtimer.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -/* -* Copyright (c) 2002 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: -* -*/ - - -#ifndef COBEXUTILSDIALOGTIMER_H -#define COBEXUTILSDIALOGTIMER_H - -// INCLUDES -#include "obexutilsdialog.h" - -// CLASS DECLARATION -/** -* A timer class for updating progress dialog. -*/ -NONSHARABLE_CLASS( CObexUtilsDialogTimer ) : public CTimer - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CObexUtilsDialogTimer* NewL( CObexUtilsDialog* aParent ); - - /** - * Destructor. - */ - virtual ~CObexUtilsDialogTimer(); - - public: // New functions - - /** - * Sets the timeout of the timer. - * @param aTimeout The timeout in microseconds. - * @return None. - */ - void SetTimeout( TTimeIntervalMicroSeconds32 aTimeout ); - - /** - * Restarts the timer. - * @return None. - */ - void Tickle(); - - private: // Functions from base classes - - /** - * From CTimer Get's called when the timer expires. - * @return None. - */ - void RunL(); - - private: - - /** - * C++ default constructor. - */ - CObexUtilsDialogTimer( CObexUtilsDialog* aParent ); - - /** - * By default Symbian OS constructor is private. - */ - void ConstructL(); - - private: // Data - TTimeIntervalMicroSeconds32 iTimeout; - CObexUtilsDialog* iParent; - }; - -#endif // COBEXUTILSDIALOGTIMER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/inc/obexutilsentryhandler.h --- a/localconnectivityservice/obexserviceman/utils/inc/obexutilsentryhandler.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* Copyright (c) 2002 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: Definition of the global progress dialog class -* -*/ - - - -#ifndef OBEXUTILSENTRYHANDLER_H_ -#define OBEXUTILSENTRYHANDLER_H_ - -#include -#include - -/** - * Obexutils link hander - * Maintain the links in inbox. - * - * @since S60 v5.0 - */ - -NONSHARABLE_CLASS( CObexutilsEntryhandler ) : public CActive -{ - -public: - - static CObexutilsEntryhandler* NewL(); - static CObexutilsEntryhandler* NewLC(); - - /** - * Destructor. - */ - virtual ~CObexutilsEntryhandler(); - - /** - * Add an linked attachment to entry - * - * @since S60 v5.0 - * @param aFilePath The absolute file path of the linked attachment file. - * @param anAttachInfo The attachment info associated with the file. - * @param aStore An interface over the message store that is associated with a message entry. - * @return error code - */ - TInt AddEntryAttachment(const TDesC &aFilePath, CMsvAttachment* anAttachInfo, CMsvStore* aStore ); - - - // from base class CActive - - /** - * From CActive. - * RunL - * - * @since S60 v5.0 - */ - void RunL(); - - /** - * From CActive. - * DoCancel - * - * @since S60 v5.0 - */ - void DoCancel(); - - -private: - /** - * Default C++ constructor. - */ - CObexutilsEntryhandler(); - - /** - * Symbian two-phase constructor. - */ - void ConstructL(); - - -private: // member data - - - /** - * Sync waiter object - */ - CActiveSchedulerWait iSyncWaiter; - - -}; - - -#endif /*OBEXUTILSENTRYHANDLER_H_*/ diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/inc/obexutilsglobalprogressdialog.h --- a/localconnectivityservice/obexserviceman/utils/inc/obexutilsglobalprogressdialog.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,226 +0,0 @@ -/* -* Copyright (c) 2002 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: Definition of the global progress dialog class -* -*/ - - - - -#ifndef __OBEXUTILS_GLOBAL_PROGRESS_DIALOG__ -#define __OBEXUTILS_GLOBAL_PROGRESS_DIALOG__ - -// INCLUDES -#include -#include -#include -#include // R_QGN_GRAF_WAIT_BAR_ANIM -#include - -#include - -// FORWARD DECLARATIONS -class CAknGlobalProgressDialog; - - -// CLASS DECLARATION - -// Call back for progress bar -NONSHARABLE_CLASS( MGlobalProgressCallback ) - { - public: - virtual void HandleGlobalProgressDialogL( TInt aSoftkey ) = 0; - }; - - - - - -NONSHARABLE_CLASS( CGlobalProgressDialog ) : public CActive -{ - public: // Constructors and destructor - - - /** - * Two-phased constructor. - */ - IMPORT_C static CGlobalProgressDialog* NewLC(MGlobalProgressCallback* aObserver); - IMPORT_C static CGlobalProgressDialog* NewL(MGlobalProgressCallback* aObserver); - - - /** - * Destructor. - */ - virtual ~CGlobalProgressDialog(); - - public: // New functions - - /** - * Sets the icon for this dialog - * @param aIconText Text of the icon - * @param aIconFile File containing icon - * @param aIconId Icon ID - * @param aIconMaskId Icon mask ID - * @return void - */ - void SetIconL( const TDesC& aIconText, const TDesC& aIconFile, - TInt aIconId = 0, TInt aIconMaskId = -1 ); - /** - * Sets the image for the dialog - * @param aImageFile Image filename - * @param aImageId Image ID - * @param aImageMaskId Image mask ID - * @return void - */ - void SetImageL( const TDesC& aImageFile, TInt aImageId = 0, - TInt aImageMaskId = -1 ); - - /** - * Shows the progress dialog - * @return void - */ - IMPORT_C void ShowProgressDialogL(TInt aStringId); - IMPORT_C void ShowProgressDialogNameSizeL( TDesC& aFileName, - TInt64 aFileSize); - - - /** - * Updates the progress dialog - * @param aValue progress bar value - * @param aFinalValue progress bar final value - * @return void - */ - IMPORT_C void UpdateProgressDialog(TInt aValue, TInt aFinalValue); - - /** - * Called to complete the global progress dialog - * @return void - */ - IMPORT_C void ProcessFinished(); - - - protected: // Functions from base classes - - /** - * From CActive Active Object RunL() - */ - virtual void RunL(); - - /** - * From CActive Active Object DoCancel() - */ - virtual void DoCancel(); - - - private: - - /** - * By default constructor is private. - */ - void ConstructL(MGlobalProgressCallback* aObserver); - - /** - * C++ default constructor. - */ - CGlobalProgressDialog(); - - private: //data - CAknGlobalProgressDialog* iProgressDialog; - - MGlobalProgressCallback* iKeyCallback; - CStringResourceReader* iStringResourceReader; - -}; - - - -// Call back for note with animation and without animation -NONSHARABLE_CLASS( MGlobalNoteCallback ) - { - public: - virtual void HandleGlobalNoteDialogL( TInt aSoftkey ) = 0; - }; - - - -NONSHARABLE_CLASS( CGlobalDialog ) : public CActive -{ - public: // Constructors and destructor - - - /** - * Two-phased constructor. - */ - IMPORT_C static CGlobalDialog* NewLC(MGlobalNoteCallback* aObserver); - IMPORT_C static CGlobalDialog* NewL(MGlobalNoteCallback* aObserver); - - - /* - * public functions - */ - IMPORT_C void ShowNoteDialogL( TInt aResourceId, TBool anAnimation); - IMPORT_C void ShowErrorDialogL(TInt aResourceId); - IMPORT_C void ProcessFinished(); - - /** - * Destructor. - */ - virtual ~CGlobalDialog(); - - - protected: // Functions from base classes - - /** - * From CActive Active Object RunL() - */ - virtual void RunL(); - - /** - * From CActive Active Object DoCancel() - */ - virtual void DoCancel(); - - - private: - - /** - * By default constructor is private. - */ - void ConstructL(MGlobalNoteCallback* aObserver); - - /** - * C++ default constructor. - */ - CGlobalDialog(); - - private: //data - - MGlobalNoteCallback* iKeyCallback; - CStringResourceReader* iStringResourceReader; - CAknGlobalNote* iAknGlobalNote; - TInt iWaitNoteID; - -}; - - - - - - - - - - - -#endif // __OBEXUTILS_GLOBAL_PROGRESS_DIALOG__ diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/inc/obexutilslaunchwaiter.h --- a/localconnectivityservice/obexserviceman/utils/inc/obexutilslaunchwaiter.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ -/* -* Copyright (c) 2002 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: -* -*/ - - -#ifndef COBEXUTILSLAUNCHWAITER_H -#define COBEXUTILSLAUNCHWAITER_H - -// INCLUDES -#include -#include - -#include -#include -#include - -class CDocumentHandler; - -// CLASS DECLARATION - -/** -* A class waiting for editing of an embedded document to complete. -*/ - -NONSHARABLE_CLASS( CObexUtilsLaunchWaiter ) : public CMsvOperation, public MAknServerAppExitObserver - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CObexUtilsLaunchWaiter* NewLC( - CMsvSession& aMsvSession, - CMsvEntry* aMessage, - TRequestStatus& aObserverRequestStatus ); - - /** - * Two-phased constructor. - */ - static CObexUtilsLaunchWaiter* NewL( - CMsvSession& aMsvSession, - CMsvEntry* aMessage, - TRequestStatus& aObserverRequestStatus ); - - /** - * Destructor. - */ - ~CObexUtilsLaunchWaiter(); - - public: // Functions from base classes - - /** - * From MAknServerAppExitObserve Editing has completed. - * @param TInt The exit mode including document state. - * @return None. - */ - void HandleServerAppExit(TInt aReason); - - /** - * From CActive A request has been completed. - * @return None. - */ - void RunL(); - - /** - * From CActive A request has been cancelled. - * @return None. - */ - void DoCancel(); - - /** - * ProgressL - * @return TDesC8&, progress - */ - virtual const TDesC8& ProgressL(); - - private: - - /** - * C++ default constructor. - */ - CObexUtilsLaunchWaiter( - CMsvSession& aMsvSession, - CMsvEntry* aMessage, - TRequestStatus& aObserverRequestStatus ); - - void ConstructL( CMsvEntry* aMessage ); - - /** - * Locate the file used to fix the broken link in Inbox - * @param aFileName the file including full path user selects ( on return ) - * @param anOldFileName old file name including full path saved in attachment. - * @return TBool - */ - TBool LocateFileL(TFileName& aFileName, const TFileName& anOldFileName); - - /** - * Launch Selection dialog for user to locate the file - * @param aFileName the file including full path user selects ( on return ) - * @param anOldFileName old file name excluding full path saved in attachment. - * @return TBool - */ - TBool LaunchFileSelectionDialogL(TFileName& aFileName, const TFileName& anOldFileName); - - /** - * Check the drive if available. - * @param aDriveNumber enum TDriveNumber defined in f32file.h - * @return Symbian error code - */ - TInt CheckDriveL(TDriveNumber aDriveNumber); - - /** - * Check if the file is saved in memory card. - * @param aFileName full path and name of the file - * @return TDriveNumber if saved in E or F drive; - * otherwise KErrNotFound. - */ - TInt CheckIfSaveInMMC(const TFileName& aFileName); - - private: - CDocumentHandler* iDocumentHandler; - }; - -#endif // COBEXUTILSLAUNCHWAITER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/inc/obexutilsopaquedata.h --- a/localconnectivityservice/obexserviceman/utils/inc/obexutilsopaquedata.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* Copyright (c) 2002 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: -* Service controller resouce file's opaque_data parser. -* -*/ - - -#ifndef OBEXUTILSOPAQUEDATA_H -#define OBEXUTILSOPAQUEDATA_H - - -// INCLUDES -#include -#include - -const TUint KObexUtilsMaxOpaqueDataStringLen = 0x100; - -// CLASS DECLARATION - -/** -* Process opaque_data field in service controller ECom plug-in resource file. -* opaque_data field contains 2 types of data: string and number. -*/ -NONSHARABLE_CLASS( CObexUtilsOpaqueData ): public CBase - { -public: - - /** - * constructor. - * @param aDes buffer to hold the opaque_data - */ - IMPORT_C CObexUtilsOpaqueData(const TDesC8& aDes); - - /** - * Get string from current location. Return error code if invalid string format.. - * @param aString buffer to hold the parsed string. - * @return Error code. - */ - IMPORT_C TInt GetString(TBuf8 &aString); - - /** - * Get number from current location. Return error code if invalid string format.. - * @param aNumber the parsed number. - * @return Error code. - */ - IMPORT_C TInt GetNumber(TUint &aNumber); - - /* - * Peek if next entry is string by looking for a '\'. - * @return TRUE: is valid string. - * FALSE: is not string. - */ - IMPORT_C TBool IsString(); - -private: - TLex8 iData;// data buffer. - }; - -#endif diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/inc/obexutilspropertynotifier.h --- a/localconnectivityservice/obexserviceman/utils/inc/obexutilspropertynotifier.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* -* Copyright (c) 2004 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: Declares disk status watcher class for ObexUtils. -* -*/ - - - -#ifndef _OBEXUTILSPROPERTYNOTIFIER_H -#define _OBEXUTILSPROPERTYNOTIFIER_H - -// INCLUDES -#include -#include -#include - -// CLASS DECLARATION - - /** - Type of memory property check, - @param ECheckPhoneMemory, phone memory is checked, default value if not mentioned explicitly. - @param ECheckMMCMemory, MMC memory is checked. - */ - -enum TMemoryPropertyCheckType - { - ECheckPhoneMemory, - ECheckMMCMemory - }; - - /** - A callback interface for informing content change of disk status. Client must derive - from this class and implement HandleNotifyL() method. When disk space will cross warning - level or critical level this method will be call back. - */ - -NONSHARABLE_CLASS( MObexUtilsPropertyNotifyHandler ) - { - public: - /** - * Callback method for disk status change - * @param aUid UID identifying a shared data file where notify came from. - * @param aKey keyword of which value was changed - */ - virtual void HandleNotifyL( TMemoryPropertyCheckType aCheckType ) =0; - }; - -NONSHARABLE_CLASS( CObexUtilsPropertyNotifier ) : public CActive - { -public: // NewL, Constructors and destructor - - /* - * Two-phased constructor. - * @param aHandler -Pointer to the MObexUtilsPropertyNotifyHandler derived class - * @param aCheckType -Constant defining type of memory checking to be done (phone/MMC) - * @return CObexUtilsPropertyNotifier* -Initialized object. - */ - - IMPORT_C static CObexUtilsPropertyNotifier* NewL( - MObexUtilsPropertyNotifyHandler* aHandler, - TMemoryPropertyCheckType aCheckType=ECheckPhoneMemory ); - - /** - * Destructor. - */ - - virtual ~CObexUtilsPropertyNotifier(); -private: // Functions from base classes - - /** - * Constructor. - * @param aHandler -Pointer to the MObexUtilsPropertyNotifyHandler derived class - * @param aCheckType -Constant defining type of memory checking to be done (phone/MMC) - */ - - CObexUtilsPropertyNotifier( - MObexUtilsPropertyNotifyHandler* aHandler, - TMemoryPropertyCheckType aCheckType ); - - void ConstructL(); - - /** - Subscribes to a property and sets active - */ - void Subscribe(); - - /** - * From CActive Gets called when CActive::Cancel is called, - * cancels disk status watching. - * - * @param None. - * @return None. - */ - - void DoCancel(); - - /** - * From CActive Gets called when content of disk status is changed, - * calls MObexUtilsPropertyNotifyHandler::HandleNotify. - * - * @param None. - * @return None. - */ - - void RunL(); - -private: - // Reference to observer - MObexUtilsPropertyNotifyHandler* iHandler; - // Type of memory check (phone/MMC) - TMemoryPropertyCheckType iCheckType; - // Database handle - RProperty iProperty; - }; - -#endif // _OBEXUTILSPROPERTYNOTIFIER_H diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/inc/obexutilsuilayer.h --- a/localconnectivityservice/obexserviceman/utils/inc/obexutilsuilayer.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,246 +0,0 @@ -/* -* Copyright (c) 2002 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: -* -*/ - - -#ifndef COBEXUTILSUILAYER_H -#define COBEXUTILSUILAYER_H - -// INCLUDES -#include -#include -#include -#include -#include -#include - -// CONSTANTS - -const TUid KUidMsgTypeBt = {0x10009ED5}; -const TInt KObexUtilsMaxChar = 80; -const TInt KObexUtilsMaxCharToFromField = 256; - -// Literals for resource location (drive, directory, file) -_LIT( KObexUtilsFileDrive, "z:"); -_LIT( KObexUtilsResourceFileName, "obexutils.rsc" ); - -// Icon file -_LIT( KCommonUiBitmapFile, "MUIU.MBM" ); - -// Cover display -const TInt KEnumStart = 1; // start of enumerations; start after ECmdNone -const TInt KResourceNumberMask = 0x00000FFF; -const TInt KFirstResourceOffset = (R_IR_CONNECTING & KResourceNumberMask); - -class CMsvOperation; - -// DATA TYPES - -enum TContextMedia - { - EBluetooth, - EInfrared, - ENfc - }; - -/** -* Backup status. -* The value is controlled by FileManager -*/ -enum TFileManagerBkupStatusType - { - EFileManagerBkupStatusUnset = 0x00000000, - EFileManagerBkupStatusBackup = 0x00000001, - EFileManagerBkupStatusRestore = 0x00000002 - }; - -// CLASS DECLARATION - -/** -* Utility methods for UI related functionality. -* -*/ -NONSHARABLE_CLASS( TObexUtilsUiLayer ) - { - public: // New functions - - typedef CArrayPtr CBitmapArray; - - /** - * Launches an editor application for the given message. - * @param aMessage The message to be launched in an application. - * @param aSession A message server session. - * @param aObserverRequestStatus Request status of the observer. - * @return MSV operation - */ - IMPORT_C static CMsvOperation* LaunchEditorApplicationOperationL( - CMsvSession& aMsvSession, - CMsvEntry* aMessage, - TRequestStatus& aObserverRequestStatus ); - - /** - * Launches an editor application for the given message. - * @param aMessage The message to be launched in an application. - * @param aSession A message server session. - * @return Symbian OS errorcode. - */ - IMPORT_C static TInt LaunchEditorApplicationL( CMsvEntry* aMessage, - CMsvSession& aSession ); - - /** - * LaunchFileManager by specific path and sort method - * @Since S60 v5.0 - * @param aPath The directory where file manager should open - * @param aSortMethod sort method to sort the files in aPath - * @param isEmbeddedMode indicates start mode for file manager or standalone mode - * @return None - */ - IMPORT_C static void LaunchFileManagerL( TDesC& aPath, TInt aSortMethod, TBool isEmbeddedMode); - - - /** - * Open the file by Launching the suitable S60 application - * @Since S60 v5.0 - * @return None - */ - IMPORT_C static void LaunchEditorApplicationL (TMsvId& aMsvIdParent); - - /** - * Shows an error note. - * @param aResourceID A resource id for the note. - * @return None. - */ - IMPORT_C static void ShowErrorNoteL( const TInt& aResourceID ); - - /** - * Shows an information note. - * @param aResourceID A resource id for the note. - * @return None. - */ - IMPORT_C static void ShowInformationNoteL( const TInt& aResourceID ); - - /** - * Reads contents of a resource into a buffer. - * @parma aBuf The buffer. - * @param aResourceID The id of the resource - * @return None. - */ - IMPORT_C static void ReadResourceL( TDes& aBuf, - const TInt& aResourceID ); - - /** - * Shows an global information note. - * @param aResourceID A resource id for the note. - * @return None. - */ - IMPORT_C static void ShowGlobalConfirmationQueryL( const TInt& aResourceID ); - - /** - * Show global conformation query without animations or tones. - * @Since S60 5.0 - * @aResourceID aREsourceID for loc string - * @return TBool - */ - IMPORT_C static TBool ShowGlobalConfirmationQueryPlainL( const TInt& aResourceID); - - /** - * Show global conformation query - * @Since S60 5.0 - * @aResourceID aREsourceID for loc string - * @aFilePath location for those files received. - * @return TBool - */ - IMPORT_C static TBool ShowGlobalFileOpenConfirmationQueryL( const TInt& aResourceID, const TDesC& aFilePath); - - - - /** - * Returns a resource id for a not supported operation. - * @return The resource id. - */ - IMPORT_C static TInt OperationNotSupported(); - - /** - * Returns an icon for the given context. - * @param aContext The context. - * @param aMedia The used media. - * @return The resource id of the icon. - */ - IMPORT_C static TInt ContextIcon( const TMsvEntry& aContext, - TContextMedia aMedia ); - - /** - * Updates bitmaps accoding to given media. - * @param aMedia The used media. - * @param aNumberOfZoomStates The media. - * @param aBitmapFile The bitmap file. - * @param aStartBitmap The resource id of the start bitmap. - * @param aEndBitmap The resource id of the start bitmap. - * @return None. - */ - IMPORT_C static void UpdateBitmaps( TUid aMedia, - TInt& aNumberOfZoomStates, - TFileName& aBitmapFile, - TInt& aStartBitmap, - TInt& aEndBitmap ); - - /** - * Create icons according to given media - * @param aMedia The used media. - * @param aIconArray The IconArray used by the caller - */ - IMPORT_C static void CreateIconsL( TUid aMedia, CArrayPtr* aIconArrays); - - /** - * Checks if backup process is running - */ - IMPORT_C TBool static IsBackupRunning(); - - /** - * Prepares dialog for execution - * @param aResourceID Resource ID of the dialog - * @param aDialog Dialog - */ - void static PrepareDialogExecuteL( const TInt& aResourceID, CEikDialog* aDialog ); - - /** - * Check if cover display is enabled - * return True if enabled - */ - TBool static IsCoverDisplayL(); - - /** - * Check if process with given id is active now - * return True if is active - */ - TBool static ProcessExists( const TSecureId& aSecureId ); - - /** - * A dummy class for opening CMsvSession. - */ - class CDummySessionObserver : public CBase , public MMsvSessionObserver - { - public: - void HandleSessionEventL( TMsvSessionEvent/*aEvent*/, - TAny* /*aArg1*/, - TAny* /*aArg2*/, - TAny* /*aArg3*/ ) {}; - }; - }; - -#endif // COBEXUTILSUILAYER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/inc/updatemusiccollection.h --- a/localconnectivityservice/obexserviceman/utils/inc/updatemusiccollection.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ - - -#ifndef UPDATEMUSICCOLLECTION_H_ -#define UPDATEMUSICCOLLECTION_H_ - - -#include -#include -#include -#include -#include - -#include - - -class MMPXCollectionHelperObserver; -class MMPXPlaybackObserver; - -NONSHARABLE_CLASS( CUpdateMusicCollection ): public CBase , - public MMPXCollectionHelperObserver, - public MMPXPlaybackObserver - - { - - public: //cunstructor and distructors - - static CUpdateMusicCollection* NewL(); // Constructor (public) - - void ConstructL(); - - ~CUpdateMusicCollection(); - - public: //callback functions from the observers - - // from MMPXCollectionHelperObserver - // Called back after a call to - // CCollectionHelper::AddL() to provide - // status - void HandleAddFileCompleteL( TInt aErr ); - - // from MMPXPlaybackObserver - // If aErr is not KErrNone, plugin might - // still call back with more info in the aMsg. - void HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError ); - - public: //own function - - //add the music to misic collection - void addToCollectionL(const TDesC& aFileName); - - //check if the type of the recieved file is supported by music player - TInt isSupported (const TDesC16& aPtr); - - protected: - - CUpdateMusicCollection(); - - private: - - MMPXCollectionHelper* iCollectionHelper; - MMPXPlaybackUtility* iPlaybackUtility; - }; - -#endif /*UPDATEMUSICCOLLECTION_H_*/ diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/inc/vMessageHandler.h --- a/localconnectivityservice/obexserviceman/utils/inc/vMessageHandler.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,185 +0,0 @@ -/* -* Copyright (c) 2004 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: -* -*/ - -#ifndef VMESSAGEHANDLER_H -#define VMESSAGEHANDLER_H - -// INCLUDES -#include -#include - -// MACROS -// None. - -// DATA TYPES -// None. - -// FUNCTION PROTOTYPES -// None. - -// FORWARD DECLARATIONS -// None. - -// CLASS DECLARATION -/** -* CSapVMessageParser -* -*/ -NONSHARABLE_CLASS(CSapVMessageParser) : public CBase -{ -public: - /** - * Recognises and parses SAP VMessage object - * @param aReceivedObject received OBEX object. - * @param aMtmID message type. - * @param aFile attachment file - * @param aMsvSession pointer msvsession. - * @param aTime current time. - * @return TBool is message recognised and parsed. - */ - static TBool HandleMessageL(CObexBufObject* aReceivedObject, const TUid aMtmID, - RFile& aFile, CMsvSession* aMsvSession, TTime aTime); -private: - -typedef enum { - ESapVMessageUnknown, - ESapVMessageDiscard, - ESapVMessageTextSMS, - ESapVMessageMMSNotificationInd -} TSapVMessageType; - -typedef enum { - ESapVMessageStatusUnknown, - ESapVMessageStatusUnread, - ESapVMessageStatusRead, - ESapVMessageStatusSent -} TSapVMessageStatus; - -private: - static CSapVMessageParser* NewLC(); - void ConstructL(); - /** - * Constructor. - * @param None - */ - CSapVMessageParser(); - - /** - * Recognises and parses SAP VMessage object - * @param aReceivedObject received OBEX object. - * @param aMtmID message type. - * @param aFile attachment file - * @param aTime current time. - * @return TBool is message recognised and parsed. - */ - TBool ParseMessageL(CObexBufObject* aReceivedObject, const TUid aMtmID, - RFile& aFile, TTime aTime); - - /** - * Saves parsed message. - * @param aMsvSession pointer msvsession. - * @return None. - */ - void SaveSapMessageL(CMsvSession* aMsvSession); - - /** - * Saves parsed message as SMS message. - * @param aMsvSession pointer msvsession. - * @return None. - */ - void SaveSapSmsL(CMsvSession* aMsvSession); - - /** - * Saves parsed message as MMS notification. - * @param aMsvSession pointer msvsession. - * @return None. - */ - void SaveSapMmsL(CMsvSession* aMsvSession) const; - - /** - * Recognises active SAP connection - * @param None. - * @return TBool is SAP connection active. - */ - static TBool IsSapConnectionActive(); - - /** - * Checks MIME type - * @param aType MIME type. - * @return TBool is MIME type for VMessage. - */ - static TBool CheckMime(const TDesC8& aType); - - /** - * Checks name - * @param aName file name. - * @return TBool is name for SAP VMessage. - */ - static TBool CheckName(const TDesC& aName); - - /** - * Returns Address field of the parsed message - * @param None. - * @return TDesC address field of the parsed message. - */ - const TDesC& Address() const; - - /** - * Returns Body text of the parsed message - * @param None. - * @return TDesC body text of the parsed message. - */ - const TDesC& Message() const; - - /** - * Destructor. - */ - ~CSapVMessageParser(); - - /** - * Parses SAP VMessage object - * @param aData VMessage data. - * @return None. - */ - void SimpleParseL(const TDesC8& aData); - - /** - * Saves parsed message to Inbox as SMS message. - * @param aMsvSession pointer msvsession. - * @return None. - */ - void SaveSmsToInboxL(CMsvSession* aMsvSession, CRichText* aMessage); - - /** - * Saves parsed message to Sent folder as SMS message. - * @param aMsvSession pointer msvsession. - * @return None. - */ - void SaveSmsToSentL(CMsvSession* aMsvSession, CRichText* aMessage); - -private: - TSapVMessageType iType; - TSapVMessageStatus iStatus; - TTime iTimeOriginal; - TTime iTimeReceived; - HBufC* iAddress; - HBufC* iMessage; -}; - -#endif //VMESSAGEHANDLER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/loc/Obexutils.loc --- a/localconnectivityservice/obexserviceman/utils/loc/Obexutils.loc Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,200 +0,0 @@ -/* -* Copyright (c) 2002 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: -* This file contains the localised strings for obexutils. -* -* -* -*/ - - -// LOCALISATION STRINGS - -// d: descripes status of item that is currently sending state in the outbox. -// l: list_double_graphic_pane_t2 -// -#define qtn_mce_outbox_status_sending "Sending" - -// d: Informs state of IR connection. -// d: this is the first shown when the user tries connect to other -// d: remote device. -// l: popup_note_wait_window -#define qtn_ir_connecting "Connecting via Infrared.." - -// d: This informs that the IR connection cannot made to other remote device -// d: for some reason. -// l: popup_note_window -#define qtn_ir_cant_establish_conn "Cannot establish Infrared connection." - -// d: This is shown after the IR connection is made succesfully and we are -// d: sending message over IR. -// l: popup_note_wait_window -#define qtn_ir_sending_data "Sending message via Infrared..." - -// d: This is shown when the IR connection is made and some thing goes wrong -// d: during connection. -// l: popup_note_window -#define qtn_ir_sending_failed "Failed to send message via Infrared." - -// d: This error note is shown when the Infrared receiving fails for some reason -// l: popup_note_window -#define qtn_ir_failed_to_receive "Receiving failed" - -// d: This is shown to the user when the message is sended succesfully. -// l: popup_note_window -#define qtn_ir_data_sent "Message sent via Infrared!" - -// d: Displayed in the "To/From" section for Ir objects in message centre. -// l: msg_header_pane_t2 -#define qtn_mce_ir_message "Infrared message" - -// d: This is shown, when the user tries open a message that is not -// d: supported type. -// l: popup_note_window -#define qtn_mce_info_message_not_opened "Invalid message, can't be opened" - -// d: Informs state of Bluetooth connection. -// d: this is the first shown when the user tries connect to other -// d: remote device. -// l: popup_note_wait_window -#define qtn_bt_connecting "Connecting..." - -// d: This is shown after the Bluetooth connection is made succesfully -// d: and we are sending message over Bluetooth. -// l: popup_note_wait_window -#define qtn_bt_sending_data "Sending message..." - -// d: This is shown after the Bluetooth connection is made succesfully -// d: and we are receiving message over Bluetooth. -// l: popup_note_wait_window -#define qtn_bt_receiving_data "Receiving message via Bluetooth" - -// d: This wait note is shown when the device is receiving something over the Infrared -// l: popup_note_wait_window -#define qtn_ir_receiving_data "Receiving message via Infrared" - -// d: This informs that the Bluetooth connection cannot made to other -// d: remote device for some reason. -// l: popup_note_window -#define qtn_bt_dev_not_avail "Cannot establish Bluetooth connection" - -// d: This is shown to the user when the message is sended succesfully via BT. -// l: popup_note_window -#define qtn_bt_data_sent "Message sent!" - -// d: This is shown when the BT connection is made and some thing goes wrong -// d: during connection. -// l: popup_note_window -#define qtn_bt_failed_to_send "Failed to send message" - -// d: This error note is shown when the BT receiving fails for some reason -// l: popup_note_window -#define qtn_bt_failed_to_receive "Receiving failed" - -// d: Displayed in the filename section for Ir objects in message centre in -// d: case of the name is corrupted. -// l: list_double_pane_t2_cp2 -// -#define qtn_fldr_default_doc_name "Document" - -// BIP usability improvement - -// d: This is shown when one could not be sent -// l: popup_note_window -#define qtn_bt_bip_format_not_supported "Receiving device does not support this image format." - -// d: This is shown when some images could not be sent -// l: popup_note_window -#define qtn_bt_bip_not_all_formats_supported "Receiving device does not support all needed image formats, Continue?" - -// d: This is shown when sending is finished in case some images are not supported. -// l: popup_note_window -#define qtn_bt_bip_some_files_sent "%0N of %1N images sent!" - -// d: This is shown when no images could be sent -// l: popup_note_window -#define qtn_bt_bip_no_formats_supported "Receiving device does not support the needed image formats." - -//d: This is shown when one could not be sent -//l: popup_note_window -//r: 3.1 -//w: -#define qtn_bt_bip_mixed_list "Receiving device does not support all needed image formats. Send anyway?" - - -// New loc strings for Req. saving file directly to file system. - -//d: This is shown after a single file received. -//l: popup_note_window -//r: 5.0 -#define qtn_bt_saved_single "File saved in %U. Open now?" - -//d: This is shown after a single file received. -//l: popup_note_window -//r: 5.0 -#define qtn_bt_saved_multiple "Files saved in %U. Open now?" - -//d: This is shown when user opens the broken link in inbox. -//l: popup_note_window -//r: 5.0 -#define qtn_bt_saved_search "File not found, would you like to locate it?" - -//d: This is shown when file is originally saved on MMC but mmc is not available. -//l: popup_note_window -//r: 5.0 -#define qtn_bt_saved_no_memory_card "File not found as memory card is not present. Locate file?" - -//d: This is shown when file link is updated. -//l: popup_note_window -//r: 5.0 -#define qtn_bt_saved_link_updated "File link updated" - -//d: This is shown when new selected filename does not match the orignal filename. -//l: popup_note_window -//r: 5.0 -#define qtn_bt_saved_search_update "File names don't match, update link anyway?" - - - -// -- New string added for CR 403-9991 show filename and size while receiving -- - - -//d: This is shown while receiving files via either bluetooth or infrared -//d: and the receiving file size is smaller than a defined limit -//l: popup_note_wait_window -//r: 5.0 -#define qtn_bt_ir_receiving_data_size_kb "Receiving \n%U\n%N kB" - -//d: This is shown while receiving files via either bluetooth or infrared -//d: and the receiving file size is larger than a defined limit -//l: popup_note_wait_window -//r: 5.0 -#define qtn_bt_ir_receiving_data_size_mb "Receiving \n%U\n%N MB" - - -//d: This is shown while receiving files via either bluetooth or infrared -//d: and the receiving file size is unknown -//l: popup_note_wait_window -//r: 5.0 -#define qtn_bt_ir_receiving_data_no_size "Receiving \n%U" - - -// -- New string added for CR 404-4716 Allow sending unsupported image over BT BIP -- - -// d: This is shown when one could not be sent -// l: popup_note_window -// r: 5.0 -#define qtn_bt_bip_format_not_supported_send "Receiving device does not support this image format. Send anyway?" - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/src/obexutilsdialog.cpp --- a/localconnectivityservice/obexserviceman/utils/src/obexutilsdialog.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,359 +0,0 @@ -/* -* Copyright (c) 2002 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: -* -*/ - - -// INCLUDE FILES -#include "obexutilsdialog.h" -#include "obexutilsdialogtimer.h" -#include "obexutilsuilayer.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "obexutilsdebug.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -CObexUtilsDialog::CObexUtilsDialog( MObexUtilsDialogObserver* aObserverPtr ) : - iDialogObserverPtr( aObserverPtr ) - { - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialog::NewL -// ----------------------------------------------------------------------------- -EXPORT_C CObexUtilsDialog* CObexUtilsDialog::NewL( MObexUtilsDialogObserver* aObserverPtr ) - { - CObexUtilsDialog* self = new ( ELeave ) CObexUtilsDialog( aObserverPtr ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return( self ); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialog::NewLC -// ----------------------------------------------------------------------------- -EXPORT_C CObexUtilsDialog* CObexUtilsDialog::NewLC( MObexUtilsDialogObserver* aObserverPtr ) - { - CObexUtilsDialog* self = new ( ELeave ) CObexUtilsDialog( aObserverPtr ); - CleanupStack::PushL( self ); - self->ConstructL(); - return( self ); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialog::ConstructL -// Symbian OS default constructor can leave. -// ----------------------------------------------------------------------------- -void CObexUtilsDialog::ConstructL() - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::ConstructL()")); - - if (!iDialogObserverPtr) - { - // The observer pointer was not given as an argument. - // - User::Leave(KErrArgument); - } - - TFileName fileName; - fileName += KObexUtilsFileDrive; - fileName += KDC_RESOURCE_FILES_DIR; - fileName += KObexUtilsResourceFileName; - BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), fileName ); - iResourceFileId = CCoeEnv::Static()->AddResourceFileL( fileName ); - - iCoverDisplayEnabled = IsCoverDisplayL(); - - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::ConstructL() completed")); - } - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -CObexUtilsDialog::~CObexUtilsDialog() - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::~CObexUtilsDialog()")); - - CCoeEnv::Static()->DeleteResourceFile( iResourceFileId ); - delete iObexDialogTimer; - - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::~CObexUtilsDialog() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialog::LaunchProgressDialogL -// ----------------------------------------------------------------------------- -EXPORT_C void CObexUtilsDialog::LaunchProgressDialogL( - MObexUtilsProgressObserver* aObserverPtr, TInt aFinalValue, - TInt aResId, TInt aTimeoutValue ) - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::LaunchProgressDialogL()")); - - if ( aObserverPtr ) - { - // The observerPtr was given, so store it and start a timer - // - iProgressObserverPtr = aObserverPtr; - - if ( iObexDialogTimer ) - { - iObexDialogTimer->Cancel(); - delete iObexDialogTimer; - iObexDialogTimer = NULL; - } - - iObexDialogTimer = CObexUtilsDialogTimer::NewL( this ); - iObexDialogTimer->SetTimeout( aTimeoutValue ); - } - - iProgressDialogResId = aResId; - - iProgressDialog = new( ELeave ) CAknProgressDialog( - ( reinterpret_cast( &iProgressDialog ) ), ETrue ); - PrepareDialogExecuteL( aResId, iProgressDialog ); - iProgressDialog->ExecuteLD( R_SENDING_PROGRESS_NOTE ); - - HBufC* buf = StringLoader::LoadLC( aResId ); - iProgressDialog->SetTextL( buf->Des() ); - CleanupStack::PopAndDestroy( buf ); - - iProgressDialog->GetProgressInfoL()->SetFinalValue( aFinalValue ); - iProgressDialog->SetCallback( this ); - if ( iProgressObserverPtr ) - { - iObexDialogTimer->Tickle(); - } - - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::LaunchProgressDialogL() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialog::LaunchWaitDialogL -// ----------------------------------------------------------------------------- -EXPORT_C void CObexUtilsDialog::LaunchWaitDialogL( TInt aResId ) - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::LaunchWaitDialogL()")); - - if ( iWaitDialog || iProgressDialog ) - { - // Allow only one dialog at a time - // - User::Leave( KErrInUse ); - } - - iWaitDialog = new( ELeave ) CAknWaitDialog( - ( reinterpret_cast( &iWaitDialog ) ), EFalse ); - - iWaitDialog->SetCallback( this ); - PrepareDialogExecuteL( aResId, iWaitDialog ); - iWaitDialog->ExecuteLD( aResId ); - - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::LaunchWaitDialogL() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialog::CancelWaitDialogL -// ----------------------------------------------------------------------------- -EXPORT_C void CObexUtilsDialog::CancelWaitDialogL() - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::CancelWaitDialogL()")); - - if( iWaitDialog ) - { - iWaitDialog->SetCallback(NULL); - iWaitDialog->ProcessFinishedL(); - iWaitDialog = NULL; - } - - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::CancelWaitDialogL() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialog::CancelProgressDialogL -// ----------------------------------------------------------------------------- -EXPORT_C void CObexUtilsDialog::CancelProgressDialogL() - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::CancelProgressDialogL()")); - - if( iProgressDialog ) - { - iProgressDialog->SetCallback(NULL); - iProgressDialog->ProcessFinishedL(); - iProgressDialog = NULL; - - if ( iObexDialogTimer ) - { - iObexDialogTimer->Cancel(); - delete iObexDialogTimer; - iObexDialogTimer = NULL; - } - } - - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::CancelProgressDialogL() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialog::UpdateProgressDialogL -// ----------------------------------------------------------------------------- -EXPORT_C void CObexUtilsDialog::UpdateProgressDialogL( TInt aValue, TInt aResId ) - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::UpdateProgressDialogL()")); - - if ( iProgressDialog ) - { - iProgressDialog->GetProgressInfoL()->SetAndDraw( aValue ); - - HBufC* buf = StringLoader::LoadLC( aResId ); - iProgressDialog->SetTextL( buf->Des() ); - iProgressDialog->LayoutAndDraw(); - CleanupStack::PopAndDestroy( buf ); - } - - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::UpdateProgressDialogL() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialog::DialogDismissedL -// ----------------------------------------------------------------------------- -void CObexUtilsDialog::DialogDismissedL( TInt aButtonId ) - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::DialogDismissedL()")); - - // The dialog has already been deleted by UI framework. - // - if( aButtonId == EAknSoftkeyCancel ) - { - if ( iDialogObserverPtr ) - { - iDialogObserverPtr->DialogDismissed( aButtonId ); - } - - if ( iObexDialogTimer ) - { - iObexDialogTimer->Cancel(); - delete iObexDialogTimer; - iObexDialogTimer = NULL; - } - } - - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::DialogDismissedL() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialog::UpdateProgressDialog -// ----------------------------------------------------------------------------- -void CObexUtilsDialog::UpdateProgressDialog() - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::UpdateProgressDialog()")); - - TRAPD( ignoredError, UpdateProgressDialogL( - iProgressObserverPtr->GetProgressStatus(), iProgressDialogResId ) ); - - if (ignoredError != KErrNone) - { - FLOG(_L("Ignore this error")); - } - - if ( iObexDialogTimer ) - { - iObexDialogTimer->Tickle(); - } - - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::UpdateProgressDialog() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialog::LaunchQueryDialogL -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CObexUtilsDialog::LaunchQueryDialogL( const TInt& aResourceID ) - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::LaunchQueryDialogL()")); - - CAknQueryDialog* dlg = CAknQueryDialog::NewL(); - CleanupStack::PushL( dlg ); - PrepareDialogExecuteL( aResourceID, dlg ); - CleanupStack::Pop( dlg ); - TInt keypress = dlg->ExecuteLD( aResourceID ); - - return keypress; - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialog::ShowNumberOfSendFileL -// ----------------------------------------------------------------------------- -// - -EXPORT_C void CObexUtilsDialog::ShowNumberOfSendFileL( TInt aSentNum, TInt aTotalNum ) - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::ShowNumberOfSendFile()")); - - CAknInformationNote* myNote = new (ELeave) CAknInformationNote(); - - CArrayFix* nums = new( ELeave ) CArrayFixFlat(3); - CleanupStack::PushL(nums); - nums->AppendL(aSentNum); - nums->AppendL(aTotalNum); - CleanupStack::Pop(nums); - - HBufC* stringholder = StringLoader::LoadLC( R_BT_SENT_IMAGE_NUMBER, *nums); - PrepareDialogExecuteL( R_BT_SENT_IMAGE_NUMBER, myNote ); - myNote->ExecuteLD( *stringholder ); - CleanupStack::PopAndDestroy( stringholder ); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialog::PrepareDialogExecuteL -// ----------------------------------------------------------------------------- -// -void CObexUtilsDialog::PrepareDialogExecuteL( const TInt& aResourceID, CEikDialog* aDialog ) - { - if (iCoverDisplayEnabled) - { - TInt dialogIndex = - ((aResourceID & KResourceNumberMask) - KFirstResourceOffset) + KEnumStart; - aDialog->PublishDialogL( dialogIndex, KObexUtilsCategory ); - } - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialog::IsCoverDisplayL() -// ----------------------------------------------------------------------------- -// -TBool CObexUtilsDialog::IsCoverDisplayL() - { - TBool coverDisplay = EFalse; - FeatureManager::InitializeLibL(); - if ( FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ) ) - { - coverDisplay = ETrue; - } - FeatureManager::UnInitializeLib(); - return coverDisplay; - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/src/obexutilsdialogtimer.cpp --- a/localconnectivityservice/obexserviceman/utils/src/obexutilsdialogtimer.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -/* -* Copyright (c) 2002 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: -* -*/ - - -// INCLUDE FILES -#include "obexutilsdialogtimer.h" -#include "obexutilsdebug.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CObexUtilsDialogTimer::CObexUtilsDialogTimer( CObexUtilsDialog* aParent) - : CTimer( EPriorityLow ), - iParent( aParent ) - { - CActiveScheduler::Add( this ); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialogTimer::ConstructL -// Symbian OS default constructor can leave. -// ----------------------------------------------------------------------------- -// -void CObexUtilsDialogTimer::ConstructL() - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::ConstructL()")); - - CTimer::ConstructL(); - - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::ConstructL() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialogTimer::NewL -// ----------------------------------------------------------------------------- -CObexUtilsDialogTimer* CObexUtilsDialogTimer::NewL( CObexUtilsDialog* aParent) - { - CObexUtilsDialogTimer* self = - new( ELeave ) CObexUtilsDialogTimer( aParent ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -CObexUtilsDialogTimer::~CObexUtilsDialogTimer() - { - Cancel(); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialogTimer::Tickle -// ----------------------------------------------------------------------------- -// -void CObexUtilsDialogTimer::Tickle() - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::Tickle()")); - - Cancel(); - After( iTimeout ); - - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::Tickle() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialogTimer::RunL -// ----------------------------------------------------------------------------- -// -void CObexUtilsDialogTimer::RunL() - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::RunL()")); - if (iParent) - { - iParent->UpdateProgressDialog(); - } - - FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::RunL() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsDialogTimer::SetTimeout -// ----------------------------------------------------------------------------- -// -void CObexUtilsDialogTimer::SetTimeout( TTimeIntervalMicroSeconds32 aTimeout ) - { - iTimeout = aTimeout; - } - -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/src/obexutilsentryhandler.cpp --- a/localconnectivityservice/obexserviceman/utils/src/obexutilsentryhandler.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -/* -* Copyright (c) 2002 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: Handles the global progress dialog -* -*/ - - - - -#include -#include - -#include "obexutilsentryhandler.h" -#include "obexutilsdebug.h" - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CObexutilsEntryhandler() -// --------------------------------------------------------------------------- -// -CObexutilsEntryhandler::CObexutilsEntryhandler(): CActive ( EPriorityNormal ) - { - CActiveScheduler::Add(this); - } - -// --------------------------------------------------------------------------- -// ConstructL() -// --------------------------------------------------------------------------- -// -void CObexutilsEntryhandler::ConstructL() - { - } - -// --------------------------------------------------------------------------- -// NewL() -// --------------------------------------------------------------------------- -// -CObexutilsEntryhandler* CObexutilsEntryhandler::NewL() - { - CObexutilsEntryhandler* self = CObexutilsEntryhandler::NewLC(); - CleanupStack::Pop( self ); - return self; - } - - -// --------------------------------------------------------------------------- -// NewLC() -// --------------------------------------------------------------------------- -// -CObexutilsEntryhandler* CObexutilsEntryhandler::NewLC() - { - CObexutilsEntryhandler* self = new( ELeave ) CObexutilsEntryhandler(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// AddLinkAttachment() -// --------------------------------------------------------------------------- -// -TInt CObexutilsEntryhandler::AddEntryAttachment( - const TDesC &aFilePath, - CMsvAttachment* anAttachInfo, - CMsvStore* aStore) - { - FLOG(_L("[OBEXUTILS]\t CObexutilsEntryhandler::AddEntryAttachment()")); - - iStatus = KRequestPending; - - TRAPD(error, aStore->AttachmentManagerL().AddLinkedAttachmentL(aFilePath,anAttachInfo, iStatus);); - - if (error != KErrNone ) - { - //Complete request - TRequestStatus* status = &iStatus; - User::RequestComplete(status, error); - } - - SetActive(); - iSyncWaiter.Start(); - - FLOG(_L("[OBEXUTILS]\t CObexutilsEntryhandler::AddEntryAttachment() Done")); - return iStatus.Int(); - } - - -// --------------------------------------------------------------------------- -// From class CActive. -// RunL() -// --------------------------------------------------------------------------- -// -void CObexutilsEntryhandler::RunL() - { - if ( iSyncWaiter.IsStarted() ) - { - iSyncWaiter.AsyncStop(); - } - FLOG(_L("[OBEXUTILS]\t CObexutilsEntryhandler::RunL() Done")); - } - -// --------------------------------------------------------------------------- -// ~CObexutilslinkhandler() -// --------------------------------------------------------------------------- -// -CObexutilsEntryhandler::~CObexutilsEntryhandler() - { - FLOG(_L("[OBEXUTILS]\t CObexutilsEntryhandler::Destructor")); - Cancel(); - } - -// --------------------------------------------------------------------------- -// From class CActive. -// DoCancel() -// --------------------------------------------------------------------------- -// -void CObexutilsEntryhandler::DoCancel() - { - FLOG(_L("[OBEXUTILS]\t CObexutilsEntryhandler::DoCancel()")); - if ( iSyncWaiter.IsStarted() ) - { - iSyncWaiter.AsyncStop(); - } - FLOG(_L("[OBEXUTILS]\t CObexutilsEntryhandler::DoCancel() done")); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/src/obexutilsglobaldialog.cpp --- a/localconnectivityservice/obexserviceman/utils/src/obexutilsglobaldialog.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -/* -* Copyright (c) 2002 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: Handles the global progress dialog for voice recognition -* -*/ - - - - - -// INCLUDE FILES - -#include "obexutilsglobalprogressdialog.h" -#include "obexutilsuilayer.h" -#include -#include -#include -#include -#include "obexutilsdebug.h" - - - -// ================= MEMBER FUNCTIONS ======================= - -// C++ default constructor can NOT contain any code, that -// might leave. -// -CGlobalDialog::CGlobalDialog() : CActive(EPriorityNormal) - { - CActiveScheduler::Add( this ); - } - -// Symbian default constructor can leave. -void CGlobalDialog::ConstructL(MGlobalNoteCallback* aObserver) - { - iKeyCallback = aObserver; - iAknGlobalNote = CAknGlobalNote::NewL(); - } - - -// Two-phased constructor. -EXPORT_C CGlobalDialog* CGlobalDialog::NewL(MGlobalNoteCallback* aObserver) - { - CGlobalDialog* self = NewLC(aObserver); - CleanupStack::Pop(); - return self; - } - -// Two-phased constructor.- stack version -EXPORT_C CGlobalDialog* CGlobalDialog::NewLC(MGlobalNoteCallback* aObserver) - { - CGlobalDialog* self=new (ELeave) CGlobalDialog(); - CleanupStack::PushL(self); - self->ConstructL(aObserver); - return self; - } - -EXPORT_C void CGlobalDialog::ShowErrorDialogL(TInt aResourceId) -{ - TFileName fileName; - fileName += KObexUtilsFileDrive; - fileName += KDC_RESOURCE_FILES_DIR; - fileName += KObexUtilsResourceFileName; - - if(!iStringResourceReader) - { - iStringResourceReader= CStringResourceReader::NewL( fileName ); - } - TPtrC buf; - buf.Set(iStringResourceReader-> ReadResourceString(aResourceId)); - iAknGlobalNote->SetSoftkeys(R_AVKON_SOFTKEYS_CLOSE); - iAknGlobalNote->ShowNoteL(iStatus,EAknGlobalInformationNote, buf); - FTRACE( FPrint(_L( "[ObexUtils] CGlobalDialog: ShowNoteDialogL buf: \t %S" ), &buf) ); - SetActive(); - -} -EXPORT_C void CGlobalDialog::ShowNoteDialogL( TInt aResourceId, TBool anAnimation) -{ - TFileName fileName; - fileName += KObexUtilsFileDrive; - fileName += KDC_RESOURCE_FILES_DIR; - fileName += KObexUtilsResourceFileName; - - if(!iStringResourceReader) - { - iStringResourceReader= CStringResourceReader::NewL( fileName ); - } - TPtrC buf; - buf.Set(iStringResourceReader-> ReadResourceString(aResourceId)); - iAknGlobalNote->SetSoftkeys(R_AVKON_SOFTKEYS_CANCEL); - if(anAnimation) - { - iAknGlobalNote->SetAnimation(R_QGN_GRAF_WAIT_BAR_ANIM); - } - iAknGlobalNote->ShowNoteL(iStatus,EAknGlobalWaitNote, buf); - FTRACE( FPrint(_L( "[ObexUtils] CGlobalDialog: ShowNoteDialogL buf: \t %S" ), &buf) ); - SetActive(); - -} - -// Destructor -CGlobalDialog::~CGlobalDialog() - { - Cancel(); - if(iAknGlobalNote) - { - delete iAknGlobalNote; - iAknGlobalNote = NULL; - } - - delete iStringResourceReader; - - } - - - -// --------------------------------------------------------- -// CGlobalDialog::DoCancel -// Active object cancel -// --------------------------------------------------------- -// -void CGlobalDialog::DoCancel() - { - ProcessFinished(); - if(iStringResourceReader) - { - delete iStringResourceReader; - iStringResourceReader = NULL; - } - } - -// --------------------------------------------------------- -// CGlobalDialog::RunL -// Active object RunL -// --------------------------------------------------------- -// -void CGlobalDialog::RunL() - { - - FTRACE( FPrint(_L( "[ObexUtils] CGlobalDialog: RunL iStatus.Int():\t %d" ), iStatus.Int() ) ); - if ( iKeyCallback != NULL ) - { - iKeyCallback->HandleGlobalNoteDialogL(iStatus.Int()); - } - } - -// --------------------------------------------------------- -// CGlobalDialog::ProcessFinished -// Stops the progress dialog -// --------------------------------------------------------- -// -EXPORT_C void CGlobalDialog::ProcessFinished() - { - FLOG( _L( "[ObexUtils] CGlobalDialog::ProcessFinished\t" ) ); - delete iAknGlobalNote; - iAknGlobalNote = NULL; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/src/obexutilsglobalprogressdialog.cpp --- a/localconnectivityservice/obexserviceman/utils/src/obexutilsglobalprogressdialog.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,272 +0,0 @@ -/* -* Copyright (c) 2002 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: Handles the global progress dialog -* -*/ - - - - - -// INCLUDE FILES -#include -#include "obexutilsglobalprogressdialog.h" -#include "obexutilsuilayer.h" -#include -#include -#include -#include -#include -#include // Compiled resource ids -#include - -#include // Localisation stringloader -#include - -#include "obexutilsdebug.h" - -const TInt KMaxDisplayFileName = 17; // used while showing receiving filename. - // If the filename is longer than 20 bytes, we make it show only 20 bytes. - -// ================= MEMBER FUNCTIONS ======================= - -// C++ default constructor can NOT contain any code, that -// might leave. -// -CGlobalProgressDialog::CGlobalProgressDialog() : CActive(EPriorityNormal) - { - CActiveScheduler::Add( this ); - } - - -// Symbian default constructor can leave. -void CGlobalProgressDialog::ConstructL(MGlobalProgressCallback* aObserver) - { - iProgressDialog = CAknGlobalProgressDialog::NewL(); - iKeyCallback = aObserver; - } - - -// Two-phased constructor. -EXPORT_C CGlobalProgressDialog* CGlobalProgressDialog::NewL(MGlobalProgressCallback* aObserver) - { - CGlobalProgressDialog* self = NewLC(aObserver); - CleanupStack::Pop(); - return self; - } - -// Two-phased constructor.- stack version -EXPORT_C CGlobalProgressDialog* CGlobalProgressDialog::NewLC(MGlobalProgressCallback* aObserver) - { - CGlobalProgressDialog* self=new (ELeave) CGlobalProgressDialog(); - CleanupStack::PushL(self); - self->ConstructL(aObserver); - return self; - } - - -// Destructor -CGlobalProgressDialog::~CGlobalProgressDialog() - { - Cancel(); - delete iProgressDialog; - delete iStringResourceReader; - } - - - -// --------------------------------------------------------- -// CGlobalProgressDialog::DoCancel -// Active object cancel -// --------------------------------------------------------- -// -void CGlobalProgressDialog::DoCancel() - { - if ( iProgressDialog ) - { - iProgressDialog->CancelProgressDialog(); - } - - if(iStringResourceReader) - { - delete iStringResourceReader; - iStringResourceReader = NULL; - } - } - -// --------------------------------------------------------- -// CGlobalProgressDialog::RunL -// Active object RunL -// --------------------------------------------------------- -// -void CGlobalProgressDialog::RunL() - { - if ( iKeyCallback != NULL ) - { - iKeyCallback->HandleGlobalProgressDialogL(iStatus.Int()); - } - } - -// --------------------------------------------------------- -// CGlobalProgressDialog::SetIconL -// Set icon on the dialog -// --------------------------------------------------------- -// -void CGlobalProgressDialog::SetIconL( const TDesC& aIconText, const TDesC& aIconFile, - TInt aIconId, TInt aIconMaskId ) - { - iProgressDialog->SetIconL(aIconText, aIconFile, aIconId, aIconMaskId ); - } - -// --------------------------------------------------------- -// CGlobalProgressDialog::SetImageL -// Set image on the dialog -// --------------------------------------------------------- -// -void CGlobalProgressDialog::SetImageL( const TDesC& aImageFile, TInt aImageId, - TInt aImageMaskId ) - { - iProgressDialog->SetImageL(aImageFile, aImageId, aImageMaskId); - } - - -// --------------------------------------------------------- -// CGlobalProgressDialog::ShowProgressDialogL -// Shows progress dialog and sets active object active -// --------------------------------------------------------- -// -EXPORT_C void CGlobalProgressDialog::ShowProgressDialogL(TInt aStringId) - { - TFileName fileName; - fileName += KObexUtilsFileDrive; - fileName += KDC_RESOURCE_FILES_DIR; - fileName += KObexUtilsResourceFileName; - - if(!iStringResourceReader) - { - iStringResourceReader= CStringResourceReader::NewL( fileName ); - } - TPtrC buf; - //buf.Set(iStringResourceReader-> ReadResourceString(R_BT_RECEIVING_DATA)); - buf.Set(iStringResourceReader-> ReadResourceString(aStringId)); - iProgressDialog->ShowProgressDialogL( iStatus, buf, R_AVKON_SOFTKEYS_HIDE_CANCEL__HIDE ); - //iProgressDialog->ShowProgressDialogL( iStatus, buf, R_BTUI_SOFTKEYS_OPTIONS_EXIT__CHANGE ); //R_OBEXUTILS_SOFTKEYS_HIDE_CANCEL ); - SetActive(); - } - -// --------------------------------------------------------- -// CGlobalProgressDialog::ShowProgressDialogNameSizeL -// Shows progress dialog and sets active object active -// --------------------------------------------------------- -// -EXPORT_C void CGlobalProgressDialog::ShowProgressDialogNameSizeL( - TDesC& aFileName, - TInt64 aFileSize) - { - TFileName fileName; - fileName += KObexUtilsFileDrive; - fileName += KDC_RESOURCE_FILES_DIR; - fileName += KObexUtilsResourceFileName; - - if(!iStringResourceReader) - { - iStringResourceReader= CStringResourceReader::NewL( fileName ); - } - TPtrC buf; - - - TBuf<20> sizeInString; - sizeInString.Zero(); - - if ( aFileSize >> 20 ) // size in MB - { - TReal sizeInMB = 0; - sizeInMB = ((TReal)aFileSize ) / (1024*1024); - _LIT16(KFormatTwoDecimal,"%4.2f"); // keep 2 decimals - sizeInString.Format(KFormatTwoDecimal,sizeInMB); - buf.Set(iStringResourceReader-> ReadResourceString(R_BT_IR_RECEIVING_DATA_SIZE_MB)); - } - else if( aFileSize >> 10 ) // size in KB - { - TInt64 sizeInKB = 0; - sizeInKB = aFileSize >> 10; - sizeInString.AppendNum(sizeInKB); - buf.Set(iStringResourceReader-> ReadResourceString(R_BT_IR_RECEIVING_DATA_SIZE_KB)); - } - else // size is unknown or less than 1K - { - buf.Set(iStringResourceReader-> ReadResourceString(R_BT_IR_RECEIVING_DATA_NO_SIZE)); - } - - - TBuf<100> tbuf; - tbuf.Zero(); - tbuf.Append(buf); - _LIT(KPrefix,"["); - _LIT(Ksuffix,"]"); - TInt prefixPos = tbuf.Find(KPrefix); - if (prefixPos!= KErrNotFound) - { - TInt keyLength = 0; - TInt suffixPos = tbuf.Find(Ksuffix); - keyLength =(tbuf.Mid(prefixPos)).Length()-(tbuf.Mid(suffixPos)).Length()+1; - tbuf.Delete(prefixPos, keyLength); - } - _LIT(KString,"%U"); - - - - if ( aFileName.Length() > KMaxDisplayFileName ) - { - // Filename is too long, - // We make it shorter. Hiding the chars in the middle part of filename. - // - TFileName shortname; - shortname = aFileName.Mid(0,KMaxDisplayFileName/2); - shortname.Append(_L("...")); - shortname.Append(aFileName.Mid(aFileName.Length() - KMaxDisplayFileName/2, KMaxDisplayFileName/2)); - tbuf.Replace(tbuf.Find(KString) , 2, shortname); - } - else - { - tbuf.Replace(tbuf.Find(KString) , 2, aFileName); - } - _LIT(KInt, "%N"); - if ( sizeInString.Length() > 0 ) - { - tbuf.Replace(tbuf.Find(KInt) , 2, sizeInString); - } - - iProgressDialog->ShowProgressDialogL( iStatus, tbuf, R_AVKON_SOFTKEYS_HIDE_CANCEL__HIDE ); - SetActive(); - } -// --------------------------------------------------------- -// CGlobalProgressDialog::UpdateProgressDialog -// Updates the progress dialog -// --------------------------------------------------------- -// -EXPORT_C void CGlobalProgressDialog::UpdateProgressDialog(TInt aValue, TInt aFinalValue) - { - iProgressDialog->UpdateProgressDialog(aValue, aFinalValue); - } - -// --------------------------------------------------------- -// CGlobalProgressDialog::ProcessFinished -// Stops the progress dialog -// --------------------------------------------------------- -// -EXPORT_C void CGlobalProgressDialog::ProcessFinished() - { - iProgressDialog->ProcessFinished(); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/src/obexutilslaunchwaiter.cpp --- a/localconnectivityservice/obexserviceman/utils/src/obexutilslaunchwaiter.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,411 +0,0 @@ -/* -* Copyright (c) 2002 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: -* -*/ - - -// INCLUDE FILES -#include -#include -#include -#include -#include -#include // for memory and file selection dialogs -#include -#include // for getting drive root path -#include -#include -#include -#include -#include "obexutilslaunchwaiter.h" -#include "obexutilsdebug.h" -#include "obexutilsuilayer.h" // For launching file manager -#include "obexutilsmessagehandler.h" // For updating an entry - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CObexUtilsLaunchWaiter::NewLC -// ----------------------------------------------------------------------------- -CObexUtilsLaunchWaiter* CObexUtilsLaunchWaiter::NewLC( - CMsvSession& aMsvSession, - CMsvEntry* aMessage, - TRequestStatus& aObserverRequestStatus ) - { - CObexUtilsLaunchWaiter* self = new( ELeave )CObexUtilsLaunchWaiter( - aMsvSession, - aMessage, - aObserverRequestStatus ); - CleanupStack::PushL( self ); - self->ConstructL( aMessage ); - return self; - } - -// ----------------------------------------------------------------------------- -// CObexUtilsLaunchWaiter::NewL -// ----------------------------------------------------------------------------- -CObexUtilsLaunchWaiter* CObexUtilsLaunchWaiter::NewL( - CMsvSession& aMsvSession, - CMsvEntry* aMessage, - TRequestStatus& aObserverRequestStatus ) - { - CObexUtilsLaunchWaiter* self = CObexUtilsLaunchWaiter::NewLC( - aMsvSession, - aMessage, - aObserverRequestStatus ); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CObexUtilsLaunchWaiter::ConstructL -// ----------------------------------------------------------------------------- -void CObexUtilsLaunchWaiter::ConstructL( CMsvEntry* aMessage ) - { - if (aMessage->Count() < 1) - { - User::Leave(KErrOverflow); - } - - CMsvEntry* attachEntry = iMsvSession.GetEntryL(((*aMessage)[0]).Id()); - CleanupStack::PushL(attachEntry); // 1st push - CMsvStore* store = attachEntry->ReadStoreL(); - CleanupStack::PushL(store); // 2nd push - - CMsvAttachment* attachInfo = store->AttachmentManagerL().GetAttachmentInfoL(0); - CleanupStack::PushL(attachInfo); // 3rd push - - TDataType dataType = attachInfo->MimeType(); - TFileName filePath; - filePath = attachInfo->FilePath(); - - TInt error = KErrNone; - TBool isCompleteSelf = EFalse; - CEikonEnv* eikEnv = CEikonEnv::Static(); - - if ( attachInfo->Type() == CMsvAttachment::EMsvFile ) - { - RFile attachFile; - TRAP( error, attachFile = store->AttachmentManagerL().GetAttachmentFileL(0)); - if ( error == KErrNone ) - { - CleanupClosePushL(attachFile); // 4th push - CAiwGenericParamList* paramList = CAiwGenericParamList::NewLC(); // 5th push - TAiwGenericParam paramSave(EGenericParamAllowSave, ETrue); - paramList->AppendL( paramSave ); - - if ( eikEnv ) - { - iDocumentHandler = CDocumentHandler::NewL( eikEnv->Process() ); - iDocumentHandler->SetExitObserver( this ); - TRAP( error, iDocumentHandler->OpenFileEmbeddedL(attachFile, dataType, *paramList)); - }// eikEnv - CleanupStack::PopAndDestroy(2); // paramList, attachFile - } - }// EMsvFile - - if ( attachInfo->Type() == CMsvAttachment::EMsvLinkedFile ) - { - if ( eikEnv ) - { - RFs rfs; - User::LeaveIfError( rfs.Connect() ); - if ( BaflUtils::FileExists( rfs, filePath ) ) - { - CAiwGenericParamList* paramList = CAiwGenericParamList::NewLC(); // 4th push - TAiwGenericParam paramSave(EGenericParamFileSaved, ETrue); - paramList->AppendL( paramSave ); - - iDocumentHandler = CDocumentHandler::NewL( eikEnv->Process() ); - iDocumentHandler->SetExitObserver( this ); - - RFile64 shareableFile; - TRAP( error, iDocumentHandler->OpenTempFileL(filePath,shareableFile)); - if ( error == KErrNone) - { - TRAP( error, iDocumentHandler->OpenFileEmbeddedL( shareableFile, dataType, *paramList)); - } - shareableFile.Close(); - CleanupStack::PopAndDestroy(); // paramList - - if ( error == KErrNotSupported ) - { - const TInt sortMethod = 2; // 0 = 'By name', 1 = 'By type', - // 2 = 'Most recent first' and 3 = 'Largest first' - TRAP (error, TObexUtilsUiLayer::LaunchFileManagerL( filePath, - sortMethod, - ETrue )); // ETrue -> launch file manager in embedded mode. - } // KErrNotSupported - isCompleteSelf = ETrue; - } - else - { - error = KErrNone; - TFileName fileName; - if (LocateFileL(fileName, filePath)) - { - // Update the entry - TRAP(error, TObexUtilsMessageHandler::UpdateEntryAttachmentL(fileName,aMessage)); - if ( error == KErrNone ) - { - // Show a confirmation note - CAknGlobalNote* note = CAknGlobalNote::NewLC(); - HBufC* stringholder = StringLoader::LoadLC( R_BT_SAVED_LINK_UPDATED ); - note->ShowNoteL(EAknGlobalConfirmationNote, *stringholder); - CleanupStack::PopAndDestroy(2); //note and stringholder - } - } - isCompleteSelf = ETrue; - } - - rfs.Close(); - } // eikEnv - } // EMsvLinkedFile - - - // Set message to READ - TMsvEntry entry = aMessage->Entry(); - entry.SetUnread( EFalse ); - aMessage->ChangeL( entry ); - - User::LeaveIfError ( error ); - CleanupStack::PopAndDestroy(3); // attachInfo, store, attachEntry - - iObserverRequestStatus = KRequestPending; // CMsvOperation (observer) - iStatus = KRequestPending; // CMsvOperation - SetActive(); - - if ( isCompleteSelf ) - { - HandleServerAppExit( error ); - } - } - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -CObexUtilsLaunchWaiter::~CObexUtilsLaunchWaiter() - { - Cancel(); - if (iDocumentHandler) - { - delete iDocumentHandler; - iDocumentHandler = NULL; - } - } - -// ----------------------------------------------------------------------------- -// CObexUtilsLaunchWaiter::RunL -// ----------------------------------------------------------------------------- -void CObexUtilsLaunchWaiter::RunL() - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsLaunchWaiter::RunL()")); - - TRequestStatus* status = &iObserverRequestStatus; - User::RequestComplete( status, KErrNone ); - - FLOG(_L("[OBEXUTILS]\t CObexUtilsLaunchWaiter::RunL() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsLaunchWaiter::DoCancel -// ----------------------------------------------------------------------------- -void CObexUtilsLaunchWaiter::DoCancel() - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsLaunchWaiter::DoCancel()")); - - if ( iStatus == KRequestPending ) - { - TRequestStatus* pstat = &iStatus; - User::RequestComplete( pstat, KErrCancel ); - } - - if( iObserverRequestStatus == KRequestPending ) - { - TRequestStatus* observerStatus = &iObserverRequestStatus; - User::RequestComplete( observerStatus, KErrCancel ); - } - - - FLOG(_L("[OBEXUTILS]\t CObexUtilsLaunchWaiter::DoCancel() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsLaunchWaiter::CObexUtilsLaunchWaiter -// ----------------------------------------------------------------------------- -CObexUtilsLaunchWaiter::CObexUtilsLaunchWaiter( - CMsvSession& aMsvSession, - CMsvEntry* /*aMessage*/, - TRequestStatus& aObserverRequestStatus ) - : - CMsvOperation(aMsvSession, EPriorityStandard, aObserverRequestStatus), - iDocumentHandler(NULL) - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsLaunchWaiter::CObexUtilsLaunchWaiter()")); - - CActiveScheduler::Add( this ); - - FLOG(_L("[OBEXUTILS]\t CObexUtilsLaunchWaiter::CObexUtilsLaunchWaiter() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsLaunchWaiter::HandleServerAppExit -// ----------------------------------------------------------------------------- -void CObexUtilsLaunchWaiter::HandleServerAppExit(TInt aReason) - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsLaunchWaiter::HandleServerAppExit()")); - - if( iStatus == KRequestPending ) - { - // Complete self - // - TRequestStatus* status = &iStatus; - User::RequestComplete( status, aReason ); - } - - MAknServerAppExitObserver::HandleServerAppExit( aReason ); - FLOG(_L("[OBEXUTILS]\t CObexUtilsLaunchWaiter::HandleServerAppExit() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsLaunchWaiter::ProgressL -// ----------------------------------------------------------------------------- -const TDesC8& CObexUtilsLaunchWaiter::ProgressL() - { - return KNullDesC8; - } - -// ----------------------------------------------------------------------------- -// CObexUtilsLaunchWaiter::LocateFile -// ----------------------------------------------------------------------------- -TBool CObexUtilsLaunchWaiter::LocateFileL(TFileName& aFileName, const TFileName& anOldFileName) - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsLaunchWaiter::LocateFile()")); - - TBuf<200> buf; - TRequestStatus status = KRequestPending; - - TParse fileParseOld; - fileParseOld.Set(anOldFileName, NULL, NULL); - TFileName oldName = fileParseOld.NameAndExt(); - - // check old link if the file saved in mmc. If so, check if mmc available. - // if unavailable, show "is File not found as memory card is not present" - // - TInt err = CheckIfSaveInMMC( anOldFileName ); - TBool showMMCOut = EFalse; - if( err == EDriveF) - { - if( CheckDriveL(EDriveF) ) - showMMCOut = ETrue; - } - else if( err == EDriveE ) - { - if( CheckDriveL(EDriveE) ) - showMMCOut = ETrue; - } - - TBool answer = EFalse; - if( showMMCOut ) - { - answer = TObexUtilsUiLayer::ShowGlobalConfirmationQueryPlainL(R_BT_SAVED_NO_MEMORY_CARD); - } - else - { - answer = TObexUtilsUiLayer::ShowGlobalConfirmationQueryPlainL(R_BT_SAVED_SEARCH); - } - - TBool updateLink = EFalse; - if ( answer ) - { - updateLink = LaunchFileSelectionDialogL(aFileName, oldName); - } - - FLOG(_L("[OBEXUTILS]\t CObexUtilsLaunchWaiter::LocateFile() completed")); - return updateLink; - } - -// ----------------------------------------------------------------------------- -// CObexUtilsLaunchWaiter::LaunchFileSelectionDialogL -// ----------------------------------------------------------------------------- -TBool CObexUtilsLaunchWaiter::LaunchFileSelectionDialogL( - TFileName& aFileName, - const TFileName& anOldName) - { - TBuf<200> buf; - TParse fileParseNew; - TFileName nameNew; - TBool updateLink = EFalse; - - while ( !updateLink ) - { - TBool isSelected = AknCommonDialogsDynMem::RunSelectDlgLD( AknCommonDialogsDynMem::EMemoryTypeMMCExternal| - AknCommonDialogsDynMem::EMemoryTypeMMC| - AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage| - AknCommonDialogsDynMem::EMemoryTypePhone, - aFileName, - R_CFD_DEFAULT_SELECT_MEMORY_SELECTION, - R_CFD_DEFAULT_SELECT_FILE_SELECTION ); - - if ( isSelected ) - { - fileParseNew.Set(aFileName, NULL, NULL); - nameNew = fileParseNew.NameAndExt(); - - if ( nameNew.Compare(anOldName)) // names do not match - { - updateLink = TObexUtilsUiLayer::ShowGlobalConfirmationQueryPlainL(R_BT_SAVED_SEARCH_UPDATE); - } - else - { - updateLink = ETrue; - } - } - else - { - break; // Exit from while loop. - } - } - - return updateLink; - } - -// ----------------------------------------------------------------------------- -// CObexUtilsLaunchWaiter::CheckDriveL -// ----------------------------------------------------------------------------- -TInt CObexUtilsLaunchWaiter::CheckDriveL(TDriveNumber aDriveNumber) - { - RFs rfs; - User::LeaveIfError(rfs.Connect()); - CleanupClosePushL( rfs ) ; - TVolumeInfo volumeInfo; - TInt err = rfs.Volume(volumeInfo, aDriveNumber); - CleanupStack::PopAndDestroy(); // rfs - - return err; - } -// ----------------------------------------------------------------------------- -// CObexUtilsLaunchWaiter::CheckIfSaveInMMC -// ----------------------------------------------------------------------------- -TInt CObexUtilsLaunchWaiter::CheckIfSaveInMMC(const TFileName& aFileName) - { - if(aFileName.Find(_L("F:")) != KErrNotFound) - return EDriveF; - if(aFileName.Find(_L("E:")) != KErrNotFound) - return EDriveE; - - return KErrNotFound; - } -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/src/obexutilsmessagehandler.cpp --- a/localconnectivityservice/obexserviceman/utils/src/obexutilsmessagehandler.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1617 +0,0 @@ -/* -* 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" -* 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: -* -*/ - - -// INCLUDE FILES -#include "obexutilsmessagehandler.h" -#include "obexutilsuilayer.h" -#include "obexutilsdebug.h" -#include "obexutilsentryhandler.h" - -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include "updatemusiccollection.h" - -#include // provides interface for quering system paths - -#ifdef __BT_SAP - #include "vMessageHandler.h" -#endif // __BT_SAP - -// CONSTANT -const TInt KFFSBelowCritical = -2; -const TInt KRenameOffSet = 4 ; -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// RemoveObexBuffer Removes Obex buffer object. -// ----------------------------------------------------------------------------- -// -void TObexUtilsMessageHandler::RemoveObexBuffer(CObexBufObject* &aBufObject) - { - if (aBufObject) - { - delete aBufObject; - aBufObject = NULL; - } - } - -// ----------------------------------------------------------------------------- -// CreateMsvSessionLC Creates MSV session -// ----------------------------------------------------------------------------- -// -void TObexUtilsMessageHandler::CreateMsvSessionLC( - CDummySessionObserver* &aSessionObs, - CMsvSession* &aMsvSession) - { - aSessionObs = new( ELeave )CDummySessionObserver; - CleanupStack::PushL( aSessionObs ); //1st push - aMsvSession = CMsvSession::OpenSyncL( *aSessionObs ); - CleanupStack::PushL( aMsvSession ); //2nd push - } - -// ----------------------------------------------------------------------------- -// CreateMsvSessionLC Creates MSV session to selected destination -// ----------------------------------------------------------------------------- -// -void TObexUtilsMessageHandler::CreateMsvSessionLC( - CDummySessionObserver* &aSessionObs, - CMsvSession* &aMsvSession, - CMsvEntry* &aDestination, - TMsvId aMsvId) - { - CreateMsvSessionLC(aSessionObs, aMsvSession); - aDestination = aMsvSession->GetEntryL( aMsvId ); - CleanupStack::PushL( aDestination ); //3rd push - } - -// ----------------------------------------------------------------------------- -// GetCenRepKeyIntValueL Gets integer repository value -// Returns: Error -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt TObexUtilsMessageHandler::GetCenRepKeyIntValueL( - TUid aRepositoryUid, // aRepositoryUid Central repository's UID value - TUint32 aId, // Central repository's ID value - TInt& aVal) // Returned integer value - { - CRepository* storage = CRepository::NewLC( aRepositoryUid ); - TInt retval = storage->Get( aId, aVal ); - if (retval != KErrNone) - { - FLOG(_L("[OBEXUTILS]\t GetCenRepKeyIntValueL() Get failed")); - } - CleanupStack::PopAndDestroy( storage ); - return retval; - } - -// ----------------------------------------------------------------------------- -// GetCurrentTime Gets current time -// Returns: Current time -// ----------------------------------------------------------------------------- -// -TTime TObexUtilsMessageHandler::GetCurrentTime() - { - TTime time; - time.UniversalTime(); - return time; - } - -// ----------------------------------------------------------------------------- -// StoreAsRichTextL Change message content to Richtext -// Returns: None. -// ----------------------------------------------------------------------------- -// -void TObexUtilsMessageHandler::StoreAsRichTextL( - CMsvEntry* aParentEntry, // A pointer to new message server entry. - RFile& aFile) // New file to store - { - FLOG(_L("[OBEXUTILS]\t StoreAsRichTextL()")); - - TInt fileLength = 0; - User::LeaveIfError( aFile.Size( fileLength ) ); - - // Calculate the number of blocks to read - const TInt blockSize = 128 * 1024; - TInt fullBlockCnt = fileLength / blockSize; - if (fileLength % blockSize > 0) - { - fullBlockCnt++; - } - - CRichText* richText = ConstructRichTextLC(); // 1st, 2nd, 3rd push - - RBuf8 buffer8; - CleanupClosePushL(buffer8); // 4th push - buffer8.CreateL( blockSize ); - RBuf buffer16; - CleanupClosePushL(buffer16); // 5th push - buffer16.CreateL(blockSize); - - // Read the file into buffer in small chunks - TInt readBytes = 0; - for (TInt i = 0; i < fullBlockCnt; ++i) - { - User::LeaveIfError( aFile.Read( buffer8 ) ); - - // In order for Bio to understand 8-bit binary data, - // it needs to be stored in wide rich text object - // in the low byte of each word with the upper byte as 0. - // Do not use UTF8, just convert 8-bit to 16-bit. - buffer16.Copy( buffer8 ); - - richText->InsertL(readBytes, buffer16); - readBytes += buffer8.Length(); - } - CleanupStack::PopAndDestroy(2, &buffer8); - // -2 pop: free unused memory before StoreBodyTextL() - - CMsvStore* parentStore = aParentEntry->EditStoreL(); - CleanupStack::PushL(parentStore); // 4th push - parentStore->StoreBodyTextL(*richText); - parentStore->CommitL(); - - CleanupStack::PopAndDestroy(4); // parentStore, richText, richParaFormatLayer, - // richCharFormatLayer - - FLOG(_L("[OBEXUTILS]\t StoreAsRichTextL() completed")); - } - -// ----------------------------------------------------------------------------- -// UpdateAttachmentInformationL Add the obex object as a file attachment. -// Returns: None. -// ----------------------------------------------------------------------------- -// -void TObexUtilsMessageHandler::UpdateAttachmentInformationL( - TReceivedData& aRecData, // The obex received data - CMsvEntry* aAttachEntry, // Attachment entry - CMsvAttachment* aAttachInfo, // Attachment information - CMsvStore* aStore) // Message store (attachment) - { - FLOG(_L("[OBEXUTILS]\t UpdateAttachmentInformationL()")); - - TMsvEntry attachTEntry = aAttachEntry->Entry(); - - SetDetailsLC(attachTEntry.iDescription, aAttachInfo->MimeType()); - attachTEntry.iSize = aRecData.bytesReceived; - attachTEntry.iDate = aRecData.recTime; - aAttachEntry->ChangeL(attachTEntry); // Save properties. - CleanupStack::PopAndDestroy(); // unicode in SetDetailsLC - - aAttachInfo->SetSize(aRecData.bytesReceived); - aAttachInfo->SetAttachmentNameL(aRecData.msgName); - aAttachInfo->SetComplete(ETrue); - - aStore->AttachmentManagerExtensionsL().ModifyAttachmentInfoL(aAttachInfo); - - FLOG(_L("[OBEXUTILS]\t UpdateAttachmentInformation() completed")); - } - -// ----------------------------------------------------------------------------- -// FinaliseMessageL Save the size of all the attachments and make visible. -// Returns: None. -// ----------------------------------------------------------------------------- -// -void TObexUtilsMessageHandler::FinaliseMessageL( - CMsvEntry* aParentEntry, // Parent entry - TReceivedData& aRecData, // The obex received data - CMsvStore* aStore, // Attachment's store - TBool aIsBioMsg) // Is BIO message? - { - FLOG(_L("[OBEXUTILS]\t FinaliseMessageL()")); - // Save the size of all the attachment & make visible. - TMsvEntry parentTEntry = aParentEntry->Entry(); - parentTEntry.iDate = GetCurrentTime(); - parentTEntry.iSize = aRecData.bytesReceived; - parentTEntry.SetUnread(ETrue); - - // Saved OK. Make the entry visible and flag it as complete. - parentTEntry.SetVisible(ETrue); // visible - parentTEntry.SetInPreparation(EFalse); // complete - if (!aIsBioMsg) - { - parentTEntry.iDescription.Set(aRecData.msgName); // "Subject" - } - aParentEntry->ChangeL(parentTEntry); // commit changes - - aStore->CommitL(); - - FLOG(_L("[OBEXUTILS]\t FinaliseMessageL() completed")); - } - -// ----------------------------------------------------------------------------- -// FinaliseMessageL Save the size of all the attachments and make visible. -// for Saving file received via BT/IR directly to file system. -// Returns: None. -// ----------------------------------------------------------------------------- -// -void TObexUtilsMessageHandler::FinaliseMessageL( - CMsvEntry* aParentEntry, - CMsvStore* aStore, - TEntry& aFileEntry, - TParse& aFileNameParser) - { - FLOG(_L("[OBEXUTILS]\t FinaliseMessageL() new ")); - - // Save the size of all the attachment & make visible. - TMsvEntry parentTEntry = aParentEntry->Entry(); - parentTEntry.iDate = GetCurrentTime(); - parentTEntry.iSize = aFileEntry.iSize; - // Saved OK. Make the entry visible and flag it as complete. - parentTEntry.SetVisible(ETrue); // visible - parentTEntry.SetUnread(ETrue); - parentTEntry.SetInPreparation(EFalse); // complete - parentTEntry.iDescription.Set(aFileNameParser.FullName()); // "Subject" - aParentEntry->ChangeL(parentTEntry); // commit changes - aStore->CommitL(); - - FLOG(_L("[OBEXUTILS]\t FinaliseMessageL() new completed ")); - } - -// ----------------------------------------------------------------------------- -// StoreAndUpdateBioMessageL Stores and updates a BIO message -// Returns: None. -// ----------------------------------------------------------------------------- -// -void TObexUtilsMessageHandler::StoreAndUpdateBioMessageL( - CBIODatabase* aBioDB, // Bio database - TUid aBioMsgId, // Bio message ID - CMsvEntry* parentEntry, // Parent message entry - RFile& aFile) // File to attachment - { - FLOG(_L("[OBEXUTILS]\t StoreAndUpdateBioMessageL()")); - - TInt index; - aBioDB->GetBioIndexWithMsgIDL(aBioMsgId, index); - - StoreAsRichTextL( parentEntry, aFile ); - - TMsvEntry parentTEntry = parentEntry->Entry(); - parentTEntry.iMtm = KUidBIOMessageTypeMtm; - parentTEntry.iServiceId = KMsvLocalServiceIndexEntryId; - parentTEntry.iBioType = aBioMsgId.iUid; - parentTEntry.iDescription.Set(aBioDB->BifReader(index).Description()); - parentEntry->ChangeL(parentTEntry); - - FLOG(_L("[OBEXUTILS]\t StoreAndUpdateBioMessageL() completed")); - } - -// ----------------------------------------------------------------------------- -// RecogniseObjectsL Recognised objects if no type field has been given. -// Returns: None. -// ----------------------------------------------------------------------------- -// -void TObexUtilsMessageHandler::RecogniseObjectsL( - TFileName& aFileName, - CMsvAttachment* aAttachInfo) // Attachment information - { - FLOG(_L("[OBEXUTILS]\t RecogniseObjectsL()")); - - TPtrC8 mimeType; - RApaLsSession lsSess; - User::LeaveIfError( lsSess.Connect() ); - CleanupClosePushL(lsSess); - TDataType appDataType; - TUid appUid; - if (lsSess.AppForDocument(aFileName, appUid, appDataType) == KErrNone) - { - mimeType.Set(appDataType.Des8()); - } - else - { - // Don't trust on sender's MIME type here. Just set to empty. - mimeType.Set(KNullDesC8); - FLOG(_L("[OBEXUTILS]\t RecogniseObjectsL() MIME check failed")); - } - CleanupStack::PopAndDestroy(); // lsSess - - HBufC* buf16 = HBufC::NewLC(mimeType.Length()); - buf16->Des().Copy(mimeType); - TPtrC mimeType16(buf16->Des()); - CleanupStack::PopAndDestroy(); // buf16 - - CUpdateMusicCollection* updateMusicCollection = CUpdateMusicCollection::NewL(); - CleanupStack::PushL(updateMusicCollection); - if (updateMusicCollection->isSupported(mimeType16)) - { - updateMusicCollection->addToCollectionL(aFileName); - } - CleanupStack::PopAndDestroy(); // updateMusicCollection - - aAttachInfo->SetMimeTypeL( mimeType ); - - - FLOG(_L("[OBEXUTILS]\t RecogniseObjectsL() completed")); - } - -// ----------------------------------------------------------------------------- -// SaveMimeAndGetBioLC Saves MIME type and gets BIO database for that MIME -// Returns: BIO database if BIO message -// ----------------------------------------------------------------------------- -// -CBIODatabase* TObexUtilsMessageHandler::SaveMimeAndGetBioLC( - TFileName& aFileName, - RFs& aFsSess, // File session - CMsvAttachment* aAttachInfo, // Attachment information - TUid &aBioMsgId) // BIO message ID for data - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::SaveMimeAndGetBioLC()")); - - RecogniseObjectsL( aFileName, aAttachInfo ); - - // For attachments / BIO check. - CBIODatabase* bioDB = CBIODatabase::NewLC( aFsSess ); // 1st push - - // Run through the data objects, seeing if they can be accepted by BIO. - // Check if they are bio objects - - TBioMsgIdText bioMessageIdText; - SetBioDataTextL( bioMessageIdText, aAttachInfo->MimeType() ); - - // Remove any zero termination on mime type - // - TInt zeroTermination = bioMessageIdText.Locate( TChar(0) ); - - if ( zeroTermination != KErrNotFound ) - { - bioMessageIdText.SetLength( zeroTermination ); - } - - TInt bioMsgErr = bioDB->IsBioMessageL( EBioMsgIdIana, bioMessageIdText, NULL, aBioMsgId ); - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::SaveMimeAndGetBioLC() completed")); - if (bioMsgErr != KErrNone) - { - return NULL; - } - return bioDB; - } - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CreateInboxAttachmentL Creates inbox entry and attachment for it -// If this leaves, it means the entry and obex object have already been deleted. -// In this case aMsvIdParent has been set to zero. -// Returns: None. -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsMessageHandler::CreateInboxAttachmentL( - CObexBufObject* &aBufObject, // Obex object - const TUid aMtmId, // Mtm ID of the message - TMsvId &aMsvIdParent, // Message ID of the parent message entry - RFile &aFile) // File to the attachment - { - TMsvId msvId = 0; - TRAPD(retTrap, DoCreateInboxAttachmentL(aMtmId, msvId, aFile,KNullDesC)) - if (retTrap != KErrNone) - { - aMsvIdParent = 0; - if (msvId) - { - RemoveInboxEntriesL(aBufObject, msvId); - } - User::Leave(retTrap); - } - aMsvIdParent = msvId; - } - -// ----------------------------------------------------------------------------- -// CreateInboxAttachmentL Creates inbox entry and attachment for it -// If this leaves, it means the entry and obex object have already been deleted. -// In this case aMsvIdParent has been set to zero. -// Returns: None. -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsMessageHandler::CreateInboxAttachmentL( - CObexBufObject* &aBufObject, // Obex object - const TUid aMtmId, // Mtm ID of the message - TMsvId &aMsvIdParent, // Message ID of the parent message entry - RFile &aFile, // File to the attachment - const TDesC& aRemoteBluetoothName) // bluetooth name of remote device - { - TMsvId msvId = 0; - TRAPD(retTrap, DoCreateInboxAttachmentL(aMtmId, msvId, aFile,aRemoteBluetoothName)) - if (retTrap != KErrNone) - { - aMsvIdParent = 0; - if (msvId) - { - RemoveInboxEntriesL(aBufObject, msvId); - } - User::Leave(retTrap); - } - aMsvIdParent = msvId; - } - -// ----------------------------------------------------------------------------- -// DoCreateInboxAttachmentL Creates inbox entry and attachment for it (private) -// Returns: None. -// ----------------------------------------------------------------------------- -// -void TObexUtilsMessageHandler::DoCreateInboxAttachmentL( - const TUid aMtmId, // Mtm ID of the message - TMsvId &aMsvIdParent, // Message ID of the parent message entry - RFile &aFile, // File to the attachment - const TDesC& aRemoteBluetoothName) // bluetooth name of remote device - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::CreateInboxAttachmentL()")); - - CDummySessionObserver* sessionObs; - CMsvSession* msvSession; - CMsvEntry* inbox; - CreateMsvSessionLC(sessionObs, msvSession, inbox, KMsvGlobalInBoxIndexEntryId); - // 1st, 2nd, 3rd push - - TBuf toFrom; - TInt resourceId; - - if (aMtmId == KUidMsgTypeBt) - { - resourceId = R_BT_TO_FROM_IN_INBOX; - } - else - { - resourceId = R_IR_TO_FROM_IN_INBOX; - } - - TObexUtilsUiLayer::ReadResourceL( toFrom, resourceId ); - - TMsvEntry parentTEntry; - parentTEntry.iMtm = aMtmId; - parentTEntry.SetVisible(EFalse); // Make invisible.. - parentTEntry.SetUnread(ETrue); - - // ...and in preparation to make sure it gets cleaned up on errors. - // - parentTEntry.SetInPreparation(ETrue); - parentTEntry.iType = KUidMsvMessageEntry; - parentTEntry.iServiceId = KMsvUnknownServiceIndexEntryId; - // iDate & iSize will be set later - if ( aRemoteBluetoothName.Length() > 0 ) - { - parentTEntry.iDetails.Set(aRemoteBluetoothName); - } - else - { - parentTEntry.iDetails.Set(toFrom); - } - inbox->CreateL(parentTEntry); - - aMsvIdParent = parentTEntry.Id(); - - // Create attachment for the inbox entry - - TMsvEntry attachTEntry; - attachTEntry.iType = KUidMsvAttachmentEntry; - attachTEntry.iServiceId = KMsvUnknownServiceIndexEntryId; - attachTEntry.iMtm = aMtmId; - - CMsvEntry* parentEntry = msvSession->GetEntryL(aMsvIdParent); - CleanupStack::PushL(parentEntry); // 4th push - parentEntry->CreateL(attachTEntry); // create attachment as child of parent - - // create the v2 attachment, save RFile - - CMsvEntry* attachEntry = msvSession->GetEntryL(attachTEntry.Id()); - CleanupStack::PushL(attachEntry); // 5th push - - CMsvStore* store = attachEntry->EditStoreL(); - CleanupStack::PushL(store); // 6th push - CMsvAttachment* attachment = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); - CleanupStack::PushL(attachment); // 7th push - - store->AttachmentManagerExtensionsL().CreateAttachmentL(_L("Unnamed"), aFile, attachment); - CleanupStack::Pop(attachment); - store->CommitL(); - // CommitL() required here otherwise EditStoreL() will fail in SaveObjToInbox() - - CleanupStack::PopAndDestroy(6); - // store, attachEntry, parentEntry, inbox, msvSession, sessionObs - - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::CreateInboxAttachmentL() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsMessageHandler::RemoveInboxEntriesL -// ----------------------------------------------------------------------------- -EXPORT_C void TObexUtilsMessageHandler::RemoveInboxEntriesL( - CObexBufObject* &aBufObject, // Obex object - TMsvId aMsvIdParent) // Message ID of the parent message entry - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::RemoveInboxEntriesL()")); - - CDummySessionObserver* sessionObs; - CMsvSession* msvSession; - CMsvEntry* inbox; - CreateMsvSessionLC(sessionObs, msvSession, inbox, KMsvGlobalInBoxIndexEntryId); - // 1st, 2nd, 3rd push - - // Close file - - RemoveObexBuffer(aBufObject); - - // Delete parent and descendants - if ( aMsvIdParent ) - { - inbox->DeleteL(aMsvIdParent); - } - - CleanupStack::PopAndDestroy(3); - - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::RemoveInboxEntriesL() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsMessageHandler::SaveObjToInboxL -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsMessageHandler::SaveObjToInboxL( - CObexBufObject* /*aReceivedObject*/, const TDesC16& /*aPath*/, const TUid /*aMtmID*/ ) - { - } - -// ----------------------------------------------------------------------------- -// CObexUtilsMessageHandler::SaveObjToInboxL -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsMessageHandler::SaveObjToInboxL( - CObexBufObject* &aReceivedObject, // Obex object - RFile &aFile, - TMsvId aMsvIdParent) // Message ID of the parent message entry - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::SaveObjToInboxL()")); - - // Open session. - CDummySessionObserver* sessionObs; - CMsvSession* msvSession; - CreateMsvSessionLC(sessionObs, msvSession); // 1st, 2nd push - - CMsvEntry* parentEntry = msvSession->GetEntryL(aMsvIdParent); - CleanupStack::PushL( parentEntry ); // 3rd push - -#ifdef __BT_SAP - if(CSapVMessageParser::HandleMessageL(aReceivedObject, parentEntry->Entry().iMtm, - aFile, msvSession, GetCurrentTime())) - { - RemoveObexBuffer(aReceivedObject); - CMsvEntry* inbox = msvSession->GetEntryL( KMsvGlobalInBoxIndexEntryId ); - CleanupStack::PushL( inbox ); //4th push - inbox->DeleteL(aMsvIdParent); - // Close session etc. - CleanupStack::PopAndDestroy(4, sessionObs); // inbox, parentEntry, session, sessionObs - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::SaveObjToInboxL() completed")); - return; - } -#endif // __BT_SAP - CMsvEntry* attachEntry = msvSession->GetEntryL(((*parentEntry)[0]).Id()); - CleanupStack::PushL(attachEntry); // 4th push - - CMsvStore* store = attachEntry->EditStoreL(); - CleanupStack::PushL( store ); // 5th push - - // Collect obex received data before obex buffer deletion - - TReceivedData receivedData; - receivedData.bytesReceived = aReceivedObject->BytesReceived(); - receivedData.recTime = aReceivedObject->Time(); - - RFs& fsSess = msvSession->FileSession(); - receivedData.msgName = aReceivedObject->Name(); - MakeValidFileName(fsSess, receivedData.msgName); - - // Rename attachment for MIME type checking - - RemoveObexBuffer(aReceivedObject); - store->AttachmentManagerExtensionsL().RenameAttachmentL(0, receivedData.msgName); - RFile newFile = store->AttachmentManagerL().GetAttachmentFileL(0); - CleanupClosePushL(newFile); // 6th push - - // RenameAttachmentL() modified attachment info, so read it now - - CMsvAttachment* attachInfo = store->AttachmentManagerL().GetAttachmentInfoL(0); - CleanupStack::PushL( attachInfo ); // 7th push - - TUid bioMsgId; // SaveMimeAndGetBioLC modifies this - TFileName fileName; - newFile.FullName(fileName); - CBIODatabase* bioDB = SaveMimeAndGetBioLC( fileName, fsSess, attachInfo, bioMsgId ); - // 8th push - if (bioDB) // bio message - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::SaveObjToInboxL() BIO")); - StoreAndUpdateBioMessageL( bioDB, bioMsgId, parentEntry, newFile ); - FinaliseMessageL(parentEntry, receivedData, store, ETrue); - TMsvId attachId = attachEntry->EntryId(); - CleanupStack::PopAndDestroy(5); // bioDB, attachInfo, newFile (close), - // store, attachEntry - // PopAndDestroying here because open store locks the entry, - // it can be deleted only after destroying the store pointer - parentEntry->DeleteL(attachId); // invalidate unused attachment - CleanupStack::PopAndDestroy(3); // parentEntry, msvSession, sessionObs - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::SaveObjToInboxL() BIO completed")); - } - else // attachment message - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::SaveObjToInboxL() Attachment")); - CleanupStack::PopAndDestroy(); // bioDB - UpdateAttachmentInformationL(receivedData, attachEntry, attachInfo, store); - CleanupStack::Pop(attachInfo); // ownership taken by ModifyAttachmentInfoL() - FinaliseMessageL(parentEntry, receivedData, store, EFalse); - CleanupStack::PopAndDestroy(6); // newFile (close), store, attachEntry, - // parentEntry, msvSession, sessionObs - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::SaveObjToInboxL() Attachment completed")); - } - - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::SaveObjToInboxL() completed")); - } - - -// ----------------------------------------------------------------------------- -// GetCenRepKeyStringValueL Gets integer repository value -// Returns: Error -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt TObexUtilsMessageHandler::GetCenRepKeyStringValueL( - TUid aRepositoryUid, // aRepositoryUid Central repository's UID value - TUint32 aId, // Central repository's ID value - TDes& aVal) // Returned String - { - CRepository* storage = CRepository::NewLC( aRepositoryUid ); - TInt retval = storage->Get( aId, aVal ); - if (retval != KErrNone) - { - FLOG(_L("[OBEXUTILS]\t GetCenRepKeyStringValueL() Get failed")); - } - CleanupStack::PopAndDestroy( storage ); - return retval; - } - -// ----------------------------------------------------------------------------- -// CreateReceiveBufferL Creates an Obex receive buffer object and RFile object. -// Returns: Symbian error code -// ----------------------------------------------------------------------------- -// - -EXPORT_C TInt TObexUtilsMessageHandler::CreateReceiveBufferAndRFileL( - RFile& aFile, - const TDesC& aPath, - TFileName& aFullName, - CBufFlat* &aReceiveObject, - const TInt aBufSize ) - { - - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::CreateReceiveBufferAndRFileL()")); - - aReceiveObject = CBufFlat::NewL(aBufSize); - aReceiveObject->ResizeL(aBufSize); - - - RFs rfs; - User::LeaveIfError( rfs.Connect() ); - if ( !BaflUtils::FolderExists( rfs, aPath ) ) - { - User::LeaveIfError(rfs.MkDirAll(aPath)); - } - User::LeaveIfError( aFile.Temp( rfs, aPath, aFullName, EFileWrite) ); - // Set temp file hidden file. - // - TUint setAttMask(0); - TUint clearAttMask(0); - aFile.SetAtt(setAttMask | KEntryAttHidden, clearAttMask); - aFile.Flush(); - aFile.Close(); - - RFile logFile; - TFileName logFilePath; - TFileName cenRepFolder; - GetCenRepKeyStringValueL(KCRUidBluetoothEngine, KLCReceiveFolder,cenRepFolder); - - logFilePath.Zero(); - logFilePath.Append(PathInfo::PhoneMemoryRootPath()); - logFilePath.Append(cenRepFolder); - - if ( !BaflUtils::FolderExists(rfs , logFilePath) ) - { - User::LeaveIfError(rfs.MkDirAll(logFilePath)); - } - logFilePath.Append(_L("log.txt")); - if ( !BaflUtils::FileExists( rfs, logFilePath )) - { - logFile.Create(rfs, logFilePath, EFileWrite); - } - else - { - User::LeaveIfError(logFile.Open(rfs, logFilePath, EFileWrite)); - } - - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::CreateReceiveBufferAndRFileL() log.txt is created")); - TFileText ft; - ft.Set(logFile); - ft.Write(aFullName); // restore tempfilename in logfile - - // Set log file - logFile.SetAtt(setAttMask | KEntryAttHidden, clearAttMask); - logFile.Flush(); - logFile.Close(); - rfs.Close(); - - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::CreateReceiveBufferAndRFileL() completed")); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CObexUtilsMessageHandler::RemoveTemporaryRFileL -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsMessageHandler::RemoveTemporaryRFileL ( const TFileName& aFullName ) - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::RemoveTemporaryRFileL()")); - RFs rfs; - User::LeaveIfError(rfs.Connect()); - - TParse fileNameParser; - User::LeaveIfError(fileNameParser.Set(aFullName, NULL, NULL)); - - TFileName logFilePath; - TFileName cenRepFolder; - GetCenRepKeyStringValueL(KCRUidBluetoothEngine, KLCReceiveFolder,cenRepFolder); - logFilePath.Zero(); - logFilePath.Append(PathInfo::PhoneMemoryRootPath()); - logFilePath.Append(cenRepFolder); - logFilePath.Append(_L("log.txt")); - - if ( fileNameParser.Ext().Compare(_L(".$$$")) == 0 ) - { - // aFullName is a temp file name, we need to remove it. - rfs.Delete( aFullName ); - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::RemoveTemporaryRFileL() temp file is removed (bt off)")); - } - else if ( (aFullName.Length() == 0) && BaflUtils::FileExists(rfs, logFilePath)) - { - RFile logFile; - User::LeaveIfError(logFile.Open(rfs, logFilePath, EFileRead)); - TFileText ft; - ft.Set(logFile); - TFileName tempFileName; - ft.Read(tempFileName); // read tempfile name stored in logfile. - - if ( tempFileName.Length() > 0 ) - { - rfs.Delete(tempFileName); - } - logFile.Close(); - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::RemoveTemporaryRFileL() temp files are removed (reboot)")); - } - rfs.Delete( logFilePath ); - rfs.Close(); - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::RemoveTemporaryRFileL() completed")); - } -// ----------------------------------------------------------------------------- -// CObexUtilsMessageHandler::SaveFileToFileSystemL -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsMessageHandler::SaveFileToFileSystemL( - CObexBufObject* &aReceivedObject, - const TUid aMtmId, - TMsvId& aMsvIdParent, - TFileName& aFullName, - RFile& aFile, - const TDesC& aSenderBluetoothName) - { - - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::SaveFileToFileSystemL()")); - // Create inbox entry ( this was done in CreateAttachment() before ) - // - CDummySessionObserver* sessionObs; - CMsvSession* msvSession; - CMsvEntry* inbox; - CreateMsvSessionLC(sessionObs, msvSession, inbox, KMsvGlobalInBoxIndexEntryId); - // 1st, 2nd, 3rd push - - TBuf toFrom; - TInt resourceId; - - if (aMtmId == KUidMsgTypeBt) - { - resourceId = R_BT_TO_FROM_IN_INBOX; - } - else - { - resourceId = R_IR_TO_FROM_IN_INBOX; - } - // NOTE: toFrom will be updated to Bluetooth sender's name - // - TObexUtilsUiLayer::ReadResourceL( toFrom, resourceId ); // read the toForm ( will be updated to sender's bt name in the future ) - - TMsvEntry parentTEntry; - parentTEntry.iMtm = aMtmId; - parentTEntry.SetVisible(EFalse); // Make invisible.. - parentTEntry.SetUnread(ETrue); // Set msg to Unread - - // ...and in preparation to make sure it gets cleaned up on errors. - // - parentTEntry.SetInPreparation(ETrue); - parentTEntry.iType = KUidMsvMessageEntry; - parentTEntry.iServiceId = KMsvUnknownServiceIndexEntryId; - // iDate & iSize will be set later - if ( aSenderBluetoothName.Length() > 0 ) - { - parentTEntry.iDetails.Set(aSenderBluetoothName); - } - else - { - parentTEntry.iDetails.Set(toFrom); - } - inbox->CreateL(parentTEntry); - - aMsvIdParent = parentTEntry.Id(); - - // Create attachment for the inbox entry - - TMsvEntry attachTEntry; - attachTEntry.iType = KUidMsvAttachmentEntry; - attachTEntry.iServiceId = KMsvUnknownServiceIndexEntryId; - attachTEntry.iMtm = aMtmId; - - CMsvEntry* parentEntry = msvSession->GetEntryL(aMsvIdParent); - CleanupStack::PushL(parentEntry); // 4th push - parentEntry->CreateL(attachTEntry); // create attachment as child of parent - - // Check if message is sap message - // If we delete parent entry in sap, we have to delete the RFile object ourself as well ) - // - RFs& fsSess = msvSession->FileSession(); - TFileName tempFullName; - aFile.FullName(tempFullName); - -#ifdef __BT_SAP - if(CSapVMessageParser::HandleMessageL(aReceivedObject, parentEntry->Entry().iMtm, - aFile, msvSession, GetCurrentTime())) - { - RemoveObexBuffer(aReceivedObject); - CMsvEntry* inbox = msvSession->GetEntryL( KMsvGlobalInBoxIndexEntryId ); - CleanupStack::PushL( inbox ); //5th push - inbox->DeleteL(aMsvIdParent); - fsSess.Delete(tempFullName); // we have to use fullname to delete the file object in file system - // Close session etc. - CleanupStack::PopAndDestroy(5, sessionObs); // inbox, parentEntry, session, sessionObs - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::SaveFileToFileSystemL() completed")); - return; - } -#endif // __BT_SAP - - // Collect obex received data before obex buffer deletion - TReceivedData receivedData; - receivedData.bytesReceived = aReceivedObject->BytesReceived(); - receivedData.recTime = aReceivedObject->Time(); - receivedData.msgName = aReceivedObject->Name(); - - TFileName filename; - TParse parse; - parse.Set(aFullName, NULL, NULL); - filename.Copy(receivedData.msgName); - FixExtremeLongFileName(filename, parse.DriveAndPath()); - MakeValidFileName( fsSess, filename); - RemoveObexBuffer(aReceivedObject); - - // We set file to visible before renaming - // so that photo/music app can scan the media files we recevie. - // - // Set file back to visible - // - TUint setAttMask(0); - TUint clearAttMask(0); - User::LeaveIfError(aFile.Open(fsSess,tempFullName,EFileWrite|EFileShareReadersOrWriters)); - User::LeaveIfError(aFile.SetAtt(setAttMask , clearAttMask | KEntryAttHidden)); - aFile.Close(); - - - // Move file to the actual drive and directory - // as well rename the file with the correct file name instead of temporary name - // tempFullName will be updated in RenameFileL() - TInt error = RenameFileL(tempFullName, filename, parse.DriveAndPath(), fsSess); - - if ( error != KErrNone ) - { - fsSess.Delete(tempFullName); // If rename fails, we remove the temp RFile object. - } - aFullName = tempFullName; // assign new full Name back to aFullName,which goes back to caller - - CleanupStack::PopAndDestroy(4); // parentEntry, inbox, msvSession, sessionObs - - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::SaveFileToFileSystemL() completed")); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsMessageHandler::AddEntryToInboxL -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsMessageHandler::AddEntryToInboxL( - TMsvId& aMsvIdParent, - TFileName& aFullName) - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::AddEntryToInboxL() ")); - - CDummySessionObserver* sessionObs; - CMsvSession* msvSession; - CreateMsvSessionLC(sessionObs, msvSession); - // 1st, 2nd push - - CMsvEntry* parentEntry = msvSession->GetEntryL(aMsvIdParent); - CleanupStack::PushL(parentEntry); // 3th push - - CMsvEntry* attachEntry = msvSession->GetEntryL(((*parentEntry)[0]).Id()); - CleanupStack::PushL(attachEntry); // 4th push - - CMsvStore* store = attachEntry->EditStoreL(); - CleanupStack::PushL( store ); // 5th push - - CObexutilsEntryhandler* entryHandler = CObexutilsEntryhandler::NewL(); - CleanupStack::PushL(entryHandler); // 6th push - - CMsvAttachment* attachInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvLinkedFile); - CleanupStack::PushL(attachInfo); // 7th push - - // Create attachment Info - // - RFs& fsSess = msvSession->FileSession(); - - TParse fileNameParser; - User::LeaveIfError(fileNameParser.Set(aFullName, NULL, NULL)); - attachInfo->SetAttachmentNameL( fileNameParser.FullName()); - - TEntry fileEntry; - User::LeaveIfError(fsSess.Entry( fileNameParser.FullName(), fileEntry) ); - attachInfo->SetSize(fileEntry.iSize); - - // check if it's the bio message - - TUid bioMsgId; // SaveMimeAndGetBioLC modifies this - CBIODatabase* bioDB = SaveMimeAndGetBioLC( aFullName, fsSess, attachInfo, bioMsgId ); - // 8th push - if (bioDB) // bio message - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::AddEntryToInboxL() BIO")); - - RFile file; - User::LeaveIfError(file.Open(fsSess,aFullName,EFileRead|EFileShareReadersOrWriters)); - TReceivedData receivedData; - receivedData.bytesReceived = fileEntry.iSize; - receivedData.recTime = fileEntry.iModified; - receivedData.msgName = fileNameParser.Name(); - - StoreAndUpdateBioMessageL( bioDB, bioMsgId, parentEntry, file ); - FinaliseMessageL(parentEntry, receivedData, store, ETrue); - TMsvId attachId = attachEntry->EntryId(); - file.Close(); - fsSess.Delete(aFullName); - CleanupStack::PopAndDestroy(5); // bioDB, attachInfo, linkHandler, - // store, attachEntry - - // PopAndDestroying here because open store locks the entry, - // it can be deleted only after destroying the store pointer - parentEntry->DeleteL(attachId); // invalidate unused attachment - CleanupStack::PopAndDestroy(3); // parentEntry, msvSession, sessionObs - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::AddEntryToInboxL() BIO completed")); - } - else - { - - CleanupStack::PopAndDestroy(); // bioDB - // Add entry to Inbox - entryHandler->AddEntryAttachment(aFullName, attachInfo, store); - CleanupStack::Pop(attachInfo); // attachInfo, Pass ownership to store - CleanupStack::PopAndDestroy(entryHandler); // entryHandler - FinaliseMessageL(parentEntry, store,fileEntry, fileNameParser); - CleanupStack::PopAndDestroy(5); // linkHandler, attachInfo, store, attachEntry, - // parentEntry, msvSession, sessionObs - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::AddEntryToInboxL() completed ")); - } - } - -// ----------------------------------------------------------------------------- -// CObexUtilsMessageHandler::AddEntryToInboxL -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsMessageHandler::AddEntryToInboxL( - TMsvId& aMsvIdParent, - TFileName& aFullName, - RArray* aMsvIdArray) - { - AddEntryToInboxL(aMsvIdParent, aFullName); - aMsvIdArray->Append(aMsvIdParent); - } - -// ----------------------------------------------------------------------------- -// CObexUtilsMessageHandler::UpdateEntryAttachmentL -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsMessageHandler::UpdateEntryAttachmentL ( - TFileName& aFullName, - CMsvEntry* aParentEntry) - { - - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::UpdateEntryAttachmentL() ")); - CDummySessionObserver* sessionObs; - CMsvSession* msvSession; - CreateMsvSessionLC(sessionObs, msvSession); - // 1st, 2nd push - - CMsvEntry* attachEntry = msvSession->GetEntryL(((*aParentEntry)[0]).Id()); - CleanupStack::PushL(attachEntry); // 3th push - - CMsvStore* store = attachEntry->EditStoreL(); - CleanupStack::PushL( store ); // 4th push - - CObexutilsEntryhandler* entryHandler = CObexutilsEntryhandler::NewL(); - CleanupStack::PushL(entryHandler); // 5th push - - // Note: - // Because setFilePath() in CMsvAttachment is not implementated by Symbian yet, - // we have to delete the original attachment and add another new one to fix the broken link. - // - // remove the old attachment first. - // - store->AttachmentManagerExtensionsL().RemoveAttachmentL(0); - - // Create a new attachment. - // - - CMsvAttachment* attachInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvLinkedFile); - CleanupStack::PushL(attachInfo); // 6th push - - // Get mime type - // - RecogniseObjectsL(aFullName, attachInfo); - - RFs& fsSess = msvSession->FileSession(); - - TParse fileNameParser; - User::LeaveIfError(fileNameParser.Set(aFullName, NULL, NULL)); - attachInfo->SetAttachmentNameL(fileNameParser.NameAndExt()); - TEntry fileEntry; - User::LeaveIfError(fsSess.Entry( fileNameParser.FullName(), fileEntry) ); - attachInfo->SetSize(fileEntry.iSize); - - entryHandler->AddEntryAttachment(aFullName,attachInfo, store); - CleanupStack::Pop(attachInfo); // attachInfo, Pass ownership to store - CleanupStack::PopAndDestroy(entryHandler); // entryHandler - FinaliseMessageL(aParentEntry, store,fileEntry, fileNameParser); - CleanupStack::PopAndDestroy(4); // store, - // attachEntry, msvSession, sessionObs - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::UpdateEntryAttachmentL() completed ")); - - } - - -// Common methods - -// ----------------------------------------------------------------------------- -// ConstructRichTextLC Handles rich text initialisation. -// Returns: CRichText* A pointer to the rich text. -// ----------------------------------------------------------------------------- -// -CRichText* TObexUtilsMessageHandler::ConstructRichTextLC() - { - FLOG(_L("[OBEXUTILS]\t ConstructRichTextLC()")); - - CParaFormatLayer* richParaFormatLayer = CParaFormatLayer::NewL(); - CleanupStack::PushL( richParaFormatLayer ); - - CCharFormatLayer* richCharFormatLayer = CCharFormatLayer::NewL(); - CleanupStack::PushL( richCharFormatLayer ); - CRichText* richText = CRichText::NewL( richParaFormatLayer, - richCharFormatLayer ); - CleanupStack::PushL(richText); - - FLOG(_L("[OBEXUTILS]\t ConstructRichTextLC() completed")); - - return richText; - } - -// ----------------------------------------------------------------------------- -// MakeValidFileName Rename the given filename to a valid filename. -// Removes invalid characters from a filename; if no characters left, filename -// is set to R_NAME_FOR_INVALID_FILE -// Returns: None. -// ----------------------------------------------------------------------------- -// -void TObexUtilsMessageHandler::MakeValidFileName( - RFs& aFileSession, // A reference to file server session. - TDes& aFileName ) // The filename to modify. - { - FLOG(_L("[OBEXUTILS]\t MakeValidFileName()")); - - TParse fileParse; - fileParse.Set(aFileName, NULL, NULL); - - TBool nameempty = ETrue; - if (fileParse.NameOrExtPresent()) - { - aFileName = fileParse.NameAndExt(); - nameempty=EFalse; - TText badChar; - TInt nameLength = aFileName.Length(); - - while ( !aFileSession.IsValidName(aFileName, badChar) ) - { - // Locate and delete all instances of the bad char - FOREVER - { - TInt index = aFileName.Locate(TChar(badChar)); - nameLength--; - if (index == KErrNotFound) - { - break; - } - aFileName.Delete(index,1); - } - if ( nameLength <= 0 ) - { - break; - } - } - } - - // Did we delete all the characters? If so then we must have some filename - if ( aFileName.Length() == 0 || nameempty ) - { - TInt resourceId = R_NAME_FOR_INVALID_FILE; - TRAPD( retVal, TObexUtilsUiLayer::ReadResourceL( aFileName, resourceId ) ); - if (retVal != KErrNone) - { - FLOG(_L("TObexUtilsMessageHandler::MakeValidFileName failed.")); - } - } - - FLOG(_L("[OBEXUTILS]\t MakeValidFileName() completed")); - } - -// ----------------------------------------------------------------------------- -// TObexUtilsMessageHandler::CreateOutboxEntryL -// ----------------------------------------------------------------------------- -// -EXPORT_C TMsvId TObexUtilsMessageHandler::CreateOutboxEntryL( - const TUid& aMtm, // Message type id - const TInt& aResourceID ) // Resource id for the message entry text - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::CreateOutboxEntryL()")); - - CDummySessionObserver* sessionObs; - CMsvSession* msvSession; - CMsvEntry* outBoxEntry; - CreateMsvSessionLC(sessionObs, msvSession, outBoxEntry, KMsvGlobalOutBoxIndexEntryId); - // 1st, 2nd, 3rd push - - TBuf toFrom; - TObexUtilsUiLayer::ReadResourceL( toFrom, aResourceID ); - - // Message entry fields - TMsvEntry newTEntry; - newTEntry.SetVisible( ETrue ); // Make visible - newTEntry.SetInPreparation( ETrue ); // and in preparation to make sure gets cleaned up on errors. - newTEntry.iDetails.Set( toFrom ); // To/From field on Outbox - newTEntry.SetSendingState( KMsvSendStateSending ); - newTEntry.iType = KUidMsvMessageEntry; - newTEntry.iMtm = aMtm; // message type id - newTEntry.iServiceId = KMsvGlobalOutBoxIndexEntryId; - outBoxEntry->CreateL( newTEntry ); - - CleanupStack::PopAndDestroy(3); //outBoxEntry, msvSession, sessionObs - return newTEntry.Id(); - } - -// ----------------------------------------------------------------------------- -// TObexUtilsMessageHandler::DeleteOutboxEntryL -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsMessageHandler::DeleteOutboxEntryL( const TMsvId& aMessageServerIndex ) - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::DeleteOutboxEntryL()")); - - CDummySessionObserver* sessionObs; - CMsvSession* msvSession; - CMsvEntry* outBoxEntry; - CreateMsvSessionLC(sessionObs, msvSession, outBoxEntry, KMsvGlobalOutBoxIndexEntryId); - // 1st, 2nd, 3rd push - - outBoxEntry->DeleteL( aMessageServerIndex ); - - CleanupStack::PopAndDestroy(3); //outBoxEntry, msvSession, sessionObs - } - -// ----------------------------------------------------------------------------- -// TObexUtilsMessageHandler::GetFileSystemStatus -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt TObexUtilsMessageHandler::GetFileSystemStatus() - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::GetFileSystemStatus()")); - - /** - * Free space level of FFS file system (drive C:) - * The integer value may be: - * 0: Free space OK - * -1: Free space at or below warning level - * -2: Free space at or below critical level - */ - - TInt status = KErrNone; - TInt retVal = KErrNone; - - retVal = GetPubSubKeyIntValue(KPSUidUikon, KUikFFSFreeLevel, status); - if ( ( retVal == KErrNone ) && ( status == KFFSBelowCritical ) ) - { - retVal = KErrDiskFull; - } - - FTRACE(FPrint(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::GetFileSystemStatus completed with %d."), retVal)); - return retVal; - } - -// ----------------------------------------------------------------------------- -// TObexUtilsMessageHandler::GetMmcFileSystemStatus -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt TObexUtilsMessageHandler::GetMmcFileSystemStatus() - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::GetMmcFileSystemStatus()")); - - /** - * Free space level of FFS file system (MMC) - * The integer value may be: - * 0: Free space OK - * -1: Free space at or below warning level - * -2: Free space at or below critical level - */ - - TInt retVal = KErrNone; - TInt status = KErrNone; - - retVal = GetPubSubKeyIntValue(KPSUidUikon, KUikMmcFFSFreeLevel, status); - if ( ( retVal == KErrNone ) && ( status == KFFSBelowCritical ) ) - { - retVal = KErrDiskFull; - } - - FTRACE(FPrint(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::GetMmcFileSystemStatus completed with %d."), retVal)); - return retVal; - } - -// ----------------------------------------------------------------------------- -// TObexUtilsMessageHandler::GetMessageCentreDriveL -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt TObexUtilsMessageHandler::GetMessageCentreDriveL() - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::GetMessageCentreDriveL()")); - - CDummySessionObserver* sessionObs; - CMsvSession* msvSession; - CreateMsvSessionLC(sessionObs, msvSession); // 1st, 2nd push - - TDriveUnit driveUnit = msvSession->CurrentDriveL(); - CleanupStack::PopAndDestroy(2); // msvSession, sessionObs - - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::GetMessageCentreDriveL() Completed")); - return driveUnit; - } - -// ----------------------------------------------------------------------------- -// TObexUtilsMessageHandler::CreateDefaultMtmServiceL -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsMessageHandler::CreateDefaultMtmServiceL(TUid aMtm) - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::CreateDefaultMtmServiceL()")); - - CDummySessionObserver* sessionObs; - CMsvSession* msvSession; - CMsvEntry* root; - CreateMsvSessionLC(sessionObs, msvSession, root, KMsvRootIndexEntryId); - // 1st, 2nd, 3rd push - - TMsvSelectionOrdering msvSelectionOrdering = root->SortType(); - msvSelectionOrdering.SetShowInvisibleEntries( ETrue ); - root->SetSortTypeL( msvSelectionOrdering ); - - CMsvEntrySelection* sel = root->ChildrenWithMtmL( aMtm ); - CleanupStack::PushL( sel ); // 4th push - if (sel->Count() == 0) - { - TMsvEntry serviceEntry; - serviceEntry.iMtm = aMtm; - serviceEntry.iType = KUidMsvServiceEntry; - serviceEntry.SetVisible(EFalse); - serviceEntry.SetReadOnly(ETrue); - serviceEntry.SetInPreparation(EFalse); - root->CreateL(serviceEntry); - } - CleanupStack::PopAndDestroy(4); // sel, root, msvSession, sessionObs - - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::CreateDefaultMtmServiceL() Completed")); - } - -// ----------------------------------------------------------------------------- -// GetCenRepKeyIntValue Gets integer value for a specified CenRep key -// Returns: CenRep key's value -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt TObexUtilsMessageHandler::GetPubSubKeyIntValue( - TUid aCategory, // Category of the key - TUint aKey, // PUBSUB key - TInt& value) // Returned value - { - TInt retVal; - RProperty property; - retVal = property.Attach(aCategory, aKey); - if ( retVal == KErrNone ) - { - retVal = property.Get(value); - if (retVal != KErrNone) - { - FLOG(_L("[OBEXUTILS]\t GetPubSubKeyIntValue() Get failed for CenRep key")); - } - } - else - { - FLOG(_L("[OBEXUTILS]\t GetPubSubKeyIntValue() Attach failed for CenRep key")); - } - property.Close(); - return retVal; - } - -// ----------------------------------------------------------------------------- -// SetBioDataTextL Converts message type to bio message id. -// Returns: None. -// ----------------------------------------------------------------------------- -// -void TObexUtilsMessageHandler::SetBioDataTextL( - TBioMsgIdText& aText, // A bio message id text. - const TDesC8& aType ) // The type of the content. - { - FLOG(_L("[OBEXUTILS]\t SetBioDataTextL()")); - - HBufC16* unicode = CnvUtfConverter::ConvertToUnicodeFromUtf8L( aType ); - CleanupStack::PushL( unicode ); - - if (unicode->Length() > KMaxBioIdText ) - { - User::Leave( KErrOverflow ); - } - - aText = unicode->Des(); - CleanupStack::PopAndDestroy( unicode ); - - FLOG(_L("[OBEXUTILS]\t SetBioDataTextL() completed")); - } - -// ----------------------------------------------------------------------------- -// SetDetailsLC Converts message type to unicode. -// Returns: None. -// ----------------------------------------------------------------------------- -// -void TObexUtilsMessageHandler::SetDetailsLC( - TPtrC& aDetails, // A message text. - const TDesC8& aType ) // The type of the content. - { - FLOG(_L("[OBEXUTILS]\t SetDetailsLC()")); - - HBufC16* unicode = CnvUtfConverter::ConvertToUnicodeFromUtf8L( aType ); - CleanupStack::PushL( unicode ); - aDetails.Set(unicode->Des()); - - FLOG(_L("[OBEXUTILS]\t SetDetailsLC() completed")); - } - -//------------------------------------------------------------------------------- -// Rename a file and move file if needed -// Return: None. -//------------------------------------------------------------------------------- -// -TInt TObexUtilsMessageHandler::RenameFileL( - TFileName& aFileName, - TFileName& aNewFileName, - const TDesC& aNewPath, - RFs& aFileSession) - { - - // We move the file to the final location - // - CFileMan* fileMan= CFileMan::NewL(aFileSession); - CleanupStack::PushL(fileMan); - TPtrC tmpNewPath; - TParse fileParse; - fileParse.Set(aFileName, NULL, NULL); - - TInt error = fileMan->Move(aFileName,aNewPath,CFileMan::ERecurse ); - - // if error while moving to new location, keep file in old location and change file name - if (error != KErrNone) - { - tmpNewPath.Set (fileParse.DriveAndPath()); - } - else - { - tmpNewPath.Set (aNewPath); - } - - CleanupStack::PopAndDestroy(fileMan); - - TFileName tempFile; - tempFile.Append(tmpNewPath); - tempFile.Append(fileParse.NameAndExt()); - aFileName = tempFile; - - // check the duplicated file name. if so, we renamed in a different way. - TInt segmentNum = 0; - TBuf<64> segmentString; - - TFileName newFullName; - newFullName.Zero(); - newFullName.Append(tmpNewPath); - newFullName.Append(aNewFileName); - - aFileSession.SetSessionPath(tmpNewPath); - - while ( BaflUtils::FileExists(aFileSession, newFullName) ) - { - segmentNum++; - User::LeaveIfError( RenameFileWithSegmentNumL(aNewFileName, segmentNum, segmentString) ); - newFullName.Zero(); - newFullName.Append(tmpNewPath); - newFullName.Append(aNewFileName); - } - // rename the file. - // - error = aFileSession.Rename(aFileName, newFullName); - - aFileName = newFullName; - - return error; - } - -//------------------------------------------------------------------------------- -// Rename a file by adding a additional segment string -// Return: None. -//------------------------------------------------------------------------------- -// -TInt TObexUtilsMessageHandler::RenameFileWithSegmentNumL( - TDes &aFileName, // name for the file - TInt aSegmentNum, // segment number - TDes &aSegmentString) // segment String with parenthesis - { - - FLOG(_L("[OBEXUTILS]\t RenameFileWithSegmentNumL()")); - - const char KDot = '.'; - const char KLeftParenthesis = '('; - const char KRightParenthesis = ')'; - - // Convert Integer to String - // - TBuf<64> buf; - buf.Zero(); - _LIT(KNum, "%d" ); - buf.AppendFormat(KNum, aSegmentNum); - - // Rules to modify the duplicated filenames. - // case 1: No extention in filename, we append aSegmentString directly. - // case 2: Filename with extention, we insert aSegmentString right before dot (.) - // case 3: Filename with aSegmentString is still duplicated, - // we remove the old aSegmentString from aFileName and add a new one and add a new aSegmentString. - - TInt posOfDot = aFileName.LocateReverse(KDot); - - if ( aSegmentNum > 1 ) // filename with aSegementString is still duplicated - { - // In case the original file name contains the same string as our aSegmentString - // eg 1 with ext. original filename is file(1).txt, after renaming, it is changed to file(1)(1).txt. - // eg 2 without ext. original filename is file(1), after renaming, it is changed to file(1)(1). - TInt posDeleteStarts = posOfDot == KErrNotFound ? - aFileName.Length() - aSegmentString.Length() : - posOfDot - aSegmentString.Length(); - - aFileName.Delete(posDeleteStarts, aSegmentString.Length()); - } - - // Construct (New) aSegmentString - aSegmentString.Zero(); - aSegmentString.Append(KLeftParenthesis); - aSegmentString.Append(buf); - aSegmentString.Append(KRightParenthesis); - - // - // If the length of new filename will be larger than KMaxFileName, we remove few chars from the end of aFilename - // in order to add aSegmentString without panic. - // - if ( KMaxFileName < (aFileName.Length() + aSegmentString.Length())) - { - aFileName.Delete(KMaxFileName - aSegmentString.Length(), KMaxFileName - aFileName.Length()); - } - - posOfDot = aFileName.LocateReverse(KDot); - if ( posOfDot == KErrNotFound ) - { - // aFileName has no extension - // we append the modification to aFileName - // - aFileName.Append(aSegmentString); - } - else - { - // Dot (.) is found, we insert the modifications before dot. - // - aFileName.Insert(posOfDot,aSegmentString); - - } - - FLOG(_L("[OBEXUTILS]\t RenameFileWithSegmentNumL() completed")); - return KErrNone; - } - -//------------------------------------------------------------------------------- -// Shorten an extreme long file name -// Return: None. -//------------------------------------------------------------------------------- -// -void TObexUtilsMessageHandler::FixExtremeLongFileName(TFileName& aExtremeLongFileName, const TDesC& aDriveAndPath) - { - FLOG( _L( "[OBEXUTILS]\t FixExtremeLongFileName() ") ); - const char KDot = '.'; - TInt combinedLength = aExtremeLongFileName.Length() + aDriveAndPath.Length(); - - if ( combinedLength > aExtremeLongFileName.MaxLength() ) - { - FLOG( _L( "[OBEXUTILS]\t FixExtremeLongFileName: combinedLenght > aExtremeLongFileName.MaxLength()\t") ); - //KDefaultFileExtensionSeparator - TFileName tempFileName; - TInt dotPos = aExtremeLongFileName.LocateReverse( KDot ); - TInt overLap = combinedLength - aExtremeLongFileName.MaxLength() + KRenameOffSet; - - if ( dotPos > 0 ) - { - tempFileName.Copy( aExtremeLongFileName.Left( dotPos - overLap ) ); - tempFileName.Append( aExtremeLongFileName.Right( aExtremeLongFileName.Length() - dotPos ) ); - } - else - { - tempFileName.Copy( aExtremeLongFileName.Left(aExtremeLongFileName.Length() - overLap ) ); - } - aExtremeLongFileName.Copy( tempFileName ); - } - FLOG( _L( "[OBEXUTILS]\t FixExtremeLongFileName() completed") ); - } - -// End of File - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/src/obexutilsopaquedata.cpp --- a/localconnectivityservice/obexserviceman/utils/src/obexutilsopaquedata.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/* -* Copyright (c) 2002 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: -* -*/ - - -// INCLUDE FILES -#include "obexutilsopaquedata.h" - -// ================= MEMBER FUNCTIONS ======================= -EXPORT_C CObexUtilsOpaqueData::CObexUtilsOpaqueData(const TDesC8& aDes):iData(aDes) - { - } - - -// ----------------------------------------------------------------------------- -// GetString -// Get string from current location. Return error code if invalid string format. -// ----------------------------------------------------------------------------- -EXPORT_C TInt CObexUtilsOpaqueData::GetString(TBuf8 &aString) - { - // reset the output string - aString.Zero(); - - if (iData.Eos()) - return KErrNotFound ; - TChar c; - TInt ret; - while(c=iData.Get()) - { - if(c=='\\') - { - switch(iData.Peek()) - { - case 'x': - case 'X': - // parse hex number - TUint8 val; - iData.Inc(); - ret=iData.Val(val,EHex); - if(ret == KErrNone) - aString.Append(val); - else - return ret; - break; - case '|': - iData.Inc(); - aString.Append('|'); - break; - case '\\': - iData.Inc(); - aString.Append('\\'); - break; - default: - // if not a decimal number, then bad format - TInt8 dval; - ret=iData.Val(dval); - if(ret == KErrNone) - aString.Append(dval); - else - return ret; - } - } - else if(c=='|') - { - if(iData.Peek()=='|') - { - // delimiter "||" found, end of the string - iData.Inc(); - break; - } - else - aString.Append(c); - } - else - aString.Append(c); - } - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// GetNumber -// Get number from current location. Return error code if invalid number format. -// ----------------------------------------------------------------------------- -EXPORT_C TInt CObexUtilsOpaqueData::GetNumber(TUint &aNumber) - { - if (iData.Eos()) - return KErrNotFound ; - - // skip dilimiter - if(iData.Peek()=='|') - { - iData.Inc(); - if(iData.Peek()=='|') - iData.Inc(); - else - return KErrNotFound ; - } - - if(iData.Peek()=='0') - { - iData.Inc(); - if(iData.Peek()=='x' || iData.Peek()=='X') - { - iData.Inc(); - return iData.Val(aNumber,EHex); - } - else - { - iData.UnGet(); - return iData.Val(aNumber,EOctal); - } - } - else - { - return iData.Val(aNumber); - } - } - -// ----------------------------------------------------------------------------- -// IsString -// Peek if next entry is string by looking for a '\'. -// ----------------------------------------------------------------------------- -EXPORT_C TBool CObexUtilsOpaqueData::IsString() - { - return iData.Peek()=='\\'; - } - diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/src/obexutilspropertynotifier.cpp --- a/localconnectivityservice/obexserviceman/utils/src/obexutilspropertynotifier.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* -* Copyright (c) 2004 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: Declares disk status watcher class for ObexUtils. -* -*/ - - -// INCLUDE FILES - -#include "obexutilspropertynotifier.h" -#include "obexutilsdebug.h" - -// ================= MEMBER FUNCTIONS ======================= - - -EXPORT_C CObexUtilsPropertyNotifier* CObexUtilsPropertyNotifier::NewL( - MObexUtilsPropertyNotifyHandler* aHandler, - TMemoryPropertyCheckType aCheckType ) - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsPropertyNotifier::NewL()")); - CObexUtilsPropertyNotifier* self=new(ELeave) CObexUtilsPropertyNotifier(aHandler, aCheckType); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - FLOG(_L("[OBEXUTILS]\t CObexUtilsPropertyNotifier::NewL() completed")); - return self; - } - -// --------------------------------------------------------- -// CObexUtilsPropertyNotifier::CObexUtilsPropertyNotifier -// C++ default constructor can NOT contain any code, that -// might leave. -// --------------------------------------------------------- -// -CObexUtilsPropertyNotifier::CObexUtilsPropertyNotifier( - MObexUtilsPropertyNotifyHandler* aHandler, - TMemoryPropertyCheckType aCheckType ) - : CActive( EPriorityNormal ), iHandler ( aHandler ), iCheckType ( aCheckType ) - { - CActiveScheduler::Add(this); - FLOG(_L("[OBEXUTILS]\t CObexUtilsPropertyNotifier::CObexUtilsPropertyNotifier() completed")); - } - -// --------------------------------------------------------- -// Destructor. -// --------------------------------------------------------- -// -CObexUtilsPropertyNotifier::~CObexUtilsPropertyNotifier() - { - Cancel(); - iProperty.Close(); - FLOG(_L("[OBEXUTILS]\t CObexUtilsPropertyNotifier::~CObexUtilsPropertyNotifier() completed")); - } - -// --------------------------------------------------------- -// CObexUtilsPropertyNotifier::ConstructL -// --------------------------------------------------------- -// -void CObexUtilsPropertyNotifier::ConstructL() - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsPropertyNotifier::ConstructL()")); - if (iCheckType == ECheckPhoneMemory) - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsPropertyNotifier::ConstructL() Phone")); - User::LeaveIfError(iProperty.Attach(KPSUidUikon,KUikFFSFreeLevel)); - } - else - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsPropertyNotifier::ConstructL() MMC")); - User::LeaveIfError(iProperty.Attach(KPSUidUikon,KUikMmcFFSFreeLevel)); - } - Subscribe(); - FLOG(_L("[OBEXUTILS]\t CObexUtilsPropertyNotifier::ConstructL() completed")); - } - -// --------------------------------------------------------- -// CObexUtilsPropertyNotifier::Subscribe -// --------------------------------------------------------- -// -void CObexUtilsPropertyNotifier::Subscribe() - { - iProperty.Subscribe(iStatus); - SetActive(); - FLOG(_L("[OBEXUTILS]\t CObexUtilsPropertyNotifier::Subscribe() completed")); - } - -// --------------------------------------------------------- -// CObexUtilsPropertyNotifier::DoCancel -// --------------------------------------------------------- -// -void CObexUtilsPropertyNotifier::DoCancel() - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsPropertyNotifier::DoCancel()")); - iProperty.Cancel(); - } - -// --------------------------------------------------------- -// CObexUtilsPropertyNotifier::RunL -// --------------------------------------------------------- -// -void CObexUtilsPropertyNotifier::RunL() - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsPropertyNotifier::RunL()")); - - Subscribe(); - - TInt memorystatus; - if ((iProperty.Get(memorystatus)!=KErrNotFound) && (memorystatus!=0)) - { - FLOG(_L("[OBEXUTILS]\t CObexUtilsPropertyNotifier::RunL() notify")); - TRAPD(retTrap, iHandler->HandleNotifyL( iCheckType )); - retTrap = retTrap; - FLOG(_L("[OBEXUTILS]\t CObexUtilsPropertyNotifier::RunL() notify completed")); - } - FLOG(_L("[OBEXUTILS]\t CObexUtilsPropertyNotifier::RunL() completed")); - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/src/obexutilsuilayer.cpp --- a/localconnectivityservice/obexserviceman/utils/src/obexutilsuilayer.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,615 +0,0 @@ -/* -* Copyright (c) 2002 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: -* -*/ - - -// INCLUDE FILES -#include "obexutilsuilayer.h" -#include "obexutilslaunchwaiter.h" -#include "obexutilsdebug.h" - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -// Launching file manager related header files -#include // The AIW service handler -#include -#include -#include // Used to launch file manager in embedded mode. -#include //for checking backup status - -//Constants -const TInt KFileManagerUID3 = 0x101F84EB; /// File Manager application UID3 -const TInt KUiNumberOfZoomStates = 2; // second for the mask -const TInt KSortNumMax = 2; -const TInt KNfcUnreadIconIndex = 10; -const TInt KNfcReadIconIndex = 8; - - -// ============================ MEMBER FUNCTIONS =============================== - - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::LaunchEditorApplicationOperationL -// ----------------------------------------------------------------------------- -// -EXPORT_C CMsvOperation* TObexUtilsUiLayer::LaunchEditorApplicationOperationL( - CMsvSession& aMsvSession, - CMsvEntry* aMessage, - TRequestStatus& aObserverRequestStatus ) - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsUiLayer::LaunchEditorApplicationOperationL()")); - CObexUtilsLaunchWaiter* waiterOperation = CObexUtilsLaunchWaiter::NewL( - aMsvSession, - aMessage, - aObserverRequestStatus ); - - return waiterOperation; - } - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::LaunchEditorApplication -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt TObexUtilsUiLayer::LaunchEditorApplicationL( CMsvEntry* /*aMessage*/, - CMsvSession& /*aSession*/ ) - { - // Obsolete - return KErrNotSupported; - } - - -// ----------------------------------------------------------------------------- -// CObexUtilsMessageHandler::LaunchFileManager -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsUiLayer::LaunchFileManagerL( - TDesC& aPath, - TInt aSortMethod, - TBool isEmbeddedMode ) - { - if ( isEmbeddedMode ) - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::LaunchFileManager() Embedded mode")); - - CAiwGenericParamList* inParams = CAiwGenericParamList::NewLC(); - inParams->AppendL(TAiwGenericParam( EGenericParamDir, TAiwVariant( aPath ) ) ); - inParams->AppendL(TAiwGenericParam( EGenericParamDir, TAiwVariant( aSortMethod ) ) ); - - CAknLaunchAppService* launchService = CAknLaunchAppService::NewL(TUid::Uid( KFileManagerUID3 ), // Use File Manager app UID directly - NULL, - inParams ); - CleanupStack::PopAndDestroy( inParams ); - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::LaunchFileManager() Embedded mode completed ")); - } - else - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::LaunchFileManager() ")); - TApaAppInfo appInfo; - RApaLsSession apaLsSession; - User::LeaveIfError( apaLsSession.Connect() ); - CleanupClosePushL( apaLsSession ); - User::LeaveIfError( apaLsSession.GetAppInfo( appInfo, TUid::Uid( KFileManagerUID3 ) ) ); // Use File Manager app UID directly - CApaCommandLine* apaCmdLine = CApaCommandLine::NewLC(); - apaCmdLine->SetExecutableNameL( appInfo.iFullName ); - apaCmdLine->SetCommandL( EApaCommandOpen ); - apaCmdLine->SetDocumentNameL( aPath ); - TBuf8 sortMode; - sortMode.AppendNum( aSortMethod ); - apaCmdLine->SetTailEndL( sortMode ); - TThreadId dummy; - User::LeaveIfError( apaLsSession.StartApp( *apaCmdLine, dummy ) ); - CleanupStack::PopAndDestroy( apaCmdLine ); - CleanupStack::PopAndDestroy( &apaLsSession ); - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::LaunchFileManager() standalone mode completed ")); - } - } - -// ----------------------------------------------------------------------------- -// CObexUtilsMessageHandler::LaunchEditorApplication -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsUiLayer::LaunchEditorApplicationL (TMsvId& aMsvIdParent) - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::LaunchEditorApplication() ")); - CDummySessionObserver* sessionObs = new( ELeave )CDummySessionObserver; - CleanupStack::PushL( sessionObs ); //1st push - CMsvSession* msvSession = CMsvSession::OpenSyncL( *sessionObs ); - CleanupStack::PushL( msvSession ); //2nd push - - // 1st, 2nd push? - CMsvEntry* parentEntry = msvSession->GetEntryL(aMsvIdParent); - CleanupStack::PushL(parentEntry); // 3th push - - TRequestStatus status = KRequestPending; - CObexUtilsLaunchWaiter* waiterOperation = CObexUtilsLaunchWaiter::NewL( - *msvSession, - parentEntry, - status); - CleanupStack::PopAndDestroy(3); // parentEntry, sessionObs, msvSession - - FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::LaunchEditorApplication() completed ")); - } - - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::ShowErrorNoteL -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsUiLayer::ShowErrorNoteL( const TInt& aResourceID ) - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsUiLayer::ShowErrorNoteL()")); - - TBuf textdata; - ReadResourceL( textdata, aResourceID ); - - CAknErrorNote* note = new( ELeave )CAknErrorNote( ETrue ); - CleanupStack::PushL( note ); - PrepareDialogExecuteL( aResourceID, note ); - CleanupStack::Pop( note ); - note->ExecuteLD( textdata ); - - FLOG(_L("[OBEXUTILS]\t TObexUtilsUiLayer::ShowErrorNoteL() completed")); - - } - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::ShowInformationNoteL -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsUiLayer::ShowInformationNoteL( const TInt& aResourceID ) - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsUiLayer::ShowInformationNoteL()")); - - TBuf textdata; - ReadResourceL( textdata, aResourceID ); - - CAknInformationNote* note = new( ELeave )CAknInformationNote; - CleanupStack::PushL( note ); - PrepareDialogExecuteL( aResourceID, note ); - CleanupStack::Pop( note ); - note->ExecuteLD( textdata ); - - FLOG(_L("[OBEXUTILS]\t TObexUtilsUiLayer::ShowInformationNoteL() completed")); - } - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::ShowGlobalInformationNoteL -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsUiLayer::ShowGlobalConfirmationQueryL( const TInt& aResourceID ) - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsUiLayer::ShowGlobalInformationNoteL()")); - - TBuf textdata; - TRequestStatus status; - - ReadResourceL( textdata, aResourceID ); - CAknGlobalConfirmationQuery* note = CAknGlobalConfirmationQuery::NewLC(); - - status=KRequestPending; - note->ShowConfirmationQueryL(status, - textdata, - R_AVKON_SOFTKEYS_OK_EMPTY, - R_QGN_NOTE_ERROR_ANIM,KNullDesC, - 0, - 0, - CAknQueryDialog::EErrorTone - ); - User::WaitForRequest(status); - - CleanupStack::PopAndDestroy(note ); - - FLOG(_L("[OBEXUTILS]\t TObexUtilsUiLayer::ShowGlobalInformationNoteL() completed")); - } - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::ShowGlobalConfirmationQueryPlainL -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool TObexUtilsUiLayer::ShowGlobalConfirmationQueryPlainL( const TInt& aResourceID) - { - CAknGlobalConfirmationQuery* pQ = CAknGlobalConfirmationQuery::NewL(); - CleanupStack::PushL(pQ); - HBufC* stringholder = NULL; - stringholder = StringLoader::LoadLC( aResourceID); - TRequestStatus status = KRequestPending; - pQ->ShowConfirmationQueryL(status,*stringholder,R_AVKON_SOFTKEYS_YES_NO); - User::WaitForRequest(status); - CleanupStack::PopAndDestroy(2);//PQ and Stringholder - return (status.Int() == EAknSoftkeyYes); - } - - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::ShowGlobalFileOpenConfirmationQueryL -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool TObexUtilsUiLayer::ShowGlobalFileOpenConfirmationQueryL( const TInt& aResourceID, const TDesC& aFilePath) - { - // Read string from resource file - TFileName fileName; - fileName += KObexUtilsFileDrive; - fileName += KDC_RESOURCE_FILES_DIR; - fileName += KObexUtilsResourceFileName; - - CStringResourceReader* stringResourceReader = CStringResourceReader::NewL(fileName); - CleanupStack::PushL(stringResourceReader); - const TDesC& resString = stringResourceReader->ReadResourceString(aResourceID); - RBuf manipString; - manipString.Assign(resString.AllocL()); - CleanupStack::PopAndDestroy(stringResourceReader); - manipString.CleanupClosePushL(); - - // Remove bracket section - _LIT(KPrefix, "["); - _LIT(KSuffix, "]"); - TInt prefixPos = manipString.Find(KPrefix); - if (prefixPos != KErrNotFound) - { - TInt keyLength = 0; - TInt suffixPos = manipString.Find(KSuffix); - keyLength = (manipString.Mid(prefixPos)).Length()-(manipString.Mid(suffixPos)).Length()+1; - manipString.Delete(prefixPos, keyLength); - } - - // Replace "%U" string parameter with file path - _LIT(KString, "%U"); - TInt replacePos = manipString.Find(KString); - if( replacePos == KErrNotFound ) - { - User::Leave(KErrNotFound); - } - const TInt minRequiredSize = manipString.Length() - KString().Length() + aFilePath.Length(); - // ensure that the buffer is big enough (otherwise re-alloc) - if(manipString.MaxLength() < minRequiredSize) - { - manipString.ReAllocL(minRequiredSize); - } - manipString.Replace(replacePos, KString().Length(), aFilePath); - - // Initiate query dialog - TRequestStatus status = KRequestPending; - - CAknGlobalConfirmationQuery* pQ = CAknGlobalConfirmationQuery::NewL(); - CleanupStack::PushL(pQ); - pQ->ShowConfirmationQueryL(status, manipString, R_AVKON_SOFTKEYS_YES_NO); - User::WaitForRequest(status); - CleanupStack::PopAndDestroy(2, &manipString); // pQ, manipString - return (status.Int() == EAknSoftkeyYes); - } - - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::ReadResourceL -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsUiLayer::ReadResourceL( TDes& aBuf, const TInt& aResourceID ) - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsUiLayer::ReadResourceL()")); - - RFs fileSession; - CleanupClosePushL( fileSession ); - User::LeaveIfError( fileSession.Connect() ); - - TFileName fileName; - fileName += KObexUtilsFileDrive; - fileName += KDC_RESOURCE_FILES_DIR; - fileName += KObexUtilsResourceFileName; - - BaflUtils::NearestLanguageFile( fileSession, fileName ); - - RResourceFile resourcefile; - CleanupClosePushL( resourcefile ); - resourcefile.OpenL( fileSession, fileName ); - resourcefile.ConfirmSignatureL( 0 ); - HBufC8* readBuffer = resourcefile.AllocReadLC( aResourceID ); - - const TPtrC16 ptrReadBuffer( (TText16*) readBuffer->Ptr(),( readBuffer->Length() + 1 ) >> 1 ); - HBufC16* textBuffer=HBufC16::NewLC( ptrReadBuffer.Length() ); - *textBuffer = ptrReadBuffer; - aBuf.Copy( *textBuffer ); - - CleanupStack::PopAndDestroy( 4 ); // textBuffer, fileSession, resourcefile, readBuffer - - FLOG(_L("[OBEXUTILS]\t TObexUtilsUiLayer::ReadResourceL() completed")); - } - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::OperationNotSupported -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt TObexUtilsUiLayer::OperationNotSupported() - { - return R_EIK_TBUF_NOT_AVAILABLE; - } - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::ContextIcon -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt TObexUtilsUiLayer::ContextIcon( const TMsvEntry& aContext, TContextMedia aMedia ) - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsUiLayer::ContextIcon()")); - - TInt icon = 0; - if( aMedia == EBluetooth ) - { - if( aContext.Unread() ) - { - icon = EMbmMuiuQgn_prop_mce_bt_unread - EMbmMuiuQgn_prop_mce_ir_unread; - } - else - { - icon = EMbmMuiuQgn_prop_mce_bt_read - EMbmMuiuQgn_prop_mce_ir_unread; - } - } - else if( aMedia == EInfrared ) - { - if( aContext.Unread() ) - { - icon = 0; - } - else - { - icon = EMbmMuiuQgn_prop_mce_ir_read - EMbmMuiuQgn_prop_mce_ir_unread; - } - } - else if( aMedia == ENfc ) - { - if( aContext.Unread() ) - { - icon = KNfcUnreadIconIndex; - } - else - { - icon = KNfcReadIconIndex; - } - } - - FLOG(_L("[OBEXUTILS]\t TObexUtilsUiLayer::ContextIcon() completed")); - - return icon; - } - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::UpdateBitmaps -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsUiLayer::UpdateBitmaps( TUid aMedia, - TInt& aNumberOfZoomStates, TFileName& aBitmapFile, TInt& aStartBitmap, - TInt& aEndBitmap ) - { - FLOG(_L("[OBEXUTILS]\t TObexUtilsUiLayer::UpdateBitmaps()")); - - aBitmapFile = KCommonUiBitmapFile; - aNumberOfZoomStates = KUiNumberOfZoomStates; - if( aMedia == KUidMsgTypeBt ) - { - aStartBitmap = EMbmMuiuQgn_prop_mce_ir_unread; - aEndBitmap = EMbmMuiuQgn_prop_mce_bt_read_mask; - } - else - { - aStartBitmap = EMbmMuiuQgn_prop_mce_ir_unread; - aEndBitmap = EMbmMuiuQgn_prop_mce_bt_unread_mask; - } - - FLOG(_L("[OBEXUTILS]\t TObexUtilsUiLayer::UpdateBitmaps() completed")); - } - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::DeleteCBitMapArray -// ----------------------------------------------------------------------------- -// -inline void DeleteCBitMapArray(TAny* aPtr) - { - if (aPtr) - { - TObexUtilsUiLayer::CBitmapArray* array = - reinterpret_cast(aPtr); - array->ResetAndDestroy(); - delete array; - } - } - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::CreateAndAppendBitmapL -// ----------------------------------------------------------------------------- -// -void CreateAndAppendBitmapL(const TAknsItemID& aID, - const TInt aFileBitmapId, - CArrayPtr* aIconArrays ) - { - TFileName muiubmpFilename; - muiubmpFilename += KObexUtilsFileDrive; - muiubmpFilename += KDC_APP_BITMAP_DIR; - muiubmpFilename += KCommonUiBitmapFile; - - TObexUtilsUiLayer::CBitmapArray* array=NULL; - array=new(ELeave) CArrayPtrFlat(KUiNumberOfZoomStates); - CleanupStack::PushL(TCleanupItem(DeleteCBitMapArray, array)); - - CFbsBitmap* bitmap=0, *mask=0; - - //Can not use CreateIconLC since the order in which bitmap and mask are pushed into Cleanup Stack is undefined. - AknsUtils::CreateIconL( - AknsUtils::SkinInstance(), - aID, - bitmap, - mask, - muiubmpFilename, - aFileBitmapId, - aFileBitmapId+1); - CleanupStack::PushL(mask); - CleanupStack::PushL(bitmap); - - // warning: bmp is deleted by the array CleanupItem. Immediately Pop or risk double deletion upon a Leave. - array->AppendL(bitmap); - CleanupStack::Pop(bitmap); - - // warning: bmp is deleted by the array CleanupItem. Immediately Pop or risk double deletion upon a Leave. - array->AppendL(mask); - CleanupStack::Pop(mask); - - aIconArrays->AppendL(array); - CleanupStack::Pop(array); - } - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::CreateIconsL -// ----------------------------------------------------------------------------- -// -EXPORT_C void TObexUtilsUiLayer::CreateIconsL( - TUid aMedia, - CArrayPtr* aIconArrays ) - { - if( aMedia == KUidMsgTypeBt ) //Bluetooth - { - CreateAndAppendBitmapL( - KAknsIIDQgnPropMceIrUnread, - EMbmMuiuQgn_prop_mce_ir_unread, - aIconArrays); - CreateAndAppendBitmapL( - KAknsIIDQgnPropMceIrRead, - EMbmMuiuQgn_prop_mce_ir_read, - aIconArrays); - CreateAndAppendBitmapL( - KAknsIIDQgnPropMceBtUnread, - EMbmMuiuQgn_prop_mce_bt_unread, - aIconArrays); - CreateAndAppendBitmapL( - KAknsIIDQgnPropMceBtRead, - EMbmMuiuQgn_prop_mce_bt_read, - aIconArrays); - CreateAndAppendBitmapL( - KAknsIIDQgnPropMceNfcRead, - 0, - aIconArrays); - CreateAndAppendBitmapL( - KAknsIIDQgnPropMceNfcUnread, - 0, - aIconArrays); - } - else //Infrared - { - CreateAndAppendBitmapL( - KAknsIIDQgnPropMceIrUnread, - EMbmMuiuQgn_prop_mce_ir_unread, - aIconArrays); - CreateAndAppendBitmapL( - KAknsIIDQgnPropMceIrRead, - EMbmMuiuQgn_prop_mce_ir_read, - aIconArrays); - CreateAndAppendBitmapL( - KAknsIIDQgnPropMceBtUnread, - EMbmMuiuQgn_prop_mce_bt_unread, - aIconArrays); - } - } - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::IsBackupRunning -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool TObexUtilsUiLayer::IsBackupRunning() - { - const TUint32 KFileManagerBkupStatus = 0x00000001; - - TInt status = EFileManagerBkupStatusUnset; - TBool retValue = EFalse; - TInt err = RProperty::Get( TUid::Uid(KFileManagerUID3), KFileManagerBkupStatus, - status ); - if ( err == KErrNone ) - { - if ( status == EFileManagerBkupStatusBackup || - status == EFileManagerBkupStatusRestore ) - { - TSecureId fileManagerSecureId( KFileManagerUID3 ); - //only returning ETrue if backup process is still active - retValue = ProcessExists( fileManagerSecureId ); - } - } - - return retValue; - } - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::PrepareDialogExecuteL -// ----------------------------------------------------------------------------- -// -void TObexUtilsUiLayer::PrepareDialogExecuteL( const TInt& aResourceID, CEikDialog* aDialog ) - { - if (IsCoverDisplayL()) - { - TInt dialogIndex = - ((aResourceID & KResourceNumberMask) - KFirstResourceOffset) + KEnumStart; - aDialog->PublishDialogL( dialogIndex, KObexUtilsCategory ); - } - } - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::IsCoverDisplayL() -// ----------------------------------------------------------------------------- -// -TBool TObexUtilsUiLayer::IsCoverDisplayL() - { - TBool coverDisplay = EFalse; - FeatureManager::InitializeLibL(); - if ( FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ) ) - { - coverDisplay = ETrue; - } - FeatureManager::UnInitializeLib(); - return coverDisplay; - } - -// ----------------------------------------------------------------------------- -// TObexUtilsUiLayer::ProcessExists -// ----------------------------------------------------------------------------- -// -TBool TObexUtilsUiLayer::ProcessExists( const TSecureId& aSecureId ) - { - _LIT( KFindPattern, "*" ); - TFindProcess finder(KFindPattern); - TFullName processName; - while( finder.Next( processName ) == KErrNone ) - { - RProcess process; - if ( process.Open( processName ) == KErrNone ) - { - TSecureId processId( process.SecureId() ); - process.Close(); - if( processId == aSecureId ) - { - return ETrue; - } - } - } - return EFalse; - } -// End of File diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/src/updatemusiccollection.cpp --- a/localconnectivityservice/obexserviceman/utils/src/updatemusiccollection.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ -/* -* Copyright (c) 2009 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: update the music library after the musics are recieved using direct file saving -* -*/ - - - -//#include -#include - -#include "updatemusiccollection.h" -#include "obexutilsdebug.h" - -//#include -#include - -// ----------------------------------------------------------------------------- -// CUpdateMusicCollection::CUpdateMusicCollection -// Default constructor -// ----------------------------------------------------------------------------- -CUpdateMusicCollection::CUpdateMusicCollection() - { - } - -// ----------------------------------------------------------------------------- -// CUpdateMusicCollection::NewL -// ----------------------------------------------------------------------------- - -CUpdateMusicCollection* CUpdateMusicCollection::NewL() - { - CUpdateMusicCollection* self = new( ELeave ) CUpdateMusicCollection(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } -// ----------------------------------------------------------------------------- -// CUpdateMusicCollection::ConstructL -// Symbian OS default constructor can leave. -// ----------------------------------------------------------------------------- - -void CUpdateMusicCollection::ConstructL() - { - iCollectionHelper = - CMPXCollectionHelperFactory::NewCollectionHelperL(); - iPlaybackUtility = MMPXPlaybackUtility::NewL( KPbModeDefault, this ); - - } -// ----------------------------------------------------------------------------- -// CUpdateMusicCollection::addToCollectionL -// add the music to music library -// ----------------------------------------------------------------------------- - -void CUpdateMusicCollection::addToCollectionL(const TDesC& aFileName) - { - iCollectionHelper->AddL(aFileName,this); - } - -// ----------------------------------------------------------------------------- -// CUpdateMusicCollection::isSupported -// checks if the file is supported by music library -// ----------------------------------------------------------------------------- - TInt CUpdateMusicCollection::isSupported (const TDesC16& aPtr) - { - CDesCArray* SupportedMimeTypes = - iPlaybackUtility->SupportedMimeTypes(); - TInt pos = 0; - return SupportedMimeTypes->Find(aPtr,pos); - } - - // ----------------------------------------------------------------------------- - // CUpdateMusicCollection::HandleAddFileCompleteL - // callbackCalled back after a call to CCollectionHelper::AddL() to provide status - // ----------------------------------------------------------------------------- - void CUpdateMusicCollection::HandleAddFileCompleteL( TInt aErr ) - { - if(aErr == KErrNone) - { - FLOG(_L("[CUpdateMusicCollection]\t HandleAddFileCompleteL successful")); - } - else - { - FLOG(_L("[CUpdateMusicCollection]\t HandleAddFileCompleteL unsuccessful")); - } - - } - // ----------------------------------------------------------------------------- - // CUpdateMusicCollection::HandlePlaybackMessage - // ----------------------------------------------------------------------------- - -void CUpdateMusicCollection::HandlePlaybackMessage( CMPXMessage* aMessage,TInt aError ) - { - if ( aError == KErrNone && aMessage ) - { - FLOG(_L("[CUpdateMusicCollection]\t HandleAddFileCompleteL unsuccessful")); - } - } - -// ----------------------------------------------------------------------------- -// CUpdateMusicCollection::~CUpdateMusicCollection -// default destructor -// ----------------------------------------------------------------------------- - -CUpdateMusicCollection::~CUpdateMusicCollection() - { - if ( iCollectionHelper ) - { - iCollectionHelper->Close(); - } - if (iPlaybackUtility) - { - iPlaybackUtility->Close(); - } - } diff -r 3dcb815346df -r 4096754ee773 localconnectivityservice/obexserviceman/utils/src/vMessageHandler.cpp --- a/localconnectivityservice/obexserviceman/utils/src/vMessageHandler.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,612 +0,0 @@ -/* -* Copyright (c) 2004 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: -* -*/ - - -// INCLUDE FILES -#include "vMessageHandler.h" -#include "obexutilsuilayer.h" -#include "obexutilsdebug.h" -#include "etelmm.h" -#include -#include // KUidMsgTypeSMS -#include -#include -#include -#include - -#include - -// SMUT Unbranch -#include - - -// ================= MEMBER FUNCTIONS ======================= -TBool CSapVMessageParser::HandleMessageL(CObexBufObject* aReceivedObject, const TUid aMtmID, - RFile& aFile, CMsvSession* aMsvSession, TTime aTime) -{ - FLOG( _L( " CSapVMessageParser: HandleMessageL\t" ) ); - - CSapVMessageParser* parser = CSapVMessageParser::NewLC(); - TBool isVmsg=parser->ParseMessageL(aReceivedObject, aMtmID, aFile, aTime); - if(isVmsg) - { - parser->SaveSapMessageL(aMsvSession); - } - CleanupStack::PopAndDestroy(parser); - - FLOG( _L( " CSapVMessageParser: HandleMessageL: Done\t" ) ); - - return isVmsg; -} - -CSapVMessageParser* CSapVMessageParser::NewLC() -{ - CSapVMessageParser* self = new (ELeave) CSapVMessageParser(); - CleanupStack::PushL(self); - self->ConstructL(); - return self; -} - -void CSapVMessageParser::ConstructL() -{ -} - -// --------------------------------------------------------- -// Constructor -// --------------------------------------------------------- -// -CSapVMessageParser::CSapVMessageParser() -{ -} - -// --------------------------------------------------------- -// ParseMessageL -// Recognises and parses SAP VMessage. -// --------------------------------------------------------- -// -TBool CSapVMessageParser::ParseMessageL(CObexBufObject* aReceivedObject, const TUid aMtmID, - RFile& aFile, TTime aTime) -{ - FLOG( _L( " CSapVMessageParser: ParseMessageL\t" ) ); - - static const TInt KExpandSize = 16; - - iType=ESapVMessageUnknown; - - if( aMtmID != KUidMsgTypeBt || - !CheckMime(aReceivedObject->Type()) || - !CheckName(aReceivedObject->Name()) || - !IsSapConnectionActive()) - { - FLOG( _L( " CSapVMessageParser: ParseMessageL: Unknown\t" ) ); - return EFalse; - } - - CBufFlat* buffer = CBufFlat::NewL( KExpandSize ); - CleanupStack::PushL(buffer); // 1st push - - TInt fileLength; - User::LeaveIfError( aFile.Size( fileLength ) ); - - // Read the file into buffer - buffer->ResizeL( fileLength ); - TPtr8 temp = buffer->Ptr(0); - TInt pos = 0; - aFile.Seek(ESeekStart, pos); - User::LeaveIfError( aFile.Read( temp ) ); - - pos=0; - aFile.Seek(ESeekStart, pos); // rewind file - - SimpleParseL(temp); - - CleanupStack::PopAndDestroy(buffer); // -1 pop - - iTimeReceived=aTime; - if(aReceivedObject->Time()==TTime(0)) - { - iTimeOriginal = aTime; - } - else - { - iTimeOriginal = aReceivedObject->Time(); - } - - return (iType!=ESapVMessageUnknown); -} - -// --------------------------------------------------------- -// IsSapConnectionActive -// Recognises active SAP connection. -// --------------------------------------------------------- -// -TBool CSapVMessageParser::IsSapConnectionActive() -{ - FLOG( _L( " CSapVMessageParser: IsSapConnectionActive\t" ) ); - - TInt state=EBTSapNotConnected; - RProperty::Get(KPSUidBluetoothSapConnectionState, KBTSapConnectionState, state); - return state==EBTSapConnected; -} - - -// --------------------------------------------------------- -// CheckMime -// Check MIME type of vMessage. -// --------------------------------------------------------- -// -TBool CSapVMessageParser::CheckMime(const TDesC8& aType) -{ - FLOG( _L( " CSapVMessageParser: CheckMime\t" ) ); - - _LIT8(KMimeVmsg,"text/x-vmsg\x00"); - - return (aType.Compare(KMimeVmsg)==0); -} - - -// --------------------------------------------------------- -// CheckName -// Check object name of SAP vMessage. -// --------------------------------------------------------- -// -TBool CSapVMessageParser::CheckName(const TDesC& aName) -{ - FLOG( _L( " CSapVMessageParser: CheckName\t" ) ); - - _LIT(KNameVmsg, "sap_sms.vmg"); - - return (aName.Compare(KNameVmsg)==0); -} - -// --------------------------------------------------------- -// Address -// Returns address field of parsed message. -// --------------------------------------------------------- -// -const TDesC& CSapVMessageParser::Address() const -{ - if(iType==ESapVMessageTextSMS && iAddress) - { - return *iAddress; - } - else - { - return KNullDesC; - } -} - -// --------------------------------------------------------- -// Message -// Returns body text of parsed message. -// --------------------------------------------------------- -// -const TDesC& CSapVMessageParser::Message() const -{ - if(iType==ESapVMessageTextSMS && iMessage) - { - return *iMessage; - } - else - { - return KNullDesC; - } -} - -// --------------------------------------------------------- -// ~CSapVMessageParser -// Destructor. -// --------------------------------------------------------- -// -CSapVMessageParser::~CSapVMessageParser() -{ - FLOG( _L( " CSapVMessageParser: ~CSapVMessageParser\t" ) ); - - delete iAddress; - delete iMessage; -} - -static TBool Compare(const TDesC8& aData, TInt& aReadBytes, const TDesC8& aToken) -{ - if( (aData.Length() >= aReadBytes + aToken.Length()) && - (aData.Mid(aReadBytes, aToken.Length()).Compare(aToken)==0) ) - { - aReadBytes+=aToken.Length(); - return ETrue; - } - else - { - return EFalse; - } -} - -// --------------------------------------------------------- -// SimpleParseL -// Parses SAP VMessage. -// --------------------------------------------------------- -// -void CSapVMessageParser::SimpleParseL(const TDesC8& aData) -{ - FLOG( _L( " CSapVMessageParser: SimpleParseL\t" ) ); - - // SAP VMessage format definitions - _LIT8(KVmsgStatus, "BEGIN:VMSG\x0d\x0a" - "VERSION:1.1\x0d\x0a" - "X-IRMC-STATUS:"); - _LIT8(KVmsgBox, "\x0d\x0a" - "X-IRMC-TYPE:SMS\x0d\x0a" - "X-IRMC-BOX:"); - _LIT8(KVmsgVCard, "BEGIN:VCARD\x0d\x0a" - "VERSION:2.1\x0d\x0a"); - _LIT8(KVmsgName1, "N:"); - _LIT8(KVmsgName2, "N;ENCODING=8BIT;CHARSET=UTF-8:"); - _LIT8(KVmsgTel, "\x0d\x0a" - "TEL:"); - _LIT8(KVmsgVCardEnd,"\x0d\x0a" - "END:VCARD\x0d\x0a"); - _LIT8(KVmsgVEnv, "BEGIN:VENV\x0d\x0a"); - _LIT8(KVmsgVBody, "BEGIN:VBODY\x0d\x0a" - "X-SMS;TYPE=TEXT;ENCODING=8BIT;CHARSET=UTF-8:"); - _LIT8(KVmsgEnd, "\x0d\x0a" - "END:VBODY\x0d\x0a" - "END:VENV\x0d\x0a" - "END:VMSG\x0d\x0a"); - _LIT8(KVmsgUnread, "UNREAD"); - _LIT8(KVmsgRead, "READ"); - _LIT8(KVmsgInbox, "INBOX\x0d\x0a"); - _LIT8(KVmsgSentbox, "SENTBOX\x0d\x0a"); - _LIT8(KCrLf, "\x0d\x0a"); - - // Simple SAP VMessage parsing - TInt readBytes=0; - if( Compare(aData, readBytes, KVmsgStatus) && - aData.Right(KVmsgEnd().Length()).Compare(KVmsgEnd)==0 ) - { // The begin and end of the message are correct - if(Compare(aData, readBytes, KVmsgUnread)) - { // Status: Unread - iStatus=ESapVMessageStatusUnread; - } - else if(Compare(aData, readBytes, KVmsgRead)) - { // Status: Read or Sent - iStatus=ESapVMessageStatusRead; - } - else - { // Unknown status - return; - } - if( Compare(aData, readBytes, KVmsgBox) ) - { - if(iStatus==ESapVMessageStatusRead && Compare(aData, readBytes, KVmsgSentbox)) - { // Status: Sent - iStatus=ESapVMessageStatusSent; - if(!Compare(aData, readBytes, KVmsgVEnv)) - { - return; - } - } - else if(! Compare(aData, readBytes, KVmsgInbox) ) - { - return; - } - if( Compare(aData, readBytes, KVmsgVCard) && - ( Compare(aData, readBytes, KVmsgName1) || - Compare(aData, readBytes, KVmsgName2) ) ) - { // The begin of the message is correct - TInt beginOfName=readBytes; - TInt endOfName=aData.Find(KVmsgTel); - TInt endOfFrom=aData.Find(KVmsgVCardEnd); - readBytes=endOfFrom+KVmsgVCardEnd().Length(); - if(iStatus!=ESapVMessageStatusSent) - { - if(!Compare(aData, readBytes, KVmsgVEnv)) - { - return; - } - } - if(endOfFrom!=KErrNotFound && endOfName!=KErrNotFound && - endOfName0 && - name.Length() <= RMobilePhone::KMaxMobileTelNumberSize) - { - iAddress = CnvUtfConverter::ConvertToUnicodeFromUtf8L(name); - } - else - { - iAddress = HBufC::NewL(from.Length()); - iAddress->Des().Copy(from); - } - - TPtrC8 body = aData.Mid(beginOfBody, bodyLength); - iMessage = CnvUtfConverter::ConvertToUnicodeFromUtf8L(body); - - FLOG( _L( " CSapVMessageParser: SimpleParseL: SMS\t" ) ); - iType=ESapVMessageTextSMS; - } - } - } - } - } - } -} - -// --------------------------------------------------------- -// SaveSapMessageL -// Saves parsed VMessage. -// --------------------------------------------------------- -// -void CSapVMessageParser::SaveSapMessageL(CMsvSession* aMsvSession) -{ - FLOG( _L( " CSapVMessageParser: SaveSapMessageL\t" ) ); - - switch(iType) - { - case ESapVMessageTextSMS: - SaveSapSmsL(aMsvSession); - break; - - case ESapVMessageMMSNotificationInd: - SaveSapMmsL(aMsvSession); - break; - - default: // Discard message - break; - } -} - -// --------------------------------------------------------- -// SaveSapSmsL -// Saves parsed VMessage as SMS. -// --------------------------------------------------------- -// -void CSapVMessageParser::SaveSapSmsL(CMsvSession* aMsvSession) -{ - FLOG( _L( " CSapVMessageParser: SaveSapSmsL\t" ) ); - - CParaFormatLayer* richParaFormatLayer = CParaFormatLayer::NewL(); - CleanupStack::PushL(richParaFormatLayer); // 1st push - CCharFormatLayer* richCharFormatLayer = CCharFormatLayer::NewL(); - CleanupStack::PushL(richCharFormatLayer); // 2nd push - CRichText* - richText = CRichText::NewL(richParaFormatLayer,richCharFormatLayer); - CleanupStack::PushL(richText); // 3rd push - - richText->InsertL(0, Message()); - - if(iStatus==ESapVMessageStatusSent) - { - SaveSmsToSentL(aMsvSession, richText); - } - else - { - SaveSmsToInboxL(aMsvSession, richText); - } - - CleanupStack::PopAndDestroy(3, richParaFormatLayer); - - FLOG( _L( " CSapVMessageParser: SaveSapSmsL: Done\t" ) ); -} - -// --------------------------------------------------------- -// SaveSapMmsL -// Saves parsed VMessage as MMS notification. -// --------------------------------------------------------- -// -void CSapVMessageParser::SaveSapMmsL(CMsvSession* /*aMsvSession*/) const -{ - // This is not supported -} - -// --------------------------------------------------------- -// SaveSmsToInboxL -// Saves parsed VMessage to Inbox as SMS. -// --------------------------------------------------------- -// -void CSapVMessageParser::SaveSmsToInboxL(CMsvSession* aMsvSession, CRichText* aMessage) -{ - FLOG( _L( " CSapVMessageParser: SaveSmsToInboxL\t" ) ); - - CSmsHeader* header=CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *aMessage ); - CleanupStack::PushL(header); // 1st push - header->SetFromAddressL(Address()); - header->SetReplyPathProvided(EFalse); - - TMsvEntry newTEntry; - - newTEntry.iType = KUidMsvMessageEntry; - newTEntry.iMtm = KUidMsgTypeSMS; - newTEntry.SetComplete(EFalse); - newTEntry.SetFailed(EFalse); - newTEntry.SetOperation(EFalse); - newTEntry.SetMultipleRecipients(EFalse); - newTEntry.SetVisible(EFalse); // Make invisible - // and in preparation to make sure gets cleaned up on errors. - newTEntry.SetInPreparation(ETrue); - newTEntry.SetSendingState(KMsvSendStateNotApplicable); - newTEntry.iServiceId = KMsvLocalServiceIndexEntryId; - newTEntry.iSize = 0; - newTEntry.iDate = iTimeReceived; - header->Message().SetTime(iTimeOriginal); - ((CSmsDeliver*)&header->Message().SmsPDU())->SetServiceCenterTimeStamp(iTimeOriginal); - -// SMUT Unbranch - CSmsGetDetDescInterface* smsPlugin = CSmsGetDetDescInterface::NewL(); - CleanupStack::PushL( smsPlugin ); - - TBuf description; - smsPlugin->GetDescription( header->Message(), description ); - newTEntry.iDescription.Set(description); - TBuf details; - smsPlugin->GetDetails( aMsvSession->FileSession(), header->Message(), details ); - newTEntry.iDetails.Set(details); - - CleanupStack::PopAndDestroy( smsPlugin ); - - // Create new entry to inbox - CMsvEntry* inbox = aMsvSession->GetEntryL( KMsvGlobalInBoxIndexEntryId ); - CleanupStack::PushL( inbox ); - inbox->CreateL(newTEntry); - CleanupStack::PopAndDestroy(inbox); - - TMsvId newEntryId=newTEntry.Id(); - aMsvSession->CleanupEntryPushL(newEntryId); //2nd push - - // Get the created entry - CMsvEntry* newEntry = aMsvSession->GetEntryL(newEntryId); - CleanupStack::PushL(newEntry); // 3rd push - - // Store SMS message to the entry - CMsvStore* newMessageStore = newEntry->EditStoreL(); - CleanupStack::PushL(newMessageStore); // 4th push - header->StoreL(*newMessageStore); - newMessageStore->StoreBodyTextL(*aMessage); - newMessageStore->CommitL(); - - // Save the size & make visible - newTEntry = newEntry->Entry(); - newTEntry.iSize = newMessageStore->SizeL(); - - // Saved OK. Make the entry visible and flag it as complete. - newTEntry.SetVisible(ETrue); - newTEntry.SetInPreparation(EFalse); - newTEntry.SetUnread(iStatus==ESapVMessageStatusUnread); - newTEntry.SetNew(iStatus==ESapVMessageStatusRead); - newTEntry.SetComplete(ETrue); - newTEntry.SetReadOnly(ETrue); - newEntry->ChangeL(newTEntry); - - CleanupStack::PopAndDestroy(2, newEntry); - aMsvSession->CleanupEntryPop(); - CleanupStack::PopAndDestroy(header); - - FLOG( _L( " CSapVMessageParser: SaveSmsToInboxL: Done\t" ) ); -} - -// --------------------------------------------------------- -// SaveSmsToSentL -// Saves parsed VMessage to Sent folder as SMS. -// --------------------------------------------------------- -// -void CSapVMessageParser::SaveSmsToSentL(CMsvSession* aMsvSession, CRichText* aMessage) -{ - FLOG( _L( " CSapVMessageParser: SaveSmsToSentL\t" ) ); - - CSmsHeader* header = CSmsHeader::NewL( CSmsPDU::ESmsSubmit, *aMessage ); - CleanupStack::PushL( header ); - header->SetFromAddressL(Address()); - - TMsvEntry newTEntry; - newTEntry.iType = KUidMsvMessageEntry; - newTEntry.iMtm = KUidMsgTypeSMS; - newTEntry.SetComplete(EFalse); - newTEntry.SetFailed(EFalse); - newTEntry.SetOperation(EFalse); - newTEntry.SetMultipleRecipients(EFalse); - newTEntry.SetVisible(EFalse); // Make invisible - // and in preparation to make sure gets cleaned up on errors. - newTEntry.SetInPreparation(ETrue); - newTEntry.SetSendingState(KMsvSendStateSent); - newTEntry.iServiceId = KMsvUnknownServiceIndexEntryId; - newTEntry.iSize = 0; - newTEntry.iDate=iTimeReceived; - header->Message().SetTime(iTimeOriginal); - -// SMUT Unbranch - CSmsGetDetDescInterface* smsPlugin = CSmsGetDetDescInterface::NewL(); - CleanupStack::PushL( smsPlugin ); - - TBuf description; - smsPlugin->GetDescription( header->Message(), description ); - newTEntry.iDescription.Set(description); - TBuf details; - smsPlugin->GetDetails( aMsvSession->FileSession(), header->Message(), details ); - newTEntry.iDetails.Set(details); - - CleanupStack::PopAndDestroy( smsPlugin ); - - CSmsSettings* settings = CSmsSettings::NewLC(); - CSmsAccount* account = CSmsAccount::NewLC(); - account->LoadSettingsL(*settings); - CleanupStack::PopAndDestroy(account); - header->SetSmsSettingsL( *settings ); - TInt scindex = settings->DefaultServiceCenter(); - if ( scindex != KErrNotFound ) - { - header->SetServiceCenterAddressL( ( settings->GetServiceCenter( scindex ) ).Address() ); - } - CleanupStack::PopAndDestroy(settings); - - CSmsNumber* rcpt = CSmsNumber::NewL(); - CleanupStack::PushL( rcpt ); - rcpt->SetAddressL(Address()); - if(Address()!=details) - { - rcpt->SetNameL(details); - } - header->Recipients().ResetAndDestroy(); - header->Recipients().AppendL( rcpt ); - CleanupStack::Pop( rcpt ); - - // Create new entry to Sent folder - CMsvEntry* sentFldr = aMsvSession->GetEntryL( KMsvSentEntryId ); - CleanupStack::PushL( sentFldr ); - sentFldr->CreateL(newTEntry); - CleanupStack::PopAndDestroy(sentFldr); - - TMsvId newEntryId=newTEntry.Id(); - aMsvSession->CleanupEntryPushL(newEntryId); //2nd push - - // Get the created entry - CMsvEntry* newEntry = aMsvSession->GetEntryL(newEntryId); - CleanupStack::PushL(newEntry); // 3rd push - - // Store SMS message to the entry - CMsvStore* newMessageStore = newEntry->EditStoreL(); - CleanupStack::PushL(newMessageStore); // 4th push - header->StoreL(*newMessageStore); - newMessageStore->StoreBodyTextL(*aMessage); - newMessageStore->CommitL(); - - // Save the size & make visible - newTEntry = newEntry->Entry(); - newTEntry.iSize = newMessageStore->SizeL(); - - // Saved OK. Make the entry visible and flag it as complete. - newTEntry.SetVisible(ETrue); - newTEntry.SetInPreparation(EFalse); - newTEntry.SetComplete(ETrue); - newEntry->ChangeL(newTEntry); - - CleanupStack::PopAndDestroy(2, newEntry); - aMsvSession->CleanupEntryPop(); - CleanupStack::PopAndDestroy(header); - - FLOG( _L( " CSapVMessageParser: SaveSmsToSentL: Done\t" ) ); -} - -// End of File diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/dialup_connection_status_api/dialup_connection_status_api.metaxml --- a/shortlinkconn_plat/dialup_connection_status_api/dialup_connection_status_api.metaxml Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ - - - Dial-up Connection Status API - provides dial-up connection status info. - c++ - localconnectivityservice - - - - - - - - no - no - - diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/dialup_connection_status_api/group/bld.inf --- a/shortlinkconn_plat/dialup_connection_status_api/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +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: File that exports the files belonging to -: Dial-up Connection Status API -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -../inc/dundomainpskeys.h MW_LAYER_PLATFORM_EXPORT_PATH(dundomainpskeys.h) diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/dialup_connection_status_api/inc/dundomainpskeys.h --- a/shortlinkconn_plat/dialup_connection_status_api/inc/dundomainpskeys.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* Copyright (c) 2002-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: -* DUN Server P&S key definitions -* -*/ - - -#ifndef DUN_DOMAIN_PS_KEYS_H -#define DUN_DOMAIN_PS_KEYS_H - -/** -* PubSub Uid of dialup connection status -*/ -const TUid KPSUidDialupConnStatus = {0x0100387d}; // UID of DUN server - -/** -* Dialup connection status -* -* Possible integer values: -* 0 (EDunUndefined) Value is not set -* 1 (EDunInactive) Dun is inactive (no listening or active plugins) -* 2 (EDunActive) Dun is active (at least one active plugin) -*/ - -const TUint KDialupConnStatus = 0x00000001; - -// Enumeration for DUN connection status -enum TDialupConnStatus - { - EDialupUndefined, - EDialupInactive, - EDialupActive - }; - -#endif // DUN_DOMAIN_PS_KEYS_H diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/dun_secondary_display_notification_api/dun_secondary_display_notification_api.metaxml --- a/shortlinkconn_plat/dun_secondary_display_notification_api/dun_secondary_display_notification_api.metaxml Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ - - - DUN Secondary Display Notification API - defines message IDs for showing message on secondary display - c++ - localconnectivityservice - - - - - - - - no - no - - diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/dun_secondary_display_notification_api/group/bld.inf --- a/shortlinkconn_plat/dun_secondary_display_notification_api/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2007 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: File that exports the files belonging to -* DUN Secondary Display Notification API -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -../inc/secondarydisplay/dunsecondarydisplayapi.h MW_LAYER_PLATFORM_EXPORT_PATH(secondarydisplay/dunsecondarydisplayapi.h) diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/dun_secondary_display_notification_api/inc/secondarydisplay/dunsecondarydisplayapi.h --- a/shortlinkconn_plat/dun_secondary_display_notification_api/inc/secondarydisplay/dunsecondarydisplayapi.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2007 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: Contains dialog index for cover UI. -* -*/ - - -#ifndef DUNSECONDARYDISPLAYAPI_H -#define DUNSECONDARYDISPLAYAPI_H - -#include - -// Category (dunutils.dll) -const TUid KDunNoteCategory = { 0x101F6E2A }; - -enum TSecondaryDisplayDunDialogs - { - ECmdNone, - ECmdMaxNumber - }; - -#endif // DUNSECONDARYDISPLAYAPI_H diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/generic_hid_api/group/bld.inf --- a/shortlinkconn_plat/generic_hid_api/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +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: File that exports the files belonging to -: Generic HID API -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -../inc/hidcollection.h MW_LAYER_PLATFORM_EXPORT_PATH(hidcollection.h) -../inc/hidfield.h MW_LAYER_PLATFORM_EXPORT_PATH(hidfield.h) -../inc/hidgeneric.h MW_LAYER_PLATFORM_EXPORT_PATH(hidgeneric.h) -../inc/hidinterfaces.h MW_LAYER_PLATFORM_EXPORT_PATH(hidinterfaces.h) -../inc/hidreportroot.h MW_LAYER_PLATFORM_EXPORT_PATH(hidreportroot.h) -../inc/hidtranslate.h MW_LAYER_PLATFORM_EXPORT_PATH(hidtranslate.h) -../inc/hidvalues.h MW_LAYER_PLATFORM_EXPORT_PATH(hidvalues.h) -../inc/hiddriverpluginuid.h MW_LAYER_PLATFORM_EXPORT_PATH(hiddriverpluginuid.h) \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/generic_hid_api/inc/hidcollection.h --- a/shortlinkconn_plat/generic_hid_api/inc/hidcollection.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,272 +0,0 @@ -/* -* Copyright (c) 2005-2007 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: Declares main application class. -* -*/ - - -#ifndef C_COLLECTION_H -#define C_COLLECTION_H - -#include - -class CField; - - -/** - * Collection of HID report descriptor - * A CCollection represents an individual collection within a HID - * report descriptor. Each collection may have a number of associated - * report fields (CField objects) and a number of child collection - * objects. The collections within a HID report descriptor form a tree - * structure, with a CReportRoot collection at the root. The tree is - * generated by CParser. - * - * - * @lib generichid.lib - * @since S60 v5.0 - */ -class CCollection : public CBase - { - -public: - - /** - * An enumerations giving the possible types of collection, as - * given in "USB Device Class Definition for Human Interface - * Devices (HID)", Firmware Specification, Version 1.11, USB - * Implementers' Forum, June 2001. - * - * Note that a TUint32 is used for CCollection::iType, as it is - * possible to have a vendor defined collection type that isn't - * included in this list. - */ - enum TType - { - EPhysical = 0x00, //!< Physical (group of axes) - EApplication = 0x01, //!< Application (mouse,keyboard) - ELogical = 0x02, //!< Logical (interrelated data) - EReport = 0x03, //!< Report - ENamedArray = 0x04, //!< NamedArray - EUsageSwitch = 0x05, //!< UsageSwitch - EUsageModifier = 0x06 //!< UsageModifier - }; - - static CCollection* NewL(); - static CCollection* NewLC(); - - /** - * Destructor. - */ - virtual ~CCollection(); - - /** - * Get collection type - * - * @since S60 v5.0 - * @return The type for this collection item - */ - IMPORT_C TUint32 Type() const; - - /** - * Get usagepage - * - * @since S60 v5.0 - * @return The usage page for this collection - */ - IMPORT_C TInt UsagePage() const; - - /** - * Get usagepage - * - * @since S60 v5.0 - * @return The usage page for this collection - */ - IMPORT_C TInt Usage() const; - - /** - * Get number of collections - * - * @since S60 v5.0 - * @return The number of collections that have been created so far - */ - IMPORT_C TInt CollectionCount() const; - - /** - * Gets numbers of field stored in collection - * - * @since S60 v5.0 - * @return The number of fields stored in for the current collection - */ - IMPORT_C TInt FieldCount() const; - - /** - * Returns a pointer to a specific collection from the list of collections - * - * @since S60 v5.0 - * @param aIndex The index of the required collection - * @return The number of fields stored in for the current collection. - * NULL if there are no collection object at the secified index - */ - IMPORT_C const CCollection* CollectionByIndex(TInt aIndex) const; - - /** - * Returns a pointer to the field object at the given index within the field - * list - * - * @since S60 v5.0 - * @param aIndex The offset within the current field list - * @return A pointer to the specified field object - * NULL if there is no field object at the specified index - */ - IMPORT_C const CField* FieldByIndex(TInt aIndex) const; - - /** - * Check if collection type is physical - * - * @since S60 v5.0 - * @return true if physical - */ - IMPORT_C TBool IsPhysical() const; - - /** - * Check if collection type is application - * - * @since S60 v5.0 - * @return true if application - */ - IMPORT_C TBool IsApplication() const; - - /** - * Check if collection type is logical - * - * @since S60 v5.0 - * @return true if logical - */ - IMPORT_C TBool IsLogical() const; - - /** - * Check if collection type is report - * - * @since S60 v5.0 - * @return true if report - */ - IMPORT_C TBool IsReport() const; - - /** - * Check if collection type is name array - * - * @since S60 v5.0 - * @return true if named array - */ - IMPORT_C TBool IsNamedArray() const; - - /** - * Check if collection type is usage switch - * - * @since S60 v5.0 - * @return true if is usage switch - */ - IMPORT_C TBool IsUsageSwitch() const; - - /** - * Check if collection type is usage modifier - * - * @since S60 v5.0 - * @return true if usage modifier - */ - IMPORT_C TBool IsUsageModifier() const; - -public: - - /** - * Set Collection type - * - * @since S60 v5.0 - * @return None - */ - void SetType(TUint32 aType); - - /** - * Set usage page - * - * @since S60 v5.0 - * @return None - */ - void SetUsagePage(TInt aUsagePage); - - /** - * Set usage - * - * @since S60 v5.0 - * @return None - */ - void SetUsage(TInt aUsage); - - /** - * Called when a new collection object has been encountered in - * the report descriptor. This creates a new CCollection object - * and adds it to the current list - * - * @since S60 v5.0 - * @return None - */ - CCollection* AddCollectionL(); - - /** - * Called when a new field object has been encountered in the - * report descriptor. This creates a new field object and adds it - * the the current list - * - * @since S60 v5.0 - * @return A pointer to the new field object - */ - CField* AddFieldL(); - -protected: - - CCollection(); - void ConstructL(); - -private: - - /** - * Collection type - */ - TUint32 iType; - - /** - * Usage page - */ - TInt iUsagePage; - - /** - * Usage - */ - TInt iUsage; - - /** - * List of collections for the report descriptor - */ - RPointerArray iCollections; - - /** - * List of fields in the current collection - */ - RPointerArray iFields; - - }; - -#endif // C_COLLECTION_H - diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/generic_hid_api/inc/hiddriverpluginuid.h --- a/shortlinkconn_plat/generic_hid_api/inc/hiddriverpluginuid.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* -* Copyright (c) 2007 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: UID definitions. -* -*/ - - -#ifndef HIDDRIVERPLUGINUID_H -#define HIDDRIVERPLUGINUID_H - -#define DRIVER_PLUGIN_IF_UID 0x10201d26 - -#endif // __HIDUIDS_H__ diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/generic_hid_api/inc/hidfield.h --- a/shortlinkconn_plat/generic_hid_api/inc/hidfield.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,732 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: HID field descriptor definition -* -*/ - -#ifndef C_FIELD_H -#define C_FIELD_H - - -#include - - -const TInt KFieldAttributeConstant = 1<<0; //!< Data (0) or Constant (1) -const TInt KFieldAttributeVariable = 1<<1; //!< Array (0) or Variable (1) -const TInt KFieldAttributeRelative = 1<<2; //!< Absolute (0) or Relative (1) -const TInt KFieldAttributeWrap = 1<<3; //!< No wrap (0) or Wrap (1) -const TInt KFieldAttributeNonLinear = 1<<4; //!< Linear (0) or Non-linear (1) -const TInt KFieldAttributeNoPreferred = 1<<5; //!< Preferred state (0) or not (1) -const TInt KFieldAttributeNullState = 1<<6; //!< No null position (0) or null state (1) -const TInt KFieldAttributeVolatile = 1<<7; //!< Non-volatile (0) or volatile (1) -const TInt KFieldAttributeBufferedBytes = 1<<8; //!< Bit field (0) or buffered bytes (1) - -const TInt KSizeOfByte = 8; -/** - * HID report field presentation - * Represents an individual field in a HID report, ie. the attributes - * of an input, output or feature Main item defined in the HID report - * descriptor. - * - * The CField contains information such as the usage IDs sent in the - * the report, the type of the report (input, output or feature) and - * the logical range. - * - * - * @lib generichid.lib - * @since S60 v5.0 - */ -class CField : public CBase - { -public: - enum TType - { - EInput, //!< Input report - EOutput, //!< Output report - EFeature //!< Feature report - }; - - - -public: - static CField* NewL(); - static CField* NewLC(); - - /** - * Destructor. - */ - virtual ~CField(); - -public: - // Accessors: - - /** - * Set Report root - * - * @since S60 v5.0 - * @return None - */ - IMPORT_C TInt UsagePage() const; - - /** - * Return report id - * - * @since S60 v5.0 - * @return report id - */ - IMPORT_C TInt ReportId() const; - - /** - * Return offset - * - * @since S60 v5.0 - * @return offset - */ - IMPORT_C TInt Offset() const; - - /** - * Return size - * - * @since S60 v5.0 - * @return None - */ - IMPORT_C TInt Size() const; - - /** - * Return count - * - * @since S60 v5.0 - * @return count - */ - IMPORT_C TInt Count() const; - - /** - * Return logical minimium - * - * @since S60 v5.0 - * @return Logical minimium - */ - IMPORT_C TInt LogicalMin() const; - - /** - * Return logical maximum - * - * @since S60 v5.0 - * @return logical maximum - */ - IMPORT_C TInt LogicalMax() const; - - /** - * Return usage min - * - * @since S60 v5.0 - * @return None - */ - IMPORT_C TInt UsageMin() const; - - /** - * Return usage max - * - * @since S60 v5.0 - * @return usage max - */ - IMPORT_C TInt UsageMax() const; - - /** - * Return Physical minimum - * - * @since S60 v5.0 - * @return physical minimum - */ - IMPORT_C TInt PhysicalMin() const; - - /** - * Return Physical max - * - * @since S60 v5.0 - * @return return physical max - */ - IMPORT_C TInt PhysicalMax() const; - - /** - * Return unit - * - * @since S60 v5.0 - * @return Unit - */ - IMPORT_C TInt Unit() const; - - /** - * Return unit exponent - * - * @since S60 v5.0 - * @return unit exponent - */ - IMPORT_C TInt UnitExponent() const; - - /** - * Return Designator index - * - * @since S60 v5.0 - * @return Designator Index - */ - IMPORT_C TInt DesignatorIndex() const; - - /** - * Return designator minimium - * - * @since S60 v5.0 - * @return return designator index minimium - */ - IMPORT_C TInt DesignatorMin() const; - - /** - * Return designator maximium - * - * @since S60 v5.0 - * @return designator maximium - */ - IMPORT_C TInt DesignatorMax() const; - - /** - * Return string minimum - * - * @since S60 v5.0 - * @return None - */ - IMPORT_C TInt StringMin() const; - - /** - * Return string maximum - * - * @since S60 v5.0 - * @return string maximum - */ - IMPORT_C TInt StringMax() const; - - /** - * Return string index - * - * @since S60 v5.0 - * @return string index - */ - IMPORT_C TInt StringIndex() const; - - /** - * Return attributes - * - * @since S60 v5.0 - * @return attributes - */ - IMPORT_C TUint32 Attributes() const; - - /** - * Return type - * - * @since S60 v5.0 - * @return type - */ - IMPORT_C TType Type() const; - - /** - * Return variable status - * - * @since S60 v5.0 - * @return variable status - */ - IMPORT_C TBool IsVariable() const; - - /** - * Return array status - * - * @since S60 v5.0 - * @return arrau status - */ - IMPORT_C TBool IsArray() const; - - /** - * Return data status - * - * @since S60 v5.0 - * @return data status - */ - IMPORT_C TBool IsData() const; - - /** - * Return constant status - * - * @since S60 v5.0 - * @return constant status - */ - IMPORT_C TBool IsConstant() const; - - /** - * Return input status - * - * @since S60 v5.0 - * @return input status - */ - IMPORT_C TBool IsInput() const; - - /** - * Return output status - * - * @since S60 v5.0 - * @return None - */ - IMPORT_C TBool IsOutput() const; - - /** - * Return feature status - * - * @since S60 v5.0 - * @return feature status - */ - IMPORT_C TBool IsFeature() const; - - /** - * Check if reportid is in report - * - * @since S60 v5.0 - * @param aReportId report id - * @return true if reportid is in report - */ - IMPORT_C TBool IsInReport(TInt aReportId) const; - - /** - * Check if usage exsist - * - * @since S60 v5.0 - * @param aUsage Usage id - * @return None - */ - IMPORT_C TBool HasUsage(TInt aUsage) const; - - /** - * Return usage array - * - * @since S60 v5.0 - * @return usage array - */ - IMPORT_C TArray UsageArray() const; - - /** - * Return usage - * - * @since S60 v5.0 - * @param aIndex usage array index - * @return usage - */ - IMPORT_C TInt Usage(TInt aIndex) const; - - /** - * Return usage count - * - * @since S60 v5.0 - * @return usage count - */ - IMPORT_C TInt UsageCount() const; - - /** - * Return last usage - * - * @since S60 v5.0 - * @return last usage - */ - IMPORT_C TInt LastUsage() const; - - /** - * Set type - * - * @since S60 v5.0 - * @param aType type of field - * @return None - */ - IMPORT_C void SetType(const TType& aType); - - /** - * Add usage - * - * @since S60 v5.0 - * @param aUsage usage to be added - * @return None - */ - IMPORT_C void AddUsageL(TInt aUsage); - - /** - * Clear usage list - * - * @since S60 v5.0 - * @return None - */ - IMPORT_C void ClearUsageList(); - - /** - * Set usage page - * - * @since S60 v5.0 - * @param aUsagePage usagepage to be set - * @return None - */ - IMPORT_C void SetUsagePage(TInt aUsagePage); - - /** - * Set offset - * - * @since S60 v5.0 - * @param aOffset offset to be set - * @return None - */ - IMPORT_C void SetOffset(TInt aOffset); - - /** - * Set size - * - * @since S60 v5.0 - * @param aSize size to be set - * @return None - */ - IMPORT_C void SetSize(TInt aSize); - - /** - * Set count - * - * @since S60 v5.0 - * @param aCount Count to be set - * @return None - */ - IMPORT_C void SetCount(TInt aCount); - - /** - * Set logical minimium - * - * @since S60 v5.0 - * @param aMin Logical minimium to be set - * @return None - */ - IMPORT_C void SetLogicalMin(TInt aMin); - - /** - * Set logical maximum - * - * @since S60 v5.0 - * @param aMax logical maximum to be used - * @return None - */ - IMPORT_C void SetLogicalMax(TInt aMax); - - /** - * Set usage min - * - * @since S60 v5.0 - * @param aMin usage minimium to be set. - * @return None - */ - IMPORT_C void SetUsageMin(TInt aMin); - - /** - * Set usage maximum - * - * @since S60 v5.0 - * @param aMax usage max to be set - * @return None - */ - IMPORT_C void SetUsageMax(TInt aMax); - - /** - * Set Report ID - * - * @since S60 v5.0 - * @param aReportId report id to be set - * @return None - */ - IMPORT_C void SetReportId(TInt aReportId); - - /** - * Set attributes - * - * @since S60 v5.0 - * @param aAttributes attributes to be set - * @return None - */ - IMPORT_C void SetAttributes(TUint32 aAttributes); - - /** - * Set physical minimium - * - * @since S60 v5.0 - * @param aValue physical minimium value - * @return None - */ - IMPORT_C void SetPhysicalMin(TInt aValue); - - /** - * Set Physical maximum - * - * @since S60 v5.0 - * @param aValue physical maximum value - * @return None - */ - IMPORT_C void SetPhysicalMax(TInt aValue); - - /** - * Set unit value - * - * @since S60 v5.0 - * @param aValue unit value - * @return None - */ - IMPORT_C void SetUnit(TInt aValue); - - /** - * Set unit exponent - * - * @since S60 v5.0 - * @param aValue unit exponent valut to be set - * @return None - */ - IMPORT_C void SetUnitExponent(TInt aValue); - - /** - * Set Designator index - * - * @since S60 v5.0 - * @param aValue Designator index value - * @return None - */ - IMPORT_C void SetDesignatorIndex(TInt aValue); - - /** - * Set designator minimium - * - * @since S60 v5.0 - * @param aValue designator minimum value - * @return None - */ - IMPORT_C void SetDesignatorMin(TInt aValue); - - /** - * Set designator maximium value - * - * @since S60 v5.0 - * @param aValue designator maximium value - * @return None - */ - IMPORT_C void SetDesignatorMax(TInt aValue); - - /** - * Set string minimium value - * - * @since S60 v5.0 - * @param aValue string minimium value - * @return None - */ - IMPORT_C void SetStringMin(TInt aValue); - - /** - * Set string maximum value - * - * @since S60 v5.0 - * @param aValue string maximum value to be set - * @return None - */ - IMPORT_C void SetStringMax(TInt aValue); - - /** - * Set string index - * - * @since S60 v5.0 - * @param aValue string index - * @return None - */ - IMPORT_C void SetStringIndex(TInt aValue); - - /** - * Set Logical range - * - * @since S60 v5.0 - * @param aMin logical range minimium value - * @param aMax logical range maximum value - * @return None - */ - IMPORT_C void SetLogicalRange(TInt aMin, TInt aMax); - - /** - * Set Usage range - * - * @since S60 v5.0 - * @param aMin usage range minimium value - * @param aMax usage range maximum value - * @return None - */ - IMPORT_C void SetUsageRange(TInt aMin, TInt aMax); - - /** - * Set Physical range - * - * @since S60 v5.0 - * @param aMin physical range minimium value - * @param aMax physical range maximum value - * @return None - */ - IMPORT_C void SetPhysicalRange(TInt aMin, TInt aMax); - - /** - * Set string range - * - * @since S60 v5.0 - * @param aMin string range minimium value - * @param aMax string range maximum value - * @return None - */ - IMPORT_C void SetStringRange(TInt aMin, TInt aMax); - - /** - * Set designator range - * - * @since S60 v5.0 - * @param aMin designator range minimium value - * @param aMax designator range maximum value - * @return None - */ - IMPORT_C void SetDesignatorRange(TInt aMin, TInt aMax); - -private: - CField(); - - - -private: - - /** - * Input, output or feature report - */ - TType iType; - - // For a detailed description of the use of the following members, - // see "USB Device Class Definition for Human Interface Devices - // (HID)", Firmware Specification, Version 1.11, USB Implementers' - // Forum, June 2001. - - /** - * The usage page this field is associated with (G) - */ - TInt iUsagePage; - - /** - * ID for the HID report containing this field (G) - */ - TInt iReportId; - - /** - * Field offset (in bits) from start of report - */ - TInt iPos; - - /** - * Bit size of each item in the current field (G) - */ - TInt iSize; - - /** - * Number of items in the report field (G) - */ - TInt iCount; - - /** - * Minimum extent value in logical units (G) - */ - TInt iLogicalMin; - - /** - * Maximum extent value in logical units (G) - */ - TInt iLogicalMax; - - /** - * Starting usage associated with array / bitmap (L) - */ - TInt iUsageMin; - - /** - * Ending usage associated with array / bitmap (L)L) - */ - TInt iUsageMax; - - /** - * Unit value (G) - */ - TInt iUnit; - - /** - * Value of the unit exponent in base 10 (G) - */ - TInt iUnitExponent; - - /** - * Body part used for a control (L) - */ - TInt iDesignatorIndex; - - /** - * String associated with a control (L) - */ - TInt iStringIndex; - - /** - * Minimum physical extent for a variable item (G) - */ - TInt iPhysicalMin; - - /** - * Maximum physical extent for a variable item (G) - */ - TInt iPhysicalMax; - - /** - * First string index for a group of strings (L) - */ - TInt iStringMin; - - /** - * Last string index for a group of strings (L) - */ - TInt iStringMax; - - /** - * Starting designator index (L) - */ - TInt iDesignatorMin; - - /** - * Ending designator index (L) - */ - TInt iDesignatorMax; - - /** - * Flags associated with a main item (e.g. "array") - */ - TUint32 iAttributes; - - /** - * The usage indexes associated with this field (G) - */ - RArray iUsageList; - - // (G) = Global item - // (L) = Local item - }; - -#endif - diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/generic_hid_api/inc/hidgeneric.h --- a/shortlinkconn_plat/generic_hid_api/inc/hidgeneric.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,339 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: Declares main application class. -* -*/ - - -#ifndef C_GENERICHID_H -#define C_GENERICHID_H - -#include - -class CDriverListItem; -class TElement; -class CParser; -class CReportRoot; -class CConnectionInfo; - -/** - * - * Generic HID main class - * Generic HID layer, allowing the HID Transport layers and device drivers to - * pass data to the Generic HID - * - * @lib generichid.lib - * @since S60 v5.0 - */ -class CGenericHid : public CHidTransport, public MDriverAccess - { -public: - virtual ~CGenericHid(); - - /** - * Constructs a generic HID layer with a reference to the owner so commands can - * be sent to connected devices - * - * @since S60 v5.0 - * @param aTransportLayer The owning transport layer - * @return a Pointer to an instantiated Generic HID layer - */ - IMPORT_C static CGenericHid* NewL(MTransportLayer* aTransportLayer); - - /** - * Constructs a generic HID layer with a reference to the owner so commands can - * be sent to connected devices - * - * @since S60 v5.0 - * @param aTransportLayer The owning transport layer - * @return a Pointer to an instantiated Generic HID layer - */ - IMPORT_C static CGenericHid* NewLC(MTransportLayer* aTransportLayer); - - /** - * Fromm class MDriverAccess - * Retrieves the country code for the HID device - * - * @since S60 v5.0 - * @param aConnectionID The device identifier - * @return a country code - */ - TUint CountryCodeL(TInt aConnectionID); - - /** - * Fromm class MDriverAccess - * Retrieves the country code for the HID device - * - * @since S60 v5.0 - * @param aConnectionId The device identifier - * @return a vendor ir - */ - TUint VendorIdL(TInt aConnectionId); - - /** - * Fromm class MDriverAccess - * Retrieves the product identifier for the HID device - * - * @since S60 v5.0 - * @param aConnectionId The device identifier - * @return a prodcut id - */ - TUint ProductIdL(TInt aConnectionId); - - - /** - * Fromm class MDriverAccess - * Sets the protocol to be used for reports. - * Leaves KErrInUse The request was not successful because the - * transport layer is busy with a previous request, - * KErrNotReady The request failed because the device - * is currently unavailable and KErrNotFound The request - * was unsuccessful - * - * @since S60 v5.0 - * @param aConnectionId The device identifier - * @param aInterface The device interface being used by the driver - * @param aProtocol The requested report protocol (boot or report) - * @parem aDriver Calling driver - * @return None. - */ - void SetProtocolL(TInt aConnectionId, TUint16 aInterface, - MDriverAccess::TProtocols aProtocol, CHidDriver* aDriver); - - - /** - * Fromm class MDriverAccess - * Requests the current protocol from the HID device. This is an asynchronous - * request. The protocol value will come through at a later time - * - * @since S60 v5.0 - * @param aConnectionId The device identifier - * @param aInterface The hid interface - * @return None. - */ - void GetProtocolL(TInt aConnectionId, TUint16 aInterface); - - /** - * Fromm class MDriverAccess - * A request for a report from the device. This is an asynchronous request. - * The report will come through at a later time - * - * @since S60 v5.0 - * @param aConnectionId The device identifier - * @param aReportId report id to be get - * @param aInterface The device interface being used by the driver - * @param aLength report lenght - * @return None. - */ - void GetReportL(TInt aConnectionId, TUint8 aReportId, - TUint16 aInterface, TUint16 aLength); - - /** - * Fromm class MDriverAccess - * A request to send a report payload to the HID device - * Leaves whit KErrInUse The request was not successful because the transport - * layer is busy with previous request and KErrNotReady The request failed - * because the device is currently unavailable - * - * @since S60 v5.0 - * @param aConnectionId The device ID - * @param aReportId The report id - * @param aReportType Type of report (input/output/feature) - * @param aPayload The report containing the device setup packet - * @param aInterface The device interface being used by the driver - * @parem aDriver Calling driver - * @return None. - */ - void SetReportL(TInt aConnectionId, - TUint8 aReportId, MDriverAccess::TReportType aReportType, - const TDesC8& aPayload, TUint16 aInterface, CHidDriver* aDriver); - - /** - * Fromm class MDriverAccess - * A request to send a report payload to the HID device in Interrupt Channel - * Leaves whit KErrInUse The request was not successful because the transport - * layer is busy with previous request and KErrNotReady The request failed - * because the device is currently unavailable - * - * @since S60 v5.0 - * @param aConnectionId The device ID - * @param aReportId report id which payload to be send - * @param aPayload The report containing the device setup packet - * @param aInterface The device interface being used by the driver - * @return None. - */ - void DataOutL(TInt aConnectionId, TUint8 aReportId, - const TDesC8& aPayload, TUint16 aInterface); - - /** - * Fromm class MDriverAccess - * Request for the current idle setting for the device - * This is an asynchronous request. The idle value will come through at a - * later time. Leaves whit KErrInUse The request was not successful because the transport - * layer is busy with previous request and KErrNotReady The request failed - * because the device is currently unavailable - * - * @since S60 v5.0 - * @param aConnectionId The device identifier - * @param aReportId The report ID for which we want the idle rate - * @param aInterface The device interface being used by the driver - * @return None. - */ - void GetIdleL(TInt aConnectionId, TUint8 aReportId, TUint16 aInterface); - - /** - * Fromm class MDriverAccess - * Request to the HID device to set the specified idle rate - * A request to send a report payload to the HID device - * Leaves whit KErrInUse The request was not successful because the transport - * layer is busy with previous request and KErrNotReady The request failed - * because the device is currently unavailable - * - * @since S60 v5.0 - * @param aConnectionId The device ID - * @param aDuration The number of 0.04ms intervals to wait between reports - * @param aReportId The report for which the idle rate is being set - * @param aInterface The device interface being used by the driver - * @parem aDriver Calling driver - * @return None. - */ - void SetIdleL(TInt aConnectionId, TUint8 aDuration, - TUint8 aReportId, TUint16 aInterface, CHidDriver* aDriver); - - /** - * From class CHidTransport - * Called by the transport layers to inform the generic HID of the success of - * the last Set... command. - * - * @since S60 v5.0 - * @param aConnectionId The device ID - * @param aCmdAck Status of the last Set... command - * @return None. - */ - void CommandResult(TInt aConnectionId, TInt aCmdAck); - - /** - * From class MDriverAccess - * Gives the device driver access to the results of the report - * descriptor parsing - * - * @since S60 v5.0 - * @param aConnectionId The device ID - * @return A pointer to the parsed descriptor object. - */ - CReportRoot* ReportDescriptor(TInt aConnectionId); - - /** - * From class CHidTransport - * Called by a transport layer when a device has connected and the report - * descriptors have been obtained - * - * @since S60 v5.0 - * @param aConnectionId The tansport-layer enumeration for the connection - * @param aDescriptor The report descriptor for the connected HID device - * @return KErrNone if a driver was found, otherwise an error code - */ - TInt ConnectedL(TInt aConnectionId, const TDesC8& aDescriptor); - - /** - * From class CHidTransport - * Called by a transport layer when a device has been disconnected - * - * @since S60 v5.0 - * @param aConnectionId The tansport-layer enumeration for the connection - * @return KErrNone if a driver was found, otherwise an error code - */ - TInt Disconnected(TInt aConnectionId); - - /** - * From class CHidTransport - * Called by the transport layer when a device has sent a report on the - * interrupt or control channel - * - * @since S60 v5.0 - * @param aConnectionId The tansport-layer enumeration for the connection - * @param aChannel Channel ID (Interrupt or Control) - * @param aPayload The complete report payload - * @return KErrNone if the data was handled by the driver, otherwise an error code - */ - virtual TInt DataIn(TInt aConnectionId, - CHidTransport::THidChannelType aChannel, const TDesC8& aPayload); - - /** - * From class CHidTransport - * Called by the transport layer to suspend or resume a driver - * - * @since S60 v5.0 - * @param aConnectionId The tansport-layer enumeration for the connection - * @param aActive EActive to start the driver(s), ESuspend to suspend - * @return KErrNone if the driver was successfully activated, otherwise an error code - */ - TInt DriverActive(TInt aConnectionId, - CHidTransport::TDriverState aActive); - -protected: - CGenericHid(MTransportLayer* aTransportLayer); - void ConstructL(); - -private: - - /** - * Remove drivers - * - * @since S60 v5.0 - * @return None - */ - void RemoveDrivers(); - - /** - * Attempts to find a driver that is handling reports from the HID device - * - * @since S60 v5.0 - * @return Connection information - */ - CConnectionInfo* SeekConnectionInfo(TInt aConnectionId); - -private: - - /** - * Instantiated driver list - */ - TSglQue iDriverList; - - /** - * Parser - * Own. - */ - CParser* iParser; - - /** - * Parser - * Not own. - */ - MTransportLayer* iTransportLayer; - - /** - * Connection information - */ - RPointerArray iConnectionInfo; - - /** - * Input data handling registry - * Own. - */ - CHidInputDataHandlingReg* iInputHandlingReg; - - }; - -#endif diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/generic_hid_api/inc/hidinterfaces.h --- a/shortlinkconn_plat/generic_hid_api/inc/hidinterfaces.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,704 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: Declares main application class. -* -*/ - - - -#ifndef C_HIDDRIVER_H -#define C_HIDDRIVER_H - -#include - - -class CReportRoot; -class MDriverAccess; -class MTransportLayer; -class CHidDriver; -// ---------------------------------------------------------------------- - -// Return codes from the Generic HID to Transport layers -// -const TInt KErrHidBase = -8000; - -const TInt KErrHidNoDriver = KErrHidBase; /*!< No driver could be found to handle the request */ -const TInt KErrHidSuspended = KErrHidBase - 1; /*!< Command not handled - driver is suspended */ -const TInt KErrHidUnrecognised = KErrHidBase - 2; /*!< Driver could not understand the data */ -const TInt KErrHidUnexpected = KErrHidBase - 3; /*!< Unsolicited data from the device */ -const TInt KErrHidBadChannel = KErrHidBase - 4; /*!< Channel was not Int or Ctrl type */ -const TInt KErrHidPartialSupported = KErrHidBase - 5; /*!< Partil supported hid device */ - -// Errors returned by the report translator / generator: -// -const TInt KErrUsageNotFound = KErrHidBase - 10; //!< Usage page/ID wasn't found in the field -const TInt KErrValueOutOfRange = KErrHidBase - 11; //!< Value specified is outside the logical range -const TInt KErrNoSpaceInArray = KErrHidBase - 12; //!< Array field already contains the maximum number of values -const TInt KErrBadControlIndex = KErrHidBase - 13; //!< Control index exceeds the number of controls in the field - -// ACK codes returned by Set/Get requests to the devices -// -const TInt KErrCommandAckBase = -8100; - -const TInt KErrAckInvalidReportID = KErrCommandAckBase; /*!< Invalid report ID */ -const TInt KErrAckInvalidParameter = KErrCommandAckBase - 1; /*!< Invalid or out of range param */ -const TInt KErrAckUnknown = KErrCommandAckBase - 2; /*!< Command failed, but the device can't determine why */ -const TInt KErrAckFatal = KErrCommandAckBase - 3; /*!< The device is in an unrecoverable state and must be restarted */ - -// Constant for plugin interface: -const TUid KHidDriverPluginInterfaceUid = { 0x10201d26 }; - - -class THidEvent - { - public: - /** - * Usage page - */ - TInt iUsagePage; - - /** - * Keycode - */ - TInt iKeyCode; - }; - -class CHidInputDataHandlingReg: public CBase - { - -public: - /** - * Two-phased constructor. - */ - static CHidInputDataHandlingReg* NewL(); - - /** - * Destructor - */ - virtual ~CHidInputDataHandlingReg(); - -public: - - /** - * Check if key event is not allready processed - * - * @since S60 v5.0 - * @param aUsagePage a usage page to be checked - * @param aUsage a usage code to be checked - * @return true if event is not allready handled - */ - IMPORT_C TBool AllowedToHandleEvent(TInt aUsagePage, TInt aUsage); - - - /** - * Add handled event - * - * @since S60 v5.0 - * @param aUsagePage usage page to be handled - * @param aUsage Usage to be handled - * @return None. - */ - IMPORT_C void AddHandledEvent( TInt aUsagePage, TInt aUsage); - - /** - * Reset Array - */ - void Reset(); - -private: - - CHidInputDataHandlingReg(); - void ConstructL(); - -private: - - /** - * Event array - * Own. - */ - CArrayFixFlat* iEventArray; - - }; - -/** - * - * Transport layer interface class - * Interface allowing the generic HID layer to pass data to a Transport layer - * All commands are asynchronous. The results are returned via the - * - * @since S60 v5.0 - */ -class MTransportLayer - { -public: - - /** - * Request for the country code of the given device. - * - * @since S60 v5.0 - * @param aConnID The device identifier - * @return country code. - */ - virtual TUint CountryCodeL(TInt aConnID) = 0; - - /** - * Request for the vendor identifier for the given device. - * - * @since S60 v5.0 - * @param aConnID The device identifier - * @return vendor id. - */ - virtual TUint VendorIdL(TInt aConnID) = 0; - - /** - * Request for the product identifier for the given device. - * - * @since S60 v5.0 - * @param aConnID The device identifier - * @return product id. - */ - virtual TUint ProductIdL(TInt aConnID) = 0; - - /** - * Request for the current device report protocol. The protocol will be - * received as a control report via the CHidTransport::DataIn function - * - * @since S60 v5.0 - * @param aConnID The device identifier - * @param aInterface The interface we want to get the protocol from - * @return None. - */ - virtual void GetProtocolL(TInt aConnID, TUint16 aInterface) = 0; - - /** - * Request to put the device in the specified protocol - * - * @since S60 v5.0 - * @param aConnID The device identifier - * @param aValue The requested protocol for the device (boot or report) - * @param aInterface The interface we want to set the protocol for - * @return None. - */ - virtual void SetProtocolL(TInt aConnID, TUint16 aValue, - TUint16 aInterface) = 0; - - /** - * Request for a device report. The data will be received as a control report - * via the CHidTransport::DataIn function - * - * @since S60 v5.0 - * @param aConnID The device identifier - * @param aReportType The type of report (input/output/feature) requested - * @param aReportID The specific report required - * @param aInterface The interface we want the report from - * @param aLength The expected length of the report buffer - * @return None. - */ - virtual void GetReportL(TInt aConnID, TUint8 aReportType,TUint8 aReportID, - TUint16 aInterface, TUint16 aLength) = 0; - - /** - * Request to send a report to a device. The response will be reported via the - * CHidTransport::CommandResult function - * - * @since S60 v5.0 - * @param aConnID The device identifier - * @param aReportType The type of report (input/output/feature) requested - * @param aReportID The specific report required to set - * @param aInterface The interface we want to send the report to - * @param aReport The report payload to be sent to the device - * @return None. - */ - virtual void SetReportL(TInt aConnID, TUint8 aReportType,TUint8 aReportID, - TUint16 aInterface, const TDesC8& aReport) = 0; - - /** - * Request to send data to a device. There are no responses to this report from device. - * - * @since S60 v5.0 - * @param aConnID The device identifier - * @param aReportID The specific report required - * @param aInterface The interface we want to send the report to - * @param aReport The report payload to be sent to the device - * @return None. - */ - virtual void DataOutL(TInt aConnID, TUint8 aReportID, - TUint16 aInterface, const TDesC8& aReport) = 0; - - /** - * Request for the current idle rate of a report from the device. The response - * will be recevied via the CHidTransport::DataIn function - * - * @since S60 v5.0 - * @param aConnID The device identifier - * @param aReportID The specific report to be queried - * @param aInterface The interface we want to query for idle rate - * @return None. - */ - virtual void GetIdleL(TInt aConnID, TUint8 aReportID, - TUint16 aInterface) = 0; - - /** - * Request to set the current idle rate for a report on the device. - * The response will be received via the CHidTransport::CommandResult function - * - * @since S60 v5.0 - * @param aConnID The device identifier - * @param aReportID The specific report to be queried - * @param aDuration The time period between idle reports (4ms per bit. An - * interval of 0 disables idle reports so that Interrupt reports are only ever - * received when the reported data has changed - * @param aReportID The specific report to be queried - * @param aInterface The interface we want to query for idle rate - * @return None. - */ - virtual void SetIdleL(TInt aConnID, TUint8 aDuration, TUint8 aReportID, - TUint16 aInterface) = 0; - }; - -/** - * - * Driver access interface - * Interface allowing drivers to request data from and send data to devices via - * the Generic HID layer. - * - * @since S60 v5.0 - */ -class MDriverAccess - { -public: - - /** - * The type of report requested from the device - * Note: The enumeration values map directly to the HID equivalent values - * (Passed as TUint16 values to the transport layer) - */ - enum TReportType - { - EInput=1, /*!< Input report */ - EOutput, /*!< Output report */ - EFeature /*!< Feature report */ - }; - - /** Return codes from the Generic HID to the device drivers - * Note: The enumeration values map directly to the HID equivalent values - *(Passed as TUint8 values to the transport layer) - */ - - enum TProtocols - { - EBoot=0, /*!< Boot Protocol */ - EReport=1 /*!< Report Protocol */ - }; - -public: - - /** - * Retrieves the country code for the HID device - * - * @since S60 v5.0 - * @param aConnID The device identifier - * @return contry code - */ - virtual TUint CountryCodeL(TInt aConnID) = 0; - - /** - * Retrieves the for the HID device - * - * @since S60 v5.0 - * @param aConnID The device identifier - * @return vendor id - */ - virtual TUint VendorIdL(TInt aConnID) = 0; - - /** - * Retrieves the product identifier for the HID device - * - * @since S60 v5.0 - * @param aConnID The device identifier - * @return produrct id - */ - virtual TUint ProductIdL(TInt aConnID) = 0; - - /** - * Requests the current protocol for the device (boot or report) - * Leaves whit KErrInUse The request was not successful because the transport - * layer is busy with previous request and KErrNotReady The request failed - * because the device is currently unavaila - * - * @since S60 v5.0 - * @param aConnectionID The connection id - * @param aInterface The current interface being used by the driver - * @return None. - */ - virtual void GetProtocolL(TInt aConnectionID, - TUint16 aInterface) = 0; - - /** - * Requests a report from the device - * Leaves whit KErrInUse The request was not successful because the transport - * layer is busy with previous request and KErrNotReady The request failed - * because the device is currently unavailable - * - * @since S60 v5.0 - * @param aConnectionId The connection id - * @param aReportId The report required from the device - * @param aInterface The current interface being used by the driver - * @param aLength ** NOT USED ** - * @return None - */ - virtual void GetReportL(TInt aConnectionId, TUint8 aReportId, - TUint16 aInterface, TUint16 aLength) = 0; - - /** - * Requests the current Idle setting for the device - * Leaves whit KErrInUse The request was not successful because the transport - * layer is busy with previous request and KErrNotReady The request failed - * because the device is currently unavailable - * - * @since S60 v5.0 - * @param aConnectionId The device ID - * @param aReportId The report required from the device - * @param aInterface The current interface being used by the driver - * @return None. - */ - virtual void GetIdleL(TInt aConnectionId, TUint8 aReportId, - TUint16 aInterface ) = 0; - - /** - * Sets the protocol to be used for reports - * Leaves whit KErrInUse The request was not successful because the transport - * layer is busy with previous request and KErrNotReady The request failed - * because the device is currently unavailable - * - * @since S60 v5.0 - * @param aConnectionId The device ID - * @param aInterface The current interface being used by the driver - * @param aProtocol The required protocol (boot or report) - * @parem aDriver Calling driver - * @return None. - */ - virtual void SetProtocolL(TInt aConnectionId, - TUint16 aInterface, TProtocols aProtocol, CHidDriver* aDriver) = 0; - - /** - * Sets the idle interval for interrupt data. - * Leaves whit KErrInUse The request was not successful because the transport - * layer is busy with previous request and KErrNotReady The request failed - * because the device is currently unavailable - * - * @since S60 v5.0 - * @param aConnectionId The device ID - * @param aDuration The idle interval, in steps of 0.04ms intervals (where - * 1 = 0.04ms, 2=0.08ms). 0 will disable idle so reports - * are only sent when the state of the device changes - * @param aInterface The current interface being used by the driver - * @param aReportId The report whose idle rate is being set - * @param aInterface The current interface being used by the driver - * @parem aDriver Calling driver - * @return None. - */ - virtual void SetIdleL(TInt aConnectionId, TUint8 aDuration, - TUint8 aReportId, TUint16 aInterface, CHidDriver* aDriver) = 0; - - - /** - * Sends a report to the device - * - * @since S60 v5.0 - * @param aConnectionId The device ID - * @param aReportId The report to receive the setup report - * @param aReportType The type of report being sent to the device (input, output - * or Feature) - * @param aPayload The report being sent to the device - * @parem aDriver Calling driver - * @param aInterface The current interface being used by the driver - * @return KErrNone The request was successful and the result of the command is - * expected at a later time (as a CmdAck message), KErrInUse The request - * was not successful because the transport layer is busy with a previous - * request, KErrNotReady The request failed because the device is currently - * unavailable and KErrNoMemory The request failed because not enough memory - * available - */ - virtual void SetReportL(TInt aConnectionId, TUint8 aReportId, - TReportType aReportType, const TDesC8& aPayload, - TUint16 aInterface, CHidDriver* aDriver) = 0; - - /** - * Sends a report to the device (from host) using Interrupt Channel as DATA - * - * @since S60 v5.0 - * @param aConnectionId The device ID - * @param aReportId The report to receive the setup report - * @param aPayload The report being sent to the device - * @param aInterface The current interface being used by the driver - * @return KErrNone The request was successful and the result of the - * command is expected at a later time (as a CmdAck message), - * KErrInUse The request was not successful because the transport layer is - * busy with a previous request, KErrNotReady The request failed because the - * device is currently unavailable and KErrNoMemory The request failed because - * not enough memory available - */ - virtual void DataOutL(TInt aConnectionId, TUint8 aReportId, - /*TReportType aReportType,*/ const TDesC8& aPayload, - TUint16 aInterface) = 0; - - /** - * A request for the parsed descriptor container object so the driver can - * retrieve the report format(s) - * - * @since S60 v5.0 - * @param aConnectionId The device ID - * @return A pointer to the parsed report descriptor container and - * NULL if no parsed report descriptor container exists - */ - virtual CReportRoot* ReportDescriptor(TInt aConnectionId) = 0; - }; - - -/** - * - * Hid transport interface - * Interface allowing the transport layer to pass data to the Generic HID - * - * @since S60 v5.0 - */ -class CHidTransport : public CBase - { -public: - /** - * Defines the channel type for the DataIn function - */ - enum THidChannelType - { - EHidChannelInt, /*!< Interrupt channel */ - EHidChannelCtrl /*!< Control channel */ - }; - - /** - *Driver state (active or suspended) - */ - enum TDriverState - { - EActive, /*!< Driver will handle interrupt data */ - ESuspend /*!< the driver will not handle interrupt data */ - }; - -public: - - /** - * Called when a device has connected - * - * @since S60 v5.0 - * @param aConnectionId The transport-layer enumeration for the connection - * @param aDescriptor The report descriptor for the device - * @return KErrNone The connection will be handled by one or more drivers, - * KErrHidNoDriver No driver was found to handle the connected device - */ - virtual TInt ConnectedL(TInt aConnectionId, const TDesC8& aDescriptor) = 0; - - /** - * Called when a device has been disconnected - * - * @since S60 v5.0 - * @param aConnectionId The transport-layer enumeration for the connection - * @param aDescriptor The report descriptor for the device - * @return KErrNone The device was recognised and its drivers were unloaded and - * KErrHidNoDriver No driver was found to handle the connected device - */ - virtual TInt Disconnected(TInt aConnectionId) = 0; - - /** - * Called when a device has been disconnected - * - * @since S60 v5.0 - * @param aConnectionId Transport layer connection enumeration - * @param aChannel Channel ID (Interrupt or Control) - * @param aPayload The complete report payload - * @return KErrNone The payload was handled by one or more drivers, - * KErrHidNoDriver No driver is handling reports from the device - * and KErrHidSuspended The report was not handled because all the drivers - * handling the device are suspended - */ - virtual TInt DataIn(TInt aConnectionId, - THidChannelType aChannel, const TDesC8& aPayload) = 0; - - /** - * Suspends or Resumes the driver(s) handling the connection - * - * @since S60 v5.0 - * @param aConnectionId Transport layer connection enumeration - * @param aActive The requested state of the driver (active or suspended) - * @return KErrNone The driver was successfully put into the requested state, - * and KErrHidAlreadyInState All the drivers were already in the - * requested state - */ - virtual TInt DriverActive(TInt aConnectionId, - CHidTransport::TDriverState aActive) = 0; - - /** - * Called by the transport layers to inform the generic HID of the - * success of the last Set... command. - * - * @since S60 v5.0 - * @param aConnectionId Transport layer connection enumeration - * @param aCmdAck Status of the last Set... command - * @return None. - */ - virtual void CommandResult(TInt aConnectionId, TInt aCmdAck) = 0; - }; - -/** - * - * Driver plugin interface - * Interface allowing drivers to request data from and send data to devices via - * the Generic HID layer. - * - * @lib generichid.lib - * @since S60 v5.0 - */ -class CHidDriver : public CBase - { -public: - - - /** - * Two-phased constructor. - * @param aImplementationUid Implementation UID of the plugin to be - * created. - * @param aHid Driver acces interface - */ - IMPORT_C static CHidDriver* NewL( - const TUid aImplementationUid, - MDriverAccess* aHid ); - - /** - * Destructor - */ - IMPORT_C virtual ~CHidDriver(); - - /** - * Called by the Generic HID to see if the factory can use reports described by - * the parsed report descriptor - * NOTE: The current implementation supports just one driver and that driver - * that will either handle all the reports from the device or none at all. - * Report ID is not currently being taken into account. - * - * @since S60 v5.0 - * @param aReportDescriptor Parsed HID report descriptor - * @return KErrNone The driver will handle reports from the report descriptor and - * KErrHidUnrecognised The driver cannot handle reports from the device - */ - virtual TInt CanHandleReportL(CReportRoot* aReportDescriptor) = 0; - - /** - * Called by the Generic HID layer when a device has sent a report on the - * interrupt or control channel - * - * @since S60 v5.0 - * @param aChannel Channel ID (Interrupt or Control) - * @param aPayload The complete report payload - * @return Error if data can't be handled. - */ - virtual TInt DataIn(CHidTransport::THidChannelType aChannel, - const TDesC8& aPayload) = 0; - - /** - * Called by the Generic HID layer when the handled device has been disconnected - * interrupt or control channel - * - * @since S60 v5.0 - * @param aReason Disconnection code - * @return None. - */ - virtual void Disconnected(TInt aReason) = 0; - - /** - * Called after a driver is sucessfully created by the Generic HID, - * when a device is connected. - * - * @since S60 v5.0 - * @param aConnectionId An number used to identify the device in - * subsequent calls from the driver to the generic HID, for example - * when sending data to the device. - * @return None. - */ - virtual void InitialiseL(TInt aConnectionId) = 0; - - /** - * Enables the driver so that it will configure the device and - * start handling interrupt reports from the device - * - * @since S60 v5.0 - * @param aConnectionId A number used to identify the device in - * subsequent calls from the driver to the Generic HID, for example - * when sending data to the device. - * @return None. - */ - virtual void StartL(TInt aConnectionId) = 0; - - /** - * Disables the driver so that it will stop handling device - * interrupt reports - * - * @since S60 v5.0 - * @return None. - */ - virtual void Stop() = 0; - - /** - * Called by the transport layers to inform the generic HID of - * the success of the last Set... command. - * - * @since S60 v5.0 - * @param aCmdAck Status of the last Set... command - * @return None. - */ - virtual void CommandResult(TInt aCmdAck) = 0; - - /** - * Return count of supported fields - * - * @since S60 v5.0 - * @return Number of supported fields. - */ - virtual TInt SupportedFieldCount()= 0; - - - /** - * Set input handling registy - * - * @since S60 v5.0 - * @param aHandlingReg a Input handling registry - * @return Number of supported fields. - */ - virtual void SetInputHandlingReg(CHidInputDataHandlingReg* aHandlingReg) = 0; - - protected: - /** - * C++ constructor. - */ - IMPORT_C CHidDriver(); - - private: // Data - - /** - * ECOM plugin instance UID. - */ - TUid iDtor_ID_Key; - }; - -#endif - - diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/generic_hid_api/inc/hidreportroot.h --- a/shortlinkconn_plat/generic_hid_api/inc/hidreportroot.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,274 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: Declares hid report class -* -*/ - - -#ifndef C_HIDREPORTROOT_H -#define C_HIDREPORTROOT_H - -#include - -#include "hidfield.h" -#include "hidcollection.h" - -#include "hidvalues.h" - -class CReportRoot; - - - -/** - * Hid field finder class - * The MHidFieldFinder class defines the call-back interface used by - * THidFieldSearch. A device driver uses THidFieldSearch::SearchL() - * along with a custom MHidFieldFinder object to determine whether it - * is compatible with a given report descriptor. - * - * @lib generichid.lib - * @since S60 v5.0 - */ -class MHidFieldFinder - { -public: - - /** - * Called by THidFieldSearch::SearchL() during traversal of the - * report descriptor tree when a CCollection is encountered. It - * will be called once, and only once, for every CCollection in the - * descriptor. It is not called for the root collection - * (the CReportRoot). - * - * @since S60 v5.0 - * @param aCollection A pointer to the collection object. - * @return ETrue if the contents of this collection (any child CField - * or CCollection objects) should be examined. A driver would return - * EFalse if a collection was not of a compatible type, for - * example if the usage page was inappropriate. - */ - virtual TBool BeginCollection(const CCollection *aCollection) = 0; - - /** - * Called by THidFieldSearch::SearchL() during traversal of the - * report descriptor tree when all CFields and child CCollections - * of a CCollection have been examined. It will be called once, - * and only once, for every CCollection in the descriptor. It is - * not called for the root collection (the CReportRoot). - * - * @since S60 v5.0 - * @param aCollection A pointer to the collection object. - * @return ETrue if the search (tree traversal) should - * continue. A driver returns EFalse if it has finished examining - * the whole descriptor, in general this will be if it has - * established that it is compatible with the report descriptor. - */ - virtual TBool EndCollection(const CCollection *aCollection) = 0; - - /** - * Called once for each CField in a CCollection by - * THidFieldSearch::SearchL() during the traversal of a report - * descriptor tree. - * - * @since S60 v5.0 - * @param aField The pointer to field - * @return None. - */ - virtual void Field(const CField* aField) = 0; - }; - - -/** - * Report Size - * - * @lib generichid.lib - * @since S60 v5.0 - */ -class TReportSize - { -public: - - /** - * Constructor. - * - * @since S60 v5.0 - * @param aReportId The report id - * @param aType Field type - * @return Pointer to report size object - */ - TReportSize(TInt aReportId, CField::TType aType); - - - /** - * TReportSize comparision - * - * @since S60 v5.0 - * @param aFirst first report size to be compared. - * @param aSecond second report size to be compared - * @return None - */ - static TBool Match(const TReportSize& aFirst, - const TReportSize& aSecond); - - /** - * Report id - */ - TInt iReportId; - - /** - * Fiel type - */ - CField::TType iType; - - /** - * Report size - */ - TInt iSize; - }; - - -/** - * Hid field search - * THidFieldSearch provides a mechanism for traversing a parsed report - * descriptor tree (a CReportRoot object). It is intended for a device - * driver to use when it is looking to see if it is compatible with a - * newly connected device, i.e. provides the appropriate types of - * report. The driver must provide an object of a class that implements - * the MHidFieldFinder interface. - * - * @since S60 v5.0 - */ -class THidFieldSearch - { -public: - - /** - * Traverse a parsed report descriptor (a tree of CCollections - * and CFields) calling the MHidFieldFinder member functions as - * appropriate. - * - * @since S60 v5.0 - * @param aReportRoot THe pointer to field - * @param aFinder An object that will establish if the report - * descriptor is suitable. - * @return None. - */ - IMPORT_C void SearchL(const CReportRoot* aReportRoot, - MHidFieldFinder* aFinder); - -private: - - /** - * Traverse a parsed report descriptor (a tree of CCollections - * and CFields) calling the MHidFieldFinder member functions as - * appropriate. - * - * @since S60 v5.0 - * @param aReportRoot THe pointer to field - * @return ETrue when search is done. - */ - TBool DoSearchL(const CCollection* aCollection); - -private: - MHidFieldFinder* iFinder; - }; - -/** - * Root report - * The top level of the tree of fields and collections in a HID - * report descriptor. - * - * @lib generichid.lib - * @since S60 v5.0 - */ -class CReportRoot : public CCollection - { -public: - static CReportRoot* NewLC(); - static CReportRoot* NewL(); - - /** - * Destructor - */ - virtual ~CReportRoot(); - - /** - * Increase the size of a given report by a given number of bits - * - * @since S60 v5.0 - * @param aReportId The report id, which size shoud be increased - * @param aType a Type of field - * @param aIncrement size of increase - * @return None - */ - void IncrementReportSizeL(TInt aReportId, - CField::TType aType, TInt aIncrement); - - /** - * Get the size of a given report in bits - * - * @since S60 v5.0 - * @param aReportId The report id, which size shoud be increased - * @param aType a Type of field - * @return Size of report in bits - */ - TInt ReportSize(TInt aReportId, CField::TType aType) const; - - /** - * Get the size of a given report in bytes - * - * @since S60 v5.0 - * @param aReportId The report id, which size shoud be increased - * @param aType a Type of field - * @return Size of report in bytys - */ - IMPORT_C TInt ReportSizeBytes(TInt aReportId, CField::TType aType) const; - - /** - * Get the number of reports - * - * @since S60 v5.0 - * @return number of reports - */ - TInt NumberOfReports() const; - - /** - * Get the size of a given report by array index, rather than type & ID - * - * @since S60 v5.0 - * @param aIndex report index - * @return report size - */ - TInt ReportSize(TInt aIndex) const; - -private: - CReportRoot(); - - /** - * Find report index - * - * @since S60 v5.0 - * @param aReportId The report id to be found - * @param aType a Type of field - * @return report size - */ - TInt FindReportSizeIndex(TInt aReportId, CField::TType aType) const; - - /** - * Array to store the size of each report - */ - RArray iSizes; - }; - -#endif diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/generic_hid_api/inc/hidtranslate.h --- a/shortlinkconn_plat/generic_hid_api/inc/hidtranslate.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,191 +0,0 @@ -/* -* Copyright (c) 2005-2007 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: Report translator -* -*/ - -#ifndef T_TRANSLATE_H -#define T_TRANSLATE_H - -#include - -class CField; - -/** - * HID report base object - * - * Base class for report translator and report generator. - * Contains only static functions. - * - * @lib generichid.lib - * @since S60 v5.0 - */ -class TReportUtils - { -public: - /** - * Find the index within the usages for a field of a given usage ID. - * - * @since S60 v5.0 - * @param aField Pointer to the field. - * @param aUsageId Usage ID to find. - * @param aUsageIndex Reference to variable to receive the index. - * @return True if the usage ID is found. - */ - static TBool GetIndexOfUsage(const CField* aField, - TInt aUsageId, TInt& aUsageIndex); - /** - * Find the usage ID at a given index within the usages for a field. - * - * @since S60 v5.0 - * @param aField Pointer to the field. - * @param aUsageIndex The index. - * @return The usage ID at the given index. - */ - static TInt UsageAtIndex(const CField* aField, TInt aUsageIndex); - - /** - * Write a value to a field at a given index. - * - * @since S60 v5.0 - * @param aData Buffer containing the HID report. - * @param aField The field in which to write. - * @param aIndex Position in the field to write. - * @param aValue Value to write to the field. - * @return Error code indicating success or reason for failure. - */ - static TInt WriteData(HBufC8& aData, const CField* aField, - TInt aIndex, TInt aValue); - - /** - * Read a value from a field at a given index. - * - * @since S60 v5.0 - * @param aData Buffer containing the HID report. - * @param aField The field from which to read. - * @param aIndex Position in the field to read. - * @param aValue Reference to variable to receive the value read - * from the field. - * @return Error code indicating success or reason for failure. - */ - static TInt ReadData(const TDesC8& aData, const CField* aField, - TInt aIndex, TInt& aValue); - }; - -/** - * HID report translator - * - * Allows a device driver to extract data items from a device report, based on - * the results of the report descriptor parser stage (at device connection) - * - * @lib generichid.lib - * @since S60 v5.0 - */ -class TReportTranslator - { -public: - - /** - * Constructor. - * - * @since S60 v5.0 - * @param aData Data to be extracted - * @param aField HID field - * @return return TReportTranslator - */ - IMPORT_C TReportTranslator(const TDesC8& aData, const CField* aField); - - /** - * For variable fields, reads the logical value of the control with the - * given usage ID. For arrays, searches for the usage ID and gives the - * value as ETrue if found and EFalse if not. - * - * @since S60 v5.0 - * @param aValue Reference to variable to receive the value read - * from the field. - * @param aUsageId Usage ID of the control to read. - * @param aControlOffset Which control to read when more than one - * have the same usage ID. - * @return Error code indicating success or reason for failure. - */ - IMPORT_C TInt GetValue(TInt& aValue, TInt aUsageId, - TInt aControlOffset = 0) const; - - /** - * Alternate version of the above method for convenience. Returns the - * value read directly and leaves if an error occurs. - * - * @since S60 v5.0 - * @param aUsageId Usage ID of the control to read. - * @param aControlOffset Which control to read when more than one - * have the same usage ID. - * @return The logical value of a variable, or true/false for an array. - */ - IMPORT_C TInt ValueL(TInt aUsageId, TInt aControlOffset = 0) const; - - /** - * Gets the usage ID at a given index in an array field. For variable - * fields, if the logical value of the control at the given index is non- - * zero, returns the usage ID of the control, otherwise returns zero. - * - * @since S60 v5.0 - * @param aUsageId Reference to variable to receive the usage ID. - * @param aIndex Index in the array to read. - * @return Error code indicating success or reason for failure. - */ - IMPORT_C TInt GetUsageId(TInt& aUsageId, TInt aIndex) const; - - /** - * Alternate version of the above method for convenience. Returns the - * usage ID directly and leaves if an error occurs. - * - * @since S60 v5.0 - * @param aIndex Index in the array to read. - * @return The usage ID. - */ - IMPORT_C TInt UsageIdL(TInt aIndex) const; - - /** - * Gets the logical value at a given index in a field. Leaves if an - * error occurs. - * - * @since S60 v5.0 - * @param aIndex Index in the field to read. - * @return The logical value. - */ - IMPORT_C TInt RawValueL(TInt aIndex) const; - - /** - * Gets the number of controls in the field. - * - * @since S60 v5.0 - * @return The number of controls. - */ - IMPORT_C TInt Count() const; - -private: - - /** - * Data to be extracted - */ - const TDesC8& iData; - - /** - * HID field - * Not own. - */ - const CField* iField; - }; - -#endif diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/generic_hid_api/inc/hidvalues.h --- a/shortlinkconn_plat/generic_hid_api/inc/hidvalues.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: HID related enums -* -*/ - - -#ifndef HIDVALUES_H -#define HIDVALUES_H - -#include - -/** - * Constants as defined in "USB HID Usage Tables", Version 1.11, USB - * Implementers' Forum, June 2001. Used throughout for parsing report - * descriptors and interpreting reports. - */ - -/** - * HID usage page ID values, as given in the document "USB HID Usage - * Tables", Version 1.11, USB Implementers' Forum, June 2001 - */ -enum THidUsagePages - { - EUsagePageUndefined = 0x00, - EUsagePageGenericDesktop = 0x01, - EUsagePageSimulationControls = 0x02, - EUsagePageVRControls = 0x03, - EUsagePageSportControls = 0x04, - EUsagePageGameControls = 0x05, - EUsagePageGenericDeviceControls = 0x06, - EUsagePageKeyboard = 0x07, - EUsagePageLEDs = 0x08, - EUsagePageButton = 0x09, - EUsagePageOrdinal = 0x0A, - EUsagePageTelephony = 0x0B, - EUsagePageConsumer = 0x0C, - EUsagePageDigitizer = 0x0D, - EUsagePagePIDPage = 0x0F, - EUsagePageUnicode = 0x10, - EUsagePageAlphanumericDisplay = 0x14, - EUsagePageMedicalInstruments = 0x40, - EUsagePageMonitorMin = 0x80, - EUsagePageMonitorMax = 0x83, - EUsagePagePowerMin = 0x84, - EUsagePagePowerMax = 0x87, - EUsagePageBarCodeScanner = 0x8C, - EUsagePageScale = 0x8D, - EUsagePageMagStripe = 0x8E, - EUsagePagePOS = 0x8F, - EUsagePageCameraControl = 0x90, - EUsagePageArcade = 0x91, - EUsagePageVendorSpecific = 0xFF01 - }; - -/** - * HID usage ID values for the Generic Desktop usage page, as given in - * the document "USB HID Usage Tables", Version 1.11, USB Implementers' - * Forum, June 2001 - */ -enum THidGenericDesktopUsages - { - EGenericDesktopUsagePointer = 0x01, - EGenericDesktopUsageMouse = 0x02, - EGenericDesktopUsageJoystick = 0x04, - EGenericDesktopUsagePad = 0x05, - EGenericDesktopUsageKeyboard = 0x06, - EGenericDesktopUsageKeypad = 0x07, - EGenericDesktopUsageMultiAxisCtrl = 0x08, - EGenericDesktopUsageX = 0x30, - EGenericDesktopUsageY = 0x31, - EGenericDesktopUsageZ = 0x32, - EGenericDesktopUsageRx = 0x33, - EGenericDesktopUsageRy = 0x34, - EGenericDesktopUsageRz = 0x35, - EGenericDesktopUsageSlider = 0x36, - EGenericDesktopUsageDial = 0x37, - EGenericDesktopUsageWheel = 0x38, - EGenericDesktopUsageHatSwitch = 0x39, - EGenericDesktopUsageCountedBuffer = 0x3A, - EGenericDesktopUsageByteCount = 0x3B, - EGenericDesktopUsageMotionWakeup = 0x3C, - EGenericDesktopUsageStart = 0x3D, - EGenericDesktopUsageSelect = 0x3E - }; - -enum THidTelephonyUsages - { - ETelephonyUsageHookSwitch = 0x20, - ETelephonyUsagePhoneMute = 0x2F, - ETelephonyUsagePoC = 0x33 - }; - -enum THidConsumerUsages - { - EConsumerUsagePlay = 0xB0, - EConsumerUsageFastForward = 0xB3, - EConsumerUsageRewind = 0xB4, - EConsumerUsageScanNext = 0xB5, - EConsumerUsageScanPrev = 0xB6, - EConsumerUsageStop = 0xB7, - EConsumerUsageRandomPlay = 0xB9, - EConsumerUsagePlayPause = 0xCD, - EConsumerUsageVolumeInc = 0xE9, - EConsumerUsageVolumeDec = 0xEA, - EConsumerUsageMute = 0xE2 - }; - -enum THidVendorSpecificUsages - { - EVendorSpecificUsagePoC = 0x01, - EVendorSpecificUsageHeadplugDetection = 0x02 - }; -// ---------------------------------------------------------------------- - -#endif diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/group/bld.inf --- a/shortlinkconn_plat/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2007 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: Includes all the Domain API specific bld.inf files, which -* export files. -* -*/ - - - -#include "../obex_service_utils_api/group/bld.inf" -#include "../obex_service_plugin_api/group/bld.inf" -#include "../dialup_connection_status_api/group/bld.inf" -#include "../dun_secondary_display_notification_api/group/bld.inf" -#include "../obex_secondary_display_notification_api/group/bld.inf" -#include "../generic_hid_api/group/bld.inf" -#include "../locod_bearer_plugin_api/group/bld.inf" -#include "../usb_obexservicemanager_client_api/group/bld.inf" diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/locod_bearer_plugin_api/group/bld.inf --- a/shortlinkconn_plat/locod_bearer_plugin_api/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +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: File that exports the files belonging to -: Locod bearer API -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -../inc/locodplugin.hrh MW_LAYER_PLATFORM_EXPORT_PATH(locodplugin.hrh) -../inc/locodbearer.h MW_LAYER_PLATFORM_EXPORT_PATH(locodbearer.h) -../inc/locodbearerplugin.h MW_LAYER_PLATFORM_EXPORT_PATH(locodbearerplugin.h) -../inc/locodbearerplugin.inl MW_LAYER_PLATFORM_EXPORT_PATH(locodbearerplugin.inl) -../inc/locodbearerpluginobserver.h MW_LAYER_PLATFORM_EXPORT_PATH(locodbearerpluginobserver.h) -../inc/locodbearerpluginparams.h MW_LAYER_PLATFORM_EXPORT_PATH(locodbearerpluginparams.h) -../inc/locodbearerpluginparams.inl MW_LAYER_PLATFORM_EXPORT_PATH(locodbearerpluginparams.inl) diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/locod_bearer_plugin_api/inc/locodbearer.h --- a/shortlinkconn_plat/locod_bearer_plugin_api/inc/locodbearer.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +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: Defines the LCD Bearer Plugin identifier. -* -*/ - - -#ifndef T_LOCODBEARER_H -#define T_LOCODBEARER_H - -#include - -/** bearer value in LC */ -enum TLocodBearer - { - ELocodBearerBT = 0x0001, - ELocodBearerIR = 0x0010, - ELocodBearerUSB = 0x0100, - }; - -#endif // T_LOCODBEARER_H diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/locod_bearer_plugin_api/inc/locodbearerplugin.h --- a/shortlinkconn_plat/locod_bearer_plugin_api/inc/locodbearerplugin.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +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: This is the LCD Bearer Plugin base class declaration. -* -*/ - - -#ifndef C_LOCODBEARERPLUGIN_H -#define C_LOCODBEARERPLUGIN_H - -#include -#include "locodbearerpluginparams.h" - -/** - * Bearer Plugin base class - * - * This is the base class from which bearer plugins inherit. - * - * See locodplugin.hrh for the resource registration definitions. - * - * @lib euser.lib - * @since S60 v3.2 - */ -class CLocodBearerPlugin : public CBase - { -public: - - static CLocodBearerPlugin* NewL(TLocodBearerPluginParams& aParams); - - virtual ~CLocodBearerPlugin(); - - /** - * Gets the implementation uid of this plugin - * - * @since S60 v3.2 - * @return The implementation uid - */ - TUid ImplementationUid() const; - -protected: - - CLocodBearerPlugin(TLocodBearerPluginParams& aParams); - - /** - * Gets the observer interface object associated with this plugin - * - * @since S60 v3.2 - * @return The observer object - */ - MLocodBearerPluginObserver& Observer() const; - -private: // data - - /** - * UID set by ECOM when the instance is created. Used when the instance - * is destroyed. - */ - TUid iInstanceUid; - - /** - * Implementation UID of the concrete instance. - */ - TUid iImplementationUid; - - /** - * Holds the observer object which will be notified when the operations - * complete - * Not own. - */ - MLocodBearerPluginObserver& iObserver; - - }; - -#include "locodbearerplugin.inl" - -#endif // C_LOCODBEARERPLUGIN_H diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/locod_bearer_plugin_api/inc/locodbearerplugin.inl --- a/shortlinkconn_plat/locod_bearer_plugin_api/inc/locodbearerplugin.inl Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +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: This is the LCD Bearer Plugin construction parameters -* declaration -* -*/ - - -#include - -// ----------------------------------------------------------------------------- -// Creates the bearer plug ins and return it to caller -// ----------------------------------------------------------------------------- -// -inline CLocodBearerPlugin* CLocodBearerPlugin::NewL(TLocodBearerPluginParams& aParams) - { - CLocodBearerPlugin* self = reinterpret_cast( - REComSession::CreateImplementationL( - aParams.ImplementationUid(), - _FOFF(CLocodBearerPlugin, iInstanceUid), - (TAny*)&aParams) - ); - - return self; - } - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -inline CLocodBearerPlugin::~CLocodBearerPlugin() - { - REComSession::DestroyedImplementation(iInstanceUid); - } - -// ----------------------------------------------------------------------------- -// Return the implemtation uid -// ----------------------------------------------------------------------------- -// -inline TUid CLocodBearerPlugin::ImplementationUid() const - { - return iImplementationUid; - } - -// ----------------------------------------------------------------------------- -// Constructor method, just saves the arguments into member variables -// ----------------------------------------------------------------------------- -// -inline CLocodBearerPlugin::CLocodBearerPlugin(TLocodBearerPluginParams& aParams) - : iImplementationUid(aParams.ImplementationUid()), - iObserver(aParams.Observer()) - { - } - -// ----------------------------------------------------------------------------- -// Return the observer class -// ----------------------------------------------------------------------------- -// -inline MLocodBearerPluginObserver& CLocodBearerPlugin::Observer() const - { - return iObserver; - } diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/locod_bearer_plugin_api/inc/locodbearerpluginobserver.h --- a/shortlinkconn_plat/locod_bearer_plugin_api/inc/locodbearerpluginobserver.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +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: This is the LCD Bearer Plugin observer interface definition. -* -*/ - - -#ifndef M_LOCODBEARERPLUGINOBSERVER_H -#define M_LOCODBEARERPLUGINOBSERVER_H - -#include "locodbearer.h" - -/** - * LCD Bearer Plugin Observer interface class - * - * This is the bearer plugin observer interface definition used by LCD - * Bearer Plugins to inform the daemon about the plugin's event. - * - * @euser.lib - * @since S60 v3.2 - */ -class MLocodBearerPluginObserver - { -public: - - /** - * This is a callback function used by the plugins to inform when the - * bearer's availability changes. - * - * @since S60 v3.2 - * @param aBearer the bearer which calls this nothification - * @param aStatus the status of this bearer, ETrue if it is available; - * EFalse otherwise. - */ - virtual void NotifyBearerStatus(TLocodBearer aBearer, TBool aStatus) = 0; - }; - -#endif // M_LOCODBEARERPLUGINOBSERVER_H diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/locod_bearer_plugin_api/inc/locodbearerpluginparams.h --- a/shortlinkconn_plat/locod_bearer_plugin_api/inc/locodbearerpluginparams.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +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: This is the LCD Bearer Plugin construction parameters -* declaration -* -*/ - - -#ifndef T_LOCODBEARERPLUGINPARAMS_H -#define T_LOCODBEARERPLUGINPARAMS_H - -class MLocodBearerPluginObserver; - -/** - * LCD Bearer Plugin Callback construction parameters - * - * This interface class is used to pass construction parameters to the - * plugins. These parameters include the callback interface and the ECOM - * plugin implementation UID - * - * @euser.lib - * @since S60 v3.2 - */ -class TLocodBearerPluginParams - { -public: - - /** - * Constructor. - * - * @since S60 v3.2 - * @param aUid Implementation UID of the plugin being constructed - * @param aObserver Callback interface object - */ - TLocodBearerPluginParams(const TUid aUid, MLocodBearerPluginObserver& aObserver); - - /** - * Gets the implementation UID of the plugin - * - * @since S60 v3.2 - * @return Implementaion UID - */ - TUid ImplementationUid() const; - - /** - * Gets the observer interface object - * - * @since S60 v3.2 - * @return The observer object - */ - MLocodBearerPluginObserver& Observer() const; - -private: // data - - /** - * The implementation UID - */ - const TUid iImplementationUid; - - /** - * Reference to the observer object - */ - MLocodBearerPluginObserver& iObserver; - - }; - -#include "locodbearerpluginparams.inl" - -#endif // T_LOCODBEARERPLUGINPARAMS_H diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/locod_bearer_plugin_api/inc/locodbearerpluginparams.inl --- a/shortlinkconn_plat/locod_bearer_plugin_api/inc/locodbearerpluginparams.inl Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +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: This is the LCD Bearer Plugin construction parameters -* declaration -* -*/ - - -// ----------------------------------------------------------------------------- -// Constructor method, just saves the arguments into member variables -// ----------------------------------------------------------------------------- -// -inline TLocodBearerPluginParams::TLocodBearerPluginParams(const TUid aUid, MLocodBearerPluginObserver& aObserver) - : iImplementationUid(aUid), - iObserver(aObserver) - { - } - -// ----------------------------------------------------------------------------- -// returns the implementation UID -// ----------------------------------------------------------------------------- -// -inline TUid TLocodBearerPluginParams::ImplementationUid() const - { - return iImplementationUid; - } - -// ----------------------------------------------------------------------------- -// returns the observer class -// ----------------------------------------------------------------------------- -// -inline MLocodBearerPluginObserver& TLocodBearerPluginParams::Observer() const - { - return iObserver; - } diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/locod_bearer_plugin_api/inc/locodplugin.hrh --- a/shortlinkconn_plat/locod_bearer_plugin_api/inc/locodplugin.hrh Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +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: Definitions for plugin resource registration. -* -*/ - - -#ifndef LOCODPLUGIN_HRH -#define LOCODPLUGIN_HRH - -/** - * This file contains the defintions for plugin resource registration. - * - * All plugins should use version 2 registration resource file and set the - * rom_only field to 1 to prevent it from being overridden by RAM-based plugins. - * - * All bearer plugins should use KLOCODBEARERINTERFACEUID as the interface UID. - * - * A bearer plugin should use its corresponding feature ID (from features.hrh) as the - * implementation UID, that is, - * Implementation UID of IR bearer is KFeatureIdIrda, - * Implementation UID of BT bearer is KFeatureIdBt, - * Implementation UID of USB bearer is KFeatureIdUsb. - * - * All service plugins should use KLOCODSERVICEINTERFACEUID as the interface UID. - * - * A service plugin should use its corresponding feature ID (from features.hrh) as the - * implementation UID, that is, - * Implementation UID of Dun is KFeatureIdDun, (not exist yet, CR created) - * Implementation UID of Obex is KFeatureIdSrcs, - * - */ - -// Interface UID of bearer plugins -#define KLOCODBEARERINTERFACEUID 0x20002771 - -// Interface UID of service plugins -#define KLOCODSERVICEINTERFACEUID 0x20002772 - -#endif // LOCODPLUGIN_HRH diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_secondary_display_notification_api/group/bld.inf --- a/shortlinkconn_plat/obex_secondary_display_notification_api/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +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: File that exports the files belonging to -: OBEX Secondary Display Notification API -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -../inc/secondarydisplay/obexutilssecondarydisplayapi.h MW_LAYER_PLATFORM_EXPORT_PATH(secondarydisplay/obexutilssecondarydisplayapi.h) diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_secondary_display_notification_api/inc/secondarydisplay/obexutilssecondarydisplayapi.h --- a/shortlinkconn_plat/obex_secondary_display_notification_api/inc/secondarydisplay/obexutilssecondarydisplayapi.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2005 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: Contains dialog index for cover UI. -* -*/ - - -#ifndef OBEXUTILS_SECONDARY_DISPLAY_API_H -#define OBEXUTILS_SECONDARY_DISPLAY_API_H - -// INCLUDES -#include - -// Category -const TUid KObexUtilsCategory = { 0x101F86AF }; - -/** -* Enumerates types. -*/ -enum TSecondaryDisplayObexUtilsDialogs - { - ECmdNone, - ECmdIrConnecting, - ECmdIrCannotEstablish, - ECmdIrSendingData, - ECmdIrSendingFailed, - ECmdIrDataSent, - ECmdBtConnecting, - ECmdBtSendingData, - ECmdBtDevNotAvail, - ECmdBtFailedToSend, - ECmdBtDataSent, - ECmdBtNotReceiveOne, - ECmdOutOfMemory, - ECmdBtSentImageNumber, - ECmdBtNotReceiveAny, - ECmdBtNotSendAll, - ECmdBtNotAllSupported, - ECmdBtNotAllSupportedMixed, - ECmdBtConnectingWait, - ECmdIrConnectingWait, - ECmdBtPrintingWait, - ECmdSendingProgress - }; - -#endif // OBEXUTILS_SECONDARY_DISPLAY_API_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_secondary_display_notification_api/obex_secondary_display_notification_api.metaxml --- a/shortlinkconn_plat/obex_secondary_display_notification_api/obex_secondary_display_notification_api.metaxml Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ - - - OBEX Secondary Display Notification API - defines message IDs for showing message on secondary display - c++ - localconnectivityservice - - - - - - - - no - no - - diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_plugin_api/group/bld.inf --- a/shortlinkconn_plat/obex_service_plugin_api/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +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: File that exports the files belonging to -: OBEX Service Plugin API -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -../inc/SrcsInterface.inl MW_LAYER_PLATFORM_EXPORT_PATH(SrcsInterface.inl) -../inc/SrcsInterface.h MW_LAYER_PLATFORM_EXPORT_PATH(SrcsInterface.h) diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_plugin_api/inc/SrcsInterface.h --- a/shortlinkconn_plat/obex_service_plugin_api/inc/SrcsInterface.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: Define obexserviceman's service controller ECom interface. -* -*/ - - - -#ifndef _SRCSINTERFACE_ -#define _SRCSINTERFACE_ - - -//INCLUDES -#include -#include -#include - -// CONSTANTS -const TUid KCSrcsInterfaceUid = {0x101F7C8C}; // UID of this interface - - -enum TSrcsMediaType //transport media types - { - ESrcsMediaBT = 1, - ESrcsMediaIrDA, - ESrcsMediaUSB - }; - -/** -* An abstract class being representative of the -* concrete class which the client wishes to use. -* -* It acts as a base, for a real class to provide all the -* functionality that a client requires. -* It supplies instantiation & destruction by using -* the ECom framework, and functional services -* by using the methods of the actual class. -*/ -class CSrcsInterface : public CBase - { -public: - - /** - * Two-phased constructor. - * @param aImplUid Implementation UId. - * @return newly created CSrcsInterface. - */ - static CSrcsInterface* NewL(TUid aImplUid); - - /** - * Destructor - */ - virtual ~CSrcsInterface(); - - /** - * Request a list of all available implementations which satisfies this given interface. - * @param aImplInfoArray Implementation instance array. - * @return none. - */ - static void ListAllImplementationsL(RImplInfoPtrArray& aImplInfoArray); - - /** - * Request a list of matching implementations which satisfies this given interface. - * @param aMatchString String to be matched by the implemention. - * @param aImplInfoArray Implementation instance array. - * @return none. - */ - static void ListImplementationsL(const TDesC8& aMatchString, RImplInfoPtrArray& aImplInfoArray); - - - /** - * Check if OBEX service is still active. - * @return ETrue: OBEX service is still active. - * EFalse: OBEX service is inactive. - */ - virtual TBool IsOBEXActive() = 0; - - /** - * Provide transport media information to service controller. - * @param aMediaType enum value specifying transport media type. - * @return none. - */ - virtual void SetMediaType( TSrcsMediaType aMediaType ) ; - - /** - * SetObexServer - * @param aObexServer pass obex server pointer to sevice controller - * @return none. - */ - virtual TInt SetObexServer( CObexServer* aObexServer ); - -protected: - /** - * C++ default Constructor - */ - inline CSrcsInterface(); - -private: - // Unique instance identifier key - TUid iDtor_ID_Key; - }; - -#include "SrcsInterface.inl" - -#endif - diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_plugin_api/inc/SrcsInterface.inl --- a/shortlinkconn_plat/obex_service_plugin_api/inc/SrcsInterface.inl Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: Define SRCS's service controller ECom interface. -* -*/ - - -// ----------------------------------------------------------------------------- -// CSrcsInterface -// ----------------------------------------------------------------------------- -// -inline CSrcsInterface::CSrcsInterface() - { - } - -// ----------------------------------------------------------------------------- -// destructor -// ----------------------------------------------------------------------------- -// -inline CSrcsInterface::~CSrcsInterface() - { - // Destroy any instance variables and then - // inform the framework that this specific - // instance of the interface has been destroyed. - REComSession::DestroyedImplementation(iDtor_ID_Key); - } - -// ----------------------------------------------------------------------------- -// NewL -// ----------------------------------------------------------------------------- -// -inline CSrcsInterface* CSrcsInterface::NewL(TUid aImplUid) - { - return REINTERPRET_CAST(CSrcsInterface*, - REComSession::CreateImplementationL(aImplUid, - _FOFF(CSrcsInterface,iDtor_ID_Key))); - } - -// ----------------------------------------------------------------------------- -// ListAllImplementationsL -// ----------------------------------------------------------------------------- -// -inline void CSrcsInterface::ListAllImplementationsL(RImplInfoPtrArray& aImplInfoArray) - { - REComSession::ListImplementationsL(KCSrcsInterfaceUid, aImplInfoArray); - } - -// ----------------------------------------------------------------------------- -// ListImplementationsL -// ----------------------------------------------------------------------------- -// -inline void CSrcsInterface::ListImplementationsL(const TDesC8& aMatchString, RImplInfoPtrArray& aImplInfoArray) - { - TEComResolverParams resolverParams; - resolverParams.SetDataType(aMatchString); - resolverParams.SetWildcardMatch(EFalse); - REComSession::ListImplementationsL(KCSrcsInterfaceUid, resolverParams, aImplInfoArray); - } - -// ----------------------------------------------------------------------------- -// SetMediaType -// ----------------------------------------------------------------------------- -// -inline void CSrcsInterface::SetMediaType( TSrcsMediaType ) - { - } -// ----------------------------------------------------------------------------- -// SetObexServer -// ----------------------------------------------------------------------------- -// -inline TInt CSrcsInterface::SetObexServer( CObexServer* ) - { - return KErrNone; - } diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_plugin_api/obex_service_plugin_api.metaxml --- a/shortlinkconn_plat/obex_service_plugin_api/obex_service_plugin_api.metaxml Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ - - - OBEX Service Plugin API - ECom interface for implementing obex service controllers, e.g. ftp, opp service controller - c++ - localconnectivityservice - - - - - - - - no - no - - diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_utils_api/group/bld.inf --- a/shortlinkconn_plat/obex_service_utils_api/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +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: File that exports the files belonging to -: OBEX Service Utils API -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -../inc/obexutilsmessagehandler.h MW_LAYER_PLATFORM_EXPORT_PATH(obexutilsmessagehandler.h) diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_utils_api/inc/obexutilsmessagehandler.h --- a/shortlinkconn_plat/obex_service_utils_api/inc/obexutilsmessagehandler.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,479 +0,0 @@ -/* -* Copyright (c) 2002 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: -* -*/ - - -#ifndef OBEXUTILSMESSAGEHANDLER_H -#define OBEXUTILSMESSAGEHANDLER_H - -// INCLUDES -#include -#include -#include -#include - -#include -#include - -// CLASS DECLARATION - -/** -* Utility methods for message handling. -*/ -class TObexUtilsMessageHandler - { - public: - - /** - * Get status of file system. (in C drive) - * @return Symbian OS errorcode - */ - IMPORT_C static TInt GetFileSystemStatus(); - - /** - * Get status of file system in MMC. - * @return Symbian OS errorcode - */ - IMPORT_C static TInt GetMmcFileSystemStatus(); - - /** - * Get current message centre drive - * @return Drive unit of the message centre drive - */ - IMPORT_C static TInt GetMessageCentreDriveL(); - - /** - * Creates default Mtm service - * @param aMtm Mtm - */ - IMPORT_C static void CreateDefaultMtmServiceL(TUid aMtm); - - /** - * Saves received object to Inbox. - * @param aReceivedObject The object to be saved. - * @param aDrive The current messaging drive. - * @param aMtmID The message type module id. - * @return None. - */ - IMPORT_C static void SaveObjToInboxL( CObexBufObject* aReceivedObject, - const TDesC16& aPath, - const TUid aMtmID ); - - /** - * Creates an Outbox entry - * @param aMTm Message type id - * @param aResourceID Resource id for the message entry text - * @return Message server entry. - */ - IMPORT_C static TMsvId CreateOutboxEntryL( const TUid& aMtm, const TInt& aResourceID ); - - /** - * Deletes an Outbox entry - * @param aMessageServerIndex Message server entry - * @return None. - */ - IMPORT_C static void DeleteOutboxEntryL( const TMsvId& aMessageServerIndex ); - - /** - * Create inbox attachment and entries. - * @param aBufObject The object to be saved - * @param aMtmId MTM Id - * @param aMsvIdParent Parent message entry (returned) - * @param aFile File to the attachment (returned) - * @return None. - */ - IMPORT_C static void CreateInboxAttachmentL( - CObexBufObject* &aBufObject, - const TUid aMtmId, - TMsvId &aMsvIdParent, - RFile &aFile); - - /** - * Create inbox attachment and entries. - * @param aBufObject The object to be saved - * @param aMtmId MTM Id - * @param aMsvIdParent Parent message entry (returned) - * @param aFile File to the attachment (returned) - * @param aRemoteBluetoothName sender's bluetooth name. - * @return None. - */ - IMPORT_C static void CreateInboxAttachmentL( - CObexBufObject* &aBufObject, - const TUid aMtmId, - TMsvId &aMsvIdParent, - RFile &aFile, - const TDesC& aRemoteBluetoothName); - - /** - * Saves received object to Inbox. - * @param aReceivedObject The object to be saved (set to null after remove). - * @param aFile File to the attachment - * @param aMsvIdParent Parent message entry - * @return None. - */ - IMPORT_C static void SaveObjToInboxL( - CObexBufObject* &aReceivedObject, - RFile &aFile, - TMsvId aMsvIdParent); - - /** - * Remove unfinished work from inbox - * @param aBufObject The object to be saved (set to null after remove) - * @param aMsvIdParent Parent message entry - * @return None. - */ - IMPORT_C static void RemoveInboxEntriesL(CObexBufObject* &aBufObject, TMsvId aMsvIdParent); - - /** - * Gets central repository key's integer value - * @param aRepositoryUid Central repository's UID value - * @param aId Central repository's ID value - * @param aVal Returned integer value - * @return Symbian OS errorcode - */ - IMPORT_C static TInt GetCenRepKeyIntValueL(TUid aRepositoryUid, TUint32 aId, TInt& aVal); - - /** - * Gets central repository key's string value - * @param aRepositoryUid Central repository's UID value - * @param aId Central repository's ID value - * @param aVal Returned string value - * @return Symbian OS errorcode - */ - - IMPORT_C static TInt GetCenRepKeyStringValueL(TUid aRepositoryUid, TUint32 aId, TDes& aVal); - - /** - * Gets Publish & Subscribe key's integer value - * @param aCategory Category of the key - * @param aKey PUBSUB Key - * @param value Returned value - * @return Symbian OS errorcode - */ - IMPORT_C static TInt GetPubSubKeyIntValue(TUid aCategory, TUint aKey, TInt& value); - - /** - * Create receive buffer and RFile object. - * @Since S60 v5.0 - * @param aFile File to temp file - * @param aPath Path The directory in which the file is created - * @param aFullName Contains the full path and file name of the file (returned) - * @param aReceiveObject Obex object for receive buffer ( returned ) - * @param aBufSize Size of receive buffer - * @return Symbian error code. - */ - IMPORT_C static TInt CreateReceiveBufferAndRFileL ( RFile& aFile, - const TDesC& aPath, - TFileName& aFullName, - CBufFlat* &aReceiveObject, - const TInt aBufSize ); - - /** - * Remove temporary RFile object. - * @Since S60 v5.0 - * @param aFullName Contains the full path and file name of the file - * @return Symbian error code. - */ - IMPORT_C static void RemoveTemporaryRFileL ( const TFileName& aFullName ); - - /** - * Create inbox entries and saves received object to file system - * @Since S60 v5.0 - * @param aReceiveObject Obex object for receive buffer - * @param aMtmId MTM Id - * @param aMsvIdParent Parent message entry (returned) - * @param aFullName The directory and file name in which the file is saved (returned) - * @param aFile File handler identical with the one in CreateReceiveBufferAndRFileL() - * it must be opened before use. - * @return None - */ - IMPORT_C static void SaveFileToFileSystemL(CObexBufObject* &aReceiveObject, - const TUid aMtmId, - TMsvId& aMsvIdParent, - TFileName& aFullName, - RFile& aFile, - const TDesC& aSenderBluetoothName); - - /** - * Add an entry to Inbox - * @Since S60 v5.0 - * @param aMsvIdParent Parent message entry - * @param aFullName Contains the full path and file name of the file - * @return None - */ - IMPORT_C static void AddEntryToInboxL( TMsvId& aMsvIdParent, - TFileName& aFullName); - - /** - * Add an entry to Inbox - * @Since S60 v5.0 - * @param aMsvIdParent Parent message entry - * @param aFullName Contains the full path and file name of the file - * @param aMsvIdArray an array contains a list of TMsvId ( returned ) - * @return None - */ - IMPORT_C static void AddEntryToInboxL( TMsvId& aMsvIdParent, - TFileName& aFullName, - RArray* aMsvIdArray); - - /** - * Update entry attachmeent in Inbox - * @Since S60 v5.0 - * @param aFullName Contains the full path and file name of the file - * @param aMsvIdParent Parent message entry - * @return None - */ - IMPORT_C static void UpdateEntryAttachmentL ( TFileName& aFullName,CMsvEntry* aParentEntry ); - - - - private: - - class CDummySessionObserver; - class TReceivedData; - - /** - * Create inbox attachment and entries. - * @param aMtmId Mtm ID of the message - * @param aMsvIdParent Parent message entry (returned) - * @param aFile File to the attachment (returned) - * @param aRemoteBluetoothName sender's bluetooth name. - */ - static void DoCreateInboxAttachmentL( - const TUid aMtmId, - TMsvId &aMsvIdParent, - RFile &aFile, - const TDesC& aRemoteBluetoothName = KNullDesC); - - /** - * Deletes Obex Buf Object buffer - * @param aBufObject The buffer object - * @return None. - */ - static void RemoveObexBuffer(CObexBufObject* &aBufObject); - - /* - * Creates Msv session - * @param aSessionObs Session observer - * @param aMsvSession Session - */ - static void CreateMsvSessionLC( - CDummySessionObserver* &aSessionObs, - CMsvSession* &aMsvSession); - - /* - * Creates Msv session to selected destination - * @param aSessionObs Session observer - * @param aMsvSession Session - * @param aDestination Destination - * @param aMsvId Destination type - */ - static void CreateMsvSessionLC( - CDummySessionObserver* &aSessionObs, - CMsvSession* &aMsvSession, - CMsvEntry* &aDestination, - TMsvId aMsvId); - - /** - * Gets current time - * @return None. - */ - static TTime GetCurrentTime(); - - /** - * Stores message as rich text - * @param aParentEntry Parent entry - * @param aFile File to store to the message entry's store - * @return None. - */ - static void StoreAsRichTextL(CMsvEntry* aParentEntry, RFile& aFile); - - /** - * Updates attachment's information - * @param aRecData Received obex data - * @param aAttachEntry Attachment entry - * @param aAttachInfo Attachment information - * @param aStore Message store (attachment) - * @return None. - */ - static void UpdateAttachmentInformationL( - TReceivedData& aRecData, - CMsvEntry* aAttachEntry, - CMsvAttachment* aAttachInfo, - CMsvStore* aStore); - - /** - * Finalises the parent entry to contain correct data - * @param aParentEntry Parent entry - * @param aReceivedData Received obex data - * @param aStore Attachment's store - * @param aIsBioMsg Is BIO message? - * @return None. - */ - static void FinaliseMessageL( - CMsvEntry* aParentEntry, - TReceivedData& aRecData, - CMsvStore* aStore, - TBool aIsBioMsg); - - /** - * Finalises the parent entry to contain correct data - * @Since v5.0 - * @param aParentEntry Parent entry - * @param aStore Attachment's store - * @param aFileEntry a file entry - * @param aFileNameParser a file name parser - * @return None. - */ - static void FinaliseMessageL( - CMsvEntry* aParentEntry, - CMsvStore* aStore, - TEntry& aFileEntry, - TParse& aFileNameParser); - - /** - * Stores BIO message to parent entry's body and updates information - * @param aBioDB BIO database for a BIO message - * @param parentEntry Parent entry - * @param aFile File to save to parent entry's body - * @return None. - */ - static void StoreAndUpdateBioMessageL( - CBIODatabase* aBioDB, - TUid aBioMsgId, - CMsvEntry* parentEntry, - RFile& aFile); - - /** - * Recognises MIME type of a file - * @param aFile File to recognise - * @param aAttachInfo Attachment information - * @return None. - */ - static void RecogniseObjectsL( - TFileName& aFileName, - CMsvAttachment* aAttachInfo); - - /** - * Saves MIME type and gets BIO for that MIME type - * @param aFile File to be recognised - * @param aFsSess File session to use for BIO database - * @param aAttachInfo Attachment information - * @param aBioMsgId Returned BIO message's ID - * @return BIO database for a MIME type (null if not BIO) - */ - static CBIODatabase* SaveMimeAndGetBioLC( - TFileName& aFileName, - RFs& aFsSess, - CMsvAttachment* aAttachInfo, - TUid &aBioMsgId); - - /** - * Constructs rich text - * @return Text in rich text. - */ - static CRichText* ConstructRichTextLC(); - - /** - * Makes a valid OS filesystem filename by removing illegal characters - * @param aFileSession File server filesession - * @param aFileName File name to check and modify - * @return None. - */ - static void MakeValidFileName(RFs& aFileSession, TDes& aFileName); - - /** - * Converts text from UTF-8 to two-byte Unicode - * @param aText destination where to store the converted text - * @param aType source of conversion in UTF-8 - * @return None. - */ - static void SetBioDataTextL(TBioMsgIdText& aText, const TDesC8& aType); - - /** - * Converts text from UTF-8 to two-byte Unicode - * @param aDetails destination where to store the converted text - * @param aType source of conversion in UTF-8 - * @return None. - */ - static void SetDetailsLC( - TPtrC& aDetails, - const TDesC8& aType); - - - /** - * Rename file and move file if needed. - * @Since S60 v5.0 - * @param anOldFileName a file name with absolute path ( returned ) - * @param aNewFileName new path where file will be moved to - * @param aFileSession a file session - * @return None - */ - static TInt RenameFileL(TFileName& aFileName, - TFileName& aNewFileName, - const TDesC& aNewPath, - RFs& aFileSession); - - /** - * Rename filename with a segement number. - * @Since S60 v5.0 - * @param aFilename name of the file ( returned ) - * @param aSegmentNum number used to modifed the file name - * @param aSegmentString string will be added to filename to solve the duplicate filenames - * @return None. - */ - static TInt RenameFileWithSegmentNumL( - TDes& aFileName, - TInt aSegmentNum, - TDes& aSegementString); - - /** - * FixExtremeLongFileName - * @param aFileName extreme long file name (returned) - * @param aDriveAndPath file drive and path - * @return None - */ - static void FixExtremeLongFileName(TFileName& aExtremeLongFileName, const TDesC& aDriveAndPath); - - - /** - * A dummy class for opening CMsvSession. - */ - class CDummySessionObserver : public CBase , public MMsvSessionObserver - { - public: - void HandleSessionEventL( TMsvSessionEvent/*aEvent*/, - TAny* /*aArg1*/, - TAny* /*aArg2*/, - TAny* /*aArg3*/ ) {}; - }; - - /** - * Class for obex received data - */ - class TReceivedData - { - public: - TInt bytesReceived; - TTime recTime; - TFileName msgName; - }; - - }; - -#endif // OBEXUTILSMESSAGEHANDLER_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_utils_api/obex_service_utils_api.metaxml --- a/shortlinkconn_plat/obex_service_utils_api/obex_service_utils_api.metaxml Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ - - - OBEX Service Utils API - provides common functionalities for all service controllers, e.g. showing progress bar on OBEX sending/receiving. - c++ - localconnectivityservice - - - - - - - - - no - no - - diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_utils_api/tsrc/Bmarm/ObexServAPItestu.def --- a/shortlinkconn_plat/obex_service_utils_api/tsrc/Bmarm/ObexServAPItestu.def Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) - diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_utils_api/tsrc/Bwins/ObexServAPItestu.def --- a/shortlinkconn_plat/obex_service_utils_api/tsrc/Bwins/ObexServAPItestu.def Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) - diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_utils_api/tsrc/EABI/ObexServAPItestU.def --- a/shortlinkconn_plat/obex_service_utils_api/tsrc/EABI/ObexServAPItestU.def Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z9LibEntryLR13CTestModuleIf @ 1 NONAME - diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_utils_api/tsrc/conf/obexservapitest.cfg --- a/shortlinkconn_plat/obex_service_utils_api/tsrc/conf/obexservapitest.cfg Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ - -[Test] -title Get file system status -create obexservapitest Message_Handler_Tester -Message_Handler_Tester GetFileSystemStatus -delete Message_Handler_Tester -[Endtest] -[Test] -title Get MMC file system status -create obexservapitest Message_Handler_Tester -Message_Handler_Tester GetMmcFileSystemStatus -delete Message_Handler_Tester -[Endtest] -[Test] -title Get message center drive -create obexservapitest Message_Handler_Tester -Message_Handler_Tester GetMessageCentreDriveL -delete Message_Handler_Tester -[Endtest] -[Test] -title Create default mtm service -create obexservapitest Message_Handler_Tester -Message_Handler_Tester CreateDefaultMtmServiceL -delete Message_Handler_Tester -[Endtest] -[Test] -title Get cenrep key int value -create obexservapitest Message_Handler_Tester -Message_Handler_Tester GetCenRepKeyIntValueL -delete Message_Handler_Tester -[Endtest] -[Test] -title Get PubSub key int value -create obexservapitest Message_Handler_Tester -Message_Handler_Tester GetPubSubKeyIntValue -delete Message_Handler_Tester -[Endtest] -[Test] -title Create and remove outpox entry -create obexservapitest Message_Handler_Tester -Message_Handler_Tester CreateOutBoxEntry -Message_Handler_Tester RemoveOutBoxEntry -delete Message_Handler_Tester -[Endtest] -[Test] -title Crate and remove outpox entry -create obexservapitest Message_Handler_Tester -Message_Handler_Tester SaveObjToInbox -delete Message_Handler_Tester -[Endtest] -[Test] -title Save object to inbox -create obexservapitest Message_Handler_Tester -Message_Handler_Tester SaveObjToInbox -delete Message_Handler_Tester -[Endtest] -[Test] -title Create and save attacment -create obexservapitest Message_Handler_Tester -Message_Handler_Tester CreateEntryToInbox -Message_Handler_Tester SaveRFileObjectToInbox -delete Message_Handler_Tester -[Endtest] -[Test] -title Create and Remove attacment -create obexservapitest Message_Handler_Tester -Message_Handler_Tester CreateEntryToInbox -Message_Handler_Tester RemoveObjectFromInbox -delete Message_Handler_Tester -[Endtest] -[Test] -title Get CenRep key string value -create obexservapitest Message_Handler_Tester -Message_Handler_Tester GetCenRepKeyStringValueL -delete Message_Handler_Tester -[Endtest] -[Test] -title Create and delete receive buffer and RFile -create obexservapitest Message_Handler_Tester -Message_Handler_Tester GetCenRepKeyStringValueL -Message_Handler_Tester CreateReceiveBufferAndRFileL -Message_Handler_Tester RemoveTemporaryRFileL -delete Message_Handler_Tester -[Endtest] -[Test] -title Save receive buffer and RFile to inbox -create obexservapitest Message_Handler_Tester -Message_Handler_Tester GetCenRepKeyStringValueL -Message_Handler_Tester CreateReceiveBufferAndRFileL -Message_Handler_Tester SaveFileToFileSystemL -Message_Handler_Tester AddEntryToInboxL -delete Message_Handler_Tester -[Endtest] -[Test] -title Update the previous Inbox entry -create obexservapitest Message_Handler_Tester -Message_Handler_Tester GetCenRepKeyStringValueL -Message_Handler_Tester CreateReceiveBufferAndRFileL -Message_Handler_Tester SaveFileToFileSystemL -Message_Handler_Tester AddEntryToInboxL -Message_Handler_Tester UpdateEntryAttachmentL -delete Message_Handler_Tester -[Endtest] diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_utils_api/tsrc/group/bld.inf --- a/shortlinkconn_plat/obex_service_utils_api/tsrc/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: ?Description -* -*/ - - - -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 -// NOTE: If using ARS requirements .mmp file operation should be done under this. -// 'abld test build' -obexservapitest.mmp - -PRJ_MMPFILES - -// End of File \ No newline at end of file diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_utils_api/tsrc/group/obexservapitest.mmp --- a/shortlinkconn_plat/obex_service_utils_api/tsrc/group/obexservapitest.mmp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/*TYPE TESTCLASS*//* -* Copyright (c) 2002 - 2007 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: ?Description -* -*/ - - -#if defined(__S60_) - // To get the OSEXT_LAYER_SYSTEMINCLUDE-definition - #include -#endif - -TARGET obexservapitest.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E3 - -CAPABILITY ALL -TCB -/* Remove comments and replace 0x00000000 with correct vendor id */ -// VENDORID 0x00000000 -/* Remove comments and replace 0x00000000 with correct secure id */ -// SECUREID 0x00000000 - -//TARGETPATH ?target_path -DEFFILE ObexServAPItest.def - -SOURCEPATH ../src -SOURCE ObexServAPItest.cpp -SOURCE ObexServAPItestBlocks.cpp -SOURCE testlogger.cpp - - -USERINCLUDE ../inc - -#if defined(__S60_) - // OSEXT_LAYER_SYSTEMINCLUDE - MW_LAYER_SYSTEMINCLUDE -#else - //SYSTEMINCLUDE /epoc32/include - //SYSTEMINCLUDE /epoc32/include/internal -#endif - -LIBRARY euser.lib -LIBRARY stiftestinterface.lib -LIBRARY sysutil.lib -LIBRARY obexutils.lib -LIBRARY irobex.lib -LIBRARY efsrv.lib -LIBRARY msgs.lib - -LANG SC - -// End of File diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_utils_api/tsrc/group/obexservapitest.pkg --- a/shortlinkconn_plat/obex_service_utils_api/tsrc/group/obexservapitest.pkg Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -; -; Copyright (c) 2009 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: -; -; -; Installation file for STIF -; - -; Languages -&EN - -; Provide value for uid -#{"obexservapitest"},(0x00000000),1,1,0,TYPE=SA - -; Series60 product id for S60 5.1 -[0x10283160], 0, 0, 0, {"Series60ProductID"} - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -; Logo -; None - -; Package signature - Optional -; None - -; Start of Package body - -; Condition blocks -; None - -; Options list -; None - -; Install files -"\epoc32\release\armv5\udeb\obexservapitest.dll"-"c:\Sys\Bin\obexservapitest.dll" - -"..\conf\obexservapitest.cfg"-"e:\testing\conf\obexservapitest.cfg" -"..\init\obexservapitest.ini"-"e:\testing\init\obexservapitest.ini" - -; Embedded SIS -; None - -; End of Package body - -; PKG dependencies -; None - -; PKG capabilities -; None - diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_utils_api/tsrc/inc/ObexServAPItest.h --- a/shortlinkconn_plat/obex_service_utils_api/tsrc/inc/ObexServAPItest.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,230 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: ?Description -* -*/ - - - -#ifndef OBEXSERVAPITEST_H -#define OBEXSERVAPITEST_H - -// INCLUDES -#include -#include -#include -#include -#include "testlogger.h" - - -// FORWARD DECLARATIONS -class CObexServAPItest; - - -// CLASS DECLARATION - -/** -* CObexServAPItest test class for STIF Test Framework TestScripter. -*/ -NONSHARABLE_CLASS(CObexServAPItest) : public CScriptBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CObexServAPItest* NewL( CTestModuleIf& aTestModuleIf ); - - /** - * Destructor. - */ - virtual ~CObexServAPItest(); - - public: // New functions - - - - public: // Functions from base classes - - /** - * From CScriptBase Runs a script line. - * @since ?Series60_version - * @param aItem Script line containing method name and parameters - * @return Symbian OS error code - */ - virtual TInt RunMethodL( CStifItemParser& aItem ); - - - - private: - - /** - * C++ default constructor. - */ - CObexServAPItest( CTestModuleIf& aTestModuleIf ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - // Prohibit copy constructor if not deriving from CBase. - // ?classname( const ?classname& ); - // Prohibit assigment operator if not deriving from CBase. - // ?classname& operator=( const ?classname& ); - - /** - * Frees all resources allocated from test methods. - * @since ?Series60_version - */ - void Delete(); - - void TestCompleted( TInt aErr, const TUint8* aFunc, const TDesC& aArg ); - - /** - * Test methods are listed below. - */ - - /** - * Test code for getting file system status. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt GetFileSystemStatusL( CStifItemParser& aItem ); - - /** - * Test code for getting mmc file system status. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt GetMmcFileSystemStatusL( CStifItemParser& aItem ); - - /** - * Test code for getting message center drive. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt GetMessageCentreDriveL( CStifItemParser& aItem ); - - /** - * Test code for creating Default MTM services. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt CreateDefaultMtmServiceL( CStifItemParser& aItem ); - - /** - * Test code for Getting CenRep key. . - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt GetCenRepKeyIntValueL( CStifItemParser& aItem ); - - /** - * Test code for Getting PubSub key. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt GetPubSubKeyIntValueL( CStifItemParser& aItem ); - - /** - * Test code for Creating outbox entry. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt CreateOutBoxEntryL( CStifItemParser& aItem ); - - /** - * Test code for removing outbox entry. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt RemoveOutBoxEntryL( CStifItemParser& aItem ); - - /** - * Test code for save received file to inbox. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt SaveObjToInboxL( CStifItemParser& aItem ); - - /** - * Test code for creating entry to inbox. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt CreateEntryToInboxL( CStifItemParser& aItem ); - - /** - * Test code for creating entry to inbox. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt SaveRFileObjectToInboxL( CStifItemParser& aItem ); - - /** - * Test code for removing entry to inbox. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt RemoveObjectL( CStifItemParser& aItem ); - - TInt CObexServAPItest::GetCenRepKeyStringValueL( CStifItemParser& aItem ); - TInt CObexServAPItest::CreateReceiveBufferAndRFileL( CStifItemParser& aItem ); - TInt CObexServAPItest::SaveFileToFileSystemL( CStifItemParser& aItem ); - TInt CObexServAPItest::AddEntryToInboxL( CStifItemParser& aItem ); - TInt CObexServAPItest::UpdateEntryAttachmentL( CStifItemParser& aItem ); - TInt CObexServAPItest::RemoveTemporaryRFileL( CStifItemParser& aItem ); - - private: // Data - - /** - * A dummy class for opening CMsvSession. - */ - class CDummySessionObserver : public CBase , public MMsvSessionObserver - { - public: - void HandleSessionEventL( TMsvSessionEvent/*aEvent*/, - TAny* /*aArg1*/, - TAny* /*aArg2*/, - TAny* /*aArg3*/ ) {}; - }; - - - - TMsvId iMessageServerIndex; - CObexBufObject* iObexObject; - RFs iRFs; - RFile iFile; - CBufFlat* iBuf; - CObexTestLogger* iTestLogger; - TFileName iCenRepFolder; - TFileName iTempFullPathFilename; - }; - -#endif // OBEXSERVAPITEST_H - -// End of File diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_utils_api/tsrc/inc/testlogger.h --- a/shortlinkconn_plat/obex_service_utils_api/tsrc/inc/testlogger.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* Copyright (c) 2007 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: -* -*/ - - -#ifndef BTTESTLOGGER_H -#define BTTESTLOGGER_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class CStifLogger; -class CTestModuleIf; - -#define TLFUNCLOG (TUint8*) __FUNCTION__ - -// CLASS DECLARATION - -NONSHARABLE_CLASS( CObexTestLogger ) : public CBase -{ - public: - - static CObexTestLogger* NewL(const CTestModuleIf* aTestModuleIf); - virtual ~CObexTestLogger(); - - public: // Data used by functions - - enum TLogLevel {ETLError, ETLResult, ETLInfo, ETLDebug}; - - public: // New functions - - TBool GetEnabled() const; - CStifLogger* GetLogger() const; - const CTestModuleIf* GetTestModuleIf() const; - TInt Log(TLogLevel aLevel, TRefByValue aLogText, ...) const; - TInt Log(const TDesC& aCategory, TRefByValue aLogText, ...) const; - TInt Log(TLogLevel aLevel, TRefByValue aLogText, ...) const; - TInt Log(const TDesC& aCategory, TRefByValue aLogText, ...) const; - TInt LogResult( const TDesC8& aFunc, const TDesC& aArg, TInt aRes ) const; - TInt LogNewLine() const; - void SetEnabled(TBool aEnabled); - void SetLogger(CStifLogger* aLog); - void SetTestModuleIf(const CTestModuleIf* aTestModuleIf); - - public: // Functions from base classes - - private: // New functions - - TInt WriteLog(TLogLevel aLevel, TDes16& aLog) const; - TInt WriteLog(const TDesC16& aCategory, const TDesC16& aLog) const; - static TPtrC GetPrefix(TLogLevel aLevel); - TInt CheckLogFile(); - void LogHeadSectionL(); - void LogTimeStampL(TDes& aBuf, TBool aTime = ETrue) const; - - private: // Constructors - - CObexTestLogger(const CTestModuleIf* aTestModuleIf); - void ConstructL(); - - public: // Data - static const TInt KPrefixLength; - - private: // Data - - TBool iEnabled; - CStifLogger* iLog; - const CTestModuleIf* iTestModuleIf; - }; - -#endif // BTTESTLOGGER_H - diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_utils_api/tsrc/init/obexservapitest.ini --- a/shortlinkconn_plat/obex_service_utils_api/tsrc/init/obexservapitest.ini Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,233 +0,0 @@ -# -# Copyright (c) 2009 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: -# -# - -# -# This is STIF initialization file -# Comment lines start with '#'-character. -# See STIF TestFramework users guide.doc for instructions - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Set following test engine settings: -# - Set Test Reporting mode. TestReportMode's possible values are: -# + 'Summary': Summary of the tested test cases. -# + 'Environment': Hardware and software info. -# + 'TestCases': Test case report. -# + 'FullReport': Set of all above ones. -# + Example 'TestReportMode= Summary TestCases' -# -# - CreateTestReport setting controls report creation mode -# + YES, Test report will created. -# + NO, No Test report. -# -# - File path indicates the base path of the test report. -# - File name indicates the name of the test report. -# -# - File format indicates the type of the test report. -# + TXT, Test report file will be txt type, for example 'TestReport.txt'. -# + HTML, Test report will be html type, for example 'TestReport.html'. -# -# - File output indicates output source of the test report. -# + FILE, Test report logging to file. -# + RDEBUG, Test report logging to using rdebug. -# -# - File Creation Mode indicates test report overwriting if file exist. -# + OVERWRITE, Overwrites if the Test report file exist. -# + APPEND, Continue logging after the old Test report information if -# report exist. -# - Sets a device reset module's dll name(Reboot). -# + If Nokia specific reset module is not available or it is not correct one -# StifHWResetStub module may use as a template for user specific reset -# module. -# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation -# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02 -# - -[Engine_Defaults] - -TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', - # 'TestCases' or 'FullReport' - -CreateTestReport= YES # Possible values: YES or NO - -TestReportFilePath= e:\testing\logs\ -TestReportFileName= obexServApiTest_TestReport - -TestReportFormat= TXT # Possible values: TXT, HTML or XML -TestReportOutput= FILE # Possible values: FILE or RDEBUG -TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND - -DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting - -DisableMeasurement= stifmeasurementdisablenone # Possible values are: - # 'stifmeasurementdisablenone', 'stifmeasurementdisableall' - # 'stifmeasurementplugin01', 'stifmeasurementplugin02', - # 'stifmeasurementplugin03', 'stifmeasurementplugin04', - # 'stifmeasurementplugin05' or 'stifbappeaprofiler' - -Timeout= 0 # Default timeout value for each test case. In milliseconds -#UITestingSupport= YES # Possible values: YES or NO -#SeparateProcesses= YES # Possible values: YES or NO (default: NO) -[End_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Module configurations start -# Modules are added between module tags -# tags. Module name is specified after ModuleName= tag, like -# ModuleName= XXXXXXXXX -# Modules might have initialisation file, specified as -# IniFile= c:\testframework\YYYYYY -# Modules might have several configuration files, like -# TestCaseFile= c:\testframework\NormalCases.txt -# TestCaseFile= c:\testframework\SmokeCases.txt -# TestCaseFile= c:\testframework\ManualCases.txt - -# (TestCaseFile is synonym for old term ConfigFile) - -# Following case specifies demo module settings. Demo module -# does not read any settings from file, so tags -# IniFile and TestCaseFile are not used. -# In the simplest case it is enough to specify only the -# name of the test module when adding new test module - -[New_Module] -ModuleName= testscripter -TestCaseFile= e:\testing\conf\obexservapitest.cfg -[End_Module] - - -# Load testmoduleXXX, optionally with initialization file and/or test case files -#[New_Module] -#ModuleName= testmodulexxx - -#TestModuleXXX used initialization file -#IniFile= c:\testframework\init.txt - -#TestModuleXXX used configuration file(s) -#TestCaseFile= c:\testframework\testcases1.cfg -#TestCaseFile= c:\testframework\testcases2.cfg -#TestCaseFile= c:\testframework\manualtestcases.cfg - -#[End_Module] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Set STIF logging overwrite parameters for Logger. -# Hardware and emulator environment logging path and styles can -# be configured from here to overwrite the Logger's implemented values. -# -# Settings description: -# - Indicates option for creation log directory/directories. If log directory/directories -# is/are not created by user they will make by software. -# + YES, Create log directory/directories if not allready exist. -# + NO, Log directory/directories not created. Only created one is used. -# -# - Overwrite emulator path setting. -# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined -# Logger's path 'D:\\LOGS\\Module\\' with those definition the path -# will be 'C:\LOGS\TestFramework\LOGS\Module\' -# -# - Overwrite emulator's logging format. -# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. -# + HTML, Log file(s) will be html type(s), for example 'Module.html'. -# -# - Overwrited emulator logging output source. -# + FILE, Logging to file(s). -# + RDEBUG, Logging to using rdebug(s). -# -# - Overwrite hardware path setting (Same description as above in emulator path). -# - Overwrite hardware's logging format(Same description as above in emulator format). -# - Overwrite hardware's logging output source(Same description as above in emulator output). -# -# - File Creation Mode indicates file overwriting if file exist. -# + OVERWRITE, Overwrites if file(s) exist. -# + APPEND, Continue logging after the old logging information if file(s) exist. -# -# - Will thread id include to the log filename. -# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. -# + NO, No thread id to log file(s), Example filename 'Module.txt'. -# -# - Will time stamps include the to log file. -# + YES, Time stamp added to each line in log file(s). Time stamp is -# for example'12.Nov.2003 115958 LOGGING INFO' -# + NO, No time stamp(s). -# -# - Will line breaks include to the log file. -# + YES, Each logging event includes line break and next log event is in own line. -# + NO, No line break(s). -# -# - Will event ranking include to the log file. -# + YES, Event ranking number added to each line in log file(s). Ranking number -# depends on environment's tics, for example(includes time stamp also) -# '012 12.Nov.2003 115958 LOGGING INFO' -# + NO, No event ranking. -# -# - Will write log file in unicode format. -# + YES, Log file will be written in unicode format -# + NO, Log will be written as normal, not unicode, file. -# - -[Logger_Defaults] - -#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' -#NOTE: TestEngine and TestServer logging settings cannot change here - -CreateLogDirectories= YES # Possible values: YES or NO - -#EmulatorBasePath= C:\LOGS\TestFramework\ -#EmulatorFormat= HTML # Possible values: TXT or HTML -#EmulatorOutput= FILE # Possible values: FILE or RDEBUG - -#HardwareBasePath= D:\LOGS\TestFramework\ -#HardwareFormat= HTML # Possible values: TXT or HTML -#HardwareOutput= FILE # Possible values: FILE or RDEBUG - -#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND - -#ThreadIdToLogFile= YES # Possible values: YES or NO -#WithTimeStamp= YES # Possible values: YES or NO -#WithLineBreak= YES # Possible values: YES or NO -#WithEventRanking= YES # Possible values: YES or NO - -#FileUnicode= YES # Possible values: YES or NO -#AddTestCaseTitle= YES # Possible values: YES or NO -[End_Logger_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Set filters to be used by ConsoleUI. -# If you want to use filter with ConsoleUI, simply remove comments -# from section below and provide valid filter entries. -# Each filter line has to start with "filter= " keyword. -# Filter can contain special wildcard characters: -# * which stands for none or any literal; -# ? which stands for single character. -# Filters are not case-sensitive. - -#[Filters] -#filter= *math* -#filter= *radio* -#[End_Filters] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -# End of file diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_utils_api/tsrc/rom/obexservapitest.iby --- a/shortlinkconn_plat/obex_service_utils_api/tsrc/rom/obexservapitest.iby Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2007-2007 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: Image description file for project bteng -* -*/ - -#ifndef BTENGAPITEST_IBY -#define BTENGAPITEST_IBY - -#include - -file=ABI_DIR\BUILD_DIR\ObexServAPItest.dll SHARED_LIB_DIR\ObexServAPItest.dll - -#endif // BTENGAPITEST_IBY diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_utils_api/tsrc/src/ObexServAPItest.cpp --- a/shortlinkconn_plat/obex_service_utils_api/tsrc/src/ObexServAPItest.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: ?Description -* -*/ - - - -// INCLUDE FILES -#include -#include "ObexServAPItest.h" - -// EXTERNAL DATA STRUCTURES -//extern ?external_data; - -// EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def - -// LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def - -// MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration - -// LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CObexServAPItest::CObexServAPItest -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CObexServAPItest::CObexServAPItest( - CTestModuleIf& aTestModuleIf ): - CScriptBase( aTestModuleIf ) - { - } - -// ----------------------------------------------------------------------------- -// CObexServAPItest::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CObexServAPItest::ConstructL() - { - - iTestLogger = CObexTestLogger::NewL( &TestModuleIf() ); - - } - -// ----------------------------------------------------------------------------- -// CObexServAPItest::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CObexServAPItest* CObexServAPItest::NewL( - CTestModuleIf& aTestModuleIf ) - { - CObexServAPItest* self = new (ELeave) CObexServAPItest( aTestModuleIf ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - - return self; - - } - -// Destructor -CObexServAPItest::~CObexServAPItest() - { - - // Delete resources allocated from test methods - Delete(); - - // Delete logger - delete iTestLogger; - iTestLogger = NULL; - } - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// LibEntryL is a polymorphic Dll entry point. -// Returns: CScriptBase: New CScriptBase derived object -// ----------------------------------------------------------------------------- -// -EXPORT_C CScriptBase* LibEntryL( - CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework - { - - return ( CScriptBase* ) CObexServAPItest::NewL( aTestModuleIf ); - - } - - -// End of File diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_utils_api/tsrc/src/ObexServAPItestBlocks.cpp --- a/shortlinkconn_plat/obex_service_utils_api/tsrc/src/ObexServAPItestBlocks.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,630 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: ?Description -* -*/ - - - -// INCLUDE FILES -#include -#include -#include -#include -#include -#include -#include -#include "testlogger.h" -#include "ObexServAPItest.h" - -#include - -// CONSTANTS -const TInt KBufferSize = 0x4000; // 16kB - -// Defined to coincide with the definition in btmsgtypeuid.h -const TUid KUidMsgTypeBt = {0x10009ED5}; - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CObexServAPItest::Delete -// Delete here all resources allocated and opened from test methods. -// Called from destructor. -// ----------------------------------------------------------------------------- -// -void CObexServAPItest::Delete() - { - delete iObexObject; - iObexObject = NULL; - delete iBuf; - iBuf = NULL; - iRFs.Close(); - } - -// ----------------------------------------------------------------------------- -// CObexServAPItest::RunMethodL -// Run specified method. Contains also table of test mothods and their names. -// ----------------------------------------------------------------------------- -// -TInt CObexServAPItest::RunMethodL( - CStifItemParser& aItem ) - { - - static TStifFunctionInfo const KFunctions[] = - { - // Copy this line for every implemented function. - // First string is the function name used in TestScripter script file. - // Second is the actual implementation member function. - ENTRY( "GetFileSystemStatus", CObexServAPItest::GetFileSystemStatusL ), - ENTRY( "GetMmcFileSystemStatus", CObexServAPItest::GetMmcFileSystemStatusL ), - ENTRY( "GetMessageCentreDriveL", CObexServAPItest::GetMessageCentreDriveL ), - ENTRY( "CreateDefaultMtmServiceL", CObexServAPItest::CreateDefaultMtmServiceL ), - ENTRY( "GetCenRepKeyIntValueL", CObexServAPItest::GetCenRepKeyIntValueL ), - ENTRY( "GetPubSubKeyIntValue", CObexServAPItest::GetPubSubKeyIntValueL ), - ENTRY( "CreateOutBoxEntry", CObexServAPItest::CreateOutBoxEntryL ), - ENTRY( "RemoveOutBoxEntry", CObexServAPItest::RemoveOutBoxEntryL ), - ENTRY( "SaveObjToInbox", CObexServAPItest::SaveObjToInboxL ), - ENTRY( "CreateEntryToInbox", CObexServAPItest::CreateEntryToInboxL ), - ENTRY( "SaveRFileObjectToInbox", CObexServAPItest::SaveRFileObjectToInboxL ), - ENTRY( "RemoveObjectFromInbox", CObexServAPItest::RemoveObjectL ), - ENTRY( "GetCenRepKeyStringValueL", CObexServAPItest::GetCenRepKeyStringValueL), // JHä - ENTRY( "CreateReceiveBufferAndRFileL", CObexServAPItest::CreateReceiveBufferAndRFileL), // JHä - ENTRY( "RemoveTemporaryRFileL", CObexServAPItest::RemoveTemporaryRFileL), // JHä - ENTRY( "SaveFileToFileSystemL", CObexServAPItest::SaveFileToFileSystemL), // JHä - ENTRY( "AddEntryToInboxL", CObexServAPItest::AddEntryToInboxL), // JHä - ENTRY( "UpdateEntryAttachmentL", CObexServAPItest::UpdateEntryAttachmentL), // JHä - }; - - const TInt count = sizeof( KFunctions ) / - sizeof( TStifFunctionInfo ); - - return RunInternalL( KFunctions, count, aItem ); - - } - - // ----------------------------------------------------------------------------- -// CBtApiTest::TestCompleted -// ----------------------------------------------------------------------------- -// -void CObexServAPItest::TestCompleted( TInt aErr, const TUint8* aFunc, const TDesC& aArg ) - { - iTestLogger->LogResult( (TPtrC8( aFunc )), aArg, aErr ); - Signal( aErr ); - } - - -// ----------------------------------------------------------------------------- -// CObexServAPItest::GetFileSystemStatusL -// Test code for getting file system status. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CObexServAPItest::GetFileSystemStatusL( CStifItemParser& /*aItem*/ ) - { - // Print to log file - TInt retVal=TObexUtilsMessageHandler::GetFileSystemStatus(); - if (retVal == 0 || retVal == KErrDiskFull) - { - TestCompleted( KErrNone, TLFUNCLOG, _L("GetFileSystemStatusL")); - } - else - { - TestCompleted( retVal, TLFUNCLOG, _L("Error getting files ystem status")); - } - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// CObexServAPItest::GetMmcFileSystemStatusL -// Test code for getting mmc file system status. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CObexServAPItest::GetMmcFileSystemStatusL( CStifItemParser& /*aItem*/ ) - { - TInt retVal=TObexUtilsMessageHandler::GetMmcFileSystemStatus(); - if (retVal == 0 || retVal == KErrDiskFull) - { - TestCompleted( KErrNone, TLFUNCLOG, _L("GetFileSystemStatusL")); - } - else - { - TestCompleted( retVal, TLFUNCLOG, _L("Error getting files ystem status")); - } - - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// CObexServAPItest::GetMessageCentreDriveL -// Test code for getting message center drive. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CObexServAPItest::GetMessageCentreDriveL( CStifItemParser& /*aItem*/ ) - { - - TInt retVal = TObexUtilsMessageHandler::GetMessageCentreDriveL(); - if (retVal >= 0 ) - { - TestCompleted( KErrNone, TLFUNCLOG, _L("GetMessageCentreDrive")); - } - else - { - TestCompleted( retVal, TLFUNCLOG, _L("GetMessageCentreDrive failed")); - } - - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// CObexServAPItest::CreateDefaultMtmServiceL -// Test code for creating Default MTM services. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CObexServAPItest::CreateDefaultMtmServiceL( CStifItemParser& /*aItem*/ ) - { - - TRAPD(error, TObexUtilsMessageHandler::CreateDefaultMtmServiceL(KUidMsgTypeBt) ); - if (error == KErrNone) - { - TestCompleted( KErrNone, TLFUNCLOG, _L("CreateDefaultMtmServiceL")); - } - else - { - TestCompleted( error, TLFUNCLOG, _L("CreateDefaultMtmServiceL")); - } - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// CObexServAPItest::GetCenRepKeyIntValueL -// Test code for Getting CenRep key. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CObexServAPItest::GetCenRepKeyIntValueL( CStifItemParser& /*aItem*/ ) // JHä note: Is return code handling done right? - { - TInt limit=0; - TInt error=0; - TRAPD(leaveVal, error = TObexUtilsMessageHandler::GetCenRepKeyIntValueL(KCRUidUiklaf, - KUikOODDiskCriticalThreshold, - limit)); - if( leaveVal != KErrNone ) - { - TestCompleted( leaveVal, TLFUNCLOG, _L("GetCenRepKeyIntValueL leaves")); - } - else if (error == KErrNone) - { - TestCompleted( leaveVal, TLFUNCLOG, _L("GetCenRepKeyIntValue return error")); - } - else - { - TestCompleted( KErrNone, TLFUNCLOG, _L("GetCenRepKeyIntValueL")); - } - - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// CObexServAPItest::GetPubSubKeyIntValueL -// Test code for Getting PubSub key. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CObexServAPItest::GetPubSubKeyIntValueL( CStifItemParser& /*aItem*/ ) - { - TInt status = KErrNone; - TInt retVal = KErrNone; - - TRAPD(leaveVal, retVal = TObexUtilsMessageHandler::GetPubSubKeyIntValue(KPSUidUikon, KUikFFSFreeLevel, status)); - - if( leaveVal != KErrNone ) - { - TestCompleted( leaveVal, TLFUNCLOG, _L("GetPubSubKeyIntValueL leaves")); - } - else if (retVal == KErrNone) - { - TestCompleted( retVal, TLFUNCLOG, _L("GetPubSubKeyIntValueL return error")); - } - else - { - TestCompleted( KErrNone, TLFUNCLOG, _L("GetPubSubKeyIntValue")); - } - - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// CObexServAPItest::OutBoxEntryL -// Test code for Creating outbox entry. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CObexServAPItest::CreateOutBoxEntryL( CStifItemParser& /*aItem*/ ) - { - TRAPD(error, iMessageServerIndex = TObexUtilsMessageHandler::CreateOutboxEntryL( KUidMsgTypeBt, R_BT_SEND_OUTBOX_SENDING )); - if( error != KErrNone) - { - TestCompleted( error, TLFUNCLOG, _L("CreateOutBoxEntryL leaves")); - } - else - { - TestCompleted( KErrNone, TLFUNCLOG, _L("CreateOutBoxEntryL")); - } - - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// CObexServAPItest::OutBoxEntryL -// Test code for removing outbox entry. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CObexServAPItest::RemoveOutBoxEntryL( CStifItemParser& /*aItem*/ ) - { - - TRAPD(error, TObexUtilsMessageHandler::DeleteOutboxEntryL( iMessageServerIndex )); - if( error != KErrNone) - { - TestCompleted( error, TLFUNCLOG, _L("RemoveOutBoxEntryL leaves")); - } - else - { - TestCompleted( KErrNone, TLFUNCLOG, _L("RemoveOutBoxEntryL")); - } - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// CObexServAPItest::SaveObjToInboxL -// Test code for save received file to inbox. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CObexServAPItest::SaveObjToInboxL( CStifItemParser& /*aItem*/ ) - { - - CObexBufObject* obexobject = CObexBufObject::NewL( NULL ); - CleanupStack::PushL(obexobject); - - TRAP_IGNORE(TObexUtilsMessageHandler::SaveObjToInboxL(obexobject , - KNullDesC, - KUidMsgTypeBt )); - TestCompleted( KErrNone, TLFUNCLOG, _L("SaveObjToInboxL leaves")); - - CleanupStack::PopAndDestroy(obexobject); - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// CObexServAPItest::CreateAndSaveObjectL -// Test code for creating entry to inbox. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CObexServAPItest::CreateEntryToInboxL( CStifItemParser& /*aItem*/ ) - { - iFile = RFile(); - - if ( iObexObject) - { - delete iObexObject; - iObexObject = NULL; - } - - iObexObject = CObexBufObject::NewL( NULL ); - - TRAPD( error, TObexUtilsMessageHandler::CreateInboxAttachmentL( iObexObject, - KUidMsgTypeBt, - iMessageServerIndex, - iFile)); - - - iBuf = CBufFlat::NewL(1024); - iBuf->ResizeL(1024); - - TObexRFileBackedBuffer bufferdetails(*iBuf,iFile,CObexBufObject::EDoubleBuffering); - - TRAP_IGNORE( iObexObject->SetDataBufL( bufferdetails) ); - - - - iFile.Write(_L8("test")); - iObexObject->SetNameL(_L("test.txt")); - - if( error != KErrNone) - { - TestCompleted( error, TLFUNCLOG, _L("CreateEntryToInboxL leaves")); - } - else - { - TestCompleted( error, TLFUNCLOG, _L("CreateEntryToInboxL")); - } - return KErrNone; - } - - -// ----------------------------------------------------------------------------- -// CObexServAPItest::CreateAndSaveObjectL -// Test code for creating entry to inbox. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CObexServAPItest::SaveRFileObjectToInboxL( CStifItemParser& /*aItem*/ ) - { - TRAPD( error, TObexUtilsMessageHandler::SaveObjToInboxL( - iObexObject, - iFile, - iMessageServerIndex)); - - delete iBuf; - iBuf = NULL; - if( error != KErrNone) - { - TestCompleted( error, TLFUNCLOG, _L("SaveObjToInboxL leaves")); - } - else - { - TestCompleted( error, TLFUNCLOG, _L("SaveObjToInboxL")); - } - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CObexServAPItest::RemoveObjectL -// Test code for removing entry to inbox. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CObexServAPItest::RemoveObjectL( CStifItemParser& /*aItem*/ ) - { - TRAPD(error,TObexUtilsMessageHandler::RemoveInboxEntriesL(iObexObject, iMessageServerIndex)); - delete iBuf; - iBuf = NULL; - if( error != KErrNone) - { - TestCompleted( error, TLFUNCLOG, _L("SaveObjToInboxL leaves")); - } - else - { - TestCompleted( error, TLFUNCLOG, _L("SaveObjToInboxL")); - } - return KErrNone; - } - -// Find out the path of the receive folder. -TInt CObexServAPItest::GetCenRepKeyStringValueL( CStifItemParser& /*aItem*/ ) // JHä - Done - { - TInt error = KErrNone; - TRAPD(leaveVal, error = TObexUtilsMessageHandler::GetCenRepKeyStringValueL(KCRUidBluetoothEngine, - KLCReceiveFolder, - iCenRepFolder)); - if( leaveVal != KErrNone ) - { - TestCompleted( leaveVal, TLFUNCLOG, _L("GetCenRepKeyStringValueL leaves")); - } - else if (error != KErrNone) - { - TestCompleted( leaveVal, TLFUNCLOG, _L("GetCenRepKeyStringValueL return error")); - } - else - { - TestCompleted( KErrNone, TLFUNCLOG, _L("GetCenRepKeyStringValueL")); - } - - return KErrNone; - } - -// Create the receive buffer and temporary receive file. -TInt CObexServAPItest::CreateReceiveBufferAndRFileL( CStifItemParser& /*aItem*/ ) // JHä - Done - { - TFileName defaultFolder; - defaultFolder.Zero(); - - User::LeaveIfError(iRFs.Connect()); - - iFile = RFile(); // Creating an empty file. - - // Ensure that the object and buffer don't exist. - // This also deletes the previous iFile object, if any existed, - // because its handle is held by iObexObject. - if(iObexObject) - { - delete iObexObject; - iObexObject = NULL; - } - if( iBuf ) - { - delete iBuf; - iBuf=NULL; - } - - // Then create a new obex object for holding the buffer and the temp file. - iObexObject = CObexBufObject::NewL( NULL ); - - defaultFolder.Append(_L("C:\\data\\")); - defaultFolder.Append(iCenRepFolder); // Got this from central repository in GetCenRepKeyStringValueL - - TRAPD(error,TObexUtilsMessageHandler::CreateReceiveBufferAndRFileL( iFile, // Out: But iFile is returned as closed. - defaultFolder, // Where to create the temp file. - iTempFullPathFilename, // Out: Can be used to open the file later. - iBuf, // Out: This contains the message buffer. - KBufferSize)); - - // Open the file again. - User::LeaveIfError(iFile.Open(iRFs, iTempFullPathFilename, EFileWrite)); - - TObexRFileBackedBuffer bufferdetails(*iBuf,iFile,CObexBufObject::EDoubleBuffering); - - // Do we really need to trap leaves here? Maybe because of Stif? - TRAP(error, iObexObject->SetDataBufL( bufferdetails) ); - if (error != KErrNone) - { - error = KErrGeneral; - } - - iFile.Write(_L8("test")); // Put some test data into the file, although it is not mandatory. - iFile.Flush(); - - iObexObject->SetNameL(_L("test.txt")); - - // At this point we have an object in file system (iFile refers to it) - // and an entry in Inbox which we can later refer to with iMessageServerIndex. - - if( error != KErrNone) - { - TestCompleted( error, TLFUNCLOG, _L("CreateReceiveBufferAndRFileL leaves")); - } - else - { - TestCompleted( error, TLFUNCLOG, _L("CreateReceiveBufferAndRFileL")); - } - - // iFile is left open - return KErrNone; - } - -// Copy the temporary receive file to the correct place in the file system after receiving is complete. -TInt CObexServAPItest::SaveFileToFileSystemL( CStifItemParser& /*aItem*/ ) // JHä - Done - { - // Create bogus device name. - TBTDeviceName remoteDeviceName; - remoteDeviceName.Zero(); - remoteDeviceName.Append(_L("APITestDevice")); - -// The iFile must be still open after calling CreateReceiveBufferAndRFileL method - - TRAPD(error,TObexUtilsMessageHandler::SaveFileToFileSystemL( iObexObject, - KUidMsgTypeBt, - iMessageServerIndex, // This is gotten - iTempFullPathFilename, // Contains the final path of the file - iFile, // Handle to the temp file. - remoteDeviceName)); - - if( error != KErrNone) - { - TestCompleted( error, TLFUNCLOG, _L("SaveFileToFileSystemL leaves")); - } - else - { - TestCompleted( error, TLFUNCLOG, _L("SaveFileToFileSystemL")); - } - return KErrNone; - } - -// Create an entry in the Inbox and attach the file there. -TInt CObexServAPItest::AddEntryToInboxL( CStifItemParser& /*aItem*/ ) // JHä - Done - { - RArray tmpMsvIdArray; // Not really needed, but must be passed to the method. - - TRAPD(error,TObexUtilsMessageHandler::AddEntryToInboxL( iMessageServerIndex, - iTempFullPathFilename, - &tmpMsvIdArray)); - - if( error != KErrNone) - { - TestCompleted( error, TLFUNCLOG, _L("AddEntryToInboxL leaves")); - } - else - { - TestCompleted( error, TLFUNCLOG, _L("AddEntryToInboxL")); - } - return KErrNone; - } - -// Replacing a broken link in Inbox with a proper link to a file. -TInt CObexServAPItest::UpdateEntryAttachmentL( CStifItemParser& /*aItem*/ ) // JHä - Done - { - // Create a new file to be the replacement: - TFileName tempFilename; - TFileName defaultFolder; - RFs rfs; - RFile newFile; - - User::LeaveIfError(rfs.Connect()); - CleanupClosePushL(rfs); - - defaultFolder.Zero(); - defaultFolder.Append(_L("C:\\data\\")); - defaultFolder.Append(iCenRepFolder); // Got this from central repository in GetCenRepKeyStringValueL - User::LeaveIfError( newFile.Temp( rfs, defaultFolder, tempFilename, EFileWrite) ); - newFile.Write(_L8("testing replacing")); - newFile.Flush(); - newFile.Close(); - - CleanupStack::PopAndDestroy(); // rfs - - // Then replace the attachment: - CDummySessionObserver* sessionObs = new( ELeave )CDummySessionObserver;; - CleanupStack::PushL( sessionObs ); - CMsvSession* msvSession = CMsvSession::OpenSyncL( *sessionObs ); - CleanupStack::PushL(msvSession); - CMsvEntry* entry = msvSession->GetEntryL(iMessageServerIndex); - CleanupStack::PushL(entry); - TRAPD(error,TObexUtilsMessageHandler::UpdateEntryAttachmentL(tempFilename, entry)); - - // Cleanup: - CleanupStack::PopAndDestroy(3); // entry, msvSession, sessionObs, - - // Save the path to the new file so it can be referred to later. - iTempFullPathFilename = tempFilename; - - if( error != KErrNone) - { - TestCompleted( error, TLFUNCLOG, _L("UpdateEntryAttachmentL leaves")); - } - else - { - TestCompleted( error, TLFUNCLOG, _L("UpdateEntryAttachmentL")); - } - return KErrNone; - } - -// Delete the temporary file. Called normally when the link is broken and the user searches for the file. -// In test code this should be called after creating the temporary RFile and before -// creating the Inbox entry. -TInt CObexServAPItest::RemoveTemporaryRFileL( CStifItemParser& /*aItem*/ ) // JHä - Done - { - TRAPD(error,TObexUtilsMessageHandler::RemoveTemporaryRFileL(iTempFullPathFilename)); - if( error != KErrNone) - { - TestCompleted( error, TLFUNCLOG, _L("RemoveTemporaryRFileL leaves")); - } - else - { - TestCompleted( error, TLFUNCLOG, _L("RemoveTemporaryRFileL")); - } - return KErrNone; - } - - -// ========================== OTHER EXPORTED FUNCTIONS ========================= -// None - -// End of File diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/obex_service_utils_api/tsrc/src/testlogger.cpp --- a/shortlinkconn_plat/obex_service_utils_api/tsrc/src/testlogger.cpp Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,530 +0,0 @@ -/* -* Copyright (c) 2007 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: -* -*/ - -// INCLUDES - -#include "testlogger.h" - -#include -#include - -#include -#include -#include - -// RDebug -#include - -const TInt CObexTestLogger::KPrefixLength = 8; -// Timestamp string length -const TInt KTimeStampStrLen = 21; -// Extended Timestamp string length -const TInt KExtTimeStampStrLen = 40; -// Extended time stamp -typedef TBuf TExtTimeStamp; -// Logging path -_LIT( KObexServAPITestSystemLogPath, "e:\\logs\\ObexServAPItest\\" ); -// Log file -_LIT( KObexServAPITestSystemLogFile, "ObexServAPItest.html" ); -// Log file -_LIT( KObexServAPITestSystemLogFullName, "\\logs\\ObexServAPItest\\ObexServAPItest%x.html" ); -// Time stamp format string -_LIT( KFormatTimeStamp, "
[%H:%T:%S.%*C4] " ); -// Date format string -_LIT( KFormatDate, "%F%D %N %Y" ); -// HTML header section -_LIT( KHtmlHeadSection, "\n\nObex Message Handler Test System results\n\n\n\n\n\n" ); -// HTML code which will display the statistics -_LIT( KHtmlStatSection, "

Logfile created on %S at %S
\nS60 version %S

\n\n
\n
\n\n" ); -// HTML identifier for test case start -_LIT( KHtmlTestCaseStart, "
" ); -// Test case result logging -_LIT( KTestCaseResult, "Test completed; function %S, parameter %S, result
%d
" ); -// JavaScript function for calculating test result -#define KJSSECTION _L( "" ) - -// Construction and destruction. - -// ----------------------------------------------------------------------------- -// CObexTestLogger::NewL -// Static constructor to constructor builder objects. -// ----------------------------------------------------------------------------- -// -CObexTestLogger* CObexTestLogger::NewL(const CTestModuleIf* aTestModuleIf) - { - CObexTestLogger* self = new (ELeave) CObexTestLogger(aTestModuleIf); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(self); - - return self; - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::CObexTestLogger -// Constructor. -// ----------------------------------------------------------------------------- -// -CObexTestLogger::CObexTestLogger(const CTestModuleIf* aTestModuleIf) - : CBase(), - iEnabled(ETrue), - iTestModuleIf(aTestModuleIf) - { - } - -// ----------------------------------------------------------------------------- -// CTestLogger::ConstructL -// 2nd phase constructor. -// ----------------------------------------------------------------------------- -// -void CObexTestLogger::ConstructL() - { - TInt err = CheckLogFile(); - iLog = CStifLogger::NewL( KObexServAPITestSystemLogPath, KObexServAPITestSystemLogFile, - CStifLogger::ETxt, CStifLogger::EFile, EFalse, EFalse ); - if( err == KErrNotFound ) - { // Add info & HTML markup to the beginning of the log file. - LogHeadSectionL(); - } - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::~CObexTestLogger -// Destructor. -// ----------------------------------------------------------------------------- -// -CObexTestLogger::~CObexTestLogger() - { - delete iLog; - } - -// Member functions. - -// ----------------------------------------------------------------------------- -// CObexTestLogger::GetLogger -// Returns a pointer to current STIF logger. -// ----------------------------------------------------------------------------- -// -CStifLogger* CObexTestLogger::GetLogger() const - { - return iLog; - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::GetTestModuleIf -// Returns a pointer to current STIF test module interface. -// ----------------------------------------------------------------------------- -// -const CTestModuleIf* CObexTestLogger::GetTestModuleIf() const - { - return iTestModuleIf; - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::Log -// Logs 8 bit data to screen and file. -// ----------------------------------------------------------------------------- -// -TInt CObexTestLogger::Log(TLogLevel aLevel, TRefByValue aLogText, ...) const - { - if (!iEnabled) - { - return KErrNone; - } - - const TDesC8& actualData = aLogText; - - // Check that user does not try to output too much data. - if (actualData.Length() > KMaxLogData - KPrefixLength) - { - return KErrTooBig; - } - - // Buffer to convert 8 bit data to to 16 bit. - TLogInfo8 converter; - - // Create variable argument list. - VA_LIST args; - VA_START(args, aLogText); - - // Format the argument list to the output buffer. - converter.FormatList( aLogText, args ); - - // Free the variable argument list - VA_END(args); - - TLogInfo buffer; - buffer.Copy( converter ); - - // Append log prefix to the output buffer. - buffer.Insert( 0, GetPrefix( aLevel ) ); - - // Log a timestamp - TStifLoggerTimeStamp8 time; - TRAP_IGNORE( LogTimeStampL( time ) ); - buffer.Insert( 0, time ); - - // Write log. - return WriteLog(aLevel, buffer); - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::Log -// Logs 8 bit data to screen and file. -// ----------------------------------------------------------------------------- -// -TInt CObexTestLogger::Log(const TDesC& aCategory, TRefByValue aLogText, ...) const - { - if (!iEnabled) - { - return KErrNone; - } - - const TDesC8& actualData = aLogText; - - // Check that user does not try to output too much data. - if (actualData.Length() > KMaxLogData - KPrefixLength) - { - return KErrTooBig; - } - - // Buffer to convert 8 bit data to to 16 bit. - TLogInfo8 converter; - - // Create variable argument list. - VA_LIST args; - VA_START(args, aLogText); - - // Format the argument list to the output buffer. - converter.FormatList(aLogText, args); - - // Free the variable argument list - VA_END(args); - - TLogInfo buffer; - buffer.Copy( converter ); - - // Log a timestamp - TStifLoggerTimeStamp8 time; - TRAP_IGNORE( LogTimeStampL( time ) ); - buffer.Insert( 0, time ); - - // Write log. - return WriteLog(aCategory, buffer); - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::Log -// Logs 16 bit data to screen and file. -// ----------------------------------------------------------------------------- -// -TInt CObexTestLogger::Log(TLogLevel aLevel, TRefByValue aLogText, ...) const - { - if (!iEnabled) - { - return KErrNone; - } - - const TDesC16& actualData = aLogText; - // Check that user does not try to output too much data. - if (actualData.Length() + KPrefixLength > KMaxLogData) - { - return KErrTooBig; - } - - TLogInfo buffer; - - // Log a timestamp - TRAP_IGNORE( LogTimeStampL( buffer ) ); - - // Create variable argument list. - VA_LIST args; - VA_START(args, aLogText); - - // Format the argument list to the output buffer. - buffer.AppendFormatList(aLogText, args); - - // Free the variable argument list - VA_END(args); - - // Write log. - return WriteLog(aLevel, buffer); - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::Log -// Logs 16 bit data to screen and file. -// ----------------------------------------------------------------------------- -// -TInt CObexTestLogger::Log(const TDesC& aCategory, TRefByValue aLogText, ...) const - { - if (!iEnabled) - { - return KErrNone; - } - - const TDesC16& actualData = aLogText; - // Check that user does not try to output too much data. - if (actualData.Length() + KPrefixLength > KMaxLogData) - { - return KErrTooBig; - } - - TLogInfo buffer; - - // Log a timestamp - TRAP_IGNORE( LogTimeStampL( buffer ) ); - - // Create variable argument list. - VA_LIST args; - VA_START(args, aLogText); - - // Format the argument list to the output buffer. - buffer.AppendFormatList(aLogText, args); - - // Free the variable argument list - VA_END(args); - - // Write log. - return WriteLog(aCategory, buffer); - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::LogNewLine -// Logs an HTML newline and timestamp. -// ----------------------------------------------------------------------------- -// -TInt CObexTestLogger::LogResult( const TDesC8& aFunc, const TDesC& aArg, TInt aRes ) const - { - TExtTimeStamp func; - func.Copy( aFunc ); // Copy 8-bit string to 16-bit buffer - - Log( CObexTestLogger::ETLResult, KTestCaseResult, &func, &aArg, aRes ); - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::LogNewLine -// Logs an HTML newline and timestamp. -// ----------------------------------------------------------------------------- -// -TInt CObexTestLogger::LogNewLine() const - { - if (!iEnabled) - { - return KErrNone; - } - TExtTimeStamp time; - TRAPD( err, LogTimeStampL( time ) ); - if( !err ) - { - time.Insert( 0, KHtmlTestCaseStart ); - err = iLog->Log( time ); - } - return err; - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::SetEnabled -// Returns a pointer to current STIF logger. -// ----------------------------------------------------------------------------- -// -void CObexTestLogger::SetEnabled(TBool aEnabled) - { - iEnabled = aEnabled; - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::SetLogger -// Sets a pointer to current STIF logger. -// ----------------------------------------------------------------------------- -// -void CObexTestLogger::SetLogger(CStifLogger* aLog) - { - iLog = aLog; - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::SetTestModuleIf -// Sets a pointer to current STIF test module. -// ----------------------------------------------------------------------------- -// -void CObexTestLogger::SetTestModuleIf(const CTestModuleIf* aTestModuleIf) - { - iTestModuleIf = aTestModuleIf; - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::WriteLog -// Writes log. -// ----------------------------------------------------------------------------- -// -TInt CObexTestLogger::WriteLog(TLogLevel aLevel, TDes16& aLog) const - { - // Write log to file if file logger is available. - if (iLog != 0) - { - iLog->Log(aLog); - } - // Remove the timestamp from the logging data. - TPtrC16 log( aLog.Mid( KTimeStampStrLen ) ); - - // Write log with RDebug. - RDebug::Print(log); - - // Write log to screen if test module interface is available. - if (iTestModuleIf != 0) - { - CTestModuleIf* nonStaticLogger = const_cast(iTestModuleIf); - nonStaticLogger->Printf(aLevel, _L(""), log); - } - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::WriteLog -// Writes log. -// ----------------------------------------------------------------------------- -// -TInt CObexTestLogger::WriteLog(const TDesC16& aCategory, const TDesC16& aLog) const - { - // Write log to file if file logger is available. - if (iLog != 0) - { - iLog->Log(aLog); - } - // Remove the timestamp from the logging data. - TPtrC16 log( aLog.Mid( KTimeStampStrLen ) ); - - // Write log with RDebug. - RDebug::Print(log); - - // Write log to screen if test module interface is available. - if (iTestModuleIf != 0) - { - CTestModuleIf* nonStaticLogger = const_cast(iTestModuleIf); - nonStaticLogger->Printf(0, aCategory, log); - } - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::GetPrefix -// Returns the prefix for a given logging level. -// ----------------------------------------------------------------------------- -// -TPtrC CObexTestLogger::GetPrefix(TLogLevel aLevel) - { - // Select a prefix for a log level and return a pointer to it. - switch(aLevel) - { - case ETLError: - { - TPtrC logPrefix = _L("ERROR : "); - return logPrefix; - } - case ETLInfo: - case ETLResult: - { - TPtrC logPrefix = _L("INFO : "); - return logPrefix; - } - case ETLDebug: - { - TPtrC logPrefix = _L("DEBUG : "); - return logPrefix; - } - default: - { - // Return a null pointer. - return TPtrC(); - } - - } - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::CheckLogFile -// Check if a log file is already existing, otherwise HTML formatting -// should be added. -// ----------------------------------------------------------------------------- -// -TInt CObexTestLogger::CheckLogFile() - { - RThread thread; - TInt id = thread.Id(); - TBuf file; - file.Format( KObexServAPITestSystemLogFullName, id ); - RFs fs; - TInt err = fs.Connect(); - TBool open = EFalse; - if( !err ) - { - err = fs.IsFileOpen( file, open ); - } - fs.Close(); - return err; - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::LogTimeStamp -// Log HTML head section and general information in a newly created logfile. -// ----------------------------------------------------------------------------- -// -void CObexTestLogger::LogHeadSectionL() - { - iLog->Log( KHtmlHeadSection ); - iLog->Log( KJSSECTION ); - TBuf version( _L( "Version unknown!" ) ); - (void) SysUtil::GetSWVersion( version ); - TStifLoggerTimeStamp8 date; - LogTimeStampL( date, EFalse ); - TStifLoggerTimeStamp8 time; - LogTimeStampL( time ); - TPtrC timePtr( time.Mid( 6, 13 ) ); - iLog->Log( KHtmlStatSection, &date, &timePtr, &version ); - } - -// ----------------------------------------------------------------------------- -// CObexTestLogger::LogTimeStamp -// Format a timestamp for logging. -// If aTime is set to false, the (formatted) date is returned. -// ----------------------------------------------------------------------------- -// -void CObexTestLogger::LogTimeStampL(TDes& aBuf, TBool aTime) const - { - TTime time; - time.HomeTime(); // Get time and format it - if( aTime ) - { - time.FormatL( aBuf, KFormatTimeStamp ); - } - else - { - time.FormatL( aBuf, KFormatDate ); - } - } diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/usb_obexservicemanager_client_api/group/bld.inf --- a/shortlinkconn_plat/usb_obexservicemanager_client_api/group/bld.inf Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +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: File that exports the files belonging to -: USB OBEX Service Manager Client API -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -../inc/usbobex.h MW_LAYER_PLATFORM_EXPORT_PATH(usbobex.h) diff -r 3dcb815346df -r 4096754ee773 shortlinkconn_plat/usb_obexservicemanager_client_api/inc/usbobex.h --- a/shortlinkconn_plat/usb_obexservicemanager_client_api/inc/usbobex.h Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: USB obexservicemanager client definition -* -*/ - - -#ifndef USBOBEX_H -#define USBOBEX_H - -#include - - -class CUSBClientWrapper; - - -/** -* Transportation string definition -*/ -_LIT8(KSrcsTransportBT,"OBEX/BT"); -_LIT8(KSrcsTransportUSB,"OBEX/USB"); -_LIT8(KSrcsTransportIrDA,"OBEX/IrDA"); - - -/** - * obexservicemanager client for usb. - * @lib obexusbapi.lib - * @since S60 v3.2 - */ -class CObexUSB : public CBase - { -public: - - /** - * Two-phased constructor. - */ - IMPORT_C static CObexUSB* NewL(); - - /** - * Destructor. - */ - ~CObexUSB(); - - /** - * Turn USB services on or off - * - * @since S60 v3.2 - * @param aUSBStatus the requested USB service status - * @param aStatus the Request status - * @return None - */ - IMPORT_C void ManageUSBServices( TBool aUSBStatus, TRequestStatus &aStatus ); - - /** - * Cancel managment request and turn services off - * @since S60 v3.2 - * - */ - IMPORT_C void CancelManageUSBServices(); - -private: - - CObexUSB(); - void ConstructL(); - -private: //data - - /** - * Obexserviceman client wrapper - */ - CUSBClientWrapper* iUSBWrapper; - }; -#endif // USBOBEX_H diff -r 3dcb815346df -r 4096754ee773 sysdef_1_4_0.dtd --- a/sysdef_1_4_0.dtd Thu Aug 19 10:46:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -