コード例 #1
0
void CAudioOutputControlTestClass::HandleTimeout(TInt aError)
{
	FTRACE(FPrint(_L("CAudioOutputControlTestClass::HandleTimeout")));
	// All expected events have ocurred
	if (aError != KErrNone)
	{
		if (iExpectedEvents.Count() == 0 )
		{
			iLog->Log(_L("Timing out but events have ocurred"));
			Signal();
		}
		else
		{
			RemoveAllExpectedEvents();
			iLog->Log(_L("Timing out and events still pending"));
			Signal(KErrEventPending);
		}
	}
	else
	{
		iLog->Log(_L("Timing out return a error %d"), aError);
		Signal(aError);
	}
}
コード例 #2
0
/*
-------------------------------------------------------------------------------

Class: CSimpleTimeout

Method: RunL

Description: RunL handles completed timeouts.

Parameters: None

Return Values: None

Errors/Exceptions: None

Status: Approved

-------------------------------------------------------------------------------
*/
void CSimpleTimeout::RunL()
{
    FTRACE(FPrint(_L("CSimpleTimeout::RunL")));
	iLog->Log(_L("CSimpleTimeout::RunL"));
    TTime timeout;
    timeout.HomeTime();
    // Handle the abort case when system time gets changed, but timeout is
    // still valid. All other cases should timeout since they invalidate the
    // logic of the timers.
    if ( iStatus == KErrAbort)
    {
        if ( iTestCaseTimeout > timeout )
        {
            RDebug::Print( _L( "Absolute timer still valid. Restaring timer. iStatus: %d" ), iStatus.Int() );
            // Start new timer
            iStatus = KErrNone; // reset value
            iTimer.At ( iStatus, iTestCaseTimeout );  // restart timer
            SetActive();
        }
        else
        {
            // Absolute timer no longer valid. Must timeout.
            iLog->Log(_L("Absolute timeout no longer valid"));
            iObserver->HandleTimeout(KErrNone);
        }

    }
    else
    {
        // Status was not KErrAbort. Timing out!
        // iLog->Log(_L("CSimpleTimeout::RunL - Timeout !!"), iTimeout);
        iLog->Log(_L("Timing out"));
        iObserver->HandleTimeout(KErrNone);
    }

}
コード例 #3
0
// ---------------------------------------------------------------------------
// Adds error code to consider as "no error" to either endpoint
// ---------------------------------------------------------------------------
//
TInt CDunStream::AddSkippedError( TInt aError,
                                  TDunOperationType aOperationType )
    {
    FTRACE(FPrint( _L("CDunStream::AddSkippedError()" ) ));
    RArray<TInt>* okErrors = NULL;
    if ( aOperationType == EDunOperationTypeRead )
        {
        okErrors = &iOkErrorsR;
        }
    else if ( aOperationType == EDunOperationTypeWrite )
        {
        okErrors = &iOkErrorsW;
        }
    else
        {
        FTRACE(FPrint( _L("CDunStream::AddSkippedError() (ERROR) complete" ) ));
        return KErrGeneral;
        }
    if ( aError >= 0 )  // errors can't be >= 0
        {
        FTRACE(FPrint( _L("CDunStream::AddSkippedError() (ERROR) complete" ) ));
        return KErrGeneral;
        }
    TInt retTemp = okErrors->Find( aError );
    if ( retTemp != KErrNotFound )
        {
        FTRACE(FPrint( _L("CDunStream::AddSkippedError() (already exists) complete" ) ));
        return KErrAlreadyExists;
        }
    retTemp = okErrors->Append( aError );
    if ( retTemp != KErrNone )
        {
        FTRACE(FPrint( _L("CDunStream::AddSkippedError() (append failed!) complete" ) ));
        return retTemp;
        }
    FTRACE(FPrint( _L("CDunStream::AddSkippedError() complete" ) ));
    return KErrNone;
    }
コード例 #4
0
// ---------------------------------------------------------------------------
// Adds callback for line status change controlling
// The callback will be called when serious read error is detected
// ---------------------------------------------------------------------------
//
TInt CDunStream::AddConnMonCallback( MDunConnMon* aCallback,
                                     TDunOperationType aOperationType )
    {
    FTRACE(FPrint( _L("CDunStream::AddConnMonCallback()" ) ));
    RPointerArray<MDunConnMon>* callbacks = NULL;
    if ( aOperationType == EDunOperationTypeRead )
        {
        callbacks = &iCallbacksR;
        }
    else if ( aOperationType == EDunOperationTypeWrite )
        {
        callbacks = &iCallbacksW;
        }
    else
        {
        FTRACE(FPrint( _L("CDunStream::AddConnMonCallback() (ERROR) complete" ) ));
        return KErrGeneral;
        }
    if ( !aCallback )
        {
        FTRACE(FPrint( _L("CDunStream::AddConnMonCallback() (aCallback) not initialized!" ) ));
        return KErrGeneral;
        }
    TInt retTemp = callbacks->Find( aCallback );
    if ( retTemp != KErrNotFound )
        {
        FTRACE(FPrint( _L("CDunStream::AddCallback() (already exists) complete" ) ));
        return KErrAlreadyExists;
        }
    retTemp = callbacks->Append( aCallback );
    if ( retTemp != KErrNone )
        {
        FTRACE(FPrint( _L("CDunStream::AddCallback() (append failed!) complete" ) ));
        return retTemp;
        }
    FTRACE(FPrint( _L("CDunStream::AddCallback() complete" ) ));
    return KErrNone;
    }
コード例 #5
0
// ---------------------------------------------------------------------------
// Creates new buffer if source buffer defined, otherwise already existing
// buffer will be used
// ---------------------------------------------------------------------------
//
void CDunTransUtils::DoCreateBufferLC( TUint8* aSrcBuffer,
                                       TPtr8* aSrcPtr,
                                       TUint8*& aDstBuffer,
                                       TPtr8*& aDstPtr,
                                       TInt aBufferLength,
                                       TInt& aItemsInCs )
    {
    FTRACE(FPrint( _L("CDunTransUtils::DoCreateBufferLC()" )));
    TUint8* buffer;
    if ( !aSrcBuffer )
        {
        buffer = new (ELeave) TUint8[aBufferLength];
        CleanupStack::PushL( buffer );
        aItemsInCs++;
        FTRACE(FPrint( _L("CDunTransUtils::DoCreateBufferLC() new created" )));
        }
    else
        {
        buffer = aSrcBuffer;
        FTRACE(FPrint( _L("CDunTransUtils::DoCreateBufferLC() existing set" )));
        }
    TPtr8* bufferPtr;
    if ( !aSrcPtr )
        {
        bufferPtr = new (ELeave) TPtr8( buffer, aBufferLength, aBufferLength );
        CleanupStack::PushL( bufferPtr );
        aItemsInCs++;
        FTRACE(FPrint( _L("CDunTransUtils::DoCreateBufferLC() new created" )));
        }
    else
        {
        bufferPtr = aSrcPtr;
        FTRACE(FPrint( _L("CDunTransUtils::DoCreateBufferLC() existing set" )));
        }
    aDstBuffer = buffer;
    aDstPtr = bufferPtr;
    FTRACE(FPrint( _L("CDunTransUtils::DoCreateBufferLC() complete" )));
    }
コード例 #6
0
// ---------------------------------------------------------------------------
// From class MDunTransporterUtility.
// Adds connection monitor callback for either local media or network side
// by connection ID
// Connection monitor will be added to aIndex:th endpoint
// ---------------------------------------------------------------------------
//
TInt CDunTransUtils::DoAddConnMonCallback( TInt aIndex,
                                           MDunConnMon* aCallback,
                                           TDunDirection aDirection,
                                           TBool aSignal )
    {
    FTRACE(FPrint( _L("CDunTransUtils::DoAddConnMonCallback()" )));

    if ( !iParent.iNetwork )
        {
        FTRACE(FPrint( _L("CDunTransUtils::DoAddConnMonCallback() (iNetwork) not initialized!" )));
        return KErrGeneral;
        }

    if ( aIndex < 0 ||
         aIndex >= iChannelData.Count() )
        {
        FTRACE(FPrint( _L("CDunTransUtils::DoAddConnMonCallback() (not found) complete" )));
        return KErrNotFound;
        }

    TDunChannelData& channelData = iChannelData[aIndex];

    // Get upstream and downstream
    CDunUpstream* upstream = channelData.iUpstreamRW;
    CDunDownstream* downstream = channelData.iDownstreamRW;

    if ( aDirection == EDunReaderUpstream )
        {
        // Initialize stream for AT parsing (ignore errors)
        upstream->InitializeForAtParsing( downstream,
                                          channelData.iChannelName,
                                          upstream,
                                          downstream );
        downstream->InitializeForDataPushing( upstream );
        }

    // Get stream type and operation type

    TDunStreamType streamType =
        static_cast<TDunStreamType>( aDirection & KDunStreamTypeMask );
    TDunOperationType operationType =
        static_cast<TDunOperationType>( aDirection & KDunOperationTypeMask );

    if ( streamType == EDunStreamTypeUpstream )
        {
        // If signal copy object(s) exist then add RunL error monitoring for them
        if ( channelData.iUpstreamSignalCopy )  // optional
            {
            // Add callback (ignore errors)
            channelData.iUpstreamSignalCopy->AddCallback( aCallback );
            }
        }
    else if ( streamType == EDunStreamTypeDownstream )
        {
        // If signal copy object(s) exist then add RunL error monitoring for them
        if ( channelData.iDownstreamSignalCopy )  // optional
            {
            // Add callback (ignore errors)
            channelData.iDownstreamSignalCopy->AddCallback( aCallback );
            }
        }
    else
        {
        FTRACE(FPrint( _L("CDunTransUtils::DoAddConnMonCallback() (stream) not initialized!" ) ));
        return KErrGeneral;
        }

    // Set signal notify callback

    if ( aSignal && aDirection==EDunReaderDownstream )
        {
        if ( !channelData.iSignalNotify )
            {
            FTRACE(FPrint( _L("CDunTransUtils::DoAddConnMonCallback() (iSignalNotify) not initialized" )));
            return KErrGeneral;
            }
        // Add callback (ignore errors)
        channelData.iSignalNotify->AddCallback( aCallback );
        }

    // Add callback (ignore errors)
    if ( streamType == EDunStreamTypeUpstream )
        {
        upstream->AddConnMonCallback( aCallback, operationType );
        }
    else  // streamType == EDunStreamTypeDownstream
        {
        downstream->AddConnMonCallback( aCallback, operationType );
        }

    FTRACE(FPrint( _L("CDunTransUtils::DoAddConnMonCallback() complete" )));
    return KErrNone;
    }
コード例 #7
0
// ---------------------------------------------------------------------------
// From class MDunLocalMediaPlugin.
// Gets called when server needs to know the active connection
// ---------------------------------------------------------------------------
//
TConnId CDunIrPlugin::ActiveConnection()
    {
    FTRACE(FPrint(_L("CDunIrPlugin::ActiveConnection()")));
    FTRACE(FPrint(_L("CDunIrPlugin::ActiveConnection() (not found) complete")));
    return NULL;
    }
コード例 #8
0
/*
 -------------------------------------------------------------------------------

 Class: CSimpleTimeout

 Method: DoCancel

 Description: voip audio service - Cancel active request

 Parameters: None

 Return Values: None

 Errors/Exceptions: None

 Status: Approved

 -------------------------------------------------------------------------------
 */
void CSimpleTimeout::DoCancel()
    {
    FTRACE(FPrint(_L("CSimpleTimeout::DoCancel")));
    iTimer.Cancel();
    }
コード例 #9
0
// ---------------------------------------------------------------------------
// For sending the frames. 
// ---------------------------------------------------------------------------
//
TInt CBTAudioStreamSender::SendThisBuffer(const TDesC8& aBuffer, TTimeIntervalMicroSeconds aTimestamp)
    {
    BT_AUDIO_STREAMER_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioStreamer]\t CBTAudioStreamSender::SendThisBuffer() ->")));

    BT_AUDIO_STREAMER_TRACE_OPT( KPRINTFTRACE, FPrint(_L("[BTAudioStreamer]\t Received timestamp low: %d"), I64LOW(aTimestamp.Int64()))); 
    BT_AUDIO_STREAMER_TRACE_OPT( KPRINTFTRACE, FPrint(_L("[BTAudioStreamer]\t Received timestamp high: %d"), I64HIGH(aTimestamp.Int64()))); 

    // Store the buffer's address for later reference. 
    iBuffer = &aBuffer; 

		if(iChangingFrameLength != EFalse) 
		{
			// Check the new framelength... 
			if(aBuffer.Length() == iNewFrameLength)  // Check if the buffer exactly of the new length. 
			{
						// If we have data with previous frame length in buffer, send it first. 
            if(iNonprocessedDataInBuffer != EFalse)
                {
	              ProceedToPacketSending(); 
                return KErrNone; 
                }
            else	// Else we can switch to new packet immediately and continue processing this buffer. 
                {
								SwitchToNewSendPacket(); 
                }
			}
			else if(aBuffer.Length() > iNewFrameLength) // Check if it's safe to peek at index iNewFrameLength. 
			{
				if(aBuffer[iNewFrameLength] == 0x9c) // Check if the index iNewFrameLength the syncword. 
				    {
						// If we have data with previous frame length in buffer, send it first. 
            if(iNonprocessedDataInBuffer != EFalse)
                {
	              ProceedToPacketSending(); 
                return KErrNone; 
                }
            else	// Else we can switch to new packet immediately and continue processing this buffer. 
                {
								SwitchToNewSendPacket(); 
                }
						}
				else 
				{
            BT_AUDIO_STREAMER_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioStreamer]\t CBTAudioStreamSender: Still waiting for packets of the new frame length...")));
				}
			}
			else 
			{
        BT_AUDIO_STREAMER_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioStreamer]\t CBTAudioStreamSender: Still waiting for packets of the new frame length...")));
				// Encoder has not yet started to use the new frame length. 
			}
		}
    else if(iStreamerState != EBuffering) 
        {
        // Previous sending is not yet completed or there is was an error that is not yet handled. 
        // Just discard the incoming frame. 
        BT_AUDIO_STREAMER_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioStreamer]\t CBTAudioStreamSender error: Previous buffer sending hasn't completed - discarding this buffer.")));
        iObserver.NotifyBufferSent(aBuffer); 
        BT_AUDIO_STREAMER_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioStreamer]\t CBTAudioStreamSender::SendThisBuffer() <-")));
        return KErrOverflow; 
        }

		// Store the timestamp for later use. 
    iTimestamp = aTimestamp.Int64(); 

    iNonprocessedDataInBuffer = ETrue; 
    ConsumeBuffer(); 

    BT_AUDIO_STREAMER_TRACE_OPT( KPRINTFTRACE, FLOG(_L("[BTAudioStreamer]\t CBTAudioStreamSender::SendThisBuffer() <-")));
    return KErrNone; 
    }
コード例 #10
0
// ---------------------------------------------------------------------------
// CDunSignalCopy::ConstructL
// ---------------------------------------------------------------------------
//
void CDunSignalCopy::ConstructL()
    {
    FTRACE(FPrint( _L("CDunSignalCopy::ConstructL()" ) ));
    CActiveScheduler::Add( this );
    FTRACE(FPrint( _L("CDunSignalCopy::ConstructL() complete" ) ));
    }
コード例 #11
0
// ---------------------------------------------------------------------------
// Destructor
// ---------------------------------------------------------------------------
//
CDunSignalCopy::~CDunSignalCopy()
    {
    FTRACE(FPrint( _L("CDunSignalCopy::~CDunSignalCopy()") ));
    ResetData();
    FTRACE(FPrint( _L("CDunSignalCopy::~CDunSignalCopy() complete") ));
    }
コード例 #12
0
TInt CWmaDecoderIntfcTestClass::GetTool( CStifItemParser& aItem )
{
	FTRACE(FPrint(_L("CWmaDecoderIntfcTestClass::GetTool")));
	iLog->Log(_L("CWmaDecoderIntfcTestClass::GetTool"));
	TInt error = KErrNone;

	TPtrC ToolType;
	error = aItem.GetNextString(ToolType);


	TBool aEnabledStatus;

	CWmaDecoderIntfc::TTool tool7 = CWmaDecoderIntfc::EToolOutput32Bit;
	CWmaDecoderIntfc::TTool tool2 = CWmaDecoderIntfc::EDownMixToStereo;
	CWmaDecoderIntfc::TTool tool3 = CWmaDecoderIntfc::ELostDataConcealment;

	if (error == KErrNone)
	{
		if (ToolType == KTagOutput32Bit)
		{
			iLog->Log(_L("CWmaDecoderIntfcTestClass::GetTool - Output32Bit"));
			iWmaDecoder->GetTool(tool7, aEnabledStatus);
		}
		else if (ToolType == KTagDownMixToStereo)
		{
			iLog->Log(_L("CWmaDecoderIntfcTestClass::GetTool - DownMixToStereo"));
			iWmaDecoder->GetTool(tool2, aEnabledStatus);
		}
		else if (ToolType == KTagLostDataConcealment)
		{
			iLog->Log(_L("CWmaDecoderIntfcTestClass::GetTool - LostDataConcealment"));
			iWmaDecoder->GetTool(tool3, aEnabledStatus);
		}
		else
		{
			iLog->Log(KMsgBadTestParameters);
			error = KErrBadTestParameter;
			return error;
		}

		TPtrC ExpectedStatus;
		error = aItem.GetNextString(ExpectedStatus);
		if (error == KErrNone)
		{
			if ( (ExpectedStatus == KTagTrue) && aEnabledStatus || (ExpectedStatus == KTagFalse) && !aEnabledStatus )
			{
				iLog->Log(_L("CWmaDecoderIntfcTestClass::GetTool OK"));
			}
			else
			{
				iLog->Log(_L("CWmaDecoderIntfcTestClass::GetTool failed. aEnabledStatus = %d"), aEnabledStatus);
				error = KErrUnexpectedValue;
			}
		}
		else
		{
			iLog->Log(KMsgBadTestParameters);
			error = KErrBadTestParameter;
		}

	}

	return error;
}
コード例 #13
0
//Will panic if called.Should not be called during playing
void CAudioRoutingTestClass::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/)
	 {
	    FTRACE(FPrint(_L("CAudioRoutingTestClass::BufferToBeEmptied")));
	    iLog->Log(_L("BufferToBeEmptied, return code =!!!"));
	 }
コード例 #14
0
// ----------------------------------------------------------------------------
// CUSBUIQueriesNotifier::GetParamsL
// ----------------------------------------------------------------------------
//
void CUSBUIQueriesNotifier::StartDialogL(const TDesC8& aBuffer,
        TInt aReplySlot, const RMessagePtr2& aMessage)
    {
    FLOG(_L("[USBUINOTIF]\t  CUSBUIQueriesNotifier::StartDialogL"));
    if ( iReplySlot != 0 || iNeedToCompleteMessage)
        {
        User::Leave( KErrInUse );
        }
        
    InitializeTextResolver();

    iMessage = aMessage;
    iNeedToCompleteMessage = ETrue;
    iReplySlot = aReplySlot;

    // Get parameters 
    //
    TUSBQueriesNotiferParams params; //stores parameters from aBuffer
    TPckgC<TUSBQueriesNotiferParams> pckg( params );
    pckg.Set( aBuffer );
    // Save the type of the query for later use (dialog selection)
    //
    iQueryType = pckg().iQuery;
         
    if (iUSBQueryDlg)
        {
        delete iUSBQueryDlg;
        iUSBQueryDlg = NULL;
        }
    iUSBQueryDlg = CHbDeviceMessageBoxSymbian::NewL(
                       CHbDeviceMessageBoxSymbian::EWarning, this);
    iUSBQueryDlg->SetTimeout(0);
    HBufC* stringHolder = NULL;
    switch (iQueryType)
            {
            case EUSBStorageMediaFailure:
                {
                _LIT(KMassStorageFail, "txt_usb_info_unable_to_show_a_memory_to_other_devi");
                stringHolder = HbTextResolverSymbian::LoadLC( KMassStorageFail );
                 break;
                }
            case EUSBDiskFull:
                {
                _LIT(KDiskFull, "txt_usb_info_disk_full_remove_some_files_and_try");
                stringHolder = HbTextResolverSymbian::LoadLC( KDiskFull );
		         break;
                }
            case EUSBNotEnoughRam:
                {
                _LIT(KNotEnoughMemory, "txt_usb_info_memory_full_close_some_applications");
                 stringHolder = HbTextResolverSymbian::LoadLC( KNotEnoughMemory );
                 break;
                }
            default:
                {
                FTRACE( FPrint( _L( "[USBUINOTIF]\t CUSBUIQueriesNotifier::ERROR! Unknown query type: %d" ),iQueryType ) );
                }
            }
   
    if (stringHolder)
        {
        iUSBQueryDlg->SetTextL(*stringHolder);
        }
        
    iUSBQueryDlg->ShowL();
    FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::StartDialogL() ShowL returned"));     
    
    CleanupStack::PopAndDestroy( stringHolder );
    
    
    FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::StartDialogL completed"));
    }
コード例 #15
0
// ---------------------------------------------------------------------------
// 
// ---------------------------------------------------------------------------
//
void CAiwPrintingProvider::DoHandleCmdL(TInt aMenuCmdId,
                            const CAiwGenericParamList& aInParamList,
                            CAiwGenericParamList& aOutParamList,
                            TUint /*aCmdOptions*/,
                            const MAiwNotifyCallback* aCallback)
    {
    if ( aMenuCmdId == KAiwCmdPrint || aMenuCmdId == KAiwCmdPrintPreview  )
        {
        FLOG(_L("[CAiwPrintingProvider]<<<  DoHandleCmdL"));
        
        CAiwGenericParamList* checkedParams = CAiwGenericParamList::NewL();
        
        iConsumerInParamList = &aInParamList;
        iConsumerOutParamList = &aOutParamList;
        iConsumerCallback = aCallback;
        
        TInt index( 0 );
	    const TAiwGenericParam* param = aInParamList.FindFirst(index,
	            EGenericParamFile,
	            EVariantTypeDesC);
	    while ( index != KErrNotFound )
			{
	        TFileName filename( param->Value().AsDes() );
 	        TInt err = KErrNone;
	        TBool result = EFalse;
	        TRAP( err, result = IsPrintingSupportedL( filename ) );
	        if ( err == KErrNone && result )
	        	{
	            FLOG(_L("[CAiwPrintingProvider] DoHandleCmdL; supported file"));
	        	checkedParams->AppendL(*param);
	        	}
	        else
	        	{
	        	FLOG(_L("[CAiwPrintingProvider] DoHandleCmdL; not supported"));
	        	++iNumberOfUnSuppFiles;
	        	iUnsupportedFiles = ETrue;
	        	}	
	        param = aInParamList.FindNext(index,
	            EGenericParamFile,
	            EVariantTypeDesC);
	        }
   
                
		FTRACE(FPrint(_L("[CAiwPrintingProvider] UnSuppFiles is %d"), iNumberOfUnSuppFiles )); 

		RFileWriteStream stream;
	  	CleanupClosePushL(stream);
		if((stream.Replace(iEikEnv.FsSession(), *iUnsuppFileName ,EFileWrite)) == KErrNone)
			{
			stream.WriteInt16L(iNumberOfUnSuppFiles);
			stream.CommitL();
			}
		CleanupStack::PopAndDestroy(&stream); 
		
        FLOG(_L("[IMAGEPRINTUI]<<< CAiwPrintingProvider;Save iUnsupportedFiles  is done"));
	
        
        RFileWriteStream writeStream;
        User::LeaveIfError( writeStream.Replace(iEikEnv.FsSession(),
        										*iPrintFileName , EFileWrite) );
        writeStream.PushL();
        checkedParams->ExternalizeL(writeStream);
        writeStream.CommitL();
        CleanupStack::PopAndDestroy( &writeStream );
        
        iNumberOfUnSuppFiles = 0;
        delete checkedParams;
        checkedParams = NULL;
        
        LaunchImagePrintApplicationL();
        FLOG(_L("[CAiwPrintingProvider]>>> DoHandleCmdL "));
        }
    }
コード例 #16
0
// ---------------------------------------------------------------------------
// Handles situation depends on result after calling DpsEventNotify 
// 
// ---------------------------------------------------------------------------
//
void CEventManager::HandleReturnStatusL()
	{
    FLOG(_L("[IMAGEPRINTUI]>>> CEventManager; HandleReturnStatus"));
    FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager event value is %d"), iEventRequest.iEvent ));
    FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iPrintStatus is %x"), iEventRequest.iPrinterEvent.iRepParam.iPrintStatus ));
    FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iJobStatus is %x"), iEventRequest.iPrinterEvent.iRepParam.iJobStatus ));
    FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iErrorStatus hex is %x"), iEventRequest.iPrinterEvent.iRepParam.iErrorStatus ));
    FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iJobEndReason is %x"), iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor ));
    FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iPaperMinor is %x"), iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iPaperMinor ));
    FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iInkMinor is %x"), iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iInkMinor ));
    FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iHardMinor is %x"), iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iHardMinor ));
    FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iFileMinor is %x"), iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iFileMinor ));
    FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iDisconnectEnable is %d"), iEventRequest.iPrinterEvent.iRepParam.iDisconnectEnable ));
    FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iCapabilityChange is %d"), iEventRequest.iPrinterEvent.iRepParam.iCapabilityChange ));
    FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager iNewJobOk is is %d"), iEventRequest.iPrinterEvent.iRepParam.iNewJobOk ));
    
    
	if(iEventRequest.iEvent == EDpsEvtNotifyJobStatus)	
		{
		FLOG(_L("[IMAGEPRINTUI]<<< CEventManager; NotifyPrintProgress"));
		FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager  iImagesPrinted is %d"), iEventRequest.iJobEvent.iRepParam.iImagesPrinted ));
		FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CEventManager  iProgress is %d"), iEventRequest.iJobEvent.iRepParam.iProgress ));
	    iAppUi->NotifyPrintProgress(iEventRequest.iJobEvent.iRepParam.iImagesPrinted, 
	                                 iEventRequest.iJobEvent.iRepParam.iProgress);
		}
		
	else if(iEventRequest.iEvent == EDpsEvtNotifyDeviceStatus)
		    {		    		    
		    FLOG(_L("[IMAGEPRINTUI]<<< CEventManager; HandleReturnStatus, EDpsEvtNotifyDeviceStatus"));
		    iAppUi->NotifyPrintStatus(iEventRequest.iPrinterEvent.iRepParam.iPrintStatus);
		    
		    HandleJobStatusL(iEventRequest.iPrinterEvent.iRepParam.iJobStatus);
		    
		    HandleErrorStatusL(iEventRequest.iPrinterEvent.iRepParam.iErrorStatus);
		    
		    if(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor == EDpsJobErrorPaper)
				{
				FLOG(_L("[IMAGEPRINTUI] CEventManager::EDpsJobErrorPaper"));
				HandlePaperErrorL(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iPaperMinor);
				}
			else if(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor == EDpsJobErrorInk)
				{
				FLOG(_L("[IMAGEPRINTUI] CEventManager::EDpsJobErrorInk"));
				HandleInkErrorL(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iInkMinor);
				}
			else if(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor == EDpsJobErrorFile)
				{
				FLOG(_L("[IMAGEPRINTUI] CEventManager::EDpsJobErrorFile"));
				HandleFileErrorL(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iFileMinor);
				}
			else if(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iMajor == EDpsJobErrorHardware)
				{
				FLOG(_L("[IMAGEPRINTUI] CEventManager::EDpsJobErrorHardware"));
				HandleHardwareErrorL(iEventRequest.iPrinterEvent.iRepParam.iJobEndReason.iHardMinor);
				}			
		    
		    if(iEventRequest.iPrinterEvent.iRepParam.iNewJobOk)
				{
				FLOG(_L("[IMAGEPRINTUI] CEventManager::HandleDeviceStatusL, NewJob is OK"));
				iAppUi->NotifyEventL(CEventManager::ENewJobOK );
		    	}
	        //capability change	
			else if(iEventRequest.iPrinterEvent.iRepParam.iCapabilityChange)
				{
				FLOG(_L("[IMAGEPRINTUI] CEventManager::capability change"));
				iAppUi->NotifyEventL(CEventManager::ECapabilityChange);
				}
		    }
    FLOG(_L("[IMAGEPRINTUI]<<< CEventManager; HandleReturnStatus, next call StartListening"));		    
	StartListening();
	}
コード例 #17
0
// ---------------------------------------------------------------------------
// Destructor.
// ---------------------------------------------------------------------------
//
CDunDataWaiter::~CDunDataWaiter()
    {
    FTRACE(FPrint( _L("CDunDataWaiter::~CDunDataWaiter()") ));
    ResetData();
    FTRACE(FPrint( _L("CDunDataWaiter::~CDunDataWaiter() complete") ));
    }
コード例 #18
0
// ---------------------------------------------------------------------------
// Destructor.
// ---------------------------------------------------------------------------
//
CDunAtCmdEchoer::~CDunAtCmdEchoer()
    {
    FTRACE(FPrint( _L("CDunAtCmdEchoer::~CDunAtCmdEchoer()") ));
    ResetData();
    FTRACE(FPrint( _L("CDunAtCmdEchoer::~CDunAtCmdEchoer() complete") ));
    }
コード例 #19
0
// ---------------------------------------------------------------------------
// Destructor.
// ---------------------------------------------------------------------------
//
CDunIrPlugin::~CDunIrPlugin()
    {
    FTRACE(FPrint( _L( "CDunIrPlugin::~CDunIrPlugin()" ) ));
    Uninitialize();
    FTRACE(FPrint( _L( "CDunIrPlugin::~CDunIrPlugin() complete" ) ));
    }
コード例 #20
0
// ---------------------------------------------------------------------------
// Something has been read from EP0 
// ---------------------------------------------------------------------------
//
void CStateMachine::ReadEP0L(RBuf8& aBuffer, const TRequestStatus& aStatus)
    {
    
    FTRACE(FPrint(
            _L("[USBDEVCON]\tCStateMachine::ReadEP0: BufferLength = %d, aStatus = %d" ),aBuffer.Length(), aStatus.Int()));
    
    // all errors while reading data lead to idle state (ESetupStage in our case)
    if(KErrNone != aStatus.Int())
        {
        // restart
        StartL();
        return;
        }
    
    TInt err(KErrNone);
    
    switch(iState)
        {
        case ESetupStage: // setup transaction received
            {
            
            FLOG( _L( "[USBDEVCON]\tCStateMachine::ReadEP0 processing ESetupStage" ) );
            
            if(aBuffer.Length() != KSetupPacketLength) // SetupPacket is always 8 bytes
                {
                StartL();
                return;
                }
            
            ProcessSetupPacketL(aBuffer);
                                
            break;
            }
        case EDataStage:  // some data received from host. This data is required for the request, received on setup stage
            {
            
            FLOG( _L( "[USBDEVCON]\tCStateMachine::ReadEP0 processing EDataStage" ) );

            // handle request, providing data together with request descriptor
            // iBuffer == request, aBuffer == data from host
            err = iRequestsHandler.Handle(iBuffer, aBuffer);
            
            if(KErrNone != err) // some error happened while handling request
                {
                iLdd.EndpointZeroRequestError(); // stall EP0
                }
                else
                {
                // send Status Packet, indicating that we received request, data, and handled request. OK
                iLdd.SendEp0StatusPacket();
                }
            
            // all done, go to idle state
            iState = ESetupStage;
            iEP0Reader->ReadSetupPacketL();
            
            break;
            
            }
        default:
            {
            FLOG( _L( "[USBDEVCON]\tCStateMachine::ReadEP0 processing ***NOT_DEFINED state***" ) );
            }
            
        }
    
    }
コード例 #21
0
void CAudioRoutingTestClass::ToneFinished(TInt aError)
   	{
    FTRACE(FPrint(_L("CAudioRoutingTestClass::ToneFinished")));
    iLog->Log(_L("ToneFinished, return code =%d!!!"),aError);
 //	Panic(KErrNotSupported);
 	}
コード例 #22
0
// ---------------------------------------------------------------------------
// Processing setup packet 
// ---------------------------------------------------------------------------
//
void CStateMachine::ProcessSetupPacketL(RBuf8& aSetupPacket)
    {
    
    FLOG( _L( "[USBDEVCON]\tCStateMachine::ProcessSetupPacket" ) );
    
    TUint datalength(0); // data length, to be received from host
            
    if(IsDataFromHostRequired(aSetupPacket, datalength)) // then goes to data stage
        {
        
        FTRACE(FPrint(
            _L("[USBDEVCON]\tCStateMachine::ProcessSetupPacket. Data from host is required: %d bytes" ),datalength));

        // save request, until receiving following data
        iBuffer.Close();
        iBuffer.CreateL(aSetupPacket);
                
        // switch to Data state
        iState = EDataStage;
        iEP0Reader->ReadL(datalength);
    
        return;
        
        }
            
    TInt err(KErrNone); 
                        
    // Handle request. It does not require data from host   
    // aSetupPacket == request, iBuffer = result of the request
    err = iRequestsHandler.Handle(aSetupPacket, iBuffer);
        
    if(KErrNone != err) // some error happened while handling request
        {
        
        FTRACE(FPrint(
            _L("[USBDEVCON]\tCStateMachine::ProcessSetupPacket. Error while handling request, errcode: %d" ), err));

        iLdd.EndpointZeroRequestError(); // stall EP0
            
        // listen to EP0
        iState = ESetupStage;
        iEP0Reader->ReadSetupPacketL();
        
        return;
        }
            
    // send response, size of datalength
    if(IsDataFromDeviceRequired(aSetupPacket, datalength))
        {
        
        FTRACE(FPrint(
          _L("[USBDEVCON]\tCStateMachine::ProcessSetupPacket. Data from device is required: %d bytes" ),datalength));

        iState = EStatusStage;
        iEP0Writer->WriteL(iBuffer, datalength);
        
        return;
                
        }
    
    // status stage 
    iLdd.SendEp0StatusPacket();
                
    // all is done, listen to EP0, in setup stage
    iState = ESetupStage;
    iEP0Reader->ReadSetupPacketL();
    
    }
コード例 #23
0
//Will panic if called.Should not be called during playing
void CAudioRoutingTestClass::ConvertError(TInt aError)
	 {
	    FTRACE(FPrint(_L("CAudioRoutingTestClass::ConvertError")));
	    iLog->Log(_L("ConvertError, return code =%d!!!"),aError);
	 }
コード例 #24
0
// ---------------------------------------------------------------------------
// Destructor.
// ---------------------------------------------------------------------------
//
CDunAtNvramListen::~CDunAtNvramListen()
    {
    FTRACE(FPrint( _L("CDunAtNvramListen::~CDunAtNvramListen()") ));
    ResetData();
    FTRACE(FPrint( _L("CDunAtNvramListen::~CDunAtNvramListen() complete") ));
    }
コード例 #25
0
// ---------------------------------------------------------------------------
// Manages downstream signal changes
// ---------------------------------------------------------------------------
//
void CDunSignalCopy::ManageSignalChangeDownstream()
    {
    FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream()" ) ));
    // For downstream the following signals are set for network:
    // KSignalDTEInputs = KSignalCTS | KSignalDSR | KSignalDCD | KSignalRNG
    if ( iSignals & KCTSChanged )
        {
        FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() checking CTS..." ) ));
        if ( iSignals & KSignalCTS )  // CTS changed to high or initially high
            {
            ChangeDownstreamSignal( KSignalCTS, 0 );
            FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() CTS changed high" ) ));
            }
        else  // CTS changed to low
            {
            ChangeDownstreamSignal( 0, KSignalCTS );
            FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() CTS changed low" ) ));
            }
        }
    if ( iSignals & KDSRChanged )
        {
        FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() checking DSR..." ) ));
        if ( iSignals & KSignalDSR )  // DSR changed to high
            {
            ChangeDownstreamSignal( KSignalDSR, 0 );
            FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() DSR changed high" ) ));
            }
        else  // DSR changed to low
            {
            ChangeDownstreamSignal( 0, KSignalDSR );
            FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() DSR changed low" ) ));
            }
        }
    if ( iSignals & KDCDChanged )
        {
        FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() checking DCD..." ) ));
        if ( iSignals & KSignalDCD )  // DCD changed to high
            {
            ChangeDownstreamSignal( KSignalDCD, 0 );
            FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() DCD changed high" ) ));
            }
        else  // DCD changed to low
            {
            ChangeDownstreamSignal( 0, KSignalDCD );
            FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() DCD changed low" ) ));
            }
        }
    if ( iSignals & KRNGChanged )
        {
        FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() checking RNG..." ) ));
        if ( iSignals & KSignalRNG )  // RNG changed to high
            {
            ChangeDownstreamSignal( KSignalRNG, 0 );
            FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() RNG changed high" ) ));
            }
        else  // RNG changed to low
            {
            ChangeDownstreamSignal( 0, KSignalRNG );
            FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() RNG changed low" ) ));
            }
        }
    IssueRequest();
    FTRACE(FPrint( _L("CDunSignalCopy::ManageSignalChangeDownstream() complete" ) ));
    }
コード例 #26
0
// ---------------------------------------------------------------------------
// From class MDunTransporterUtility.
// Allocates a channel by creating and setting local media independent
// objects
// This is a common method used by exported local media dependent methods
// ---------------------------------------------------------------------------
//
void CDunTransUtils::DoAllocateChannelL( RComm* aComm,
                                         TInt& aBufferLength,
                                         TInt aFirstFree,
                                         MDunBufferCorrection* aCorrection )
    {
    FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL()" )));
    TInt retTemp;
    TInt itemsInCs = 0;

    if ( !iParent.iNetwork )
        {
        FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() (iNetwork) not initialized!" )));
        User::Leave( KErrGeneral );
        }

    FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() aFirstFree = %d" ), aFirstFree));

    // Allocate network channel
    RComm* networkEntity;
    retTemp = iParent.iNetwork->AllocateChannel( networkEntity );
    if ( retTemp != KErrNone )
        {
        FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() network allocation failed" )));
        if ( retTemp == KErrTooBig )
            {
            // Start to show note
            if ( iParent.iNoteHandler )
                {
                iParent.iNoteHandler->IssueRequest();
                }
            // Set flag to indicate that advertisement is not possible anymore
            ManageAdvertisementStatusChange( EFalse );
            FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() (too big) complete" )));
            User::Leave( KErrTooBig );
            }
        FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() (ERROR) complete" )));
        User::Leave( KErrGeneral );
        }

    TInt currentLength = networkEntity->ReceiveBufferLength();
    TInt newLength = currentLength;
    FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() buffer length before = %d" ), currentLength));
    if ( aCorrection )
        {
        // Get network side buffer length and request change if required.
        // Check "newlength>currentLength" here as it is not possible to
        // increase Dataport's buffer length
        newLength = aCorrection->NotifyBufferCorrection( currentLength );
        if ( newLength<=0 || newLength>currentLength )
            {
            FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() unknown buffer length" )));
            User::Leave( KErrGeneral );
            }
        // It is not possible to set Dataport side receive buffer length to any
        // arbitrary value (currently only 8kB..20kB are supported but that
        // can't be queried via an API). So here only default buffer size will
        // be used from Dataport while this component's local buffering uses
        // Dataport's default buffer size if not adjusted via plugin side.
        // NOTE: If Dataport side starts to support arbitrary receive buffer
        // size, it should be changed here if newLength != currentLength.
        }
    aBufferLength = newLength;
    FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() buffer length after = %d" ), newLength));

    // Get channel data

    TDunChannelData& channelData = iChannelData[aFirstFree];

    // Create buffers and set length

    TUint8* bufferUpstream;
    TPtr8* bufferUpPtr;
    DoCreateBufferLC( channelData.iBufferUpstream,
                      channelData.iBufferUpPtr,
                      bufferUpstream,
                      bufferUpPtr,
                      newLength,
                      itemsInCs );

    TUint8* bufferDownstream;
    TPtr8* bufferDownPtr;
    DoCreateBufferLC( channelData.iBufferDownstream,
                      channelData.iBufferDownPtr,
                      bufferDownstream,
                      bufferDownPtr,
                      newLength,
                      itemsInCs );

    // Create signal copy objects

    CDunSignalCopy* upstreamCopy = channelData.iUpstreamSignalCopy;
    CDunSignalCopy* downstreamCopy = channelData.iDownstreamSignalCopy;
    if ( aComm )
        {
        DoCreateSignalCopyLC( channelData.iUpstreamSignalCopy,
                              upstreamCopy,
                              itemsInCs );
        DoCreateSignalCopyLC( channelData.iDownstreamSignalCopy,
                              downstreamCopy,
                              itemsInCs );
        retTemp = upstreamCopy->SetMedia( aComm,
                                          networkEntity,
                                          EDunStreamTypeUpstream );
        if ( retTemp != KErrNone )
            {
            delete upstreamCopy;
            upstreamCopy = NULL;
            }
        retTemp = downstreamCopy->SetMedia( aComm,
                                            networkEntity,
                                            EDunStreamTypeDownstream );
        if ( retTemp != KErrNone )
            {
            delete downstreamCopy;
            downstreamCopy = NULL;
            }
        }

    // Create signal notify objects

    CDunSignalNotify* signalNotify = channelData.iSignalNotify;
    if ( !aComm )  // RSocket
        {
        DoCreateSignalNotifyLC( channelData.iSignalNotify,
                                signalNotify,
                                itemsInCs );
        retTemp = signalNotify->SetMedia( networkEntity );
        if ( retTemp != KErrNone )
            {
            delete signalNotify;
            signalNotify = NULL;
            }
        }

    // Create upstream objects

    CDunUpstream* upstreamRW;
    DoCreateUpTransferObjectL( channelData.iUpstreamRW,
                               upstreamRW,
                               itemsInCs );
    upstreamRW->SetBuffering( bufferUpPtr );
    upstreamRW->SetMedia( networkEntity, EDunMediaContextNetwork );
    upstreamRW->SetActivityCallback( this );

    // Create downstream objects

    CDunDownstream* downstreamRW;
    DoCreateDownTransferObjectL( channelData.iDownstreamRW,
                                 downstreamRW,
                                 itemsInCs );
    downstreamRW->SetBuffering( bufferDownPtr );
    downstreamRW->SetMedia( networkEntity, EDunMediaContextNetwork );

    // Save values

    channelData.iNetwork = networkEntity;
    channelData.iUpstreamRW = upstreamRW;
    channelData.iDownstreamRW = downstreamRW;
    channelData.iBufferUpstream = bufferUpstream;
    channelData.iBufferDownstream = bufferDownstream;
    channelData.iBufferUpPtr = bufferUpPtr;
    channelData.iBufferDownPtr = bufferDownPtr;
    channelData.iUpstreamSignalCopy = upstreamCopy;
    channelData.iDownstreamSignalCopy = downstreamCopy;
    channelData.iSignalNotify = signalNotify;

    CleanupStack::Pop( itemsInCs );

    // Set flag to indicate that advertisement is now possible
    ManageAdvertisementStatusChange( ETrue, ETrue );

    FTRACE(FPrint( _L("CDunTransUtils::DoAllocateChannelL() complete" )));
    }
コード例 #27
0
/*
 -------------------------------------------------------------------------------

 Class: CSimpleTimeout

 Method: ~CSimpleTimeout

 Description: voip audio service - Destructor.

 Cancel request

 Parameters: None

 Return Values: None

 Errors/Exceptions: None

 Status: Approved

 -------------------------------------------------------------------------------
 */
CSimpleTimeout::~CSimpleTimeout()
    {
    FTRACE(FPrint(_L("CSimpleTimeout::~CSimpleTimeout")));
    Cancel();
    iTimer.Close();
    }
コード例 #28
0
// ---------------------------------------------------------------------------
// Destructor.
// ---------------------------------------------------------------------------
//
CDunTransUtils::~CDunTransUtils()
    {
    FTRACE(FPrint( _L("CDunTransUtils::~CDunTransUtils()" )));
    FTRACE(FPrint( _L("CDunTransUtils::~CDunTransUtils() complete" )));
    }
コード例 #29
0
/*
 -------------------------------------------------------------------------------

 Class: CSimpleTimeout

 Method: CSimpleTimeout

 Description: voip audio service - Default constructor

 C++ default constructor can NOT contain any code, that might leave.

 Parameters: None

 Return Values: None

 -------------------------------------------------------------------------------
 */
CSimpleTimeout::CSimpleTimeout() :
    CActive(CActive::EPriorityStandard)
    {
    FTRACE(FPrint(_L("CSimpleTimeout::CSimpleTimeout")));
    }
コード例 #30
0
// ---------------------------------------------------------------------------
// Destructor.
// ---------------------------------------------------------------------------
//
CDunCloseWait::~CDunCloseWait()
    {
    FTRACE(FPrint( _L("CDunCloseWait::~CDunCloseWait()" )));
    ResetData();
    FTRACE(FPrint( _L("CDunCloseWait::~CDunCloseWait() complete" )));
    }