By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,712 Members | 1,390 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,712 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.