468,509 Members | 1,256 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,509 developers. It's quick & easy.

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

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

Aug 30 '06 #1
2 15323
abhay wrote:
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() */

--
Eric Sosman
es*****@acm-dot-org.invalid
Aug 30 '06 #2
Eric Sosman <es*****@acm-dot-org.invalidwrote:
abhay wrote:
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() */
And, critically, do this on a binary stream, not on a text stream.

Richard
Aug 30 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Miky | last post: by
3 posts views Thread by Str Noetika | last post: by
4 posts views Thread by F.C. | last post: by
reply views Thread by B Loggins | last post: by
3 posts views Thread by William Stacey [MVP] | last post: by
3 posts views Thread by zlf | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.