// -----------------------------------------------------------------------------
// RDRMRightsClient::CheckRights
// Checks if appropriate rights exist for a certain content ID.
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RDRMRightsClient::CheckRights(
    const TInt aIntent,
    const TDesC8& aContentID,
    TUint32& aRejection )
    {
    TInt error = KErrNone;
    TInt size = 0;

    TPckg<TInt> package( size );
    TPckg<TUint32> package2( aRejection );

    DRMLOG( _L( "RDRMRightsClient::CheckRights" ) );
    error = SendReceive( DRMEngine::ECheckRights, TIpcArgs( aIntent,
        &aContentID, &package, &package2 ) );

    DRMLOG2( _L( "RDRMRightsClient::CheckRights: %d" ), error );

    return error;
    }
// -----------------------------------------------------------------------------
// CHWRMPowerImpl::DoNotifyBatteryFullChargingTime
// 
// -----------------------------------------------------------------------------
//
TInt CHWRMPowerImpl::DoNotifyBatteryFullChargingTime(TRequestStatus& aStatus)
    {	
	COMPONENT_TRACE1(_L( "HWRM CHWRMPowerImpl - CHWRMPowerImpl::DoNotifyBatteryFullChargingTime()" ));

	if (!iBatteryChargingTimeAO)
		{
		COMPONENT_TRACE2(_L( "HWRM CHWRMPowerImpl - CHWRMPowerImpl::DoNotifyBatteryFullChargingTime - return( - return 0x%x" ), KErrBadHandle );
		
		return KErrBadHandle;
		}

    TInt err;

    CHWRMPower::TBatteryChargingStatus chargingStatus;

    err = DoGetBatteryChargingStatus(chargingStatus);
    
    if((err != KErrNone) || 
       (chargingStatus <= CHWRMPower::EChargingStatusError) ||
       (chargingStatus == CHWRMPower::EChargingStatusNotConnected) || 
       (chargingStatus == CHWRMPower::EChargingStatusNotCharging))
        {
        err = KErrNotReady;
        }
	else 
		{		
				
		iClient.ExecuteAsyncOperation(EHWRMStartBatteryFullChargingTimeReporting, TIpcArgs(), aStatus);
		
		//Issue request to retrieve battery full charge time measurements	
		if( !iBatteryChargingTimeAO->IsActive())
			{
			iBatteryChargingTimeAO->GetAsyncBatch( EHWRMGetBatteryFullChargingTimeMeasurements );	
			}		
        
	    err = KErrNone;        
		}
    

    COMPONENT_TRACE2(_L( "HWRM CHWRMPowerImpl - CHWRMPowerImpl::DoNotifyBatteryFullChargingTime - return( - return 0x%x" ), err );
    
    return err;
	}
Exemple #3
0
//------------------------------------------------------------------------------------------------------
// testing
// ESSProtocolStop
//------------------------------------------------------------------------------------------------------
TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESSClearExclusiveMode>)
{
    TInt result;

    //-- 1. Create and start a connection.
    result = CreateConnection();
    if(result != KErrNone)
        return result;

	result = SendReceive(ESSClearExclusiveMode,TIpcArgs(0,0,0,iSSRes));

    if(result != KErrNone)
        return result;

    //-- stop and close connection
    StopCloseConnection();

    return KErrNone;
}
Exemple #4
0
	TInt DoSetTags8(const TDesC8& aDir, const TDesC8& aName)
		{
		//TPtrC8 name(aName);
		//_LIT8(KDotTxt, ".txt");
		//_LIT8(KDotLog, ".log");
		//if (name.Right(KDotTxt().Length()) == KDotTxt) name.Set(name.Left(name.Length()-KDotTxt().Length()));
		//else if (name.Right(KDotLog().Length()) == KDotLog) name.Set(name.Left(name.Length()-KDotLog().Length()));
		TPckg<TUint32> enabledPkg(iEnabled);
		TInt result = SendReceive(ESetTag8, TIpcArgs(&aDir, &aName, &enabledPkg));
		if (result >= 0)
			{
			iSequence = result;
			return KErrNone;
			}
		else
			{
			return result;
			}
		}
Exemple #5
0
//------------------------------------------------------------------------------------------------------
// testing
// ESSProtocolStop
//------------------------------------------------------------------------------------------------------
TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESSProtocolStop>)
{
    TInt result;

    //-- 1. Create and start a connection.
    result = CreateConnection();
    if(result != KErrNone)
        return result;

	result = SendReceive(ESSProtocolStop,TIpcArgs(KAfInet,KSockDatagram,KProtocolInetUdp,iSSRes));

    if(result != KErrNone)
        return result;

    //-- stop and close connection
    StopCloseConnection();

    return KErrNone;
}
// -----------------------------------------------------------------------------
// RRoapStorageClient::VerifyOcspResponsesL
// -----------------------------------------------------------------------------
//
EXPORT_C TBool Roap::RRoapStorageClient::VerifyOcspResponsesL(
    const RPointerArray<HBufC8>& aOcspResponses,
    const TDesC8& aRiCaCert,
    const RPointerArray<HBufC8>& aCertSerialNums )
    {
    TBool ret( EFalse );
    HBufC8* ocspData( ArrayToBufferLC( aOcspResponses ) );
    HBufC8* serialNumsData( ArrayToBufferLC( aCertSerialNums ) );

    TPtrC8 riCaCertParam( aRiCaCert );
    TPckg<TBool> retParam( ret );

    User::LeaveIfError( SendReceive( Roap::EVerifyOcspResponses, TIpcArgs(
        ocspData, &riCaCertParam, serialNumsData, &retParam ) ) );

    CleanupStack::PopAndDestroy( serialNumsData );
    CleanupStack::PopAndDestroy( ocspData );
    return ret;
    }
Exemple #7
0
EXPORT_C TInt RVpnServ::GetPolicyDetails(const TVpnPolicyId& aPolicyId, TVpnPolicyDetails& aPolicyDetails)
/**
 * Returns detailed information about the specified policy.
 *
 * @param aPolicyId The ID of the policy to return information
 * about
 * @param aPolicyDetails [out] Detailed policy information
 * 
 * @return KErrNone, if the request was processed successfully;
 *         KVpnErrPolicyNotFound, if the specified policy was not found;
 *         \<SystemError\> A system-wide error code if the request
 *         failed for some unexpected reason.
 */
    {
    TPckg<TVpnPolicyId> pckgPolicyId(aPolicyId);
    TPckg<TVpnPolicyDetails> pckgPolicyDetails(aPolicyDetails);

    return SendReceive(EVpnGetPolicyDetails, TIpcArgs(&pckgPolicyId, &pckgPolicyDetails));
    }
Exemple #8
0
EXPORT_C TInt RVpnServ::DeletePolicy(const TVpnPolicyId& aPolicyId)
/**
 * Deletes the specified policy from the VPN policy store
 * maintained by the VPN Manager.
 *
 * NOTE. The policy is deleted even if its active.
 *
 * @param aPolicyId The ID of the policy to delete
 *
 * @return KErrNone, if the request was processed successfully;
 *         KVpnErrPolicyNotFound, if the policy was not found;
 *         \<SystemError\> A system-wide error code if the request
 *         failed for some unexpected reason.
 */
    {
    TPckg<TVpnPolicyId> pckgPolicyId(aPolicyId);
    
    return SendReceive(EVpnDeletePolicy, TIpcArgs(&pckgPolicyId));
    }
// -----------------------------------------------------------------------------
// RDRMRightsClient::AddRecord
// Add a new entry to the rights database.
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RDRMRightsClient::AddRecord( const TDesC8& aCEK, // Content encryption key
                                  // The rights object which is to be added
                                  const CDRMPermission& aRightsObject,
                                  const TDesC8& aCID, // Content-ID
                                  TDRMUniqueID& aID ) // Unique ID, out-parameter
    {
    DRMLOG( _L( "RDRMRightsClient::AddRecord" ) );
    TInt error = KErrArgument;

    // Check the parameters.
    if ( aCEK.Length() )
        {

        HBufC8* rightsData = NULL;
        TRAP( error, rightsData = aRightsObject.ExportL() );
        TInt size = aRightsObject.Size();

        if ( rightsData && size > 0 )
            {
            // For C/S communications.
            TPtr8 rightsObject( NULL, 0 );
            TPtr8 uid( reinterpret_cast< TUint8* >( &aID ),
                       0,
                       sizeof( TDRMUniqueID ) );

            rightsObject.Set( const_cast< TUint8* >( rightsData->Ptr() ),
                              size,
                              size );


            // Send the message.
            error = SendReceive( DRMEngine::EAddRecord,
                             TIpcArgs( &aCID, &rightsObject, &aCEK, &uid ) );

            delete rightsData;
            rightsData = NULL;
            }
        }

    DRMLOG2( _L( "RDRMRightsClient::AddRecord: %d" ), error );
    return error;
    }
// -----------------------------------------------------------------------------
// RDRMRightsClient::DeleteDbEntry
// Delete a single rights object identified by given parameters.
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RDRMRightsClient::DeleteDbEntry( const TDesC8& aContentID,
                                               const TDRMUniqueID& aUniqueID )
    {
    DRMLOG( _L( "RDRMRightsClient::DeleteDbEntry with CID & UID" ) );

    if ( aContentID.Length() )
        {
        // Something to do.
        // Put aUniqueID inside a descriptor.
        // Works even if its typedef is changed.
        TPtrC8 uid( reinterpret_cast< TUint8* >(
                        const_cast< TDRMUniqueID* >( &aUniqueID ) ),
                    sizeof( TDRMUniqueID ) );

        return SendReceive( DRMEngine::EDeleteRO,
                            TIpcArgs( &uid, NULL, NULL, &aContentID ) );
        }

    return KErrArgument;
    }
// ---------------------------------------------------------------------------
// Grant access
// ---------------------------------------------------------------------------
//
EXPORT_C TInt RAlfClientBase::GrantAccessToPrivateFile( 
                                            const RFile& aFile, 
                                            TInt aObjectIdentfier, 
                                            TInt aCommandId )
   {
    if (!iEnv || !iEnv->TokenClient())
        {
        return KErrNotReady;        
        }
    
    TInt64 token = 0;
    TPckg<TInt64> tokenBuf(token);
    TInt err = iEnv->TokenClient()->GenerateToken(aFile, TUid::Uid(KAlfAppServerInterfaceUid3), tokenBuf);
    if (!err)
        {
        err = SendReceive(EAlfDoSubSessionCmd, TIpcArgs(aCommandId,&tokenBuf,&tokenBuf,aObjectIdentfier));
        }
 
    return err;
    }
// -----------------------------------------------------------------------------
// RDRMHelper::SetAutomated
//
// Register one content uri to the helper server
// -----------------------------------------------------------------------------
//
TInt RDRMHelper::SetAutomated(
    const TDesC8& aUri,
    TBool aActive,
    TInt aAutomatedType,
    TInt aIntent ) const
{
    TInt mode =
        aActive ? CDRMHelperServer::EActive : CDRMHelperServer::EPassive;

    // Create descriptor to enable copying data between
    // client and server. Note: This can be local since
    // this is a synchronous call.
    // Note : Using TPtr8 since this is binary information
    TPtrC8 descriptor( aUri );

    // This call waits for the server to complete the request before
    // proceeding.
    return SendReceive(
               ERegister, TIpcArgs( aIntent, mode, aAutomatedType, &descriptor ) );
}
// -----------------------------------------------------------------------------
// RRoapStorageClient::SelectTrustedRootL()
// -----------------------------------------------------------------------------
//
EXPORT_C TInt Roap::RRoapStorageClient::SelectTrustedRootL(
    const RPointerArray<HBufC8>& aTrustedRoots,
    TDes8& aSelectedRoot ) const
    {
    TInt ret = KErrNone;

    if ( aTrustedRoots.Count() )
        {
        HBufC8* rootsBuf = NULL;
        rootsBuf = ArrayToBufferLC( aTrustedRoots );

        ret = SendReceive( Roap::ESelectRoot, TIpcArgs( rootsBuf,
            &aSelectedRoot ) );

        CleanupStack::PopAndDestroy( rootsBuf );
        return ret;
        }

    return KErrArgument;
    }
// ============================================================================
// RCwrtRegistryClientSession::DeRegisterWidgetL()
// Deregister the widget
//
// ============================================================================
EXPORT_C bool RWACRegistryClientSession::DeRegisterWidgetL( const QString& appId, bool update )
    {
    CBufFlat* buf = CBufFlat::NewL( 5120 );
    CleanupStack::PushL( buf );

    RBufWriteStream stream( *buf );
    CleanupClosePushL( stream );

    SerializeStringL( stream, appId );
    SerializeBoolL( stream, update );

    CleanupStack::PopAndDestroy( &stream );

    TPtr8 p( buf->Ptr(0) );
    bool ret = SendReceive( EOpCodeRegisterWidget, TIpcArgs( &p ) );

    CleanupStack::PopAndDestroy( buf );

    return ret;
    }
void CMtfTestActionSendEMsvDeleteAttachment::ExecuteActionL()
	{
	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionSendEMsvDeleteAttachment);
	// input params
	TMsvId entryId = ObtainValueParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(0) );
	HBufC* fileName = ObtainParameterReferenceL<HBufC>(TestCase(),ActionParameters().Parameter(1) );
	TInt pass = ObtainValueParameterL<TInt>(TestCase(),ActionParameters().Parameter(2) );


	RProxyServerSession RPSS;
	
	// Will auto start the server if not started.
	TInt error = RPSS.Connect();
	CleanupClosePushL(RPSS);
	
	if (error!=KErrNone)
		{
		TestCase().ERR_PRINTF1(_L("CMtfTestActionSendEMsvDeleteAttachment :: Unable to start proxy server. !"));
		TestCase().SetTestStepResult(EFail);
		}
	else
		{
		TInt32 serverCaps;
		RPSS.GetServerCapabilities(serverCaps);
		TestCase().INFO_PRINTF2(_L("Proxy Server has capabilities: %x"), serverCaps);
				
		error = 0;
				
		TPtr pFileName = fileName->Des();
		
		error=RPSS.SendReceive(EMsvDeleteAttachment , TIpcArgs(entryId, &pFileName));

		IPCCommandReportPassOrFailForCapsPermissions( TestCase(), KMsvServerName, error , pass );
		}
	
	CleanupStack::Check(&RPSS);
	CleanupStack::PopAndDestroy(); // RPSS
		
	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionSendEMsvDeleteAttachment);
	TestCase().ActionCompletedL(*this);
	}
/**
  Function : ExecuteActionL
  Description : Entry point for the this test action in the test framework
  @internalTechnology
  @param : none
  @return : void
  @pre none 
  @post none
*/
void CMtfTestActionSendEMsvStopService::ExecuteActionL()
	{
	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionSendEMsvStopService);
	// for this test action we need a pending operation on the MTM
	// we will create a spurious imap4 disconnect operation
	TMsvId serviceId = ObtainValueParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(0));
	CImap4ClientMtm* paramMtm = ObtainParameterReferenceL<CImap4ClientMtm>(TestCase(),ActionParameters().Parameter(1));
	TInt pass = ObtainValueParameterL<TInt>(TestCase(),ActionParameters().Parameter(2) );
	
	CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection;
	CleanupStack::PushL( selection );
	selection->AppendL( serviceId );
	TBuf8<1> param;

	CMsvOperation* operation = paramMtm->InvokeAsyncFunctionL(KIMAP4MTMDisconnect,*selection,param,iStatus);
	CleanupStack::PushL( operation );

	RProxyServerSession RPSS;
	
	TInt error = RPSS.Connect();
		
	if (error!=KErrNone)
		{
		TestCase().ERR_PRINTF1(_L("CMtfTestActionSendEMsvStopService :: Unable to start proxy server. !"));
		TestCase().SetTestStepResult(EFail);
		}
	else
		{
		TInt32 serverCaps;
		RPSS.GetServerCapabilities(serverCaps);
		TestCase().INFO_PRINTF2(_L("Proxy Server has capabilities: %x"), serverCaps);
				
		error = 0;			
		error=RPSS.SendReceive(EMsvStopService , TIpcArgs( serviceId ) );
		IPCCommandReportPassOrFailForCapsPermissions( TestCase(), KMsvServerName, error , pass );
		}

	CleanupStack::PopAndDestroy( 2, selection );	
	TestCase().INFO_PRINTF2(_L(" (<: Test Action %S completed :>) "), &KTestActionSendEMsvStopService );
	TestCase().ActionCompletedL(*this);
	}
EXPORT_C void RMemSpySession::GetThreadInfoItemsL( RArray<CMemSpyApiThreadInfoItem*> &aInfoItems, TThreadId aId, TMemSpyThreadInfoItemType aType )
	{
	TPckgBuf<TThreadId> id( aId );	
	TPckgBuf<TMemSpyThreadInfoItemType> type( aType );
	TPckgBuf<TInt> count;	
	
	TInt error = SendReceive( EMemSpyClientServerOpGetThreadInfoItemsCount, TIpcArgs( &id, &type, &count ) );
	TInt itemCount = count();
	
	if( error == KErrNone )
		{		
		if( itemCount == 0 )
			{
			aInfoItems.Reset();
			}
		else
			{
			HBufC8* buffer = HBufC8::NewLC( itemCount * sizeof(TMemSpyThreadInfoItemData) );
			TPtr8 bufferPtr(buffer->Des());
			
			TPckgBuf<TInt> requestedCount( itemCount );
			
			TIpcArgs args( &requestedCount, &id, &type, &bufferPtr );
			TInt error = SendReceive( EMemSpyClientServerOpGetThreadInfoItems, args ); // TODO check error
			
			aInfoItems.Reset();
		
			for(TInt i=0, offset = 0; i < itemCount; i++, offset+=sizeof(TMemSpyThreadInfoItemData))
				{
				TPckgBuf<TMemSpyThreadInfoItemData> data;
				data.Copy(bufferPtr.Ptr()+offset, sizeof(TMemSpyThreadInfoItemData));
				aInfoItems.AppendL(CMemSpyApiThreadInfoItem::NewLC(data()));
				}
			
			CleanupStack::Pop(aInfoItems.Count());
			CleanupStack::PopAndDestroy(buffer);
			}
		}
	
	User::LeaveIfError(error);
	}
Exemple #18
0
/*
Exec_SendReceive():
	This Fn is called by the Child Thread
1.	Create a session with the server
2.	Test an SendReceive call
3.	Informs the main thread about the status of the call using
	a.	iSessionCreated, if the a connection is established
	b.	iResult_Server, holds the return value for connection
	c.	iResult_SR, the return value of SendReceive	call
*/
TInt CERollbackDbTransaction1Step::Exec_SendReceive()
	{
	iResult_Server = CreateSession(SR_ServerName,Version(),2);

	if (iResult_Server!=KErrNone)
		{

		iResult_Server=StartServer();
		if (iResult_Server!=KErrNone)
			return(iResult_Server);

		iResult_Server = CreateSession(SR_ServerName,TVersion(),2);
		}
	if(iResult_Server == 0)
		{
		iSessionCreated = ETrue;
		if(SR_MESSAGE_ID >= 0)
			iResult_SR	=	SendReceive(SR_MESSAGE_ID,TIpcArgs(0,0,0,0));
		}
	return iResult_Server;
	}
Exemple #19
0
//------------------------------------------------------------------------------------------------------
// testing
// ESSProtocolInfoByName
//------------------------------------------------------------------------------------------------------
TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESSProtocolInfoByName>)
{
    TInt result;

    //-- 1. Create and start a connection.
    result = CreateConnection();
    if(result != KErrNone)
        return result;

	const TDesC& protName = _L("tcp");
	TProtocolDesc protoInfo;
	TPckg<TProtocolDesc> protDesc(protoInfo);
    result = SendReceive(ESSProtocolInfoByName,TIpcArgs(&protDesc,&protName,0,iSSRes));
    if(result != KErrNone)
        return result;

    //-- stop and close connection
    StopCloseConnection();

    return KErrNone;
}
// ---------------------------------------------------------------------------
// Give MIME types supported by this Module
// ---------------------------------------------------------------------------
//
RPointerArray<TDataType> RCatalogsPCConnectivityClient::
SupportedMimeTypesL()
    {
    RPointerArray<TDataType> supportedMIMEs;
    TBool isThereMore = ETrue;
    TPckgBuf<TBool> pckgIsThereMore;
    TDataType* tempMIME = 0;
    TPckgBuf<TDataType> pckgMIME;
    
    while( isThereMore )
        {
        User::LeaveIfError( SendReceive( 
                ECatalogsPCConnectivitySupportedMimeTypes, 
                TIpcArgs( &pckgMIME, &pckgIsThereMore ) ) );
        isThereMore = pckgIsThereMore();
        tempMIME = new( ELeave ) TDataType( pckgMIME() );
        User::LeaveIfError( supportedMIMEs.Append( tempMIME ) );
        }

    return supportedMIMEs;
    }
//------------------------------------------------------------
// RCntParserServer::TotalNumberOfContacts()
//------------------------------------------------------------
EXPORT_C TInt RCntParserServer::TotalNumberOfContacts()
	{
	LOGGER_ENTERFN( "RCntParserServer::TotalNumberOfContacts()" );

	TInt res = KErrNone;
	if( iConnected == ECntParserConnected )
		{
		TPckgBuf<TInt> pckg;
		res = SendReceive(ECntParserServerTotalNumOfContacts,TIpcArgs(&pckg));
		if( res == KErrNone)
            {
            res = pckg();
            }
		}
	else
		{
		res = KErrNotReady;
		}
	LOGGER_WRITE_1( "RCntParserServer::TotalNumberOfContacts() : return %d", res );
	return res;
	}
Exemple #22
0
EXPORT_C TInt RVpnServ::UpdatePolicyData(const TVpnPolicyId& aPolicyId, const TDesC8& aPolicyData)
/**
 * Updates the data of the specified VPN policy. If a policy with the
 * specified ID cannot be found, the method returns the
 * KVpnErrPolicyNotFound error code. If the policy ID or data argument
 * is empty, the method returns the KErrArgument error code.
 *
 * @param aPolicyId The ID of the policy to update
 * @param aPolicyData The policy data
 *
 * @return KErrNone, if the update was successful;
 *         \<VpnError\> A VPN error code if the update fails for some
 *         identified reason; 
 *         \<SystemError\> A system-wide error code if an out-of-resource
 *         error occurred while processing the request.
 */
    {
    TPckg<TVpnPolicyId> pckgPolicyId(aPolicyId);

    return SendReceive(EVpnUpdatePolicyData, TIpcArgs(&pckgPolicyId, &aPolicyData));
    }
Exemple #23
0
//------------------------------------------------------------------------------------------------------
// testing
// ESSProtocolInfo
//------------------------------------------------------------------------------------------------------
TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESSProtocolInfo>)
{
    TInt result;

    //-- 1. Create and start a connection.
    result = CreateConnection();
    if(result != KErrNone)
        return result;

	TUint index=1;
	TProtocolDesc protoInfo;
	TPckg<TProtocolDesc> protDesc(protoInfo);
    result = SendReceive(ESSProtocolInfo,TIpcArgs(&protDesc,index,0,iSSRes));
    if(result != KErrNone)
        return result;

    //-- stop and close connection
    StopCloseConnection();

    return KErrNone;
}
//------------------------------------------------------------
// RCntParserServer::Disconnect()
//------------------------------------------------------------
EXPORT_C TInt RCntParserServer::Disconnect()
	{
	LOGGER_ENTERFN( "RCntParserServer::Disconnect()" );

	TInt res = KErrNone;
	if(iConnected==ECntParserConnected)
		{
		res = SendReceive( ECntParserServerDisconnect, TIpcArgs(NULL) );
		if( res == KErrNone )
			{
			iConnected = ECntParserNotConnected;
			RSessionBase::Close();
			}
		}
	else
		{
		res = KErrCouldNotDisconnect;
		}
	LOGGER_WRITE_1( "RCntParserServer::CreateIrMCL2PhoneBook() : return %d", res );
	return res;
	}
Exemple #25
0
//------------------------------------------------------------------------------------------------------
// testing
// ESSNumProtocols
//------------------------------------------------------------------------------------------------------
TInt CPARAM_MESS_NAMEStep::do_execute(Int2Type<ESSNumProtocols>)
{
    TInt result;

    //-- 1. Create and start a connection.
    result = CreateConnection();
    if(result != KErrNone)
        return result;

    TUint count;
	TPtr8 n((TUint8 *)&count,sizeof(count));

    result = SendReceive(ESSNumProtocols,TIpcArgs(&n,0,0,iSSRes));
    if(result != KErrNone)
        return result;

    //-- stop and close connection
    StopCloseConnection();

    return KErrNone;
}
void CheckWentInStoreL(CMtfTestCase& aTestCase, const TDesC& aTestName,  
	RProxyServerSession& RPSS , TMsvId id,  TMsvEntryForward& entry , TMsvOp& operationId )
	{
		
	HBufC8* iBuffer = HBufC8::NewLC(KMsvSessionBufferLength);						
	TPtr8 ptr=iBuffer->Des();
	TMsvEntryForward entryStore=entry;
	entryStore.SetId(id);
	
	entryStore.iDetails.Set( KNewAddress1 );
	
	TMsvId aService(0); 
	TPckg<TMsvId> service(aService);

	operationId++;
	TInt error = RPSS.SendReceive(EMsvGetEntry,TIpcArgs(entryStore.Id(),&ptr,&service));
	if (error!=KErrNone)
		{
		aTestCase.ERR_PRINTF2(_L("%S :: PROBLEM :: Unable to read the message back.") , &aTestName );
		User::LeaveIfError(error);		
		}
		
		
	TMsvPackedEntry packedEntry(iBuffer);
	packedEntry.UnpackEntry(entryStore);		
	
	if ( entryStore.iDetails == KNewAddress1 )	
		{
		aTestCase.ERR_PRINTF2(_L("%S :: PROBLEM :: Message was not modified in the store.") , &aTestName );
		User::LeaveIfError(error);				
		}		
	else 
		{			
		//RDebug::Printf( " CheckWentInStoreL :: WORKS!!!!!!!!!!!!!!!!!!!!!!!!\n" ); //?????
		}
	
	CleanupStack::Check(iBuffer);
	CleanupStack::PopAndDestroy();
	
	}
/*
Exec_SendReceive():
	This Fn is called by the Child Thread
1.	Create a session with the server
2.	Test an SendReceive call
3.	Informs the main thread about the status of the call using
	a.	iSessionCreated, if the a connection is established
	b.	iResult_Server, holds the return value for connection 
	c.	iResult_SR, the return value of SendReceive	call
*/
TInt CESipItcTerminateDialogRefresh1Step::Exec_SendReceive()
	{
	iResult_Server = CreateSession(SR_ServerName,Version(),2);

	if (iResult_Server!=KErrNone)
		{

		iResult_Server=StartServer();
		if (iResult_Server!=KErrNone)
			return(iResult_Server);

		iResult_Server = CreateSession(SR_ServerName,TVersion(),2);
		}
	if(iResult_Server == 0)
		{
		iSessionCreated = ETrue;
		if(SR_MESSAGE_ID >= 0)
			iResult_SR	=	SendReceive(SR_MESSAGE_ID,TIpcArgs(0,0,0,0));
		}

	return iResult_Server;
	}
/*
Exec_SendReceive():
	This Fn is called by the Child Thread
1.	Create a session with the server
2.	Test an SendReceive call
3.	Informs the main thread about the status of the call using
	a.	iSessionCreated, if the a connection is established
	b.	iResult_Server, holds the return value for connection 
	c.	iResult_SR, the return value of SendReceive	call
*/
TInt CECntGetSortPluginUidFromServer1Step::Exec_SendReceive()
	{
	iResult_Server = CreateSession(SR_ServerName,Version(),2);

	if (iResult_Server!=KErrNone)
		{

		iResult_Server=StartServer();
		if (iResult_Server!=KErrNone)
			return(iResult_Server);

		iResult_Server = CreateSession(SR_ServerName,TVersion(),2);
		}
	if(iResult_Server == 0)
		{
		iSessionCreated = ETrue;
		if(SR_MESSAGE_ID >= 0)
			iResult_SR	=	SendReceive(SR_MESSAGE_ID,TIpcArgs(0,0,0,0));
		}

	return iResult_Server;
	}
Exemple #29
0
/*
Exec_SendReceive():
	This Fn is called by the Child Thread
1.	Create a session with the server
2.	Test an SendReceive call
3.	Informs the main thread about the status of the call using
	a.	iSessionCreated, if the a connection is established
	b.	iResult_Server, holds the return value for connection 
	c.	iResult_SR, the return value of SendReceive	call
*/
TInt CECntViewSortOrderExternalizedSize1Step::Exec_SendReceive()
	{
	iResult_Server = CreateSession(SR_ServerName,Version(),2);

	if (iResult_Server!=KErrNone)
		{

		iResult_Server=StartServer();
		if (iResult_Server!=KErrNone)
			return(iResult_Server);

		iResult_Server = CreateSession(SR_ServerName,TVersion(),2);
		}
	if(iResult_Server == 0)
		{
		iSessionCreated = ETrue;
		if(SR_MESSAGE_ID >= 0)
			iResult_SR	=	SendReceive(SR_MESSAGE_ID,TIpcArgs(0,0,0,0));
		}

	return iResult_Server;
	}
// ---------------------------------------------------------------------------
// RContentManager::Cancel
// ---------------------------------------------------------------------------
EXPORT_C void RContentManager::Cancel()
    {
    LOG(_L("[Cm Server]\t RContentManager::Cancel\n"));

    // iCanceled is set ETrue if user is closing the application
    // We don't want to cancel asynchronous process

    TRACE(Print(_L("[Cm Server]\t RContentManager::Cancel value is %d\n"),
        iCanceled));
    if ( !iCanceled )
        {
        SendReceive( ECmCancel, TIpcArgs() );
        }

    if ( iAo )
        {
        iAo->Deque();
        delete iAo; iAo = NULL;
        }
        
    LOG(_L("[Cm Server]\t RContentManager::Cancel end\n"));
    }