⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smsdatagramservice.cpp

📁 经过改造的EasyDgm
💻 CPP
字号:
// SMSDatagramService.cpp
//
// Copyright (c) 2003 Symbian Ltd.  All rights reserved.
//

#include "SMSDatagramService.h"
#include "SMSSendRecv.h"
#include <ImplementationProxy.h>
#include <ecom.h>


CSMSDatagramService::~CSMSDatagramService()
/**
	ECOM will destroy the current instance. We also clean up our internal 
	send and receiver helper classes.
*/
	{
	REComSession::DestroyedImplementation(iDtor_ID_Key);
	delete iSender;
	delete iReceiver;
	}


CDatagramService* CSMSDatagramService::NewL()
/**
	Intended Usage: Static factory constructor. Uses two phase 
	construction and leaves nothing on the CleanupStack.

	Will be called explicitly by the ECOM framework.

	@returns a new CSMSDatagramService instance.
*/	
	{
	CSMSDatagramService* self = new (ELeave) CSMSDatagramService();
	CleanupStack::PushL(self);
	static_cast<CSMSDatagramService*>(self)->ConstructL();	
	CleanupStack::Pop();
	return self;
	}


void CSMSDatagramService::ConstructL()
/**
	Intended Usage: Static factory constructor. Uses two phase 
	construction and leaves an instance of CSMSDatagramService on the CleanupStack.

	@returns a new CSMSDatagramService instance.
*/	
	{	
	iSender = CSMSSender::NewL();
	iReceiver = CSMSReceiver::NewL();
	}


void CSMSDatagramService::SendL(CDatagram* aDatagram, TRequestStatus& aStatus)
/**
	Send an SMS Asynchronously
	@param aDatagram CDatagram to be sent
	@param aStatus Clients TRequestStatus which will be notified of completion of send
	@capability NetworkServices
	@capability ReadUserData
*/
	{
	iSender->SendSMSL(aDatagram->GetData(), aDatagram->GetAddress(), aStatus);
	}


void CSMSDatagramService::ReceiveL(CDatagram* aDatagram,  const TDesC8& aRecvParams, TRequestStatus& aStatus)
/**
	Receive an SMS message Asynchronously
	@param aDatagram CDatagram to be populated during receive.
	@param aRecvParams buffer pattern match at beginning of incoming SMS message. Only SMS 
	messages containing this Pattern match will be intercepted. Example: //MYPATTERN 
	@param aStatus Clients TRequestStatus which will be notified of completion of Receive
	@capability NetworkServices
	@capability ReadUserData
*/
	{
	iReceiver->ListenForSMSL(aRecvParams, aDatagram, aStatus);
	}

	
// Define the interface UIDs
const TImplementationProxy ImplementationTable[] =
/**
	ECOM Specific entry point to create an CDatagramService derived instance.
*/
    {    
    #ifdef EKA2
    IMPLEMENTATION_PROXY_ENTRY(0x101FA9C3, CSMSDatagramService::NewL)
    #else    
    {{0x101FA9C3}, CSMSDatagramService::NewL}
    #endif
    };


EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
    {
    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
    return ImplementationTable;
    }


#ifndef EKA2
TInt E32Dll(TDllReason)
	{
	return KErrNone;
	}
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -