how to send ctrl-Z in C language - modem interfacing

A

abhay

hi,i m interfacing gsm modem to my microcontroller.i need to send sms
through it.
i am using AT commands for that.the command to send sms (AT+ CMGS)
terminates with
ctrl-Z.now in my program i hav tried all ways to send ctrl-Z at end of
my sms.but it takes this as
a character or string only.also i tried with ascii value of ctrl-Z but
of no use.

i am able to see the transmitted commands on hyper-terminal through
serial interface & also on serail window while debugging.
the commands are as follows with 2ms delay between each of them.

AT , AT+CMGF = 1, AT+CMGS = mobile no. , "message to be sent " ctrl-Z /
26 / ^Z


plz suggest some way.suggestions are also invited if you suspect some
other problem
 
E

Eric Sosman

abhay said:
hi,i m interfacing gsm modem to my microcontroller.i need to send sms
through it.
i am using AT commands for that.the command to send sms (AT+ CMGS)
terminates with
ctrl-Z.now in my program i hav tried all ways to send ctrl-Z at end of
my sms.but it takes this as
a character or string only.also i tried with ascii value of ctrl-Z but
of no use.

fprintf (stream, "whatever\032");
fflush (stream); /* or use setvbuf() after fopen() */
 
R

Richard Bos

Eric Sosman said:
fprintf (stream, "whatever\032");
fflush (stream); /* or use setvbuf() after fopen() */

And, critically, do this on a binary stream, not on a text stream.

Richard
 
Joined
Sep 30, 2008
Messages
1
Reaction score
0
SMS sending and receiving issues.

Dear Abhay and co,

I recently switched from Windows to Linux. Needless to say I am new to serial programming under Linux and C.
I learnt how to from,
http://www.easysw.com/~mike/serial/serial.html

I am trying to write a program in C to send and receive SMS. I am having also sorts of problems. Would it be possible to post sample code to send and receive SMS?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top