Using AT commands with C

there is a AT commands here
http://www.developershome.com/sms/readSmsByAtCommands.asp


suppose i want to work with C visual or ++, how can i use this AT commands in a what that it will be sent to the mobile phone that will be connected to the computer
?

for example this is the at command to read unread sms
AT+CMGL="REC UNREAD"
how i can write it inside the c code, in a way that it will send this command to the mobile phone?
sasha85Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
alb66Connect With a Mentor Commented:
You can use a COM port.
A good article on windows serial communication:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp
0
 
sasha85Author Commented:
how to open socket or port?
how to send the at commends to this port?
0
 
sasha85Author Commented:
i tried every part of the code in the link but it somehow not work...when i look inside the settings 'phone and modems' i see the nokia and the motorola that i tried to connect on com 4
i set it on com 4 inside the string but i realy got no idea in what order this code need to be...msdn give only part and not the all code example:(
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
sasha85Author Commented:
i want to do this in C#
0
 
sasha85Author Commented:
what is the diffrences in coding  between serial rs232 cable and USB cable?
0
 
alb66Connect With a Mentor Commented:
There is no difference. Applications manage a modem as a serial device using a COM port; the phisical layer differences are managed at driver level.
0
 
sasha85Author Commented:
there is no even speed deiffrences??
0
 
alb66Connect With a Mentor Commented:
I don't know... i think performance may be different
0
 
sasha85Author Commented:
and how i transfer the at commands to the phone?
0
 
alb66Connect With a Mentor Commented:
System.IO.Ports.SerialPort port = new System.IO.Ports.SerialPort( "COM4", 115200, Parity.None, 8, StopBits.One);
port.ReadTimeout = 500;
try
{
  port.Open();
  port.WriteLine("AT");
  string str = port.ReadLine();
}
catch...
0
 
unmeshdaveConnect With a Mentor Commented:
offcourse there is a speed difference between COM port and USB communication. anyhow, you can use the createfile to open comport and write function to send output. you can get the code of win32 example in this link(download link is there).

http://msdn2.microsoft.com/en-us/library/ms810467.aspx
0
 
sasha85Author Commented:
for example i got 10,000 sms at a time...my income limit is 200 sms
the program will need to read each sms than to procces it and delete it and read the new one...

speed is highly important...may be i will need a special GSM modem and not a regular mobile phone?
0
 
unmeshdaveConnect With a Mentor Commented:
10,000 SMS happens frequently then its a design flaw, why GSM modem is choosen instead of going for GPRS/data connection?
0
 
sasha85Author Commented:
i ment to write 1000 sms and not 10000...
i manage to get
Sierra Wireless AirCard 875U USB

i got it here it looking at me and i don't know how to communicate with this...cause i don't know what at command i have to use...i am sure it want to say something to me:)

*for gsm/data connection, as i understand i need to pay the service provider company...because it for study project and my budget limitted i cannot do this...
0
 
unmeshdaveConnect With a Mentor Commented:
u can use the 3G AT commands as your card is 3G card.
u can check both of the following link.

http://the.taoofmac.com/space/AT%20Commands
ftp://ftp.biometrics.co.za/Miscellaneous/3G_AT_Commands.zip
0
 
sasha85Author Commented:
i realy tried to understand what i am reading on this link but i realy do not understand how 3G and my
Sierra Wireless AirCard 875U USB  connected?
0
 
sasha85Author Commented:
its gsm card...
0
 
unmeshdaveConnect With a Mentor Commented:
did u try to use the commands listed in the link? it will serve your purpose..
0
 
DanRollinsConnect With a Mentor Commented:
I suggest first trying to establish comminications manually.  Use the Windows program named "Hyperterminal"  to see if the device accepts simple AT commands.  Start > All Programs > Accessories > Communications

Once you know that you can "converse" with the device manually, you've taken the first "baby step"  towards writing code to do the same thing programamtically.
0
 
sasha85Author Commented:
ok...i just lost 2 weeks:(
this system have to run on linux...that means that c# or visual not good for this...

i will have to start all over again with c++
someone can please help me only with the part of communicating with the phone modem?
i mean opening the port and talking to the device...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.