471,601 Members | 1,725 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,601 software developers and data experts.

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 15655
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 leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.