Hi everyone,
I’m developing an application that communicates with the other devices over the CSD (data call).
I successfully connected to RTelServer, loaded phone module (PHONETSY) and have opened a phone and line too.
After the successful answer to a data call, my application goes to state of waiting for a new data.
When something comes, I print it to the phone display and once again my app goes to wait for a data state.
When the exit button is pressed, I hang up the phone call (if there is one) and de allocate any allocate resources.
Another situation is when I want to send some data using the same RCommServer. When I try to send some data (RComm::Write(…)), everything works fine and after successful sending my app goes to wait for a data state again (RComm::NotifyDataAvailable(…)). That’s it, I can send and receive as much data I want and after the “exit” button is pressed, I hang up the call and close all the ports and servers. But in that situation, my application doesn’t close. It stays active – but not working anymore. It just exists in active process list (I’m testing this on Nokia 6600) and when I try to switch to it, it doesn’t paint itself good.
Here is the peace of code I use when I want to send something (just to mention that without this call, application works fine and closes regularly):
The part I do in DoCancel() functionCode:bool CPhoneCall::SendMessage(const TDesC8& aMessage){ if(!iCallEstablished){ iObserver->WriteMessage("Not connected!"); return false; } iObserver->WriteMessage("sending message..."); Cancel(); iCallState = EWritingToComm; iWritingComm.ResetBuffers(); iWritingComm.Write(callstatus, aMessage, aMessage.Length()); SetActive(); return true; }
And the part I do after the Write(…) is complete:Code:void CPhoneCall::DoCancel() { switch (iCallState) { case EWaitingForData:{ comm.NotifyDataAvailableCancel(); }break; ... }
I’m using two RComm objects connected to the same RCommServer and the same port but I tried to use one RComm object too.Code:void CPhoneCall::RunL(){ switch (iCallState) { case EWritingToComm:{ if (callstatus == KErrNone){ iObserver->WriteMessage("message was sent"); }else{ iObserver->WriteMessage("Error writing to COMM"); } iCallState = EWaitingForData; comm.NotifyDataAvailable(callstatus); SetActive(); }break; …
Am I doing something wrong here?
Please help me! I would appreciate any help.
Thanks in advance,
Sasa





