Ejemplo n.º 1
0
void CT_EntryArrayData::DoCmdIndexOperatorL( const TDesC& aSection )
/**
* Assigns an element of TEntryArray to another TEntry object using "=" operator
*/
	{
	TInt index;
	TPtrC entryObjectName;
	
	if( GET_MANDATORY_INT_PARAMETER( KParamIndex, aSection, index ) && 
		GET_MANDATORY_STRING_PARAMETER( KParamDestination, aSection, entryObjectName ))
		{
		TEntry* entry = new(ELeave) TEntry();
		CleanupStack::PushL(entry);
		
		*entry = iEntryArray->operator[](index);
		CT_EntryData* entryWrapperObject = static_cast<CT_EntryData*>(GetDataWrapperL(entryObjectName));
		
		if(!entryWrapperObject)
		    {
			ERR_PRINTF2(_L("%S is not initialised"), &entryObjectName);
		    SetBlockResult(EFail); 
		    CleanupStack::PopAndDestroy(entry);
		    }
		else
			{
			entryWrapperObject->SetObjectL(entry);
			CleanupStack::Pop(entry);
			}
		}
	}
/**
Test SetBTAddr()
*/
void CT_InquirySockAddrData::DoCmdSetBTAddr(const TDesC& aSection)
	{	
	TPtrC	tBTDevAddrName;
	TBool	foundParameter=EFalse;	
	
	if(GetStringFromConfig(aSection, KTBTDevAddr(), tBTDevAddrName))
		{
		foundParameter=ETrue;			
		CT_BTDevAddrData* tBTDevAddrData=static_cast<CT_BTDevAddrData*>(GetDataWrapperL(tBTDevAddrName));
		const TBTDevAddr* btDevAddr = tBTDevAddrData->GetAddress();
		
		INFO_PRINTF1(_L("TInquirySockAddr SetBTAddr Call"));
		iData->SetBTAddr(*btDevAddr);
		}
	
	TInt	intBtDevAddr=0;	
	if(GetIntFromConfig(aSection, KIntDevAddr(), intBtDevAddr))
		{
		foundParameter=ETrue;			
		const TBTDevAddr btDevAddr(intBtDevAddr);
		
		INFO_PRINTF1(_L("TInquirySockAddr SetBTAddr Call"));	
		iData->SetBTAddr(btDevAddr);
		}
		
	if( !foundParameter )
		{
		ERR_PRINTF3(KLogMissingParameters, &KTBTDevAddr(), &KIntDevAddr());
		SetBlockResult(EFail);
		}
	}
Ejemplo n.º 3
0
void CT_RMobileCallData::DoCmdOpenExistingCall(const TTEFFunction& aSection)
	{
	INFO_PRINTF1(_L("*START*CT_RMobileCallData::DoCmdOpenExistingCall"));
	TInt callNameParameter;
	TBool dataOk = ETrue;
	if ( !GetIntFromConfig(aSection, KCallName, callNameParameter ))
		{
		ERR_PRINTF2(_L("Error in getting parameter %S from INI file"), &KCallName);
		SetBlockResult(EFail);
		dataOk = EFalse;
		}
	TPtrC mobileLineName;
	if ( !GetStringFromConfig (aSection, KMobileLineKey (), mobileLineName))
		{
		ERR_PRINTF2(_L("Error in getting parameter %S from INI file"), &KMobileLineKey );
		SetBlockResult(EFail);
		dataOk = EFalse;
		}
	if ( dataOk )
		{
		CT_RMobileLineData* mobileLineWrapper = static_cast<CT_RMobileLineData*>(GetDataWrapperL(mobileLineName));
		const TName* callName = NULL;
		TRAPD( error, callName = mobileLineWrapper->GetCallNameL (callNameParameter) );
		if(error != KErrNone)
			{
			ERR_PRINTF2(_L("Left while getting call name with error %d"), error);
			SetError(error);
			}
		else
			{
			INFO_PRINTF1(_L("Open handle to RMobileCall which can be used to receive incoming or dial outgoing call."));
			RMobileLine* mobileLineObject = static_cast<RMobileLine*>(GetDataObjectL(mobileLineName));
			INFO_PRINTF1(_L("Getting mobile call"));
			TRAP( error, iMobileCall = GetMobileCallL(callNameParameter) );
			if(error != KErrNone)
				{
				ERR_PRINTF2(_L("GetMobileCallL left when trying to obtain the MobileCall with error %d"), error);
				SetBlockResult(EFail);
				}
			else
				{
				INFO_PRINTF1(_L("Opening existing call"));
				error = iMobileCall->OpenExistingCall(*mobileLineObject, *callName);
				if ( error != KErrNone)
					{
					ERR_PRINTF2(_L("OpenExistingCall failed with error [%d]"), error);
					SetError (error);
					}
				else
					{
					INFO_PRINTF1(_L("OpenExistingCall succeeded"));
					}
				}
			}
		}
	INFO_PRINTF1(_L("*END*CT_RMobileCallData::DoCmdOpenExistingCall"));
	}
Ejemplo n.º 4
0
void CT_DataSdpAgent::DoCmdNewLC(const TDesC& aSection)
	{
	DestroyData();		
	TPtrC	tBTDevAddrName;
	TBool	foundParameter=EFalse;

	if( GetStringFromConfig(aSection, KTBTDevAddr(), tBTDevAddrName))
		{
		foundParameter=ETrue;			
		CT_BTDevAddrData* tBTDevAddrData=static_cast<CT_BTDevAddrData*>(GetDataWrapperL(tBTDevAddrName));
		TBTDevAddr btDevAddr = *tBTDevAddrData->GetAddress();
		TBuf<KMaxSockAddrSize> tmpBuf2;
		btDevAddr.GetReadable(tmpBuf2);

		TRAPD(err, iSdpAgent = CSdpAgent::NewLC(*this, btDevAddr); CleanupStack::Pop(iSdpAgent));
		if(err != KErrNone)
			{
			ERR_PRINTF2(_L("CSdpAgent NewLC failed with error %d"), err);
			SetError(err);
			}
		}
		
   	TInt	intBtDevAddr=0;	
	if( GetIntFromConfig(aSection, KIntDevAddr(), intBtDevAddr))
		{
		foundParameter=ETrue;			
		const TBTDevAddr btDevAddr(intBtDevAddr);
		TRAPD(err, iSdpAgent = CSdpAgent::NewLC(*this, btDevAddr));
		if(err != KErrNone)
			{
			ERR_PRINTF2(_L("CSdpAgent NewLC failed with error %d"), err);
			SetError(err);
			}
   		}  	
   		
	if( !foundParameter )
		{
		ERR_PRINTF2(_L("Missing parameter %S"), &KIntDevAddr());
		SetBlockResult(EFail);
		}
	}
Ejemplo n.º 5
0
void CT_DataSdpAgent::DoCmdNewL(const TDesC& aSection)
	{
	DestroyData();
	TPtrC	tBTDevAddrName;
	TBool	foundParameter=EFalse;	
	INFO_PRINTF1(_L("CSdpAgent NewL call"));
	if( GetStringFromConfig(aSection, KTBTDevAddr(), tBTDevAddrName))
		{
		foundParameter=ETrue;			
		CT_BTDevAddrData* tBTDevAddrData=static_cast<CT_BTDevAddrData*>(GetDataWrapperL(tBTDevAddrName));
		const TBTDevAddr* btDevAddr = tBTDevAddrData->GetAddress();
		TRAPD(err, iSdpAgent = CSdpAgent::NewL(*this, *btDevAddr));
		if(err != KErrNone)
			{
			ERR_PRINTF2(_L("CSdpAgent NewL failed with error %d"), err);
			SetError(err);
			}
   		}
   	TInt	intBtDevAddr=0;	
	if( GetIntFromConfig(aSection, KIntDevAddr(), intBtDevAddr))
		{
		foundParameter=ETrue;			
		const TBTDevAddr btDevAddr(intBtDevAddr);
		TRAPD(err, iSdpAgent = CSdpAgent::NewL(*this, btDevAddr));
		if(err != KErrNone)
			{
			ERR_PRINTF2(_L("CSdpAgent NewL failed with error %d"), err);
			SetError(err);
			}
   		}  	
   		
	if( !foundParameter )
		{
		ERR_PRINTF2(_L("Missing parameter %S"), &KIntDevAddr());
		SetBlockResult(EFail);
		}
	}
Ejemplo n.º 6
0
TBool CDataWrapperBase::GetWsGraphicIdFromConfigL(const TDesC& aSectName, const TDesC& aKeyName, TWsGraphicId& aResult)
	{
	TBuf<KMaxTestExecuteCommandLength>	tempStore;

	TInt	id;
	tempStore.Format(KFormatEntryField, &aKeyName, &KTagWsGraphicIdUid);
	TBool	ret=GetIntFromConfig(aSectName, tempStore, id);

	if ( ret )
		{
		TUid	uid=TUid::Uid(id);
		aResult.Set(uid);
		}
	else
		{
		tempStore.Format(KFormatEntryField, &aKeyName, &KTagWsGraphicIdId);
		ret=GetIntFromConfig(aSectName, tempStore, id);
		if ( ret )
			{
			aResult.Set(id);
			}
		else
			{
			tempStore.Format(KFormatEntryField, &aKeyName, &KTagWsGraphicIdName);
			TPtrC	name;
			ret=GetStringFromConfig(aSectName, tempStore, name);
			if ( ret )
				{
				CDataWrapperBase*	wrapper=static_cast<CDataWrapperBase*>(GetDataWrapperL(name));
				aResult=wrapper->GetId();
				}
			}
		}

	return ret;
	}