The great Symbian AT command response challenge?

Login to reply to this topic.
Wed, 2007-03-07 14:22
Joined: 2004-06-11
Forum posts: 404
Hi,
I have been fiddling with AT commands lately on my N-GAGE.I have been successful on writing the commands and then getting some response. Grin
But the good news ends there:The response is just:
Code:
OKOK
Nothing less nothing more.
For any command I get this response.
The code for writing the commands and reading the response is as follows:
Code:
_LIT(PDD_NAME,"EUART1");
_LIT(LDD_NAME,"ECOMM");
_LIT(KCommModuleName, "dataport");
_LIT(KPort, "DATAPORT::0");//just echoes back the most recent commands//N-GAge opens ,but 6630 does not work
//_LIT(KPort, "DATAPORT::1");//works on 6630
_LIT8(KATCommand,"ATQ0\r\n%S\r\n");

// Init code starts here
CActiveScheduler::Add(this);

iAppState = EConnecting;

User::LoadPhysicalDevice (PDD_NAME);

User::LoadLogicalDevice (LDD_NAME);

StartC32();

User::LeaveIfError(iCommServer.Connect());

iCommServer.LoadCommModule(KCommModuleName);

User::LeaveIfError(iComm.Open (iCommServer, KPort, ECommShared));

//Wait for some time
User::After(2000000);

//configuring the port

TCommConfig portSettings;

TCommConfigV01 portSettingsv01 = portSettings();

iComm.Config (portSettings);

portSettingsv01.iRate = EBps19200;

portSettingsv01.iParity = EParityNone;

portSettingsv01.iDataBits = EData8;

portSettingsv01.iStopBits = EStop1;

portSettingsv01.iFifo = EFifoEnable;

portSettingsv01.iHandshake = (KConfigObeyXoff | KConfigSendXoff); // for xon/xoff

portSettingsv01.iTerminator[0] = 10;

portSettingsv01.iTerminatorCount = 1; // so that we terminate a read on each line feed arrives

User::LeaveIfError(iComm.SetConfig (portSettings));

iComm.SetSignals (KSignalDTR, 0);

iComm.SetSignals (KSignalRTS, 0);

TInt curlenth = iComm.ReceiveBufferLength ();

iComm.SetReceiveBufferLength (4096);

curlenth = iComm.ReceiveBufferLength ();

CEventLogger::SLog(_L("Open done.."));

// Code for writing to the port
CEventLogger::SLog(_L("Writing command.."));

iComm.Write(iStatus, iAtRequest);

iAppState = EWriting;

SetActive();

response->Des().Zero();

// Code for reading from port
User::After(1000000);

CEventLogger::SLog(_L("read now.."));

iResponseDes.Zero();

iComm.ReadOneOrMore(iStatus, iResponseDes);

iAppState = EReading;

SetActive();


I have seen samples where the code is returning some response,but then am not able to gauge why it doesn't return the desired response in my case.
So please can someone help me in my quest for AT command response. Roll Eyes
One more thing:DATAPORT::0 works on N-GAGE fine but not on 6630.
Also DATAPORT::1 on 6630 opens but spews the same response as specified above.

Thanks.
--Mayur.


Wed, 2007-03-07 16:20
Joined: 2007-02-28
Forum posts: 12
Re: The great Symbian AT command response challenge?
Hi,

I think it's like all the nokia's phone : there is already a program that uses the serial port and is listening to AT command. for example on Nokia N70 this program is called "FaxModem" and you have to kill it before doing anything with the serial port...
Wed, 2007-03-07 16:57
Joined: 2004-06-11
Forum posts: 404
Re: The great Symbian AT command response challenge?
What about the N-Gage?
--Mayur.

Fri, 2007-03-09 09:26
Joined: 2007-02-28
Forum posts: 12
Re: The great Symbian AT command response challenge?
I don't know, try to find a program that shows the hidden tasks on your phone. (I think there is on called gnutask but i'm not sure ...). When you find the task kill it with this code :

TBuf8<50> buf;
    TFullName repName;
      _LIT8(KFAXMODEM,  "FaxModem" );

    TFindProcess process;
    for(TInt i = 0; i < 1000; i++)
    {
      while(process.Next(repName) != KErrNotFound)
      {
         buf.Copy(repName);
   
          if ( (buf.Find(KFAXMODEM) != KErrNotFound) )
          {
           
             RProcess aProcess;
             aProcess.Open(process);
             aProcess.Kill(0);
             aProcess.Close();
         }
      }
    }

instead of "FaxModem" you put the name of the task
Mon, 2007-03-12 09:37
Joined: 2004-06-11
Forum posts: 404
Re: The great Symbian AT command response challenge?
Actually killing FaxModem does not help at all.
I have seen some posts where they have been able to do this stuff without killing any other process.
Any other ideas are welcome?
--Mayur.

Wed, 2007-06-20 14:55
Joined: 2006-10-05
Forum posts: 80
Re: The great Symbian AT command response challenge?

Hi Mayur,

Please let me know if you have tested this code on Nokia 6600 or Nokia 6670.
My application goes into an infinite loop when I try to read the data from the port. Writing to the port gives no error and request completes successfully.

I am using the same code as u have posted here, only that I am not using an Active Object but waiting on the request as follows:
TBuf8<512> aDes;
comm.Read(status, aDes);
User::WaitForRequest(status);

How much time does it normally take to receive the response of an AT command??

plz do reply....

regards,
jp

Thu, 2007-06-21 05:58
Joined: 2006-10-05
Forum posts: 80
Re: The great Symbian AT command response challenge?


I have at least managed to get a response by using ReadOneOrMore in place of Read function.

But now the problem is that, no matter how much delay I keep between write and read, in response I get the same command back.
Whereas I should be getting an "OK" in response..

Any ideas what the problem is?

  • Login to reply to this topic.