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

Discussion in 'C Programming' started by abhay, Aug 30, 2006.

  1. abhay

    abhay Guest

    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
     
    abhay, Aug 30, 2006
    #1
    1. Advertising

  2. abhay

    Eric Sosman Guest

    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
    lid
     
    Eric Sosman, Aug 30, 2006
    #2
    1. Advertising

  3. abhay

    Richard Bos Guest

    Eric Sosman <> 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
     
    Richard Bos, Aug 30, 2006
    #3
  4. abhay

    ram.r

    Joined:
    Sep 30, 2008
    Messages:
    1
    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
     
    ram.r, Sep 30, 2008
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Danny

    Implement Ctrl-C, Ctrl-V

    Danny, Aug 14, 2003, in forum: C++
    Replies:
    5
    Views:
    653
    CBFalconer
    Aug 15, 2003
  2. Danny

    Implement Ctrl-C, Ctrl-V

    Danny, Aug 14, 2003, in forum: C Programming
    Replies:
    5
    Views:
    667
    CBFalconer
    Aug 15, 2003
  3. Etienne Labuschagne

    Interfacing with Voice modem

    Etienne Labuschagne, Jan 21, 2004, in forum: Python
    Replies:
    1
    Views:
    380
    Josiah Carlson
    Jan 21, 2004
  4. Anthony Baxter

    Re: Interfacing with Voice modem

    Anthony Baxter, Jan 21, 2004, in forum: Python
    Replies:
    0
    Views:
    364
    Anthony Baxter
    Jan 21, 2004
  5. sp
    Replies:
    1
    Views:
    831
    Steven Cheng [MSFT]
    Aug 28, 2008
Loading...

Share This Page