I'm trying to write an app which would seamlessly (i.e. without user interaction) intercept incoming SMSs, and reply to them.
I basically follow the outlines from the "Symbian OS C++ for Mobile Phones" book, especially chapters on AOs and their SMS implementation of GDP.
First, I struggled a lot to get the sending functionality in place, getting -5 (that is, KErrNotSupported) runtime errors on RSocket.Ioctl execution. Somehow, I finally managed to work that out, but now I'm stuck with receiving SMSs.
For now, I just want to have a regular GUI app which waits for incoming SMSs. What I do is
iSocket.Open(iSocketServ, KSMSAddrFamily, KSockDatagram, KSMSDatagramProtocol);
receiver = CSMSReceiver::NewL();
TPckgBuf<TUint> ioctlResult = KSockSelectRead;
iSocket.Ioctl(KIOctlSelect,receiver->iStatus ,&ioctlResult, KSOLSocket);
and CSMSReceiver only shows an info window in its RunL() method (I never got to see this window, though..)
.When I send an SMS it goes to the phone's inbox, rather than being caught by my app, like I wanted it to work.
CSMSReceiver, which derives after CActive, is for sure set to active and registered with the scheduler.
Where is the problem?
Thanks in advance for any help on this,