Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > how to send ctrl-Z in C language - modem interfacing

Reply
Thread Tools

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

 
 
abhay
Guest
Posts: n/a
 
      08-30-2006
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

 
Reply With Quote
 
 
 
 
Eric Sosman
Guest
Posts: n/a
 
      08-30-2006
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
http://www.velocityreviews.com/forums/(E-Mail Removed)lid
 
Reply With Quote
 
 
 
 
Richard Bos
Guest
Posts: n/a
 
      08-30-2006
Eric Sosman <(E-Mail Removed)> wrote:

> 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
 
Reply With Quote
 
ram.r ram.r is offline
Junior Member
Join Date: Sep 2008
Posts: 1
 
      09-30-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to use internal modem to connect to other modem and send data? sp ASP .Net Mobile 1 08-28-2008 02:08 AM
Modem in Device Manager but DUN tries to detect new modem Claudine L. Computer Support 3 02-12-2004 06:47 PM
Interfacing with Voice modem Etienne Labuschagne Python 1 01-21-2004 04:48 PM
Re: Interfacing with Voice modem Anthony Baxter Python 0 01-21-2004 02:55 PM



Advertisments