# HG changeset patch # User hgs # Date 1274083372 -10800 # Node ID 0b722902461e1521b197377feff8b70d45c5d3c5 # Parent 51f207bebb0625bfde9275a01bf612281f99853a 201019_1 diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/dun/atext/inc/DunAtCmdHandler.h --- a/localconnectivityservice/dun/atext/inc/DunAtCmdHandler.h Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/dun/atext/inc/DunAtCmdHandler.h Mon May 17 11:02:52 2010 +0300 @@ -86,6 +86,11 @@ TInt iDecodeIndex; /** + * Index in iInputBuffer for extended character position + */ + TInt iExtendedIndex; + + /** * Previous character in parsing */ TChar iPrevChar; @@ -96,6 +101,21 @@ 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; + + /** * Buffer for parsing */ TBuf8 iDecodeBuffer; @@ -519,12 +539,10 @@ * @since S60 5.0 * @param aDes String descriptor * @param aStartIndex Start index for search - * @pram aExtended ETrue if extended command, EFalse otherwise * @return Index if found, KErrNotFound otherwise */ TInt FindStartOfDecodedCommand( TDesC8& aDes, - TInt aStartIndex, - TBool& aExtended ); + TInt aStartIndex ); /** * Checks if character is delimiter character @@ -545,16 +563,6 @@ TBool IsExtendedCharacter( TChar aCharacter ); /** - * Checks extended command - * - * @since S60 5.0 - * @param aStartIndex Start index (doesn't change) - * @param aEndIndex End index (changes) - * @return ETrue if end of extended found, EFalse otherwise - */ - TBool CheckExtendedCommand( TInt aStartIndex, TInt& aEndIndex ); - - /** * Checks special command * * @since S60 5.0 @@ -566,36 +574,68 @@ TInt& aEndIndex ); /** - * Checks basic command + * Saves character decode state for a found character * - * @since S60 5.0 + * @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) - * @param aACmdFound ETrue if one character "A" command found, - * EFalse otherwise * @return Symbian error code on error, KErrNone otherwise */ - TInt CheckBasicCommand( TInt aStartIndex, - TInt& aEndIndex, - TBool& aOneCharCmd ); + void SaveNotFoundCharDecodeState(); /** - * Check if any one character command + * Find quotes within subcommands * - * @since S60 5.0 + * @since TB9.2 + * @param aCharacter Character to check * @param aStartIndex Start index (doesn't change) - * @return ETrue if any one character command, EFalse otherwise + * @param aEndIndex End index (changes) + * @return Symbian error code on error, KErrNone otherwise */ - TBool IsOneCharacterCommand( TInt aStartIndex ); + TBool FindSubCommandQuotes( TChar aCharacter, TInt aStartIndex, TInt& aEndIndex ); /** - * Check if one character "A" command + * Check if in next subcommand's extended border * - * @since S60 5.0 + * @since TB9.2 + * @param aCharacter Extended character to check * @param aStartIndex Start index (doesn't change) - * @return ETrue if one character "A" command, EFalse otherwise + * @param aEndIndex End index (changes) + * @return ETrue if in next command's extended border, EFalse otherwise */ - TBool IsOneCharacterACommand( TInt aStartIndex ); + 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 aStartIndex Start index (doesn't change) + * @param aEndIndex End index (changes) + * @return Symbian error code on error, KErrNone otherwise + */ + TInt FindSubCommand( TInt aStartIndex, TInt& aEndIndex ); /** * Check if "A/" command diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/dun/atext/inc/DunAtSpecialCmdHandler.h --- a/localconnectivityservice/dun/atext/inc/DunAtSpecialCmdHandler.h Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/dun/atext/inc/DunAtSpecialCmdHandler.h Mon May 17 11:02:52 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -21,13 +21,13 @@ #include #include -const TInt KInputBufLength = (512 + 1); // 512 chars for command + +const TInt KInputBufLength = (512 + 1); // Set this the same as in KDunInputBufLength /** * Class for special AT command handler * * @lib dunatext.lib - * @since S60 v5.0 + * @since TB9.2 */ NONSHARABLE_CLASS( CDunAtSpecialCmdHandler ) : public CBase { @@ -45,23 +45,56 @@ * Destructor. */ ~CDunAtSpecialCmdHandler(); - + public: - - TBool IsCompleteSubCommand(TChar aCharacter); - TBool IsCompleteSubCommand(TDesC8& aDes, TInt aStartIndex, TInt& aEndIndex); + + /** + * 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(); - - TBool IsDataReadyForComparison(TInt aLength); + + /** + * 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 -private: // data /** * Buffer for temporary AT command input */ @@ -70,7 +103,8 @@ /** * Special commands for parsing */ - CDesC8Array *iSpecialCmds; + CDesC8Array *iSpecialCmds; + }; #endif // C_CDUNATSPECIALCMDHANDLER_H diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/dun/atext/src/DunAtCmdHandler.cpp --- a/localconnectivityservice/dun/atext/src/DunAtCmdHandler.cpp Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/dun/atext/src/DunAtCmdHandler.cpp Mon May 17 11:02:52 2010 +0300 @@ -377,8 +377,12 @@ iCommand = 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; iEditorModeInfo.iContentFound = EFalse; iCmdPusher = NULL; iEcomListen = NULL; @@ -882,11 +886,8 @@ TDunDecodeInfo oldInfo = iDecodeInfo; iDecodeInfo.iDecodeBuffer.Zero(); // Find start of decode command from input buffer - TBool extendedCmd = EFalse; TInt startIndex = iDecodeInfo.iDecodeIndex; - startIndex = FindStartOfDecodedCommand( iInputBuffer, - startIndex, - extendedCmd ); + startIndex = FindStartOfDecodedCommand( iInputBuffer, startIndex ); if ( startIndex < 0 ) { RestoreOldDecodeInfo( aPeek, oldInfo ); @@ -894,24 +895,12 @@ return EFalse; } // Find end of decode command from input buffer - TBool extendedEnd = EFalse; - TBool oneCharCmd = EFalse; TBool specialCmd = EFalse; TInt endIndex = KErrNotFound; - if ( extendedCmd ) + specialCmd = CheckSpecialCommand( startIndex, endIndex ); + if ( !specialCmd ) { - if( iAtSpecialCmdHandler->IsCompleteSubCommand(iInputBuffer, startIndex, endIndex) == EFalse ) - { - extendedEnd = CheckExtendedCommand( startIndex, endIndex ); - } - } - else - { - specialCmd = CheckSpecialCommand( startIndex, endIndex ); - if ( !specialCmd ) - { - CheckBasicCommand( startIndex, endIndex, oneCharCmd ); - } + FindSubCommand( startIndex, endIndex ); } if ( endIndex < startIndex ) { @@ -926,7 +915,7 @@ iParseInfo.iLimit = cmdLength; } // Next create a new command - if ( !iDecodeInfo.iFirstDecode && !oneCharCmd && !specialCmd ) + if ( !iDecodeInfo.iFirstDecode && !specialCmd ) { _LIT( KAtMsg, "AT" ); iDecodeInfo.iDecodeBuffer.Append( KAtMsg ); @@ -939,10 +928,6 @@ // Set index for next round iDecodeInfo.iFirstDecode = EFalse; iDecodeInfo.iDecodeIndex = endIndex + 1; - if ( extendedEnd ) // skip the extra ';' - { - iDecodeInfo.iDecodeIndex++; - } RestoreOldDecodeInfo( aPeek, oldInfo ); FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractNextDecodedCommand() complete") )); return ETrue; @@ -1008,35 +993,19 @@ // --------------------------------------------------------------------------- // TInt CDunAtCmdHandler::FindStartOfDecodedCommand( TDesC8& aDes, - TInt aStartIndex, - TBool& aExtended ) + TInt aStartIndex ) { FTRACE(FPrint( _L("CDunAtCmdHandler::FindStartOfDecodedCommand()") )); - aExtended = EFalse; TInt i; TInt count = aDes.Length(); for ( i=aStartIndex; i| + // 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 aStartIndex, TInt& aEndIndex ) + { + FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommand()") )); aEndIndex = aStartIndex; - aOneCharCmd = EFalse; - TBool inQuotes = EFalse; + TBool found = EFalse; TInt length = iInputBuffer.Length(); - iDecodeInfo.iPrevExists = EFalse; - if ( aStartIndex < length ) - { - TChar character = iInputBuffer[aStartIndex]; - if ( IsOneCharacterCommand(aStartIndex) ) - { - aOneCharCmd = ETrue; - // Without "endIndex++" here - FTRACE(FPrint( _L("CDunAtCmdHandler::CheckBasicCommand() (X) complete") )); - return KErrNone; - } - } + 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::CheckBasicCommand() (S or extended) complete") )); + FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommand() (delimiter) complete") )); return KErrNone; } - if ( !iDecodeInfo.iPrevExists ) + // The check below detects the following type of cases: + // ATCMD+CMD [first + as delimiter] + // AT+CMD+CMD [second + as delimiter] + if ( IsExtendedCharacter(character) ) { - iDecodeInfo.iPrevExists = ETrue; - iDecodeInfo.iPrevChar = character; - continue; - } - if ( IsOneCharacterCommand(aEndIndex) ) - { - aEndIndex--; - FTRACE(FPrint( _L("CDunAtCmdHandler::CheckBasicCommand() (one char) complete") )); + found = IsExtendedBorder( character, aStartIndex, aEndIndex ); + if ( !found ) + { + continue; + } + FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommand() (extended) complete") )); return KErrNone; } - if ( character.IsAlpha() && !iDecodeInfo.iPrevChar.IsAlpha() ) + found = FindSubCommandAlphaBorder( character, aEndIndex ); + if ( found ) { - aEndIndex--; - FTRACE(FPrint( _L("CDunAtCmdHandler::CheckBasicCommand() (boundary) complete") )); + FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommand() (alpha sub) complete") )); return KErrNone; } - iDecodeInfo.iPrevExists = ETrue; - iDecodeInfo.iPrevChar = character; + SaveFoundCharDecodeState( character ); } aEndIndex--; - FTRACE(FPrint( _L("CDunAtCmdHandler::CheckBasicCommand() (not found) complete") )); + FTRACE(FPrint( _L("CDunAtCmdHandler::FindSubCommand() (not found) complete") )); return KErrNotFound; } // --------------------------------------------------------------------------- -// Check if any one character command -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::IsOneCharacterCommand( TInt aIndex ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::IsOneCharacterCommand()") )); - if ( aIndex<0 || aIndex>=iInputBuffer.Length() ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::IsOneCharacterCommand() (index out of bounds) complete") )); - return EFalse; - } - TChar character = iInputBuffer[aIndex]; - if ( character==',' || character==';' || character=='@' || character=='!' || - IsOneCharacterACommand(aIndex) ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::IsOneCharacterCommand() complete") )); - return ETrue; - } - FTRACE(FPrint( _L("CDunAtCmdHandler::IsOneCharacterCommand() (not found) complete") )); - return EFalse; - } - -// --------------------------------------------------------------------------- -// Check if one character "A" command -// --------------------------------------------------------------------------- -// -TBool CDunAtCmdHandler::IsOneCharacterACommand( TInt aIndex ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::IsOneCharacterACommand()") )); - if ( aIndex<0 || aIndex>=iInputBuffer.Length() ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::IsOneCharacterACommand() (index out of bounds) complete") )); - return EFalse; - } - if ( iInputBuffer[aIndex]!='a' && iInputBuffer[aIndex]!='A' ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::IsOneCharacterACommand() (not found) complete") )); - return EFalse; - } - TBool prevAlpha = EFalse; - TBool nextAlpha = EFalse; - TBool nextSlash = EFalse; - TInt length = iInputBuffer.Length(); - if ( iDecodeInfo.iPrevExists && iDecodeInfo.iPrevChar.IsAlpha() ) - { - prevAlpha = ETrue; - } - if ( aIndex+1 < length ) - { - TChar nextChar = iInputBuffer[aIndex+1]; - if ( nextChar.IsAlpha() ) - { - nextAlpha = ETrue; - } - if ( nextChar == '/' ) - { - nextSlash = ETrue; - } - } - if ( prevAlpha || nextAlpha || nextSlash ) - { - FTRACE(FPrint( _L("CDunAtCmdHandler::IsOneCharacterACommand() (not found) complete") )); - return EFalse; - } - FTRACE(FPrint( _L("CDunAtCmdHandler::IsOneCharacterACommand() (complete) complete") )); - return ETrue; - } - -// --------------------------------------------------------------------------- // Check if "A/" command // --------------------------------------------------------------------------- // diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/dun/atext/src/DunAtSpecialCmdHandler.cpp --- a/localconnectivityservice/dun/atext/src/DunAtSpecialCmdHandler.cpp Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/dun/atext/src/DunAtSpecialCmdHandler.cpp Mon May 17 11:02:52 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -18,11 +18,13 @@ #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 -_LIT8(KSpecialATCmd1, "AT&F"); -// Number of special commands -const TInt KDefaultGranularity = 1; +// 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. @@ -42,7 +44,7 @@ // --------------------------------------------------------------------------- // CDunAtSpecialCmdHandler::CDunAtSpecialCmdHandler() - { + { } // --------------------------------------------------------------------------- @@ -51,9 +53,9 @@ // void CDunAtSpecialCmdHandler::ConstructL() { - iSpecialCmds = new (ELeave) CDesC8ArrayFlat(KDefaultGranularity); - // Add here all special commands which need to be handled - iSpecialCmds->AppendL(KSpecialATCmd1); + iSpecialCmds = new (ELeave) CDesC8ArrayFlat( KDefaultGranularity ); + // Add here all special commands which need to be handled + iSpecialCmds->AppendL( KSpecialATCmd1 ); } // --------------------------------------------------------------------------- @@ -68,36 +70,35 @@ } // --------------------------------------------------------------------------- -// Checks if the command has to be treated special way +// 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. +// of the command. // Search is done character by character basis. // --------------------------------------------------------------------------- // -TBool CDunAtSpecialCmdHandler::IsCompleteSubCommand (TChar aCharacter) +TBool CDunAtSpecialCmdHandler::IsCompleteSubCommand( TChar aCharacter ) { FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::IsCompleteSubCommand()") )); - iBuffer.Append(aCharacter); + iBuffer.Append( aCharacter ); TBool completeSubCmd = EFalse; - - if( !IsDataReadyForComparison( iBuffer.Length()) ) + + 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 ; i < count ; i++ ) + 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. - iBuffer.FillZ(); - iBuffer.Zero(); + ResetComparisonBuffer(); completeSubCmd = ETrue; break; } @@ -107,57 +108,34 @@ } // --------------------------------------------------------------------------- -// 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. +// Resets the buffer used for comparisons // --------------------------------------------------------------------------- // -TBool CDunAtSpecialCmdHandler::IsCompleteSubCommand(TDesC8& aDes, TInt aStartIndex, TInt& aEndIndex) +void CDunAtSpecialCmdHandler::ResetComparisonBuffer() { - FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::IsCompleteSubCommand()") )); - TBool completeSubCmd = EFalse; - if( aDes.Length() < MinimumLength() || aStartIndex != 0 ) - { - // No need to do comparison because we don't have correct amount of data or - // we are not at the beginning of the input buffer (non decoded buffer) - FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::IsCompleteSubCommand(), no need to compare") )); - return completeSubCmd; - } - - TInt count = iSpecialCmds->Count(); - for( TInt i = 0 ; i < count ; i++ ) - { - TInt length = iSpecialCmds->MdcaPoint(i).Length(); - TPtrC8 cmd = aDes.Mid(0, length); - if( iSpecialCmds->MdcaPoint(i).Compare(cmd) == 0 ) - { - FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::IsCompleteSubCommand(), match found, cmd index %d"), i )); - aEndIndex = length - 1; - completeSubCmd = ETrue; - break; - } - } - FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::IsCompleteSubCommand() complete") )); - return completeSubCmd; + 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) +TBool CDunAtSpecialCmdHandler::IsDataReadyForComparison( TInt aLength ) { + FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::IsDataReadyForComparison()") )); TInt count = iSpecialCmds->Count(); - for( TInt i = 0 ; i < count ; i++ ) + 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; } @@ -167,9 +145,10 @@ // TInt CDunAtSpecialCmdHandler::MinimumLength() { + FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::MinimumLength()") )); TInt length = iSpecialCmds->MdcaPoint(0).Length(); TInt count = iSpecialCmds->Count(); - for( TInt i = 1 ; i < count ; i++ ) + for ( TInt i=1; iMdcaPoint(i).Length() < length ) { @@ -177,5 +156,6 @@ break; } } + FTRACE(FPrint( _L("CDunAtSpecialCmdHandler::MinimumLength() complete") )); return length; } diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/dun/utils/src/DunNoteHandler.cpp --- a/localconnectivityservice/dun/utils/src/DunNoteHandler.cpp Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/dun/utils/src/DunNoteHandler.cpp Mon May 17 11:02:52 2010 +0300 @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "DunNoteHandler.h" #include "DunDebug.h" diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/generichid/group/bld.inf --- a/localconnectivityservice/generichid/group/bld.inf Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/generichid/group/bld.inf Mon May 17 11:02:52 2010 +0300 @@ -21,15 +21,6 @@ DEFAULT PRJ_EXPORTS -../inc/hidgeneric.h |../../../inc/hidgeneric.h -../inc/hidinterfaces.h |../../../inc/hidinterfaces.h -../inc/hidtranslate.h |../../../inc/hidtranslate.h -../inc/hidreportroot.h |../../../inc/hidreportroot.h -../inc/hidfield.h |../../../inc/hidfield.h -../inc/hidcollection.h |../../../inc/hidcollection.h -../inc/hidvalues.h |../../../inc/hidvalues.h -../inc/hiddriverpluginuid.h |../../../inc/hiddriverpluginuid.h - ../rom/generichid.iby CORE_MW_LAYER_IBY_EXPORT_PATH(generichid.iby) PRJ_MMPFILES diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/generichid/inc/hidcollection.h --- a/localconnectivityservice/generichid/inc/hidcollection.h Sun May 02 21:46:11 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 51f207bebb06 -r 0b722902461e localconnectivityservice/generichid/inc/hiddriverpluginuid.h --- a/localconnectivityservice/generichid/inc/hiddriverpluginuid.h Sun May 02 21:46:11 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 51f207bebb06 -r 0b722902461e localconnectivityservice/generichid/inc/hidfield.h --- a/localconnectivityservice/generichid/inc/hidfield.h Sun May 02 21:46:11 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 51f207bebb06 -r 0b722902461e localconnectivityservice/generichid/inc/hidgeneric.h --- a/localconnectivityservice/generichid/inc/hidgeneric.h Sun May 02 21:46:11 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 51f207bebb06 -r 0b722902461e localconnectivityservice/generichid/inc/hidinterfaces.h --- a/localconnectivityservice/generichid/inc/hidinterfaces.h Sun May 02 21:46:11 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 51f207bebb06 -r 0b722902461e localconnectivityservice/generichid/inc/hidreportroot.h --- a/localconnectivityservice/generichid/inc/hidreportroot.h Sun May 02 21:46:11 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 51f207bebb06 -r 0b722902461e localconnectivityservice/generichid/inc/hidtranslate.h --- a/localconnectivityservice/generichid/inc/hidtranslate.h Sun May 02 21:46:11 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 51f207bebb06 -r 0b722902461e localconnectivityservice/generichid/inc/hidvalues.h --- a/localconnectivityservice/generichid/inc/hidvalues.h Sun May 02 21:46:11 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 51f207bebb06 -r 0b722902461e localconnectivityservice/headset/hidremconbearer/group/bld.inf --- a/localconnectivityservice/headset/hidremconbearer/group/bld.inf Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/headset/hidremconbearer/group/bld.inf Mon May 17 11:02:52 2010 +0300 @@ -18,10 +18,6 @@ PRJ_PLATFORMS DEFAULT -PRJ_EXPORTS -../inc/hidremconbearerinternalpskeys.h |../../../../inc/hidremconbearerinternalpskeys.h -../inc/hidremconbearerscancodes.h |../../../../inc/hidremconbearerscancodes.h - PRJ_MMPFILES hidremconbearer.mmp diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexreceiveservices/mtmuiinfrared/src/irmtmui.cpp --- a/localconnectivityservice/obexreceiveservices/mtmuiinfrared/src/irmtmui.cpp Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/obexreceiveservices/mtmuiinfrared/src/irmtmui.cpp Mon May 17 11:02:52 2010 +0300 @@ -36,7 +36,7 @@ #include // Notifier UID's #include //For notifier #include -#include +#include // ================= MEMBER FUNCTIONS ======================= diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexreceiveservices/opp/src/oppcontroller.cpp --- a/localconnectivityservice/obexreceiveservices/opp/src/oppcontroller.cpp Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/obexreceiveservices/opp/src/oppcontroller.cpp Mon May 17 11:02:52 2010 +0300 @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include @@ -593,7 +593,8 @@ iDrive = imsDrive; } } - else + + if ( iDrive == EDriveZ) { err = rfs.Volume(volumeInfo, mmcDrive); if ( !err ) diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexsendservices/group/sendutils.mmp --- a/localconnectivityservice/obexsendservices/group/sendutils.mmp Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/obexsendservices/group/sendutils.mmp Mon May 17 11:02:52 2010 +0300 @@ -46,6 +46,7 @@ SOURCE BTSUXmlParser.cpp SOURCE BTConnectionTimer.cpp SOURCE BTSController.cpp +SOURCE BTSProgresstimer.cpp USERINCLUDE ../obexservicesendutils/inc SYSTEMINCLUDE ../../inc ../../../inc /epoc32/include/libc @@ -53,6 +54,7 @@ SYSTEMINCLUDE /epoc32/include/mw/hb/hbwidgets MW_LAYER_SYSTEMINCLUDE + LIBRARY apgrfx.lib // App Arch Session LIBRARY apmime.lib // App Arch Mime Recognizers LIBRARY bafl.lib // Basic Application Framework Library diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexsendservices/obexhighway/inc/btsendingservicedebug.h --- a/localconnectivityservice/obexsendservices/obexhighway/inc/btsendingservicedebug.h Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/obexsendservices/obexhighway/inc/btsendingservicedebug.h Mon May 17 11:02:52 2010 +0300 @@ -16,8 +16,8 @@ */ -#ifndef BT_SENDING_SERVICE_DEBUG_H -#define BT_SENDING_SERVICE_DEBUG_H +#ifndef BTSENDINGSERVICEDEBUG_H +#define BTSENDINGSERVICEDEBUG_H #ifdef _DEBUG @@ -76,6 +76,6 @@ #endif // _DEBUG -#endif // BT_SENDING_SERVICE_DEBUG_H +#endif // BTSENDINGSERVICEDEBUG_H // End of File diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexsendservices/obexhighway/inc/btsendserviceprovider.h --- a/localconnectivityservice/obexsendservices/obexhighway/inc/btsendserviceprovider.h Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/obexsendservices/obexhighway/inc/btsendserviceprovider.h Mon May 17 11:02:52 2010 +0300 @@ -20,8 +20,8 @@ #define BTSENDSERVICEPROVIDER_H #include -#include -#include +#include +#include class CBTServiceAPI; class CBTSSSendListHandler; diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexsendservices/obexhighway/inc/btsssendlisthandler.h --- a/localconnectivityservice/obexsendservices/obexhighway/inc/btsssendlisthandler.h Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/obexsendservices/obexhighway/inc/btsssendlisthandler.h Mon May 17 11:02:52 2010 +0300 @@ -24,10 +24,9 @@ #include #include #include -#include -#include -#include "BTSendingServiceDebug.h" - +#include +#include +#include "btsendingservicedebug.h" class CBTServiceParameterList; diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexsendservices/obexhighway/src/btsendserviceprovider.cpp --- a/localconnectivityservice/obexsendservices/obexhighway/src/btsendserviceprovider.cpp Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/obexsendservices/obexhighway/src/btsendserviceprovider.cpp Mon May 17 11:02:52 2010 +0300 @@ -16,14 +16,15 @@ */ - +#include "btsendserviceprovider.h" #include -#include "BTSSSendListHandler.h" -#include "btsendserviceprovider.h" +#include "btsssendlisthandler.h" #include // For Enterprise security settings #include // For Enterprise security notifier + + CBtSendServiceProvider* CBtSendServiceProvider::NewL() { CBtSendServiceProvider* self = new( ELeave ) CBtSendServiceProvider(); diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexsendservices/obexhighway/src/btsssendlisthandler.cpp --- a/localconnectivityservice/obexsendservices/obexhighway/src/btsssendlisthandler.cpp Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/obexsendservices/obexhighway/src/btsssendlisthandler.cpp Mon May 17 11:02:52 2010 +0300 @@ -19,13 +19,11 @@ #include -#include "BTSSSendListHandler.h" -#include "btserviceparameterlist.h" +#include "btsssendlisthandler.h" +#include "BTServiceParameterList.h" #include - - // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexsendservices/obexhighway/xml/obexhighway_conf.xml --- a/localconnectivityservice/obexsendservices/obexhighway/xml/obexhighway_conf.xml Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/obexsendservices/obexhighway/xml/obexhighway_conf.xml Mon May 17 11:02:52 2010 +0300 @@ -8,5 +8,7 @@ 1.0 Send interface Via Bluetooth + bluetooth + txt_send_via_bluetooth \ No newline at end of file diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSOPPController.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSOPPController.h Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSOPPController.h Mon May 17 11:02:52 2010 +0300 @@ -119,6 +119,8 @@ * @return None. */ void HandleConnectCompleteIndicationL(); + + void UpdateProgressNoteL(); private: // Data diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSProgresstimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSProgresstimer.h Mon May 17 11:02:52 2010 +0300 @@ -0,0 +1,89 @@ +/* +* 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 BTSPROGRESSTIMER_H +#define BTSPROGRESSTIMER_H + + +#include + +class MBTServiceObserver; + +// CLASS DECLARATION +/** +* A timer class for updating progress dialog. +*/ +NONSHARABLE_CLASS( CBTSProgressTimer ) : public CTimer + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CBTSProgressTimer* NewL( MBTServiceObserver* aProgressObserverPtr ); + + /** + * Destructor. + */ + virtual ~CBTSProgressTimer(); + + 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(); + + TInt RunError( TInt aError ); + + private: + + /** + * C++ default constructor. + */ + CBTSProgressTimer( MBTServiceObserver* aProgressObserverPtr ); + + /** + * By default Symbian OS constructor is private. + */ + void ConstructL(); + + private: // Data + TTimeIntervalMicroSeconds32 iTimeout; + MBTServiceObserver* iProgressObserverPtr; + }; + +#endif // BTSPROGRESSTIMER_H + +// End of File diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTServiceStarter.h --- a/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTServiceStarter.h Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTServiceStarter.h Mon May 17 11:02:52 2010 +0300 @@ -29,7 +29,9 @@ #include #include #include +#include #include +#include // DATA TYPES @@ -52,6 +54,7 @@ class CObexUtilsUiLayer; class MBTServiceProgressGetter; class CBTSController; +class CBTSProgressTimer; const TUint KBTSdpObjectPush = 0x1105; @@ -80,7 +83,24 @@ * @param aGetter A pointer to a progess status getter object. * @return None. */ - virtual void LaunchProgressNoteL( MBTServiceProgressGetter* aGetter, TInt aTotalSize ) = 0; + virtual void LaunchProgressNoteL( MBTServiceProgressGetter* aGetter, TInt aTotalSize, TInt aFileCount ) = 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 UpdateProgressNoteL(TInt aFileSize,TInt aFileIndex, const TDesC& aFileName ) = 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 UpdateProgressInfoL() = 0; + /** * Informs the observer that a confirmation query for sending @@ -107,7 +127,8 @@ public MObexUtilsProgressObserver, public MBTEngSdpResultReceiver, public MBTEngSettingsObserver, - public MHbDeviceProgressDialogObserver + public MHbDeviceProgressDialogObserver, + public MHbDeviceDialogObserver { public: // Constructors and destructor @@ -151,7 +172,23 @@ * @param aTotalSize Max size of the progress bar. * @return None. */ - void LaunchProgressNoteL( MBTServiceProgressGetter* aGetter, TInt aTotalSize ); + void LaunchProgressNoteL( MBTServiceProgressGetter* aGetter, TInt aTotalSize, TInt aFileCount ); + + + /** + * From MBTServiceObserver Updating progress note when multiple files are sent. + * @param aFileSize Size of the file to be send. + * @param aFileIndex index of the file to be send. + * @param aFileName name of the file to be send. + * @return None. + */ + void UpdateProgressNoteL(TInt aFileSize,TInt aFileIndex, const TDesC& aFileName ); + + /** + * From MBTServiceObserver Updating progress note info about the progress percentage + * @return None. + */ + void UpdateProgressInfoL(); /** * From MObexUtilsWaitDialogObserver The wait note has been dismissed. @@ -411,6 +448,10 @@ * @return None. */ void TurnBTPowerOnL( const TBTPowerStateValue aState ); + + void DataReceived(CHbSymbianVariantMap& aData); + + void DeviceDialogClosed(TInt aCompletionCode); private: // Data definitions enum TBTServiceStarterState @@ -452,7 +493,11 @@ TBool iFeatureManagerInitialized; TBool iTriedBIP; TBool iTriedOPP; + CHbDeviceDialogSymbian *iDeviceDialog; CHbDeviceProgressDialogSymbian *iProgressDialog; + TInt iFileCount; + TInt iFileIndex; + CBTSProgressTimer *iProgressTimer; }; #endif // BT_SERVICE_CONTROLLER_H diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSBIPController.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSBIPController.cpp Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSBIPController.cpp Mon May 17 11:02:52 2010 +0300 @@ -235,7 +235,7 @@ } else if( aStatus != KErrAbort && aGetResponse->BytesReceived()==0 ) { - TRAPD( error,iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ImageListSize() ) ); + TRAPD( error,iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ImageListSize(),iListPtr->ImageCount() ) ); error=KErrNone; TRAP(error, SendL() ); if ( error != KErrNone ) @@ -290,14 +290,20 @@ // TBTSUImageParam imageparam = iListPtr->ImageAtL( iFileIndex ); + RBuf filename; + filename.CreateL(256); + CleanupClosePushL(filename); + imageparam.iFile.Name(filename); + iObserverPtr->UpdateProgressNoteL(imageparam.iFileSize,iFileIndex,filename); + CleanupStack::PopAndDestroy(&filename); iListPtr->MarkAsSendL(iFileIndex); iClient->PutObjectL( headerList, imageparam.iFile ); - + CleanupStack::Pop(4); // headerList, imageDescriptorHeader, typeHeader, imagedescriptor delete imagedescriptor; headerList.Close(); @@ -632,7 +638,7 @@ { // Everything went ok. Start sending images // - iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ImageListSize() ); + iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ImageListSize(),iListPtr->ImageCount() ); // Start sending images // @@ -651,7 +657,7 @@ { // Everything went ok. Start sending the images // - iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ImageListSize() ); + iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ImageListSize(),iListPtr->ImageCount() ); // Start sending images // @@ -660,10 +666,10 @@ } else if( allSupported ) { - iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ImageListSize() + iListPtr->ObjectListSizeL()); + iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ImageListSize() + iListPtr->ObjectListSizeL(),iListPtr->ImageCount() + iListPtr->ObjectCount()); // Start sending images - // + // SendL(); } diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSOPPController.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSOPPController.cpp Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSOPPController.cpp Mon May 17 11:02:52 2010 +0300 @@ -160,11 +160,15 @@ { FLOG(_L("[BTSS]\t CBTSOPPController::Send()")); + TInt error(KErrNone); 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 ) )); + RArray headerList; // the array does not need to be closed + + TRAP( error, { + UpdateProgressNoteL(); + iClient->PutObjectL( headerList, iListPtr->ObjectAtL( iFileIndex )); }); if ( error ) { @@ -214,9 +218,22 @@ } } } - iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ObjectListSizeL() ); + iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ObjectListSizeL(),iListPtr->ObjectCount() ); iFileIndex = 0; + UpdateProgressNoteL(); Send(); } + +void CBTSOPPController::UpdateProgressNoteL() + { + TInt size; + RBuf filename; + iListPtr->ObjectAtL( iFileIndex ).Size(size); + filename.CreateL(255); + iListPtr->ObjectAtL( iFileIndex ).Name(filename); + iObserverPtr->UpdateProgressNoteL(size,iFileIndex,filename); + filename.Close(); + } + // End of File diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSProgresstimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTSProgresstimer.cpp Mon May 17 11:02:52 2010 +0300 @@ -0,0 +1,121 @@ +/* +* 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 "BTSProgresstimer.h" +#include "BTServiceStarter.h" +#include "BTSUDebug.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CBTSProgressTimer::CBTSProgressTimer( MBTServiceObserver* aProgressObserverPtr) + : CTimer( EPriorityLow ), + iProgressObserverPtr( aProgressObserverPtr ) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// CObexUtilsDialogTimer::ConstructL +// Symbian OS default constructor can leave. +// ----------------------------------------------------------------------------- +// +void CBTSProgressTimer::ConstructL() + { + FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::ConstructL()")); + + CTimer::ConstructL(); + + FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::ConstructL() completed")); + } + +// ----------------------------------------------------------------------------- +// CObexUtilsDialogTimer::NewL +// ----------------------------------------------------------------------------- + CBTSProgressTimer* CBTSProgressTimer::NewL( MBTServiceObserver* aProgressObserverPtr) + { + CBTSProgressTimer* self = + new( ELeave ) CBTSProgressTimer( aProgressObserverPtr ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +CBTSProgressTimer::~CBTSProgressTimer() + { + Cancel(); + } + +// ----------------------------------------------------------------------------- +// CObexUtilsDialogTimer::Tickle +// ----------------------------------------------------------------------------- +// + void CBTSProgressTimer::Tickle() + { + FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::Tickle()")); + + Cancel(); + After( iTimeout ); + + FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::Tickle() completed")); + } + +// ----------------------------------------------------------------------------- +// CObexUtilsDialogTimer::RunL +// ----------------------------------------------------------------------------- +// +void CBTSProgressTimer::RunL() + { + FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::RunL()")); + if (iProgressObserverPtr) + { + iProgressObserverPtr->UpdateProgressInfoL(); + } + + FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::RunL() completed")); + } + +TInt CBTSProgressTimer::RunError( TInt aError ) + { + FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::RunError()")); + (void) aError; + FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::RunError() - completed")); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CObexUtilsDialogTimer::SetTimeout +// ----------------------------------------------------------------------------- +// + void CBTSProgressTimer::SetTimeout( TTimeIntervalMicroSeconds32 aTimeout ) + { + iTimeout = aTimeout; + } + +// End of File diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceClient.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceClient.cpp Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceClient.cpp Mon May 17 11:02:52 2010 +0300 @@ -403,7 +403,8 @@ FTRACE(FPrint(_L("[BTSU]\t CBTServiceClient::GetProgressStatus() completed, bytes sent %d"), iTotalBytesSent + bytesSent ) ); - return iTotalBytesSent + bytesSent; + // return iTotalBytesSent + bytesSent; + return bytesSent; } // ----------------------------------------------------------------------------- diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceStarter.cpp --- a/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceStarter.cpp Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/obexsendservices/obexservicesendutils/src/BTServiceStarter.cpp Mon May 17 11:02:52 2010 +0300 @@ -29,7 +29,9 @@ #include #include #include -#include "hbdevicemessageboxsymbian.h" +#include "BTSProgresstimer.h" +#include +#include // CONSTANTS @@ -38,6 +40,10 @@ const TUint KBTServiceDirectPrinting = 0x1118; const TUint KBTServiceImagingResponder = 0x111B; +const TUint KBTProgressInterval = 1000000; + + +_LIT(KSendingDialog,"com.nokia.hb.btdevicedialog/1.0"); // ============================ MEMBER FUNCTIONS =============================== @@ -73,6 +79,9 @@ FLOG(_L("[BTSU]\t CBTServiceStarter::ConstructL()")); iDevice = CBTDevice::NewL(); // iDialog = CObexUtilsDialog::NewL( this ); + iDeviceDialog = CHbDeviceDialogSymbian::NewL(); + iProgressDialog = CHbDeviceProgressDialogSymbian::NewL(CHbDeviceProgressDialogSymbian::EWaitDialog,this); + FeatureManager::InitializeLibL(); iFeatureManagerInitialized = ETrue; FLOG(_L("[BTSU]\t CBTServiceStarter::ConstructL() completed")); @@ -109,7 +118,12 @@ delete iController; delete iBTEngDiscovery; // delete iDialog; + delete iDeviceDialog; delete iProgressDialog; + if(iProgressTimer) + { + delete iProgressTimer; + } if(iWaiter && iWaiter->IsStarted() ) { @@ -248,6 +262,42 @@ } } +void CBTServiceStarter::UpdateProgressInfoL() + { + HBufC* key = HBufC::NewL(50); + CleanupStack::PushL(key); + + HBufC* value = HBufC::NewL(50); + CleanupStack::PushL(value); + + CHbSymbianVariantMap* map = CHbSymbianVariantMap::NewL(); + CleanupStack::PushL(map); + + TInt progress = GetProgressStatus(); + + key->Des().Copy(_L("progressValue")); + CHbSymbianVariant* progressvalue = CHbSymbianVariant::NewL(&progress, CHbSymbianVariant::EInt); + map->Add(*key,progressvalue); + + key->Des().Copy(_L("currentFileIdx")); + value->Des().AppendNum(iFileIndex); + CHbSymbianVariant* currentFileIdx = CHbSymbianVariant::NewL(value, CHbSymbianVariant::EDes); + map->Add(*key,currentFileIdx); + + + TInt ret = iDeviceDialog->Update(*map); + + CleanupStack::PopAndDestroy(map); + CleanupStack::PopAndDestroy(value); + CleanupStack::PopAndDestroy(key); + + + if ( iProgressTimer ) + { + iProgressTimer->Tickle(); + } + } + // ----------------------------------------------------------------------------- // CBTServiceStarter::ValidParameters // ----------------------------------------------------------------------------- @@ -432,7 +482,6 @@ { // iDialog->LaunchWaitDialogL( R_BT_CONNECTING_WAIT_NOTE ); _LIT(KConnectText, "Connecting..."); - iProgressDialog = CHbDeviceProgressDialogSymbian::NewL(CHbDeviceProgressDialogSymbian::EWaitDialog,this); iProgressDialog->SetTextL(KConnectText); iProgressDialog->ShowL(); @@ -467,22 +516,45 @@ // ----------------------------------------------------------------------------- // void CBTServiceStarter::LaunchProgressNoteL( MBTServiceProgressGetter* aGetter, - TInt aTotalSize ) + TInt aTotalSize, TInt aFileCount) { FLOG(_L("[BTSU]\t CBTServiceStarter::LaunchProgressNoteL()")); (void) aTotalSize; if ( iService != EBTPrintingService ) { - iProgressGetter = aGetter; + iProgressGetter = aGetter; CancelWaitNote(); if ( !iProgressDialogActive ) { + iFileCount = aFileCount; iMessageServerIndex = TObexUtilsMessageHandler::CreateOutboxEntryL( KUidMsgTypeBt, R_BT_SEND_OUTBOX_SENDING ); // iDialog->LaunchProgressDialogL( this, aTotalSize, // R_BT_SENDING_DATA, KBTProgressInterval ); + CHbSymbianVariantMap* map = CHbSymbianVariantMap::NewL(); + CleanupStack::PushL(map); + if ( iProgressTimer ) + { + iProgressTimer->Cancel(); + delete iProgressTimer; + iProgressTimer = NULL; + } + + iProgressTimer = CBTSProgressTimer::NewL( this ); + iProgressTimer->SetTimeout( KBTProgressInterval ); + + iProgressTimer->Tickle(); + + CHbSymbianVariant* value = NULL; + TBuf<6> key; + TInt data = TBluetoothDialogParams::ESend; + key.Num(TBluetoothDialogParams::EDialogType); + value = CHbSymbianVariant::NewL( (TAny*) &data, CHbSymbianVariant::EInt ); + User::LeaveIfError(map->Add( key, value )); // Takes ownership of value + iDeviceDialog->Show(KSendingDialog(),*map,this); + CleanupStack::PopAndDestroy(map); } iProgressDialogActive=ETrue; } @@ -490,6 +562,77 @@ FLOG(_L("[BTSU]\t CBTServiceStarter::LaunchProgressNoteL() completed")); } +void CBTServiceStarter::UpdateProgressNoteL(TInt aFileSize,TInt aFileIndex, const TDesC& aFileName ) + { + HBufC* key = HBufC::NewL(50); + CleanupStack::PushL(key); + + HBufC* value = HBufC::NewL(50); + CleanupStack::PushL(value); + + CHbSymbianVariantMap* map = CHbSymbianVariantMap::NewL(); + CleanupStack::PushL(map); + + iFileIndex = aFileIndex+1; + key->Des().Copy(_L("currentFileIdx")); + value->Des().AppendNum(aFileIndex+1); + CHbSymbianVariant* currentFileIdx = CHbSymbianVariant::NewL(value, CHbSymbianVariant::EDes); + map->Add(*key,currentFileIdx); + + key->Des().Copy(_L("totalFilesCnt")); + value->Des().Zero(); + value->Des().AppendNum(iFileCount); + CHbSymbianVariant* totalFilesCnt = CHbSymbianVariant::NewL(value, CHbSymbianVariant::EDes); + map->Add(*key,totalFilesCnt); + + + key->Des().Copy(_L("destinationName")); + if ( iDevice->IsValidFriendlyName() ) + { + value->Des().Copy( iDevice->FriendlyName() ); + } + else + { + value->Des().Copy( BTDeviceNameConverter::ToUnicodeL(iDevice->DeviceName())); + } + + CHbSymbianVariant* destinationName = CHbSymbianVariant::NewL(value, CHbSymbianVariant::EDes); + map->Add(*key,destinationName); + + key->Des().Copy(_L("fileName")); + value->Des().Copy(aFileName); + CHbSymbianVariant* fileName = CHbSymbianVariant::NewL(value, CHbSymbianVariant::EDes); + map->Add(*key,fileName); + + key->Des().Copy(_L("fileSzTxt")); + value->Des().Zero(); + if(aFileSize < 1024) + { + value->Des().AppendNum(aFileSize); + value->Des().Append(_L(" Bytes")); + } + else + { + TInt filesize = aFileSize/1024; + value->Des().AppendNum(filesize); + value->Des().Append(_L(" KB")); + } + + CHbSymbianVariant* fileSzTxt = CHbSymbianVariant::NewL(value, CHbSymbianVariant::EDes); + map->Add(*key,fileSzTxt); + + + key->Des().Copy(_L("fileSz")); + CHbSymbianVariant* fileSz = CHbSymbianVariant::NewL(&aFileSize, CHbSymbianVariant::EInt); + map->Add(*key,fileSz); + + + + TInt ret = iDeviceDialog->Update(*map); + CleanupStack::PopAndDestroy(map); + CleanupStack::PopAndDestroy(value); + CleanupStack::PopAndDestroy(key); + } // ----------------------------------------------------------------------------- // CBTServiceStarter::CancelProgressNote // ----------------------------------------------------------------------------- @@ -501,7 +644,17 @@ // if ( iDialog ) { // TRAP_IGNORE( iDialog->CancelProgressDialogL() ); + if ( iProgressTimer ) + { + iProgressTimer->Cancel(); + delete iProgressTimer; + iProgressTimer = NULL; + } } + if(iDeviceDialog) + { + iDeviceDialog->Cancel(); + } } // ----------------------------------------------------------------------------- @@ -549,7 +702,7 @@ { case EBTSNoError: { - if ( iService == EBTPrintingService ) + /* if ( iService == EBTPrintingService ) { // resource = R_BT_DATA_SENT2; @@ -558,10 +711,20 @@ } else { - //resource = R_BT_DATA_SENT; - _LIT(KText, "Data Sent"); + //resource = R_BT_DATA_SENT;*/ + _LIT(KText, "All files Sent to "); buf.Copy(KText); - } + if ( iDevice->IsValidFriendlyName() ) + { + buf.Append( iDevice->FriendlyName() ); + } + else + { + TRAP_IGNORE( buf.Append( BTDeviceNameConverter::ToUnicodeL(iDevice->DeviceName()))); + } + + +// } break; } case EBTSConnectingFailed: @@ -635,7 +798,8 @@ } // TRAP_IGNORE(TObexUtilsUiLayer::ShowInformationNoteL( resource ) ); - CHbDeviceMessageBoxSymbian::InformationL(buf); +// CHbDeviceMessageBoxSymbian::InformationL(buf); + TRAP_IGNORE(CHbDeviceNotificationDialogSymbian::NotificationL(KNullDesC, buf, KNullDesC)); FLOG(_L("[BTSU]\t CBTServiceStarter::ShowNote() completed")); } @@ -1074,3 +1238,43 @@ void CBTServiceStarter::ProgressDialogClosed(const CHbDeviceProgressDialogSymbian* /* aDialog*/) { } + + +void CBTServiceStarter::DataReceived(CHbSymbianVariantMap& /*aData*/) + { + + } + + +void CBTServiceStarter::DeviceDialogClosed(TInt /* aCompletionCode*/) + { + TBuf<255> buf; + _LIT(KText, "Sending Cancelled to "); + buf.Copy(KText); + if ( iDevice->IsValidFriendlyName() ) + { + buf.Append( iDevice->FriendlyName() ); + } + else + { + TRAP_IGNORE(buf.Append( BTDeviceNameConverter::ToUnicodeL(iDevice->DeviceName()))); + } + + iUserCancel=ETrue; + if ( iController ) + { + iController->Abort(); + } + else + { + StopTransfer(KErrCancel); + } + + if ( iProgressTimer ) + { + iProgressTimer->Cancel(); + delete iProgressTimer; + iProgressTimer = NULL; + } + TRAP_IGNORE(CHbDeviceNotificationDialogSymbian::NotificationL(KNullDesC, buf, KNullDesC)); + } diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexserviceman/utils/src/obexutilsdialog.cpp --- a/localconnectivityservice/obexserviceman/utils/src/obexutilsdialog.cpp Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/obexserviceman/utils/src/obexutilsdialog.cpp Mon May 17 11:02:52 2010 +0300 @@ -20,7 +20,7 @@ #include "obexutilsdialog.h" #include "obexutilsdialogtimer.h" #include "obexutilsuilayer.h" -#include +#include #include #include #include diff -r 51f207bebb06 -r 0b722902461e localconnectivityservice/obexserviceman/utils/src/obexutilsuilayer.cpp --- a/localconnectivityservice/obexserviceman/utils/src/obexutilsuilayer.cpp Sun May 02 21:46:11 2010 +0300 +++ b/localconnectivityservice/obexserviceman/utils/src/obexutilsuilayer.cpp Mon May 17 11:02:52 2010 +0300 @@ -21,7 +21,7 @@ #include "obexutilslaunchwaiter.h" #include "obexutilsdebug.h" -#include +#include #include #include #include diff -r 51f207bebb06 -r 0b722902461e shortlinkconn_plat/generic_hid_api/group/bld.inf --- a/shortlinkconn_plat/generic_hid_api/group/bld.inf Sun May 02 21:46:11 2010 +0300 +++ b/shortlinkconn_plat/generic_hid_api/group/bld.inf Mon May 17 11:02:52 2010 +0300 @@ -31,3 +31,4 @@ ../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 51f207bebb06 -r 0b722902461e shortlinkconn_plat/generic_hid_api/inc/hiddriverpluginuid.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/shortlinkconn_plat/generic_hid_api/inc/hiddriverpluginuid.h Mon May 17 11:02:52 2010 +0300 @@ -0,0 +1,24 @@ +/* +* 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__