localconnectivityservice/dun/atext/src/DunAtCmdHandler.cpp
changeset 38 48c22c726cf9
parent 33 883e91c086aa
equal deleted inserted replaced
33:883e91c086aa 38:48c22c726cf9
   853         {
   853         {
   854         iEndIndex = KErrNotFound;
   854         iEndIndex = KErrNotFound;
   855         FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractLineFromInputBuffer() (more needed) complete") ));
   855         FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractLineFromInputBuffer() (more needed) complete") ));
   856         return ETrue;
   856         return ETrue;
   857         }
   857         }
   858     // As a last step adjust the possible multiple IsDelimiterCharacter()
       
   859     // characters and set length of iLineBuffer. Leave iEndIndex untouched.
       
   860     lineLength = iLineBuffer.Length();
       
   861     for ( TInt i=lineLength-1; i>=0; i-- )
       
   862         {
       
   863         TChar character = iLineBuffer[i];
       
   864         if ( !IsDelimiterCharacter(character) )
       
   865             {
       
   866             iLineBuffer.SetLength( i + 1 );
       
   867             FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractLineFromInputBuffer() after (%d bytes):"), iLineBuffer.Length() ));
       
   868             FTRACE(FPrintRaw(iLineBuffer) );
       
   869             break;
       
   870             }
       
   871         }
       
   872     FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractLineFromInputBuffer() (line found) complete") ));
   858     FTRACE(FPrint( _L("CDunAtCmdHandler::ExtractLineFromInputBuffer() (line found) complete") ));
   873     return EFalse;
   859     return EFalse;
   874     }
   860     }
   875 
   861 
   876 // ---------------------------------------------------------------------------
   862 // ---------------------------------------------------------------------------
  1411         }
  1397         }
  1412     if ( extendedIndex == expectedIndex )
  1398     if ( extendedIndex == expectedIndex )
  1413         {
  1399         {
  1414         iDecodeInfo.iExtendedIndex = aEndIndex;
  1400         iDecodeInfo.iExtendedIndex = aEndIndex;
  1415         SaveFoundCharDecodeState( aCharacter );
  1401         SaveFoundCharDecodeState( aCharacter );
  1416         FTRACE(FPrint( _L("CDunAtCmdHandler::IsExtendedBorder() (no border) complete") ));
  1402         FTRACE(FPrint( _L("CDunAtCmdHandler::IsExtendedBorder() (no border normal) complete") ));
  1417         return EFalse;
  1403         return EFalse;
       
  1404         }
       
  1405     // Now suspect border found so peek the next character after the suspected
       
  1406     // extended character. If it is not alphabetical character, return with EFalse.
       
  1407     // This case is to detect the cases such as "AT+VTS={*,3000}", where '*' would
       
  1408     // be the start of the next command in normal cases.
       
  1409     TInt peekIndex = aEndIndex + 1;
       
  1410     TInt lineLength = iLineBuffer.Length();
       
  1411     if ( peekIndex < lineLength )
       
  1412         {
       
  1413         TChar nextCharacter = iLineBuffer[peekIndex];
       
  1414         if ( !nextCharacter.IsAlpha() )
       
  1415             {
       
  1416             SaveFoundCharDecodeState( aCharacter );
       
  1417             FTRACE(FPrint( _L("CDunAtCmdHandler::IsExtendedBorder() (no border special) complete") ));
       
  1418             return EFalse;
       
  1419             }
  1418         }
  1420         }
  1419     aEndIndex--;
  1421     aEndIndex--;
  1420     FTRACE(FPrint( _L("CDunAtCmdHandler::IsExtendedBorder() (border) complete") ));
  1422     FTRACE(FPrint( _L("CDunAtCmdHandler::IsExtendedBorder() (border) complete") ));
  1421     return ETrue;
  1423     return ETrue;
  1422     }
  1424     }