×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Mar 2004
    Location
    Novi Sad - Serbia
    Posts
    63

    Problems with RComm

    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):
    Code:
    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;
    }
    The part I do in DoCancel() function
    Code:
    void CPhoneCall::DoCancel()
    {
    
       switch (iCallState) {
    		case EWaitingForData:{
    
    			comm.NotifyDataAvailableCancel();
    		}break;
    ...		
    }
    And the part I do after the Write(…) is complete:
    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;
    …
    I’m using two RComm objects connected to the same RCommServer and the same port but I tried to use one RComm object too.

    Am I doing something wrong here?
    Please help me! I would appreciate any help.

    Thanks in advance,
    Sasa

  2. #2
    Regular Contributor
    Join Date
    Mar 2004
    Location
    Novi Sad - Serbia
    Posts
    63

    Problem solved

    The problem was in the fact that I was using my own TRequestStatus instance instead of using the iStatus member variable.

  3. #3
    Registered User
    Join Date
    Oct 2004
    Posts
    3
    Hi there, Sasa.

    In your post above, you said :

    > 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.

    You also mentioned :

    > I’m testing this on Nokia 6600

    By the looks of it, you managed to overcome the problem described by HSagovac in the following thread :
    http://discussion.forum.nokia.com/fo...9331#post79331
    (RCall::Dial() fails with error code "KErrArgument" if data line is used)

    I seem to be running into exactly the same problem as HSagovac. Could you possibly provide some hints on how you managed to get around this issue? Perhaps some minimalistic code sample that manages not to fail with KErrArgument error on 6600? Anything?

    I would greatly appreciate any help with this issue.

    BTW, what is firmware version of the 6600 you used for testing?

    Thanks in advance.
    Last edited by NSDev; 2004-10-25 at 20:35.

  4. #4
    Regular Contributor
    Join Date
    Mar 2004
    Location
    Novi Sad - Serbia
    Posts
    63

    Problems with Dial() function

    Hi NSDev,

    You are right, you can not use the Dial() function on Nokia6600.
    A workaround I used is to establish a phone call using the AT commands (that way you can control the modem without API calls).
    After RComm initialization, you can do something like this:
    iComm.Write(ATDTxxx)

    where you should replace the xxx with a number you want to dial.

    I hope this can help you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •